:root {
  --felt: #1a6b3c;
  --felt-dark: #0e4425;
  --gold: #f5c518;
  --text: #f2f2f2;
  --muted: #b8c4bb;
  --danger: #e5533c;
  --ok: #3ac569;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: radial-gradient(ellipse at center, #0c2b1d 0%, #07130d 100%); color: var(--text); -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #0c2b1d 0%, #06110c 100%); z-index: 50; padding: 16px; }
.join-card { width: 100%; max-width: 360px; background: #123a26; border: 1px solid #1e5a3a; border-radius: 18px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.join-card h1 { margin: 0 0 6px; font-size: 26px; }
.join-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.join-card input { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 10px; border: 1px solid #2c6b49; background: #0d2c1d; color: #fff; outline: none; margin-bottom: 12px; }
.join-card input:focus { border-color: var(--gold); }

.btn { border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .05s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #1a1a1a; width: 100%; }
.btn-ghost { background: transparent; color: #b8c4bb; border: 1px solid #2c6b49; width: 100%; margin-top: 8px; }
.btn-start { background: #d32029; color: #fff; }
.btn-check { background: #2f7f4f; color: #fff; }
.btn-bet { background: #2b5f8f; color: #fff; }
.btn-call { background: #2f7f4f; color: #fff; }
.btn-raise { background: #7a4fb0; color: #fff; }
.btn-fold { background: #b3412f; color: #fff; }
.error { color: var(--danger); min-height: 18px; margin: 10px 0 0; font-size: 13px; }

.app { min-height: 100vh; display: flex; flex-direction: column; padding: 10px 12px 16px; background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.05), transparent 60%), var(--felt); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 8px; font-size: 14px; flex-wrap: wrap; }
.round-info { color: var(--gold); font-weight: 700; }
.phase-info { flex: 1; text-align: center; color: var(--muted); font-size: 13px; }
.chip-box { background: #0b2317; padding: 4px 10px; border-radius: 999px; font-size: 13px; border: 1px solid #1e5a3a; }
.chip-box b { color: var(--gold); }
.chip-btn { background: #123a26; color: #fff; border: 1px solid #2c6b49; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }

.admin-panel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: rgba(245,197,24,.10); border: 1px solid rgba(245,197,24,.35); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
.admin-title { color: var(--gold); font-weight: 700; }
.admin-panel input { width: 70px; background: #0d2c1d; border: 1px solid #2c6b49; border-radius: 6px; padding: 4px 6px; color: #fff; font-size: 12px; outline: none; }
.admin-list { background: #0b2317; border: 1px solid #1e5a3a; border-radius: 10px; padding: 10px; margin-bottom: 8px; font-size: 12px; max-height: 200px; overflow-y: auto; }
.admin-list table { width: 100%; border-collapse: collapse; }
.admin-list th, .admin-list td { padding: 4px 6px; border-bottom: 1px solid #1e5a3a; text-align: left; }

.lobby { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.lobby-title { text-align: center; color: var(--muted); font-size: 14px; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: start; }
.seat { background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 8px; text-align: center; min-height: 70px; }
.seat .sname { font-weight: 700; font-size: 13px; }
.seat .schips { font-size: 11px; color: var(--muted); }
.seat.empty { color: #5a6f60; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.lobby-actions { display: flex; gap: 8px; justify-content: center; }

.table { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.community { text-align: center; min-height: 60px; }
.community .label { font-size: 12px; color: var(--muted); }
.community .cards { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.table-info { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 14px; }
.table-info b { color: var(--gold); font-size: 18px; }
.turn-info { color: #ffe9a8; font-weight: 700; }
.players { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.player { background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 8px 6px; text-align: center; position: relative; min-height: 110px; }
.player.current { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(245,197,24,.4); }
.player.folded { opacity: .4; }
.player .badge { font-size: 9px; color: var(--gold); font-weight: 700; }
.player .pname { font-size: 12px; font-weight: 700; }
.player .pbet { font-size: 11px; color: var(--gold); }
.player .pcards { display: flex; justify-content: center; gap: 3px; margin: 4px 0; }
.player .phand { font-size: 11px; color: #ffe9a8; font-weight: 700; }

.card { width: 40px; height: 56px; background: #fff; color: #111; border-radius: 6px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.card .suit { font-size: 15px; line-height: 1; }
.card.red { color: #d32029; }
.card.back { background: repeating-linear-gradient(45deg, #1b3d8f, #1b3d8f 4px, #17337a 4px, #17337a 8px); color: transparent; }
.card.back .suit { display: none; }

.my-hand { text-align: center; padding: 6px; }
.my-hand .label { font-size: 12px; color: var(--muted); }
.my-hand .cards { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.my-hand .cards .card { width: 56px; height: 80px; font-size: 20px; }
.my-hand .cards .card .suit { font-size: 20px; }
.my-hand .hand-name { font-size: 14px; color: var(--gold); font-weight: 700; }
.controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.controls .wait-note { color: var(--muted); font-size: 13px; padding: 8px; text-align: center; width: 100%; }

.chat-panel { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 8px; }
.chat-messages { height: 110px; overflow-y: auto; background: rgba(0,0,0,.22); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.chat-line { margin: 2px 0; word-break: break-all; }
.chat-line .t { color: #7d9184; font-size: 11px; }
.chat-line b { color: #ffd84d; }
.chat-line.mine b { color: #7ec8ff; }
.chat-line.system { color: #9fb5a6; font-style: italic; font-size: 12px; }
.chat-input-row { display: flex; gap: 6px; margin-top: 6px; }
.chat-input-row input { flex: 1; background: #0d2c1d; border: 1px solid #2c6b49; border-radius: 10px; padding: 8px 12px; color: #fff; font-size: 14px; outline: none; }

@media (max-width: 640px) {
  .seats, .players { grid-template-columns: repeat(2, 1fr); }
  .card { width: 32px; height: 46px; font-size: 12px; }
}

/* 聊天快捷短语 */
.chat-quick { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.quick-btn { background: #123a26; color: #cfe0d5; border: 1px solid #2c6b49; border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.quick-btn:active { background: #1e5a3a; }

/* 管理员透视底牌 */
.pcards.peek .card { box-shadow: 0 0 0 1px var(--gold), 0 2px 6px rgba(245,197,24,.5); }

/* 下注金额输入 */
.bet-input-row { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bet-input-row input { width: 90px; background: #0d2c1d; border: 1px solid #2c6b49; border-radius: 8px; padding: 8px 10px; color: #fff; font-size: 15px; outline: none; text-align: center; }
.action-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* 轮到自己时高亮 */
.turn-info.mine { color: #ff5252; font-weight: 800; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* 版本号 */
.ver { color: #6b8f7a; font-size: 11px; margin-top: 6px; }
