/* ============================================================
   Poker Night — "The Den" theme
   Cozy, lamp-lit den · petrol-blue felt · walnut rail · magenta accent
   Drop-in replacement for public/style.css — every id/class the client
   renders is preserved; only the visual treatment changes.
   ============================================================ */

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

:root {
  --bg: #0c0805;
  --ink: #f3eee4;
  --text: #f3eee4;
  --muted: #a59c8d;
  --faint: #6f6759;

  --magenta: #ec4d92;
  --magenta-bright: #ff5fa2;
  --magenta-deep: #c0316f;
  --accent: #ec4d92;

  --felt: #1c5076;
  --felt-lit: #2d6f9f;
  --felt-edge: #0e3047;

  --card-bg: #fbf7ee;
  --card-red: #c8454f;
  --card-black: #232831;

  --gold: #d9b063;
  --panel: #181208;
  --plate: rgba(14, 12, 9, 0.86);
  --line: rgba(217, 176, 99, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --danger: #d76a6a;

  --font: "Helvetica Neue", Helvetica, "Segoe UI", system-ui, Arial, sans-serif;
}

html, body { height: 100%; }
body {
  background:
    radial-gradient(120% 90% at 50% -12%, #2a201a 0%, #150f0b 46%, var(--bg) 100%) fixed;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
/* 100dvh tracks the *visible* viewport on mobile (excludes the dynamic browser
   bars), so the bottom action bar is never pushed below the fold. */
.screen { height: 100vh; height: 100dvh; width: 100vw; }

/* the magenta brand pip, if the markup wraps it (graceful no-op otherwise) */
.suit-pip { color: var(--magenta-bright); filter: drop-shadow(0 0 8px rgba(236, 77, 146, .5)); }

/* ============================================================
   Join screen
   ============================================================ */
#join-screen { display: flex; overflow-y: auto; position: relative; padding: 16px; }
#join-screen::before {
  content: "";
  position: absolute; top: -6%; left: 50%; transform: translateX(-50%);
  width: 520px; height: 420px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 224, 168, .13), transparent 70%);
  pointer-events: none;
}
.join-card {
  position: relative;
  margin: auto; /* centers when it fits; allows scrolling when taller than the screen */
  background: linear-gradient(165deg, #1e1610, #140e09);
  border: 1px solid var(--line);
  border-top-color: rgba(217, 176, 99, .3);
  border-radius: 22px;
  padding: 32px 32px 28px;
  width: 392px;
  max-width: 92vw;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .05);
  text-align: center;
}
.join-card h1 { font-size: 27px; font-weight: 800; letter-spacing: .3px; }
.tagline { color: var(--muted); margin: 8px 0 24px; font-size: 14px; }
.join-section h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--muted); margin-bottom: 11px; font-weight: 700; text-align: left;
}
.join-card input[type=text], .join-card input[type=number], .join-card select {
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  color: var(--ink);
  padding: 12px 13px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
}
.join-card input::placeholder { color: var(--faint); }
.join-card input:focus, .join-card select:focus {
  outline: none; border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(236, 77, 146, .18);
}
/* account bar + auth form on the join screen */
#account-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  justify-content: center;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 8px 12px; margin-bottom: 16px;
  font-size: 13px;
}
#account-status { color: var(--ink); font-weight: 600; }
#auth-form { margin-bottom: 18px; display: flex; flex-direction: column; gap: 9px; }
#auth-form input { text-align: center; }
.auth-act { flex: 1; }
.auth-hint { font-size: 11px; color: var(--faint); line-height: 1.4; margin-top: 2px; }
.auth-warn {
  font-size: 11.5px; color: #e9c46a; line-height: 1.4;
  background: rgba(233, 196, 106, .1); border: 1px solid rgba(233, 196, 106, .32);
  border-radius: 8px; padding: 8px 10px;
}
#auth-error { margin-top: 2px; }

#name-input { margin-bottom: 16px; text-align: center; }
.avatar-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--muted); margin-bottom: 9px; font-weight: 700;
}
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.avatar-opt {
  width: 42px; height: 42px;
  font-size: 21px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #2a2018, #160f09);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.avatar-opt:hover { transform: scale(1.1); }
.avatar-opt.sel {
  border-color: transparent;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--magenta);
  transform: scale(1.1);
}
#code-input { text-transform: uppercase; letter-spacing: 7px; text-align: center; font-weight: 700; }
.row { display: flex; gap: 10px; }
.row.options { justify-content: center; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.row.options label { display: flex; align-items: center; gap: 6px; }
.row.options input { width: 72px !important; padding: 7px 8px !important; text-align: center; }
.opt-hint { font-size: 11px; color: var(--faint); margin: 8px 0 4px; line-height: 1.4; }
.divider {
  display: flex; align-items: center; color: var(--faint); margin: 22px 0;
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.divider span { padding: 0 12px; }
.error { color: var(--danger); font-size: 13px; margin-top: 14px; min-height: 18px; }
.disclaimer {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--muted); line-height: 1.5; text-align: center;
}
.disclaimer b { color: var(--ink); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: filter .12s, transform .06s, background .15s, border-color .15s;
}
.btn:hover { background: rgba(255, 255, 255, .1); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--magenta), var(--magenta-deep));
  border-color: var(--magenta-bright);
  color: #fff; font-weight: 700;
  box-shadow: 0 8px 22px rgba(236, 77, 146, .38);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; }
.btn.tiny { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ============================================================
   Game screen + top bar
   ============================================================ */
#game-screen { display: flex; flex-direction: column; position: relative; }

#topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px; height: 52px; flex-shrink: 0;
  background: linear-gradient(#1a130d, #140e09);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px; z-index: 12; position: relative;
}
.brand { font-weight: 700; letter-spacing: .3px; font-size: 15px; white-space: nowrap; }
#room-info { display: flex; align-items: center; gap: 9px; color: var(--muted); white-space: nowrap; }
#room-code {
  color: var(--ink); letter-spacing: 3px; font-size: 14px; font-weight: 700;
  background: rgba(236, 77, 146, .13);
  border: 1px solid rgba(236, 77, 146, .35);
  border-radius: 7px; padding: 2px 9px;
}
#blind-info { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* desktop: actions sit inline on the right; the ☰ button is hidden */
#topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
#menu-btn { display: none; }
#pause-btn.active, #sitout-btn.active {
  background: linear-gradient(135deg, var(--magenta), var(--magenta-deep));
  color: #fff; border-color: var(--magenta-bright); font-weight: 700;
}

#table-area { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }

/* ---- The felt + walnut rail + overhead lamp ---- */
#table {
  position: relative;
  width: min(92vw, 1000px);
  height: min(62vh, 560px);
  border-radius: 50% / 46%;
  background: radial-gradient(80% 92% at 50% 28%, var(--felt-lit) 0%, var(--felt) 52%, var(--felt-edge) 100%);
  border: 16px solid transparent;
  box-shadow:
    0 0 0 16px #4a3320,
    0 0 0 20px #2c1d10,
    inset 0 0 90px rgba(0, 0, 0, .6),
    0 40px 80px rgba(0, 0, 0, .6);
}
#table::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 5px);
  mix-blend-mode: overlay; opacity: .6; pointer-events: none;
}
#table::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(46% 56% at 50% 20%, rgba(255, 246, 224, .2), transparent 70%);
  pointer-events: none;
}

#table-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; z-index: 4;
}
#board { display: flex; gap: 9px; min-height: 86px; }

#pot {
  display: flex; align-items: center; gap: 12px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(236, 77, 146, .4);
  border-radius: 22px; padding: 5px 16px;
}
.pot-label { color: var(--ink); font-size: 15px; font-weight: 700; white-space: nowrap; }

#banner {
  background: rgba(0, 0, 0, .68);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 12px; padding: 9px 22px;
  font-size: 16px; font-weight: 700; text-align: center; max-width: 72%;
}
#banner .win-odds { font-size: 12px; font-weight: 500; color: #8fd3a6; margin-top: 2px; }

/* ============================================================
   Cards (rank stacked over suit, centered)
   ============================================================ */
.card {
  width: 60px; height: 86px;
  border-radius: 9px;
  background: linear-gradient(150deg, #fefdf9, var(--card-bg));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .06);
  user-select: none;
}
.card .rank { font-size: 25px; line-height: 1; letter-spacing: -1px; }
.card .suit { font-size: 21px; line-height: 1.15; }
.card.red { color: var(--card-red); }
.card.black { color: var(--card-black); }
.card.back {
  background: repeating-linear-gradient(45deg, #234a6e 0 7px, #1a3a59 7px 14px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 0 0 3px var(--card-bg), inset 0 0 0 4px rgba(0, 0, 0, .2);
}
.card.small { width: 42px; height: 60px; border-radius: 6px; }
.card.small .rank { font-size: 17px; }
.card.small .suit { font-size: 14px; }

/* ---- card animations ---- */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-48px) scale(.8) rotate(-9deg); }
  to   { opacity: 1; transform: none; }
}
.card.dealing { animation: dealIn .42s cubic-bezier(.2, .85, .25, 1) backwards; }
@keyframes flipIn {
  0%   { opacity: 0; transform: rotateY(88deg) scale(.9); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: rotateY(0) scale(1); }
}
.card.flipping { animation: flipIn .42s ease-out backwards; transform-style: preserve-3d; }

/* ---- show / muck prompt (uncontested winner) ---- */
#show-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: rgba(0, 0, 0, .72); border: 1px solid var(--magenta);
  border-radius: 13px; padding: 12px 18px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55); z-index: 4;
}
.sp-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.sp-btns { display: flex; gap: 9px; }
.sp-btns .btn { padding: 8px 18px; font-size: 14px; }

/* ============================================================
   Seats
   ============================================================ */
.seat {
  position: absolute;
  width: 150px;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}
.seat .cards { display: flex; gap: 4px; justify-content: center; min-height: 62px; margin-bottom: 5px; }
.seat.below .cards { margin-bottom: 0; margin-top: 5px; }
.seat .plate {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--plate);
  border: 1px solid var(--line-soft);
  border-top-color: rgba(217, 176, 99, .3);
  border-radius: 12px;
  padding: 7px 12px 7px 8px;
  min-width: 124px;
  backdrop-filter: blur(6px);
  transition: border-color .2s, box-shadow .2s;
}
.host-badge { color: var(--gold); font-size: 12px; }
.kick-btn {
  position: absolute; top: -9px; right: -9px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); border: 1px solid rgba(0, 0, 0, .4);
  color: #fff; font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5); opacity: .85; z-index: 3;
}
.kick-btn:hover { opacity: 1; filter: brightness(1.12); }

.seat-timer {
  position: absolute; top: 50%; left: -13px;
  transform: translateY(-50%);
  min-width: 24px; height: 24px; padding: 0 5px;
  border-radius: 12px;
  background: var(--magenta); color: #fff;
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .55), 0 0 14px rgba(236, 77, 146, .5);
  z-index: 4;
}
.seat-timer.low { background: var(--danger); animation: timerpulse 1s ease-in-out infinite; }
@keyframes timerpulse { 50% { opacity: .5; } }

.seat.turn .plate {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta), 0 0 22px rgba(236, 77, 146, .55);
}
.seat.folded { opacity: .42; }
.seat.idle { opacity: .6; }
.seat.winner .plate {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(217, 176, 99, .6);
}
.seat.disconnected .pname { color: var(--muted); font-style: italic; }

/* avatar emoji upgraded into a tinted disc */
.seat .pname .avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2a2018, #160f09);
  box-shadow: inset 0 0 0 1.5px rgba(217, 176, 99, .35);
  font-size: 15px; margin-right: 5px; vertical-align: middle;
}
.seat .pname {
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px;
  display: flex; align-items: center;
}
.seat .pname .you { color: var(--magenta-bright); font-weight: 700; margin-left: 4px; }
.seat .pchips { font-size: 13px; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.seat .status {
  font-size: 10.5px; color: var(--muted); min-height: 13px;
  text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}
.seat .status.allin { color: var(--magenta-bright); font-weight: 800; }
.seat .status.waiting { color: var(--gold); }
.seat .status.sitout { color: #6ea8ff; font-weight: 600; }

.seat .bet-chip {
  position: absolute;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid var(--gold);
  border-radius: 12px; padding: 2px 8px;
  white-space: nowrap; z-index: 2;
}
.bet-amt { color: var(--gold); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.marker-row { position: absolute; top: 50%; right: -10px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px; z-index: 3; }
.dealer-btn, .blind-btn {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 2px 5px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.dealer-btn { background: var(--card-bg); color: #1b2430; font-size: 11px; }
.blind-btn { color: #fff; font-size: 8.5px; letter-spacing: .3px; }
.blind-sb { background: #3a83c9; }
.blind-bb { background: var(--magenta-deep); }

/* ============================================================
   Action bar
   ============================================================ */
#action-bar {
  background: linear-gradient(#140e09, #100b07);
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px; z-index: 6; flex-shrink: 0;
}
#timer-bar { height: 4px; background: rgba(255, 255, 255, .08); border-radius: 3px; margin-bottom: 12px; overflow: hidden; }
#timer-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--magenta-bright), var(--magenta-deep));
  box-shadow: 0 0 10px rgba(236, 77, 146, .6);
  transition: width 1s linear;
}
#action-buttons { display: flex; gap: 11px; align-items: center; justify-content: center; flex-wrap: wrap; }
.btn.act {
  font-size: 16px; font-weight: 700; padding: 13px 28px; min-width: 116px;
  border-radius: 11px; color: var(--ink);
}
.btn.act.fold { background: #3a2024; border-color: #5a2e34; color: #e7b8bd; }
.btn.act.check, .btn.act.call { background: #173b2b; border-color: #2a7a4f; color: #b9e8cd; }
.btn.act.raise {
  background: linear-gradient(135deg, var(--magenta), var(--magenta-deep));
  border-color: var(--magenta-bright); color: #fff;
  box-shadow: 0 6px 18px rgba(236, 77, 146, .4);
}
#raise-group { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; justify-content: center; }
#raise-slider { width: 170px; accent-color: var(--magenta); }
#raise-amount {
  width: 100px; text-align: center;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line-soft);
  border-radius: 9px; color: #ffd98a;
  font-size: 16px; font-weight: 700; padding: 9px;
  font-variant-numeric: tabular-nums;
}
#raise-presets { display: flex; gap: 6px; }
.btn.tiny.preset { background: rgba(255, 255, 255, .05); color: var(--muted); }
.btn.tiny.preset:hover { background: rgba(236, 77, 146, .16); color: var(--ink); border-color: rgba(236, 77, 146, .4); }

#rebuy-bar {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 20px;
  display: flex; gap: 14px; align-items: center; z-index: 6;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}

/* ============================================================
   Chat
   ============================================================ */
#chat-panel {
  position: absolute; top: 56px; right: 0; bottom: 0; width: 300px;
  background: rgba(16, 11, 7, .96);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 8;
}
#chat-log { flex: 1; overflow-y: auto; padding: 12px; font-size: 13px; }
#chat-log .entry { margin-bottom: 7px; line-height: 1.4; }
#chat-log .entry.sys { color: var(--muted); font-style: italic; }
#chat-log .entry b { color: var(--magenta-bright); }
#chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
#chat-input {
  flex: 1; background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line-soft); border-radius: 9px;
  color: var(--ink); padding: 9px 11px; font-size: 13px; font-family: inherit;
}
#chat-input:focus { outline: none; border-color: var(--magenta); }

/* Desktop panel docking — leaderboard left (always on), chat right (toggle).
   The table shrinks to fit whichever panels are open. (Logic preserved.) */
@media (min-width: 701px) {
  #table-area, #action-bar { transition: margin .18s ease; }
  #game-screen:not(.scores-hidden) #table-area,
  #game-screen:not(.scores-hidden) #action-bar { margin-left: 240px; }
  #game-screen.chat-open #table-area,
  #game-screen.chat-open #action-bar { margin-right: 300px; }
  #table { width: min(calc(92vw - 280px), 1000px); }
  #game-screen.scores-hidden #table { width: min(92vw, 1000px); }
  #game-screen.chat-open:not(.scores-hidden) #table { width: min(calc(92vw - 580px), 1000px); }
  #game-screen.chat-open.scores-hidden #table { width: min(calc(92vw - 340px), 1000px); }
}

/* ============================================================
   Leaderboard (docked left)
   ============================================================ */
#scores-panel {
  position: absolute; top: 56px; left: 0; bottom: 0; width: 240px;
  overflow-y: auto;
  background: rgba(16, 11, 7, .96);
  border-right: 1px solid var(--line);
  padding: 14px 14px 16px;
  display: flex; flex-direction: column; z-index: 8;
}
#game-screen.scores-hidden #scores-panel { display: none; }
.scores-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
#scores-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#scores-table th {
  text-align: left; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; padding: 4px 6px;
  border-bottom: 1px solid var(--line-soft);
}
#scores-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
#scores-table td:nth-child(2), #scores-table th:nth-child(2),
#scores-table td:nth-child(3), #scores-table th:nth-child(3) { text-align: right; }
#scores-table .lb-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2a2018, #160f09);
  font-size: 13px; margin-right: 5px; vertical-align: middle;
}
#scores-table .pos { color: #6fcf97; font-weight: 700; }
#scores-table .neg { color: var(--danger); font-weight: 700; }
#scores-table tr.departed td { color: var(--muted); font-style: italic; }
.left-tag, .rebuy-tag { color: var(--faint); font-size: 11px; font-style: normal; }
.scores-note { margin-top: 14px; font-size: 11px; color: var(--faint); line-height: 1.4; }
#scores-table .chips-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ============================================================
   Poker chips (horizontal stacks, clay-edge look)
   ============================================================ */
.chip {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800;
  border: 2px dashed rgba(255, 255, 255, .6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .15);
  flex: 0 0 auto; user-select: none;
}
.chip.sm { width: 17px; height: 17px; font-size: 7px; border-width: 1.5px; }
.chip-white { background: #efe9da; color: #2a2a2a; border-color: rgba(0, 0, 0, .28); }
.chip-red { background: #c0392b; color: #fff; }
.chip-green { background: #1e8a52; color: #fff; }
.chip-black { background: #242c38; color: #fff; }
.chip-purple { background: #7d3c98; color: #fff; }
.chip-gold { background: var(--gold); color: #3a2d00; }

.chip-cluster { display: inline-flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.chip-stack { display: inline-flex; align-items: center; }
.chip-stack .chip + .chip { margin-left: -15px; }
.chip-stack.sm .chip + .chip { margin-left: -11px; }
.chip-count { font-size: 10px; font-weight: 700; color: var(--ink); margin-left: 4px; }
.bet-chip .chip-count { color: var(--gold); font-size: 9px; }

.chip-legend { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.chip-legend h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
.chip-legend .leg-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 5px; }
.chip-legend .leg-row .val { margin-left: auto; color: var(--gold); font-weight: 600; }

.chip-tray-wrap { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; margin-top: 4px; }
.tray-label { font-size: 12px; color: var(--muted); }
.chip-tray { display: inline-flex; gap: 7px; flex-wrap: wrap; }
.chip-btn { background: none; border: none; padding: 0; cursor: pointer; transition: transform .08s; }
.chip-btn:hover { transform: translateY(-3px); }
.chip-btn:active { transform: translateY(-1px); }

/* ============================================================
   Paused overlay + toast
   ============================================================ */
#paused-overlay {
  position: absolute; inset: 56px 0 0 0;
  background: rgba(8, 6, 4, .74);
  display: flex; align-items: center; justify-content: center; z-index: 15;
}
.paused-card {
  background: var(--panel); border: 1px solid var(--gold);
  border-radius: 16px; padding: 26px 44px;
  font-size: 26px; font-weight: 800; color: var(--gold); text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.paused-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 8px; }

#toast {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: #fff;
  padding: 10px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600; z-index: 20;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}

/* ============================================================
   Blinds modal
   ============================================================ */
#blinds-modal {
  position: absolute; inset: 0; z-index: 16;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 4, .6);
}
.modal-card {
  background: linear-gradient(165deg, #1e1610, #140e09);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 28px; width: 340px; max-width: 92vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.modal-card h3 { font-size: 18px; margin-bottom: 16px; }
.blinds-row { display: flex; gap: 12px; }
.blinds-row label { flex: 1; font-size: 12px; color: var(--muted); }
.modal-card input {
  width: 100%; margin-top: 5px;
  background: rgba(0, 0, 0, .32); border: 1px solid var(--line-soft);
  border-radius: 9px; color: var(--ink); padding: 9px 11px; font-size: 15px; font-family: inherit;
}
.modal-note { font-size: 12px; color: var(--faint); margin: 14px 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Stats modal ---- */
#stats-modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 4, .68);
}
.stats-card { width: 400px; max-height: 86vh; overflow-y: auto; }
#profile-section { margin-bottom: 4px; }
.profile-id-row { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
#profile-username { color: var(--ink); font-weight: 600; }
.profile-edit-row { display: flex; gap: 8px; }
#nickname-input {
  flex: 1; background: rgba(0, 0, 0, .32); border: 1px solid var(--line-soft);
  border-radius: 9px; color: var(--ink); padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.profile-hint { font-size: 11px; color: var(--faint); line-height: 1.4; margin-top: 7px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 8px; }
.stat-cell {
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 13px; text-align: center;
}
.stat-num { font-size: 22px; font-weight: 800; }
.stat-num.pos { color: #6fd08c; }
.stat-num.neg { color: var(--danger); }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .8px; }
.stats-h { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin: 16px 0 8px; }
.stats-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 12px; }
.recent-hand {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.rh-net { font-weight: 800; min-width: 64px; }
.rh-net.pos { color: #6fd08c; }
.rh-net.neg { color: var(--danger); }
.rh-board { color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .5px; flex: 1; }
.rh-tag { color: var(--gold); font-size: 11px; }
.stats-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

/* ---- Admin menu ---- */
#admin-modal {
  position: absolute; inset: 0; z-index: 16;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 4, .6);
}
.admin-card { width: 390px; max-height: 86vh; overflow-y: auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.admin-head h3 { margin: 0; }
.admin-section { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.admin-section:first-of-type { border-top: none; padding-top: 6px; }
.admin-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 10px; }
.admin-row { display: flex; align-items: center; gap: 9px; }
.admin-row input { width: 74px !important; margin-top: 0 !important; text-align: center; }
.admin-unit { font-size: 13px; color: var(--muted); }
.admin-cur { font-size: 13.5px; color: var(--ink); flex: 1; }
.admin-note { font-size: 11px; color: var(--faint); margin: 9px 0 0; line-height: 1.4; }
.admin-player { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.ap-name { font-size: 13px; }
.remove-btn { background: rgba(215, 106, 106, .14); border-color: rgba(215, 106, 106, .4); color: #e9a3a3; }
.btn.armed { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; font-weight: 700; }
.danger-section { border-top-color: rgba(215, 106, 106, .3); }
.danger-btn { background: rgba(215, 106, 106, .16); border: 1px solid rgba(215, 106, 106, .45); color: #e9a3a3; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 700px) {
  .join-card { padding: 22px 20px 20px; }
  .join-card h1 { font-size: 23px; }
  .tagline { margin: 6px 0 18px; }
  .avatar-opt { width: 38px; height: 38px; font-size: 19px; }
  .avatar-picker { gap: 6px; margin-bottom: 18px; }
  #table { height: 46vh; border-width: 9px; box-shadow: 0 0 0 9px #4a3320, 0 0 0 11px #2c1d10, inset 0 0 50px rgba(0,0,0,.6), 0 18px 44px rgba(0,0,0,.6); }
  .card { width: 38px; height: 55px; }
  .card .rank { font-size: 15px; }
  .card .suit { font-size: 14px; }
  .card.small { width: 28px; height: 41px; }
  .card.small .rank { font-size: 11px; }
  .card.small .suit { font-size: 10px; }
  .seat { width: 92px; }
  .seat .cards { gap: 2px; min-height: 44px; }
  /* stack the plate vertically on phones so it stays narrow and never overflows */
  .seat .plate { flex-direction: column; align-items: center; gap: 1px; min-width: 0; max-width: 96px; padding: 5px 9px; }
  .seat .pname { font-size: 11px; max-width: 86px; }
  .seat .pname .avatar { font-size: 13px; }
  .seat .pchips { font-size: 11px; }
  .seat .status { font-size: 10px; }

  /* --- top bar: collapse actions into a ☰ dropdown --- */
  #topbar { gap: 8px; padding: 0 10px; }
  .brand-text { display: none; }
  #blind-info { display: none; }
  #menu-btn { display: inline-flex; margin-left: auto; }
  #topbar-actions {
    position: absolute; top: 50px; right: 8px;
    flex-direction: column; align-items: stretch; gap: 6px;
    background: linear-gradient(165deg, #221913, #16100b);
    border: 1px solid var(--line); border-radius: 12px;
    padding: 10px; min-width: 190px; margin-left: 0;
    box-shadow: 0 18px 50px rgba(0,0,0,.7); z-index: 40;
    display: none;
  }
  #topbar-actions.open { display: flex; }
  #topbar-actions .btn { width: 100%; text-align: left; padding: 11px 13px; font-size: 14px; }

  /* --- action bar: fill the width, drop the chip tray --- */
  #action-bar { padding: 9px 8px 11px; }
  #action-buttons { gap: 7px; }
  .btn.act { min-width: 0; flex: 1 1 30%; padding: 13px 6px; font-size: 15px; }
  #raise-group { gap: 7px; width: 100%; margin-top: 7px; }
  #raise-group .btn.act.raise { flex: 1 1 100%; }
  #raise-slider { flex: 1 1 120px; width: auto; min-width: 100px; }
  #raise-amount { width: 72px; font-size: 15px; padding: 8px; }
  #raise-presets { width: 100%; justify-content: center; }
  .chip-tray-wrap { display: none; }

  #chat-panel { width: 100vw; }
  #scores-panel { width: 84vw; max-width: 330px; z-index: 14; box-shadow: 4px 0 30px rgba(0, 0, 0, .6); }
}
