/* ═══════════════════════════════════════════ RESET & TOKENS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:       #0a0a0b;
  --surface:  #111114;
  --surface2: #18181d;
  --border:   #252530;
  --border2:  #32323f;
  --gold:     #c9a84c;
  --gold-dim: #7a6530;
  --gold-glow:rgba(201,168,76,0.15);
  --amber:    #d4820a;
  --crimson:  #c0392b;
  --emerald:  #1e8a5e;
  --text:     #e2e2e8;
  --text-dim: #888896;
  --radius:   6px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-body:    'Crimson Pro', Georgia, serif;
}
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); }
.hidden { display: none !important; }
.eliminated { opacity: 0.4; text-decoration: line-through; }
.muted-text { color: var(--text-dim); font-size: 0.9rem; }

/* ═══════════════════════════════════════════ LOBBY */
#view-lobby { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.lobby-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.06) 0%, transparent 60%); }
.lobby-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px); background-size: 40px 40px; }
.lobby-content { position: relative; width: 100%; max-width: 460px; padding: 2rem; display: flex; flex-direction: column; gap: 2rem; align-items: center; }
.lobby-brand { text-align: center; width: 100%; }
.brand-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); margin: 1rem 0; }
.brand-title { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; letter-spacing: 0.08em; color: var(--gold); line-height: 1.15; text-transform: uppercase; }
.brand-sub { color: var(--text-dim); font-size: 1rem; font-style: italic; margin-top: 0.5rem; }
.lobby-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; width: 100%; display: flex; flex-direction: column; gap: 1rem; }
.lobby-card input[type="text"] { width: 100%; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius); padding: 0.75rem 1rem; color: var(--text); font-family: var(--font-body); font-size: 1.05rem; outline: none; transition: border-color 0.15s; }
.lobby-card input[type="text"]:focus { border-color: var(--gold-dim); }
.lobby-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.lobby-or { text-align: center; color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.1em; }
.join-row { display: flex; gap: 0.5rem; }
.join-row input { flex: 1; font-family: var(--font-mono); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 0 !important; }
.btn-gold { background: var(--gold); color: #0a0a0b; border: none; border-radius: var(--radius); padding: 0.8rem 1.5rem; font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: 0.05em; cursor: pointer; transition: opacity 0.15s, transform 0.1s; width: 100%; }
.btn-gold:hover { opacity: 0.88; }
.btn-gold:active { transform: scale(0.98); }
.btn-gold:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 0.8rem 1.25rem; font-family: var(--font-display); font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.btn-ghost:hover { background: var(--gold-glow); }
.error-msg { color: var(--crimson); font-size: 0.9rem; }
.waiting-header { display: flex; justify-content: space-between; align-items: baseline; }
.waiting-label { color: var(--text-dim); font-size: 0.75rem; letter-spacing: 0.2em; }
.waiting-code { font-family: var(--font-mono); font-size: 1.4rem; color: var(--gold); letter-spacing: 0.2em; }
.waiting-hint { color: var(--text-dim); font-size: 0.9rem; font-style: italic; }
.player-list-lobby { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.player-list-lobby li { padding: 0.5rem 0.75rem; background: var(--surface2); border-radius: var(--radius); font-size: 1rem; }

/* ═══════════════════════════════════════════ ANTE TOAST */
#ante-toast {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(192,57,43,0.92);
  border: 1px solid var(--crimson);
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.ante-label { font-size: 0.65rem; letter-spacing: 0.15em; opacity: 0.75; text-transform: uppercase; }
.ante-enter { animation: anteIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both; }
.ante-exit  { animation: anteOut 0.4s ease both; }
@keyframes anteIn  { from{opacity:0;transform:translateX(-50%) translateY(-8px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
@keyframes anteOut { from{opacity:1;transform:translateX(-50%) translateY(0)} to{opacity:0;transform:translateX(-50%) translateY(-8px)} }

/* ═══════════════════════════════════════════ SKIP BAR */
#skip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(201,168,76,0.06);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0.4rem 1.25rem;
  flex-shrink: 0;
}
#skip-votes-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--gold); }
.btn-skip { background: transparent; border: 1px solid var(--gold-dim); border-radius: 3px; color: var(--gold); font-family: var(--font-mono); font-size: 0.7rem; padding: 0.25rem 0.75rem; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.btn-skip:hover { background: var(--gold-glow); }
.btn-skip:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════ GAME LAYOUT */
#view-game { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

#top-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
#round-badge { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold); background: rgba(201,168,76,0.08); border: 1px solid var(--gold-dim); padding: 0.25rem 0.6rem; border-radius: 3px; }
#phase-label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.15em; color: var(--text-dim); transition: color 0.3s; }
#bankroll-display { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--text); }
.pts-label { font-size: 0.7rem; color: var(--text-dim); margin-left: 2px; }

#timer-track { height: 3px; background: var(--border); flex-shrink: 0; }
#timer-fill { height: 100%; background: var(--gold); width: 100%; }

/* ═══════════════════════════════════════════ ARENA */
#arena { flex: 1; overflow-y: auto; padding: 1.25rem 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 1rem; }
.prompt-text { font-family: var(--font-display); font-size: clamp(1rem, 2.5vw, 1.25rem); font-style: italic; color: var(--text-dim); text-align: center; }

#options-row { display: flex; gap: 0; align-items: stretch; min-height: 120px; }

.option-card { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; text-align: left; position: relative; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; gap: 0.5rem; font-family: inherit; }
.option-card:hover { border-color: var(--border2); background: var(--surface2); }
.option-card.selected { border-color: var(--gold); background: rgba(201,168,76,0.07); box-shadow: inset 0 0 0 1px var(--gold-dim); }
.option-card.correct   { border-color: var(--emerald) !important; background: rgba(30,138,94,0.08) !important; }
.option-card.incorrect { border-color: var(--crimson) !important;  background: rgba(192,57,43,0.06) !important; }

.option-tag { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--text-dim); font-weight: 600; }
.option-card.selected .option-tag { color: var(--gold); }
.option-label { font-family: var(--font-body); font-size: clamp(0.9rem, 2vw, 1.05rem); color: var(--text); line-height: 1.4; }
.option-odds { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--gold); margin-top: auto; }

/* Odds divider */
#odds-divider { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; flex-shrink: 0; gap: 0.3rem; padding: 0 0.2rem; }
.odds-format-btn { background: none; border: 1px solid var(--border2); border-radius: 3px; color: var(--text-dim); font-size: 0.7rem; padding: 0.15rem 0.3rem; cursor: pointer; transition: border-color 0.15s, color 0.15s; width: 100%; font-family: var(--font-mono); }
.odds-format-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
#odds-bar-wrap { display: flex; width: 100%; height: 5px; border-radius: 3px; overflow: hidden; background: var(--border); }
#odds-bar-a { background: var(--gold); height: 100%; transition: width 0.4s ease; }
#odds-bar-b { background: var(--text-dim); height: 100%; transition: width 0.4s ease; }
#odds-labels { display: flex; justify-content: space-between; width: 100%; }
#odds-a-pct, #odds-b-pct { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); }
#odds-format-hint { font-family: var(--font-mono); font-size: 0.55rem; color: var(--gold-dim); text-align: center; line-height: 1.3; padding: 0 0.1rem; }

/* Bet zone */
#bet-zone { display: flex; flex-direction: column; gap: 0.75rem; }
.bet-confirm { font-size: 1rem; padding: 0.85rem; }
#bet-slider-row { display: flex; align-items: center; gap: 0.75rem; }
.slider-min { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); width: 16px; text-align: center; }
input[type="range"] { flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px; background: var(--border2); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--gold-dim); cursor: pointer; }
.bet-amount { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--gold); min-width: 70px; text-align: right; }
.bet-status { font-size: 0.85rem; color: var(--text-dim); font-style: italic; min-height: 1.2em; }

/* Action zone */
#action-zone { display: flex; flex-direction: column; gap: 0.6rem; }
.action-btn { width: 100%; padding: 0.85rem; border: 1px solid; border-radius: var(--radius); font-family: var(--font-display); font-size: 1rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s; display: flex; justify-content: space-between; align-items: center; }
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.action-hold   { background: var(--surface2); border-color: var(--border2); color: var(--text); }
.action-double { background: rgba(201,168,76,0.1); border-color: var(--gold-dim); color: var(--gold); }
.action-sell   { background: rgba(192,57,43,0.1); border-color: var(--crimson); color: #e05555; }
.penalty-tag   { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.7; }
#double-slider-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; animation: slideDown 0.15s ease; }
@keyframes slideDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }

/* ═══════════════════════════════════════════ PLAYER TABLE */
#player-table { background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; padding: 0.6rem 1.25rem 0.75rem; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.table-title { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.25em; color: var(--text-dim); }
#table-round-info { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); }
#player-seats { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 2px; }
#player-seats::-webkit-scrollbar { height: 3px; }
#player-seats::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.seat { display: flex; align-items: center; gap: 0.5rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem; min-width: 160px; flex-shrink: 0; transition: border-color 0.2s; position: relative; overflow: visible; }
.seat-me          { border-color: var(--gold-dim); }
.seat-bet         { border-color: var(--emerald); }
.seat-acted       { border-color: var(--amber); }
.seat-eliminated  { opacity: 0.35; }
.seat-pulse { animation: seatPulse 0.5s ease; }
@keyframes seatPulse { 0%{box-shadow:0 0 0 0 rgba(30,138,94,0.6)} 50%{box-shadow:0 0 0 8px rgba(30,138,94,0)} 100%{box-shadow:none} }

.seat-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--border2); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 600; color: var(--text-dim); flex-shrink: 0; }
.seat-me .seat-avatar { background: var(--gold-dim); color: var(--bg); }
.seat-info { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.seat-name { font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-name em { font-style: normal; color: var(--text-dim); font-size: 0.75rem; }
.seat-bankroll { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); }
.seat-status { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.status-thinking { animation: blink 1.2s steps(1) infinite; }
.status-bet      { color: var(--emerald); }
.status-acted    { color: var(--amber); }
.status-eliminated { color: var(--crimson); }
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0.2} }

/* Floating bet chip */
.bet-chip {
  position: absolute;
  top: -28px;
  right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
  animation: chipFloat 0.9s ease forwards;
  z-index: 10;
}
.bet-chip-A { background: var(--gold); color: var(--bg); box-shadow: 0 2px 8px rgba(201,168,76,0.4); }
.bet-chip-B { background: var(--text-dim); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
@keyframes chipFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  20%  { opacity: 1; transform: translateY(-4px) scale(1.1); }
  60%  { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.8); }
}

/* ═══════════════════════════════════════════ OVERLAYS */
#reveal-overlay, #gameover-overlay { position: fixed; inset: 0; background: rgba(10,10,11,0.92); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 100; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

#reveal-card, #gameover-card { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 1.25rem; box-shadow: 0 0 60px rgba(0,0,0,0.6); }
#reveal-header { display: flex; flex-direction: column; gap: 0.25rem; }
.reveal-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.25em; color: var(--text-dim); }
.reveal-answer { font-family: var(--font-display); font-size: 2rem; font-weight: 900; color: var(--gold); }
.reveal-trivia { font-size: 1rem; color: var(--text-dim); font-style: italic; line-height: 1.5; }
#payout-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.payout-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: var(--radius); background: var(--surface2); border-left: 3px solid transparent; animation: slideUp 0.2s ease both; }
.payout-win  { border-left-color: var(--emerald); }
.payout-loss { border-left-color: var(--crimson); opacity: 0.7; }
@keyframes slideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.payout-name   { flex: 1; font-size: 0.95rem; }
.payout-result { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; }
.payout-win  .payout-result { color: var(--emerald); }
.payout-loss .payout-result { color: var(--crimson); }
.payout-total  { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.gameover-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 900; letter-spacing: 0.1em; color: var(--gold); text-align: center; }
.gameover-winner { font-size: 1.15rem; text-align: center; }
#final-standings { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
#final-standings li { font-family: var(--font-mono); font-size: 0.85rem; padding: 0.5rem 0.75rem; background: var(--surface2); border-radius: var(--radius); }

/* ═══════════════════════════════════════════ TUTORIAL */
#tutorial-popup { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); width: calc(100% - 2.5rem); max-width: 480px; z-index: 200; pointer-events: none; }
#tutorial-popup.tutorial-enter { animation: tutorialIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both; pointer-events: all; }
#tutorial-popup.tutorial-exit  { animation: tutorialOut 0.25s ease both; }
@keyframes tutorialIn  { from{opacity:0;transform:translateX(-50%) translateY(20px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
@keyframes tutorialOut { from{opacity:1;transform:translateX(-50%) translateY(0)} to{opacity:0;transform:translateX(-50%) translateY(12px)} }
#tutorial-inner { background: var(--surface2); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.1rem 1.1rem; box-shadow: 0 0 0 1px rgba(201,168,76,0.08), 0 8px 32px rgba(0,0,0,0.5); position: relative; overflow: hidden; }
#tutorial-inner::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; background:linear-gradient(90deg,var(--gold-dim),var(--gold),var(--gold-dim)); }
#tutorial-close { position:absolute; top:0.6rem; right:0.6rem; background:none; border:1px solid var(--border2); border-radius:50%; color:var(--text-dim); width:22px; height:22px; font-size:0.65rem; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:border-color 0.15s,color 0.15s,background 0.15s; }
#tutorial-close:hover { border-color:var(--crimson); color:var(--crimson); background:rgba(192,57,43,0.08); }
#tutorial-phase-tag { font-family:var(--font-mono); font-size:0.6rem; letter-spacing:0.2em; color:var(--gold); margin-bottom:0.4rem; }
#tutorial-title { font-family:var(--font-display); font-size:1.05rem; font-weight:700; color:var(--text); margin-bottom:0.4rem; padding-right:1.5rem; }
#tutorial-body  { font-family:var(--font-body); font-size:0.95rem; color:var(--text-dim); line-height:1.55; margin-bottom:0.6rem; }
#tutorial-tip   { font-family:var(--font-mono); font-size:0.72rem; color:var(--gold-dim); border-top:1px solid var(--border); padding-top:0.5rem; line-height:1.4; }
#tutorial-tip div + div { margin-top: 0.35rem; }

/* ═══════════════════════════════════════════ RESPONSIVE */
@media (max-width: 500px) {
  #options-row { flex-direction: column; }
  #odds-divider { flex-direction: row; width: 100%; height: 40px; }

/* ═══════════════════════════════════════════ SELECTED CARD PULSE */
.option-card.selected {
  animation: cardPulse 2s ease-in-out infinite;
}
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.15), inset 0 0 0 1px var(--gold-dim); }
  50%       { box-shadow: 0 0 22px rgba(201,168,76,0.35), inset 0 0 0 1px var(--gold); }
}

.timer-critical .option-card.selected {
  animation: cardPulseFast 0.55s ease-in-out infinite;
  border-color: var(--gold) !important;
}
@keyframes cardPulseFast {
  0%, 100% { box-shadow: 0 0 18px rgba(201,168,76,0.4), inset 0 0 0 1px var(--gold-dim); }
  50%       { box-shadow: 0 0 36px rgba(201,168,76,0.7), inset 0 0 0 1px var(--gold); }
}
  #odds-bar-wrap { flex: 1; }
  .option-card { min-height: 80px; }
}

/* ── Confetti ── */
.confetti-piece {
  position: fixed;
  top: -12px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 500;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1);    opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(900deg) scale(0.5); opacity: 0; }
}


/* ═══════════════════════════════════════════ PAYOUT PREVIEW */
#payout-preview {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 0.45rem 0.85rem;
  margin-bottom: 0.6rem;
}
#preview-position { color: var(--text-dim); }
#preview-win  { color: var(--emerald); font-weight: 600; }
#preview-divider { color: var(--border2); }
#preview-cost { color: var(--text-dim); }

/* ═══════════════════════════════════════════ FINAL BET ROW */
#final-bet-row { display: flex; gap: 0.5rem; }
#final-bet-row .btn-gold { flex: 1; }
.pass-confirm { width: auto; padding: 0.8rem 1.2rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════ HISTORY PANEL */
#history-panel {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0;
}
.history-header {
  cursor: pointer; user-select: none;
  padding: 0.65rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.history-header:hover { background: var(--surface2); }
#history-chevron {
  font-size: 0.8rem; color: var(--text-dim);
  transition: transform 0.15s;
}
#history-entries { padding: 0 0 0.5rem; max-height: 180px; overflow-y: auto; }
.history-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 1rem; font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.history-round {
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); min-width: 2rem; flex-shrink: 0;
}
.history-prompt { flex: 1; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-result { font-family: var(--font-mono); font-size: 0.75rem; flex-shrink: 0; }
.history-win  .history-result { color: var(--emerald); }
.history-loss .history-result { color: var(--crimson); }

/* ═══════════════════════════════════════════ A — BET CHIPS & INPUT */
#bet-chips, #double-chips {
  display: flex; gap: 0.4rem;
}
.chip-btn {
  flex: 1;
  padding: 0.5rem 0.2rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.chip-btn:hover  { border-color: var(--gold-dim); color: var(--gold); background: var(--gold-glow); }
.chip-btn.active { border-color: var(--gold);     color: var(--gold); background: var(--gold-glow); }

#bet-input-row, #double-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0 0.85rem;
  transition: border-color 0.15s;
}
#bet-input-row:focus-within, #double-input-row:focus-within { border-color: var(--gold-dim); }

#bet-input, #double-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.65rem 0;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
}
#bet-input::-webkit-outer-spin-button,
#bet-input::-webkit-inner-spin-button,
#double-input::-webkit-outer-spin-button,
#double-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pts-tag { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); user-select: none; }

#double-expand { display: flex; flex-direction: column; gap: 0.5rem; animation: slideDown 0.15s ease; }

/* ═══════════════════════════════════════════ B — PHASE IDENTITY */
#arena { transition: background 0.7s ease; }
#arena[data-phase="blind"]      { background: var(--bg); }
#arena[data-phase="correction"] { background: rgba(212,130,10,0.028); }
#arena[data-phase="final"]      { background: rgba(192,57,43,0.045); }
#arena[data-phase="reveal"]     { background: var(--bg); }

/* Option card selected state inherits phase accent colour */
#arena[data-phase="blind"]      .option-card.selected { border-color: var(--gold);    box-shadow: inset 0 0 0 1px var(--gold-dim),    0 0 14px rgba(201,168,76,0.2); background: rgba(201,168,76,0.07); }
#arena[data-phase="correction"] .option-card.selected { border-color: var(--amber);   box-shadow: inset 0 0 0 1px rgba(212,130,10,0.6), 0 0 14px rgba(212,130,10,0.2); background: rgba(212,130,10,0.08); }
#arena[data-phase="final"]      .option-card.selected { border-color: var(--crimson); box-shadow: inset 0 0 0 1px rgba(192,57,43,0.6),  0 0 14px rgba(192,57,43,0.2);  background: rgba(192,57,43,0.07); }

/* Pulse animation respects phase colour */
#arena[data-phase="blind"]      .option-card.selected { animation: cardPulse       2s ease-in-out infinite; }
#arena[data-phase="correction"] .option-card.selected { animation: cardPulseAmber  2s ease-in-out infinite; }
#arena[data-phase="final"]      .option-card.selected { animation: cardPulseCrimson 2s ease-in-out infinite; }

@keyframes cardPulseAmber {
  0%,100% { box-shadow: inset 0 0 0 1px rgba(212,130,10,0.5), 0 0  8px rgba(212,130,10,0.15); }
  50%     { box-shadow: inset 0 0 0 1px var(--amber),          0 0 22px rgba(212,130,10,0.4);  }
}
@keyframes cardPulseCrimson {
  0%,100% { box-shadow: inset 0 0 0 1px rgba(192,57,43,0.5), 0 0  8px rgba(192,57,43,0.15); }
  50%     { box-shadow: inset 0 0 0 1px var(--crimson),       0 0 22px rgba(192,57,43,0.4);  }
}

/* Timer-critical fast pulse keeps phase colour */
.timer-critical #arena[data-phase="blind"]      .option-card.selected { animation: cardPulseFast        0.55s ease-in-out infinite; }
.timer-critical #arena[data-phase="correction"] .option-card.selected { animation: cardPulseFastAmber   0.55s ease-in-out infinite; }
.timer-critical #arena[data-phase="final"]      .option-card.selected { animation: cardPulseFastCrimson 0.55s ease-in-out infinite; }

@keyframes cardPulseFastAmber   { 0%,100%{box-shadow:inset 0 0 0 1px rgba(212,130,10,0.6),0 0 18px rgba(212,130,10,0.35)} 50%{box-shadow:inset 0 0 0 1px var(--amber),0 0 36px rgba(212,130,10,0.65)} }
@keyframes cardPulseFastCrimson { 0%,100%{box-shadow:inset 0 0 0 1px rgba(192,57,43,0.6), 0 0 18px rgba(192,57,43,0.35)}  50%{box-shadow:inset 0 0 0 1px var(--crimson),0 0 36px rgba(192,57,43,0.65)}  }

/* ═══════════════════════════════════════════ C — DRAMATIC REVEAL DRUMROLL */
.option-card.drumrolling {
  animation: drumRoll 0.45s ease-in-out infinite !important;
}
.option-card.selected.drumrolling {
  animation: drumRollSelected 0.45s ease-in-out infinite !important;
}
@keyframes drumRoll {
  0%,100% { opacity: 0.65; transform: scale(0.99); }
  50%     { opacity: 1;    transform: scale(1.01); }
}
@keyframes drumRollSelected {
  0%,100% { box-shadow: inset 0 0 0 1px var(--gold-dim), 0 0 10px rgba(201,168,76,0.25); transform: scale(0.99); }
  50%     { box-shadow: inset 0 0 0 1px var(--gold),     0 0 32px rgba(201,168,76,0.65); transform: scale(1.015); }
}

/* ═══════════════════════════════════════════ D — TRADING DESK ODDS PANEL */
#options-row { gap: 0.5rem; } /* cards side-by-side without the old divider */

#odds-panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#odds-track {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.odds-side {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 52px;
  flex-shrink: 0;
}
.odds-side-a { justify-content: flex-start; }
.odds-side-b { justify-content: flex-end; }

.odds-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.delta-arrow { font-size: 0.8rem; font-weight: 700; min-width: 0.8em; }
.delta-up    { color: var(--emerald); }
.delta-down  { color: var(--crimson); }

/* Expand the bar to be much more prominent than the old inline version */
#odds-bar-wrap {
  flex: 1;
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
}
#odds-bar-a { background: var(--gold);     height: 100%; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
#odds-bar-b { background: var(--text-dim); height: 100%; flex: 1;   transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

#odds-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
#odds-format-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--gold-dim);
  line-height: 1.4;
  flex: 1;
}
/* Override old inline odds-divider styles to prevent bleed */
#odds-divider { display: none; }

/* ═══════════════════════════════════════════ E — SPARKLINES & CROWN */
.seat-spark {
  display: block;
  margin-top: 3px;
  line-height: 0;
}
.seat-spark svg { display: block; overflow: visible; }

.seat-avatar { position: relative; }
.seat-crown {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--gold);
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(201,168,76,0.5));
}

/* Slightly wider seats to accommodate spark */
.seat { min-width: 170px; }

/* ═══════════════════════════════════════════ F — MOBILE-FIRST */
@media (max-width: 600px) {
  /* Option cards stack vertically */
  #options-row { flex-direction: column; gap: 0.4rem; }
  .option-card  { min-height: 72px; }

  /* Odds panel full-width — already is, just bump bar height */
  #odds-bar-wrap { height: 12px; }

  /* Sticky bet zone pinned to bottom of the scrollable arena */
  #bet-zone, #action-zone {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin: 0 -1.25rem;
    padding: 0.75rem 1.25rem 0.85rem;
    z-index: 20;
  }

  /* Bigger tap targets */
  .chip-btn      { padding: 0.7rem 0.25rem; font-size: 0.8rem; }
  .action-btn    { padding: 1rem; }
  #bet-btn, #pass-btn { padding: 1rem; font-size: 1.05rem; }
  #bet-input, #double-input { font-size: 1.2rem; padding: 0.75rem 0; }

  /* Player table: smaller seats so more fit on screen */
  .seat         { min-width: 145px; }
  .seat-spark   { display: none; } /* hide on very small screens to save space */

  /* Prompt text slightly smaller */
  .prompt-text  { font-size: 1rem; }

  /* Payout preview single line */
  #payout-preview { flex-wrap: wrap; gap: 0.4rem; }
}

/* ═══════════════════════════════════════════ G — MARKET, ROUND TYPES & SOCIAL LAYER */

/* Lobby: game length */
#rounds-setting { display: flex; flex-direction: column; gap: 0.4rem; }
#rounds-options { display: flex; gap: 0.4rem; }
.rounds-fixed { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }

/* Top bar: pot */
#round-total { opacity: 0.6; }
#pot-display { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--gold); }
.pot-label { font-size: 0.6rem; letter-spacing: 0.2em; color: var(--gold-dim); }

/* Round banner chips */
#round-banner { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.rb-chip {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
  padding: 0.3rem 0.6rem; border-radius: 999px; border: 1px solid var(--border2);
  background: var(--surface); color: var(--text-dim);
}
.rb-chip b { color: var(--text); }
.rb-finale  { border-color: var(--crimson); color: #e57368; background: rgba(192,57,43,0.08); }
.rb-meta    { border-color: var(--amber);   color: var(--amber); background: rgba(212,130,10,0.08); }
.rb-ou      { border-color: var(--gold-dim); color: var(--gold); }
.rb-roll    { border-color: var(--emerald); color: #3cbf8a; background: rgba(30,138,94,0.08); }
.rb-insider { border-style: dashed; }

/* Insider tip (private) */
#insider-banner {
  background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(201,168,76,0.03));
  border: 1px dashed var(--gold); border-radius: var(--radius);
  padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem;
  animation: slideDown 0.25s ease;
}
.insider-head { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--gold); }
.insider-secret { letter-spacing: 0.05em; color: var(--gold-dim); margin-left: 0.4rem; }
#insider-text { font-size: 1.05rem; color: var(--text); }
.insider-foot { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); line-height: 1.4; }

/* Prompt + category */
#prompt-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
#category-tag {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-dim); border-bottom: 1px solid var(--border2); padding-bottom: 0.15rem;
}

/* Correction: switch button */
.action-switch { background: rgba(136,136,150,0.08); border-color: var(--border2); color: var(--text); }
#action-status:empty { display: none; }

/* Analyst desk */
#analyst-zone {
  display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--border2); border-radius: var(--radius); background: var(--surface);
  padding: 0.85rem;
}
.analyst-head { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--text-dim); }
.analyst-copy { font-size: 0.95rem; color: var(--text-dim); }
.analyst-btns { display: flex; gap: 0.5rem; }
.analyst-btns .btn-ghost { flex: 1; }
.analyst-btns .btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

/* Seats: record + analyst call */
.seat-record { font-family: var(--font-mono); font-size: 0.6rem; color: var(--amber); white-space: nowrap; }
.seat-call   { font-family: var(--font-mono); font-size: 0.6rem; color: var(--gold); white-space: nowrap; }
.seat-eliminated.seat { opacity: 0.6; }

/* Lock-in chip (side is never shown) */
.bet-chip { background: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(30,138,94,0.4); }

/* Small info toast (analyst calls) */
.info-toast {
  position: fixed; top: 3.5rem; right: 1rem; z-index: 300;
  background: var(--surface2); border: 1px solid var(--gold-dim); border-radius: var(--radius);
  padding: 0.45rem 0.8rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); animation: slideDown 0.2s ease;
  transition: opacity 0.4s;
}
.info-toast-out { opacity: 0; }

/* Reveal: scrollable card */
#reveal-card { max-height: calc(100vh - 3rem); overflow-y: auto; }

/* Reveal: values count-up */
#reveal-values { display: flex; flex-direction: column; gap: 0.35rem; }
#reveal-values:empty { display: none; }
.rv-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0.75rem; background: var(--surface2); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.rv-label { font-size: 0.9rem; color: var(--text-dim); flex: 1; min-width: 0; }
.rv-value { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-win  { border-color: var(--emerald); }
.rv-win .rv-value, .rv-main .rv-value { color: #3cbf8a; }
.rv-line { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold); text-align: right; padding-right: 0.75rem; }

.reveal-pot { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold); }
.reveal-rollover { color: var(--amber); }

/* Reveal: payout rows */
.payout-row { gap: 0.6rem; }
.payout-out { border-left-color: var(--border2); opacity: 0.6; }
.payout-side {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--border2); color: var(--text); flex-shrink: 0;
}
.payout-side-none { background: transparent; color: var(--text-dim); }
.payout-contra { margin-left: 0.35rem; color: var(--amber); font-size: 0.85rem; }
.payout-net { font-family: var(--font-mono); font-size: 0.75rem; min-width: 3.5rem; text-align: right; }
.net-up   { color: var(--emerald); }
.net-down { color: var(--crimson); }
.payout-total { min-width: 3.5rem; text-align: right; }
.payout-result, .payout-net, .payout-total { font-variant-numeric: tabular-nums; }

/* Reveal: notes */
#reveal-notes { display: flex; flex-direction: column; gap: 0.35rem; }
#reveal-notes:empty { display: none; }
.note { font-size: 0.9rem; color: var(--text-dim); line-height: 1.45; }
.note b { color: var(--text); font-weight: 400; }
.note-insider { border-left: 2px dashed var(--gold-dim); padding-left: 0.6rem; }
.tip-true, .tip-false { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; margin-left: 0.3rem; padding: 0.1rem 0.35rem; border-radius: 3px; }
.tip-true  { color: var(--emerald); border: 1px solid var(--emerald); }
.tip-false { color: var(--crimson); border: 1px solid var(--crimson); }

/* Reveal: catch-up category pick */
#category-pick {
  display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start;
  border: 1px solid var(--border2); border-radius: var(--radius); padding: 0.7rem 0.85rem; background: var(--surface2);
}
.cp-label  { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.2em; color: var(--gold); }
.cp-chosen { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--text); }
.cp-by     { font-size: 0.85rem; color: var(--text-dim); font-style: italic; }
.cp-options { display: flex; gap: 0.4rem; width: 100%; flex-wrap: wrap; }
.cp-options .chip-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#reveal-footer { text-align: center; font-style: italic; }

/* Game over: awards */
#gameover-card { max-height: calc(100vh - 3rem); overflow-y: auto; }
#awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.award {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.7rem;
}
.award-icon { font-size: 1.3rem; line-height: 1; }
.award-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.award-title  { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; }
.award-name   { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.award-detail { font-size: 0.82rem; color: var(--text-dim); }

@media (max-width: 600px) {
  #top-bar { flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.9rem; }
  #phase-label { order: 5; width: 100%; text-align: center; }
  .rb-chip { font-size: 0.62rem; }
  .payout-row { flex-wrap: wrap; }
  .payout-name { min-width: 40%; }
  #reveal-card, #gameover-card { padding: 1.25rem; }
  #analyst-zone { position: sticky; bottom: 0; z-index: 20; }
}

/* Layout fixes: arena children keep their natural height (no overlap when content is tall),
   and the odds-format button no longer squeezes the hint text */
#arena > * { flex-shrink: 0; }
#odds-meta .odds-format-btn { width: auto; flex-shrink: 0; padding: 0.15rem 0.55rem; }
