*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt:      #0d5c2f;
  --felt-dark: #083d1f;
  --felt-rim:  #c8962a;
  --bg:        #0a0e14;
  --surface:   #111827;
  --surface2:  #1a2332;
  --gold:      #f0b429;
  --gold-dim:  #a07820;
  --red:       #e53e3e;
  --green:     #38a169;
  --blue:      #3b82f6;
  --text:      #e2e8f0;
  --text-dim:  #718096;
  --card-bg:   #fefce8;
  --card-red:  #c53030;
  --card-blk:  #1a202c;
  --r:         12px;
  --r-sm:      6px;
  --shadow:    0 4px 24px rgba(0,0,0,0.6);
  --fd:        'Cinzel', serif;
  --fb:        'Inter', sans-serif;
  --fm:        'JetBrains Mono', monospace;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--fb); font-size: 14px; overflow: hidden; }

/* ── SCREENS ── */
.screen  { position: fixed; inset: 0; display: none; }
.screen.active { display: flex; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); display: none; place-items: center; z-index: 200; overflow-y: auto; padding: 20px; }
.overlay.visible { display: grid; }
.hidden  { display: none !important; }

/* ── LOBBY ── */
#screen-lobby {
  flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #0d3320 0%, var(--bg) 70%);
  overflow-y: auto; padding: 24px;
}
.lobby-center { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 400px; }
.lobby-footer-links { display: flex; gap: 10px; }

.logo-suits { font-size: 28px; letter-spacing: 10px; color: var(--gold); opacity: 0.8; text-align: center; }
.logo-title {
  font-family: var(--fd); font-size: 36px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), #fff7cc); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-align: center;
}
.logo-sub-title {
  font-family: var(--fd); font-size: 15px; font-weight: 600;
  letter-spacing: 7px; text-transform: uppercase; text-indent: 7px;
  color: var(--gold-dim); margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.logo-sub-title::before, .logo-sub-title::after {
  content: ''; height: 1px; width: 40px; flex-shrink: 0;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.logo-sub-title::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.logo-sub { color: var(--text-dim); font-size: 12px; text-align: center; margin-top: 8px; }

.table-quote {
  font-family: var(--fd); font-style: italic; font-size: 13px;
  color: var(--gold-dim); text-align: center; line-height: 1.5;
  max-width: 320px; margin: 0 auto;
}

.lobby-card {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 28px 24px; width: 100%;
  display: flex; flex-direction: column; gap: 14px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

input[type="text"], input[type="number"] {
  background: var(--surface2); border: 1.5px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: var(--r-sm); padding: 11px 14px;
  font-size: 15px; font-family: var(--fb); outline: none; transition: border-color 0.2s; width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus { border-color: var(--gold); }
input[type="text"]::placeholder { color: var(--text-dim); }

.or-row { text-align: center; color: var(--text-dim); font-size: 12px; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; font-family: var(--fm); letter-spacing: 3px; text-transform: uppercase; font-size: 16px; }
.error-msg { color: var(--red); font-size: 13px; text-align: center; }
.btn-ghost { background: none; border: 1px solid rgba(255,255,255,0.1); color: var(--text-dim); border-radius: var(--r-sm); padding: 8px 18px; cursor: pointer; font-family: var(--fb); font-size: 13px; }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

/* ── BUTTONS ── */
.btn {
  border: none; border-radius: var(--r-sm); padding: 10px 16px;
  font-size: 13px; font-weight: 600; font-family: var(--fb);
  cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }
.btn-primary  { background: linear-gradient(135deg, #c8962a, var(--gold)); color: #1a1000; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary{ background: var(--surface2); color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.btn-xl { width: 100%; padding: 14px; font-size: 15px; border-radius: var(--r); justify-content: center; }

.btn-chaal   { background: #15803d2e; color: #8fd4ab; border: 1px solid #2f855a55; }
.btn-sideshow{ background: #5b21b62e; color: #c4b5fd; border: 1px solid #5b21b655; }
.btn-show    { background: #c8962a2e; color: #dcbd6b; border: 1px solid #c8962a55; }
.btn-pack    { background: #7f1d1d2e; color: #e69a9a; border: 1px solid #7f1d1d55; }
#btn-predrop.armed { background: #7f1d1d66; color: #ffb4b4; border: 1px solid #e69a9a; }

.btn-chaal:not(:disabled):hover    { background: #15803d44; }
.btn-sideshow:not(:disabled):hover { background: #5b21b644; }
.btn-show:not(:disabled):hover     { background: #c8962a44; }

/* ── LOGIN / ACCOUNT ── */
.access-denied {
  background: rgba(200,150,42,0.1); border: 1px solid rgba(240,180,41,0.45);
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; text-align: center;
}
.access-denied-title { font-weight: 700; font-size: 14px; color: var(--gold); margin-bottom: 6px; }
.access-denied-text { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.access-denied-email { font-family: var(--fm); color: #dcbd6b; word-break: break-all; }
.access-denied-hint { font-size: 12px; color: var(--text-dim); }
.login-hint { font-size: 13px; color: var(--text-dim, #94a3b8); text-align: center; margin-bottom: 14px; }
.btn-google {
  background: #fff; color: #1f1f1f; border: 1px solid rgba(0,0,0,0.15);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600;
}
.btn-google:hover { filter: brightness(0.95); }
.user-chip { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.user-pic { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(240,180,41,0.5); }
.user-chip-info { flex: 1; text-align: left; }
.user-name { font-weight: 700; font-size: 14px; }
.user-coins { font-family: var(--fm, monospace); font-size: 12px; color: var(--gold, #f0b429); }
.btn-logout { font-size: 11px; padding: 6px 10px; }
.btn-pack:not(:disabled):hover     { background: #7f1d1d44; }

.btn-close { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.btn-close:hover { color: var(--text); }

/* ── RULES MODAL ── */
.rules-card {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; width: 100%; max-width: 660px;
  max-height: 90vh; display: flex; flex-direction: column;
}
.rules-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
.rules-header h2 { font-family: var(--fd); font-size: 20px; color: var(--gold); }
.rules-body { overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 24px; }

.rules-body section h3 { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.rules-body p { color: var(--text-dim); line-height: 1.7; font-size: 13px; margin-bottom: 6px; }
.rules-body ul, .rules-body ol { color: var(--text-dim); padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rules-body li { font-size: 13px; line-height: 1.6; }
.rules-body strong { color: var(--text); }

.rules-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules-table th { background: var(--surface2); color: var(--text-dim); padding: 8px 10px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.rules-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.rules-table tr:last-child td { border-bottom: none; }
.rank-1 td { color: #fcd34d; }
.rank-2 td { color: #c4b5fd; }
.rank-3 td { color: #93c5fd; }
.rank-4 td { color: #6ee7b7; }
.rank-5 td { color: #fdba74; }
.rank-6 td { color: var(--text-dim); }

.seq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { background: var(--surface2); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 5px 14px; font-family: var(--fm); font-size: 13px; color: var(--gold); }

.action-explainers { display: flex; flex-direction: column; gap: 12px; }
.ae-row { display: flex; align-items: flex-start; gap: 12px; }
.ae-badge {
  flex-shrink: 0; font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}
.ae-badge.chaal    { background: #15803d33; color: #4ade80; }
.ae-badge.show     { background: #c8962a33; color: var(--gold); }
.ae-badge.pack     { background: #7f1d1d33; color: #f87171; }
.ae-row div { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.ae-row div strong { color: var(--text); }
.ae-row div em { color: var(--text-dim); font-style: italic; }

/* ── WAITING ROOM ── */
#screen-waiting { align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, #0d3320 0%, var(--bg) 70%); }
.waiting-center { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 480px; width: 100%; padding: 24px; }
.waiting-title { font-family: var(--fd); font-size: 26px; color: var(--gold); }
.share-hint { color: var(--text-dim); font-size: 13px; }
.waiting-players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.wpc { background: var(--surface2); border: 1px solid rgba(255,255,255,0.08); border-radius: 40px; padding: 8px 16px; display: flex; align-items: center; gap: 8px; }
.wpc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.wpc-name { font-weight: 600; font-size: 13px; }
.wpc-host { font-size: 10px; color: var(--gold); }
.waiting-msg { color: var(--text-dim); font-size: 13px; }
.deck-note { color: var(--text-dim); font-size: 11px; opacity: 0.6; }

/* ── GAME LAYOUT ── */
#screen-game { flex-direction: column; background: var(--bg); overflow: hidden; }

.hud-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.hud-actions {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 6px; padding: 6px 16px; background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.hud-actions .hud-timer { margin-right: auto; }
.user-ident { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ui-pic { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(240,180,41,0.4); flex-shrink: 0; }
.ui-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; min-width: 0; }
.ui-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ui-email { font-size: 10px; color: var(--text-dim); font-family: var(--fm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-ident.corner {
  position: fixed; top: 10px; left: 12px; z-index: 60;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 6px 12px;
}
.hud-round { font-size: 12px; color: var(--text-dim); }

.table-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; min-height: 0; }

.felt-table {
  width: min(560px, 96vw); height: min(560px, 40vh);
  background: radial-gradient(ellipse at 50% 50%, #1a603a 0%, #114227 55%, #0a2d19 100%);
  border-radius: 50%;
  border: 10px solid var(--felt-rim);
  box-shadow: 0 0 0 4px #6b4a0e, 0 12px 60px rgba(0,0,0,0.8), inset 0 0 40px rgba(0,0,0,0.3);
  position: relative; flex-shrink: 0;
}

.table-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  text-align: center; pointer-events: none;
}
.center-label  { font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 2px; text-transform: uppercase; }
.center-amount { font-family: var(--fm); font-size: 28px; font-weight: 700; color: var(--gold); text-shadow: 0 0 16px rgba(240,180,41,0.22); }
.center-bet    { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px; }

/* Seats */
.seat {
  position: absolute; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 88px;
}
.seat-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; background: var(--surface2);
  border: 2px solid rgba(255,255,255,0.15); position: relative; transition: all 0.3s;
}
.seat-avatar.is-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,180,41,0.35), 0 0 18px rgba(240,180,41,0.3);
  animation: tp 1.5s ease-in-out infinite;
}
@keyframes tp {
  0%,100% { box-shadow: 0 0 0 3px rgba(240,180,41,0.3), 0 0 16px rgba(240,180,41,0.22); }
  50%      { box-shadow: 0 0 0 4px rgba(240,180,41,0.45), 0 0 22px rgba(240,180,41,0.32); }
}
/* Live "currently talking" ring — a separate ::after (not another box-shadow
   on .seat-avatar) so it can render at the same time as .is-turn's gold
   pulse without a specificity fight; a player very often talks on their own
   turn, so both need to show at once as two concentric rings. */
.seat-avatar.speaking::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(74,222,128,0.85);
  box-shadow: 0 0 10px rgba(74,222,128,0.55);
  animation: speakPulse 0.9s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes speakPulse {
  0%,100% { opacity: 0.65; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}
.seat-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.seat-avatar.packed { opacity: 0.3; filter: grayscale(1); }
.seat-avatar.out    { opacity: 0.15; filter: grayscale(1); }
.seat-avatar.away   { opacity: 0.45; filter: grayscale(0.7); }
.seat-avatar.is-me  { border-color: var(--blue); }
.seat-dealer-chip {
  position: absolute; top: -5px; right: -5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); color: #1a1000;
  font-size: 8px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.seat-name  { font-size: 11px; font-weight: 600; max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.seat-coins { font-family: var(--fm); font-size: 10px; color: var(--gold); }
.seat-status-badge {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 10px; text-transform: uppercase;
}
.ssb-packed  { background: rgba(239,68,68,0.2);    color: #fca5a5; }
.ssb-out     { background: rgba(100,100,100,0.2);  color: #9ca3af; }
.ssb-active  { background: rgba(56,161,105,0.25);  color: #86efac; }
.seat-bet { font-size: 9px; color: var(--gold-dim); font-family: var(--fm); }
.seat-mic {
  position: absolute; bottom: -5px; right: -5px;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1; padding: 0; border: 1px solid rgba(0,0,0,0.35);
  background: rgba(20,20,20,0.85); color: var(--text-dim);
  cursor: default; z-index: 2;
}
.seat-mic.muted { background: rgba(20,20,20,0.85); color: #fff; }
/* Muted = mic icon crossed by a red line (not a speaker-mute glyph) —
   drawn as a diagonal band so the 🎙️ underneath still reads through it. */
.seat-mic.muted::after {
  content: '';
  position: absolute; inset: 2px;
  border-radius: 50%;
  background: linear-gradient(45deg, transparent 44%, #ef4444 44%, #ef4444 56%, transparent 56%);
  pointer-events: none;
}
.seat-mic.clickable { cursor: pointer; }
.seat-mic.clickable:hover { filter: brightness(1.3); }

/* Pending side show: who asked (👀) and who is deciding (🤔).
   Wraps inside the seat width so it can't spill off narrow screens. */
.seat-ask-badge {
  font-size: 8px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
  background: rgba(168,85,247,0.28); color: #d8b4fe;
  max-width: 100%; text-align: center; line-height: 1.4;
  animation: askPulse 1.2s ease-in-out infinite;
}
.seat-ask-badge.deciding { background: rgba(59,130,246,0.25); color: #93c5fd; }
@keyframes askPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ── MY CARDS PANEL ── */
.my-panel {
  background: rgba(0,0,0,0.5); border-top: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.my-cards-col { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.my-cards-label { font-size: 11px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.hand-badge { background: rgba(240,180,41,0.15); color: var(--gold); font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.btn-eye {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-dim); font-size: 13px; line-height: 1;
  padding: 3px 9px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center;
}
.btn-eye:hover { background: rgba(255,255,255,0.12); }
.my-cards { display: flex; gap: 8px; }
.my-info { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.my-coins { font-family: var(--fm); font-size: 15px; font-weight: 700; color: var(--gold); }

/* Cards */
.card {
  width: 52px; height: 76px; border-radius: 6px;
  background: var(--card-bg); border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; padding: 4px 5px;
  font-family: var(--fm); position: relative; flex-shrink: 0; transition: transform 0.2s;
}
.card:hover { transform: translateY(-5px); }
.card-rank   { font-size: 15px; font-weight: 700; line-height: 1; color: var(--card-blk); }
.card-suit   { font-size: 12px; line-height: 1; color: var(--card-blk); }
.card-center { font-size: 26px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: var(--card-blk); }
.card.red .card-rank, .card.red .card-suit, .card.red .card-center { color: var(--card-red); }
.card-back {
  width: 52px; height: 76px; border-radius: 6px;
  background: linear-gradient(135deg,#1e3a5f,#0d2137);
  border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: rgba(255,255,255,0.12); flex-shrink: 0;
}

/* ── ACTION PANEL ── */
.action-panel {
  background: rgba(0,0,0,0.65); border-top: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px; flex-shrink: 0;
}
.hud-timer {
  font-family: var(--fm); font-size: 13px; font-weight: 700; color: var(--gold);
  background: rgba(240,180,41,0.1); border: 1px solid rgba(240,180,41,0.3);
  border-radius: 20px; padding: 4px 12px; min-width: 110px; text-align: center;
}
.hud-timer:empty { visibility: hidden; }
/* Voice toggle: the one HUD action people reach for mid-round, so it stays
   inline rather than tucked in the overflow menu. Neutral gold at rest,
   green once you're actually on the call. */
.btn-voice {
  background: rgba(240,180,41,0.08); color: var(--gold); border: 1px solid rgba(240,180,41,0.3);
  border-radius: 20px; font-size: 11px; font-family: var(--fb); font-weight: 600;
  padding: 6px 12px; cursor: pointer;
}
.btn-voice:hover { background: rgba(240,180,41,0.18); }
.btn-voice.active { background: rgba(56,161,105,0.2); color: #86efac; border-color: rgba(56,161,105,0.4); }
.btn-voice.active:hover { background: rgba(56,161,105,0.35); }

/* Overflow "⋮" trigger: everything that isn't reached for every round
   (co-host/kick admin, end session, leave table) lives behind this so the
   HUD isn't a wall of identical red buttons. */
.btn-menu {
  width: 30px; height: 30px; flex-shrink: 0; padding: 0;
  border-radius: 50%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-dim); font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-menu:hover, .btn-menu.open { color: var(--text); background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }

.table-menu {
  position: fixed; top: 90px; right: 12px; z-index: 250;
  background: var(--surface); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; min-width: 200px; padding: 6px;
}
.tm-item {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: none; border: none; color: var(--text);
  font-family: var(--fb); font-size: 13px; font-weight: 600;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.tm-item:hover { background: rgba(255,255,255,0.08); }
.tm-item.tm-danger { color: #f87171; }
.tm-item.tm-danger:hover { background: rgba(127,29,29,0.25); }
.tm-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 6px; }
.log-time { color: var(--text-dim); font-family: var(--fm); font-size: 9px; margin-right: 6px; }
.hud-timer.urgent { color: #ef9a9a; border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.1); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.72} }
.action-prompt { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; text-align: center; }
.action-prompt.your-turn { color: var(--gold); }
.action-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.action-btns .btn { padding: 8px 12px; font-size: 12px; }

/* ── ALERT BANNER ── */
.alert-banner {
  position: fixed; bottom: 170px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: var(--r); padding: 16px 20px;
  z-index: 300; text-align: center; min-width: 280px;
  box-shadow: 0 0 30px rgba(240,180,41,0.25);
}
.alert-banner p { margin-bottom: 10px; font-size: 14px; }
.alert-btns { display: flex; gap: 10px; justify-content: center; }

/* ── LOG ── */
.log-panel {
  position: fixed; right: 8px; top: 46px;
  width: 210px; max-height: 220px;
  background: rgba(8,12,18,0.92); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r); display: flex; flex-direction: column; z-index: 20; overflow: hidden;
}
.log-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.log-entries { overflow-y: auto; flex: 1; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.log-entry {
  font-size: 11px; color: var(--text-dim); line-height: 1.4;
  padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: li 0.3s ease;
}
.log-entry.hl { color: var(--gold); font-weight: 600; }
@keyframes li { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ── SHOWDOWN / GAMEOVER ── */
.showdown-card {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 28px 24px; max-width: 520px; width: 92%;
  text-align: center; max-height: 90vh; overflow-y: auto;
}
.showdown-title { font-family: var(--fd); font-size: 26px; color: var(--gold); margin-bottom: 8px; }
.showdown-winner { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* Winner hero card at the top of the round-over screen */
.showdown-winner-hero {
  background: linear-gradient(135deg, rgba(240,180,41,0.16), rgba(240,180,41,0.03));
  border: 1px solid var(--gold); border-radius: var(--r-sm);
  padding: 14px 16px; margin-bottom: 12px; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.showdown-winner-hero > div:first-child { flex: 1; min-width: 0; }
.sd-hero-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.sd-hero-hand { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.sd-asked-chip {
  display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(200,150,42,0.35); color: #dcbd6b;
}
.sd-hero-cards { display: flex; gap: 5px; margin-top: 8px; }
.sd-hero-coins { font-family: var(--fm); color: var(--gold); font-size: 16px; font-weight: 700; flex-shrink: 0; text-align: right; }

.sd-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); margin: 4px 0 6px; text-align: left;
}

/* How a player left the round: dropped, timed out, lost a side show, etc. */
.sd-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; white-space: nowrap;
}
.sd-tag.dropped, .sd-tag.timeout { background: rgba(127,29,29,0.35); color: #e69a9a; }
.sd-tag.sideshow                 { background: rgba(91,33,182,0.35); color: #c4b5fd; }
.sd-tag.show                     { background: rgba(200,150,42,0.35); color: #dcbd6b; }
.sd-tag.left                     { background: rgba(255,255,255,0.1); color: var(--text-dim); }
.sd-tag.allin                    { background: rgba(37,99,235,0.35); color: #93c5fd; }

/* Callout: someone folded a hand that would have beaten the winner's */
.showdown-missed {
  background: rgba(200,150,42,0.1); border: 1px solid rgba(240,180,41,0.45);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px;
  font-size: 12px; text-align: left; color: #dcbd6b;
}
.sd-row.missed-winner { border: 1px solid #f87171; }

.showdown-hands { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sd-row {
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sd-row > div:first-child { flex: 1; min-width: 0; }
.sd-name {
  font-weight: 600; font-size: 14px; text-align: left; overflow-wrap: anywhere;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
}
.sd-hand { font-size: 12px; color: var(--text-dim); text-align: left; margin-top: 2px; }
.sd-cards { display: flex; gap: 4px; }
.sd-coins { font-family: var(--fm); color: var(--gold); font-size: 13px; flex-shrink: 0; }
.ssb-watch { background: rgba(59,130,246,0.15); color: #93c5fd; }
.ssb-blind { background: rgba(240,180,41,0.15); color: #f0b429; }
.sd-delta { font-weight: 700; }
.sd-delta.win  { color: #4ade80; }
.sd-delta.loss { color: #f87171; }

.showdown-footer-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.gameover-standings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.standing-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface2); border-radius: var(--r-sm); }
.standing-rank { font-family: var(--fm); font-size: 16px; width: 32px; }
.standing-name { font-weight: 600; flex: 1; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.standing-coins { font-family: var(--fm); color: var(--gold); }
.standing-me { border: 1px solid var(--gold); background: rgba(240,180,41,0.07); }
.standing-delta { font-family: var(--fm); margin: 0 10px; }
.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.standing-sub { font-size: 11px; font-weight: 400; color: var(--text-dim); }
.gameover-stats { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.gameover-section-title { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }

/* Stacked buttons on the round-over / game-over cards get even breathing room */
.showdown-card .btn-xl { margin-top: 10px; }
.showdown-card .waiting-msg { margin-top: 12px; }
.gameover-history-link { display: block; margin-top: 14px; font-size: 13px; color: var(--text-dim); text-decoration: none; }
.gameover-history-link:hover { color: var(--gold); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .felt-table { width: 94vw; height: 36vh; }
  .log-panel { display: none; }
  .seat { width: 70px; } .seat-avatar { width: 36px; height: 36px; font-size: 13px; }
  .seat-name { font-size: 9px; } .card { width: 44px; height: 64px; }
  .logo-title { font-size: 28px; }
  .logo-sub-title { font-size: 12px; letter-spacing: 5px; text-indent: 5px; }
  /* Larger touch targets for game actions on phones */
  .action-btns { gap: 8px; }
  .action-btns .btn {
    padding: 13px 10px; font-size: 14px; min-height: 48px;
    flex: 1 1 auto; justify-content: center; white-space: nowrap;
  }
  /* Round-over / game-over summary: use the full width and let each player
     row wrap instead of pushing text past the screen edge. */
  .overlay { padding: 12px; }
  .showdown-card { width: 100%; padding: 20px 14px; }
  .sd-row { flex-wrap: wrap; padding: 10px 12px; gap: 6px 10px; }
  .sd-row > div:first-child { flex: 1 1 60%; }
  .sd-cards { flex-basis: 100%; order: 3; justify-content: flex-start; }
  .sd-tag { white-space: normal; text-align: left; line-height: 1.4; }
  .sd-hero-coins { font-size: 14px; }
  .standing-row { padding: 10px; }
  .standing-rank { width: 28px; flex-shrink: 0; }
  .standing-delta { margin: 0 6px; }
}

/* ── ADMIN GAME CONFIG SCREEN ── */
.cfg-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.deck-options { display: flex; gap: 10px; }
.deck-option { flex: 1; cursor: pointer; }
.deck-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.deck-box {
  background: var(--surface2); border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--r-sm); padding: 14px 12px; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.deck-option input:checked + .deck-box {
  border-color: var(--gold); background: rgba(212,175,55,0.08);
}
.deck-box-title { font-size: 17px; font-weight: 700; }
.deck-box-ranks { font-family: var(--fm); font-size: 13px; color: var(--gold); margin-top: 4px; letter-spacing: 1px; }
.deck-box-note  { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── GOLD COIN ICON ── */
/* Emoji glyphs ignore `color:`; a filter shifts the 🪙 to the site gold. */
.coin { display: inline-block; filter: sepia(1) saturate(4) hue-rotate(-12deg) brightness(1.15); }
