:root {
  --bg: #0b0f2b;
  --bg-alt: #161b3d;
  --panel: #1f2555;
  --accent: #ffcc33;
  --accent-2: #ff5f6d;
  --text: #f5f6ff;
  --text-dim: #a9adcf;
  --good: #3ddc84;
  --bad: #ff5f6d;
  --team-a: #3aa0ff;
  --team-b: #ff5fa2;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: 'Segoe UI', Verdana, system-ui, sans-serif;
}

html {
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 64px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 900px 500px at 20% -10%, rgba(255, 204, 51, 0.14), transparent 60%),
    radial-gradient(ellipse 900px 500px at 85% 0%, rgba(255, 95, 109, 0.12), transparent 60%),
    radial-gradient(circle at top, var(--bg-alt), var(--bg) 65%);
  background-attachment: fixed;
}

/* Subtle vignette so the corners recede — reads as a "stage" rather than a flat page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 140% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

h1, h2, h3 { margin: 0.2em 0; }

/* --- Wordmark logo (SVG badge + gradient text), see FGSUtil.logoHtml --- */
.fgs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 14px;
}
.fgs-logo-badge { flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(255, 204, 51, 0.35)); }
.fgs-logo-text {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fgs-logo-small { margin: 0; }

/* --- Marquee chase-light strip for the display page --- */
.fgs-marquee {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 0 14px;
}
.fgs-bulb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 2px rgba(255, 204, 51, 0.5);
  animation: fgs-bulb-chase 1.4s infinite;
}
@keyframes fgs-bulb-chase {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 10px 4px rgba(255, 204, 51, 0.75); }
}

.fgs-game-icon { vertical-align: middle; flex-shrink: 0; }

.card {
  background: linear-gradient(165deg, var(--panel), #171c47);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  margin-bottom: 16px;
}

.room-code {
  font-size: 2.4rem;
  letter-spacing: 0.3em;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

input, select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #363c73;
  background: #10143a;
  color: var(--text);
  font-size: 1rem;
  margin: 6px 0 12px;
}

button {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #ffb833);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin: 6px 0;
  box-shadow: 0 4px 14px rgba(255, 204, 51, 0.25);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(255, 204, 51, 0.4); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

button.secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

/* --- Custom scrollbar (webkit) for a more polished feel --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 6px;
}

button.danger { background: var(--bad); color: white; }
button.small { width: auto; padding: 8px 14px; font-size: 0.9rem; }

.error {
  color: var(--bad);
  min-height: 1.2em;
  font-size: 0.9rem;
  text-align: center;
}

.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: #10143a;
  margin-bottom: 6px;
}
.player-list li.disconnected { opacity: 0.45; }
.player-list .badge {
  font-size: 0.7rem;
  background: var(--accent);
  color: #1a1a1a;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 6px;
}

.team-a { color: var(--team-a); }
.team-b { color: var(--team-b); }

.letter-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.letter-grid button {
  padding: 10px 0;
  font-size: 1rem;
}

.board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin: 16px 0;
}
.board .word-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
.board .tile {
  min-width: 28px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e123a;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.hidden { display: none !important; }

.center { text-align: center; }
.dim { color: var(--text-dim); }
.app-version { position: fixed; top: 8px; right: 12px; font-size: 0.75rem; color: var(--text-dim); opacity: 0.7; }

.letter-splash {
  margin: 10px auto;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  max-width: 90%;
  text-align: center;
  animation: splash-pop 0.35s ease-out;
}
.letter-splash.found { background: rgba(61, 220, 132, 0.18); color: var(--good); border: 2px solid var(--good); }
.letter-splash.not-found { background: rgba(255, 95, 109, 0.18); color: var(--bad); border: 2px solid var(--bad); }

@keyframes splash-pop {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.round-result-banner {
  margin: 14px auto;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255, 204, 51, 0.15);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  max-width: 90%;
  text-align: center;
  animation: splash-pop 0.4s ease-out;
}

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 14px auto;
}
.mc-option {
  background: #10143a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1.1rem;
  text-align: left;
  border: 2px solid transparent;
}
.mc-option.correct {
  background: rgba(61, 220, 132, 0.18);
  border-color: var(--good);
  color: var(--good);
  font-weight: 700;
}
.mc-option.your-wrong-pick {
  border-color: var(--bad);
  color: var(--bad);
}

/* --- Toasts --- */
.fgs-toast-stack {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 100%;
  padding: 0 16px;
}
.fgs-toast {
  background: var(--panel);
  border: 1px solid #363c73;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 420px;
  text-align: center;
}
.fgs-toast-in { opacity: 1; transform: translateY(0); }
.fgs-toast-connect { border-color: var(--good); color: var(--good); }
.fgs-toast-disconnect { border-color: var(--bad); color: var(--bad); }

/* --- Avatar badges --- */
.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  font-size: 1rem;
  margin-right: 6px;
  flex-shrink: 0;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 6px 0 12px;
}
.avatar-picker button {
  padding: 8px 0;
  font-size: 1.4rem;
  background: #10143a;
  border: 2px solid transparent;
}
.avatar-picker button.avatar-selected {
  border-color: var(--accent);
  background: rgba(255, 204, 51, 0.15);
}

/* --- Sticky room-code header shown during gameplay --- */
.room-code-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: 480px;
  text-align: center;
  background: rgba(11, 15, 43, 0.9);
  backdrop-filter: blur(4px);
  padding: 6px 0;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-radius: 8px;
}
.room-code-header strong { color: var(--accent); letter-spacing: 0.15em; }

/* --- Host controls panel --- */
.host-controls {
  border: 1px dashed #4a5090;
}
.host-controls summary {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 4px 0;
}

/* --- Modal overlay (how-to-play, recap) --- */
.fgs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.fgs-modal {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.fgs-modal h2 { margin-top: 0; }
.fgs-modal .close-btn { margin-top: 12px; }

.help-btn {
  width: auto;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid #4a5090;
  color: var(--text-dim);
}

/* --- Large text accessibility mode (display page) --- */
body.large-text .room-code { font-size: 3.2rem; }
body.large-text h2 { font-size: 2rem; }
body.large-text .dim, body.large-text p { font-size: 1.25rem; }
body.large-text .board .tile { min-width: 52px; height: 66px; font-size: 2.1rem; }
body.large-text .leaderboard-row, body.large-text .feud-board .row { font-size: 1.4rem; }

/* --- Pre-game stage screens (pick game / setup / ready-up) --- */
.stage-game { display: flex; align-items: center; justify-content: center; gap: 10px; }
.stage-game h2 { margin: 0; }
.ready-mark { font-size: 0.8rem; color: var(--text-dim); }
.ready-mark.ready { color: var(--good); font-weight: 700; }
.card label { display: block; margin-top: 6px; font-size: 0.85rem; }

/* --- Cluedo --- */
.cluedo-triple { font-size: 1.15rem; font-weight: 700; margin: 6px 0; line-height: 1.5; }
.cluedo-select { margin-bottom: 8px; }
.cluedo-hand { display: flex; flex-wrap: wrap; gap: 8px; }
.cluedo-card {
  background: #10143a;
  border: 1px solid #363c73;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
}
.reveal-line { color: var(--accent); font-size: 1.05rem; }
.nb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.nb-grid button.nb-cell {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #10143a;
  color: var(--text);
  box-shadow: none;
  border: 1px solid #363c73;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  text-align: left;
}
.nb-grid button.nb-cell.nb-locked { opacity: 0.6; }
.nb-grid button.nb-cell.nb-solution { border-color: var(--good); background: rgba(61, 220, 132, 0.15); }
.nb-mark { color: var(--accent); white-space: nowrap; }
.card summary { cursor: pointer; font-weight: 700; }
.card h4 { margin: 12px 0 6px; color: var(--text-dim); }

.cluedo-envelope {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, #6b4f2a, #4a3419);
  border: 2px solid #8a6a3a;
}
.cluedo-slot {
  background: #f3e6c8;
  color: #2a1d0a;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  min-width: 130px;
}
.cluedo-envelope.open { border-color: var(--good); }
.score-card.eliminated { opacity: 0.45; }

/* ===== Cluedo board ===== */
.cb-slot { width: 100%; margin-bottom: 14px; }
.cb-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  -webkit-overflow-scrolling: touch;
  max-height: 78vh;
}
.cb-inner { position: relative; width: 100%; transition: width 0.35s ease; container-type: inline-size; }
.cb-inner.cb-zoomed { width: 230%; }
.cb-svg { display: block; width: 100%; height: auto; }
.cb-bg { fill: #0d5a3c; }
.cb-cell { fill: #d9c7a0; stroke: #b09868; stroke-width: 0.6; }
.cb-cell.cb-door { fill: #f0d98a; stroke: #e0b21f; stroke-width: 1.4; }
.cb-room-rect { opacity: 0.88; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.2; }
.cb-room-label { fill: #fff; font: 700 11px system-ui, sans-serif; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 2.5px; }
.cb-passage { fill: #ffe9a6; font: 600 7.5px system-ui, sans-serif; text-anchor: middle; }
.cb-cellar rect { fill: #1b1330; stroke: #ffcc33; stroke-width: 1.5; stroke-dasharray: 5 4; }
.cb-cellar text { fill: #ffcc33; font: 800 13px system-ui, sans-serif; text-anchor: middle; }
.cb-cellar .cb-cellar-sub { font: 500 9px system-ui, sans-serif; fill: #b9a86a; }

/* Tokens glide between squares */
.cb-token { transition-property: transform; transition-timing-function: ease-in-out; transition-duration: 0.25s; }
.cb-token.cb-no-anim { transition: none !important; }
.cb-suspect-disc { stroke: #fff; stroke-width: 1.8; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.cb-suspect-initial { font: 800 11px system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.cb-weapon-tile { fill: rgba(15, 18, 45, 0.92); stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; }
.cb-weapon-icon { font-size: 12px; text-anchor: middle; pointer-events: none; }
.cb-active .cb-suspect-disc { animation: cb-pulse 1s ease-in-out infinite; stroke: #ffcc33; stroke-width: 3; transform-box: fill-box; transform-origin: center; }
@keyframes cb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.cb-teleport { animation: cb-teleport 0.9s ease-in-out; }
@keyframes cb-teleport { 0% { opacity: 1; } 35% { opacity: 0; } 65% { opacity: 0; } 100% { opacity: 1; } }

/* Where you can move */
.cb-opt { fill: rgba(77, 225, 255, 0.55); stroke: #4de1ff; stroke-width: 1.6; cursor: pointer; animation: cb-glow 1.1s ease-in-out infinite; }
.cb-opt.cb-static { cursor: default; }
.cb-opt-room { fill: rgba(77, 225, 255, 0.28); stroke-width: 3; }
.cb-opt.cb-selected { fill: rgba(61, 220, 132, 0.55); stroke: #3ddc84; stroke-width: 2.5; animation: none; }
@keyframes cb-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Dice */
.cb-dice {
  position: absolute;
  left: 37.5%;
  top: 36%;
  width: 25%;
  height: 28%;
  transform: scale(0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 2px 4px;
  border-radius: 12px;
  background: rgba(13, 10, 30, 0.97);
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 5;
  overflow: hidden;
}
.cb-dice.show { opacity: 1; transform: scale(1); }
.cb-die { font-size: 2.2rem; font-size: 7.4cqw; line-height: 1; color: #fff; }
.cb-dice.rolling .cb-die { animation: cb-shake 0.16s linear infinite; }
.cb-dice.landed .cb-die { animation: cb-land 0.45s ease-out; }
.cb-dice-who { flex-basis: 100%; text-align: center; color: var(--accent); font-size: 0.6rem; font-size: 2.1cqw; font-weight: 700; line-height: 1.1; }
@keyframes cb-shake { 0% { transform: rotate(-14deg) translateY(-3px); } 50% { transform: rotate(14deg) translateY(3px); } 100% { transform: rotate(-14deg) translateY(-3px); } }
@keyframes cb-land { 0% { transform: scale(1.5) rotate(20deg); } 60% { transform: scale(0.92); } 100% { transform: scale(1) rotate(0); } }

/* Phone panels */
.cluedo-identity { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.cluedo-identity .small { margin: 0; }
.cluedo-status { padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); text-align: center; margin-bottom: 12px; font-weight: 600; }
.cluedo-status.mine { background: rgba(255, 204, 51, 0.16); border: 2px solid var(--accent); color: var(--accent); }
.cluedo-status.pop, .cluedo-headline.pop { animation: cluedo-pop 0.45s ease-out; }
@keyframes cluedo-pop { 0% { transform: scale(0.85) translateY(-8px); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
.cluedo-roll { font-size: 1.3rem; padding: 18px; animation: cluedo-bounce 1.6s ease-in-out infinite; }
@keyframes cluedo-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Card flip when a card is shown to you */
.flip-card { perspective: 700px; display: flex; justify-content: center; margin: 8px 0; }
.flip-face {
  background: linear-gradient(160deg, #fff6d6, #f0d98a);
  color: #2a1d0a;
  font-weight: 800;
  font-size: 1.2rem;
  padding: 16px 26px;
  border-radius: 12px;
  border: 2px solid #b8902c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.flip-card.flip .flip-face { animation: cluedo-flip 0.8s ease-out; }
@keyframes cluedo-flip { 0% { transform: rotateY(90deg) scale(0.8); opacity: 0; } 60% { transform: rotateY(-10deg) scale(1.05); opacity: 1; } 100% { transform: rotateY(0) scale(1); } }

/* Envelope opening at the end */
.cluedo-envelope.reveal-anim .cluedo-slot { animation: cluedo-slot-in 0.9s ease-out backwards; }
.cluedo-envelope.reveal-anim .cluedo-slot:nth-child(2) { animation-delay: 0.5s; }
.cluedo-envelope.reveal-anim .cluedo-slot:nth-child(3) { animation-delay: 1s; }
@keyframes cluedo-slot-in { 0% { transform: translateY(40px) rotateX(80deg); opacity: 0; } 70% { transform: translateY(-6px); opacity: 1; } 100% { transform: translateY(0); } }

/* TV layout */
.cluedo-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; width: 100%; }
.cluedo-layout .card { max-width: none; }
.cluedo-layout .cb-wrap { max-height: none; overflow: hidden; }
.cluedo-headline { font-size: 1.4rem; font-weight: 800; color: var(--accent); margin: 8px 0 12px; }
.cluedo-suggestion-card { background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.cluedo-side-card h2 { margin-top: 0; }
@media (max-width: 860px) { .cluedo-layout { grid-template-columns: 1fr; } }

/* Turn announcements (phones share these with the TV; the TV adds delays in display.css) */
.turn-splash { text-align: center; }
.turn-splash .turn-sub { font-size: 0.8em; font-weight: 600; opacity: 0.9; margin-top: 0.3em; }
.turn-splash.bankrupt { animation: turn-shake 0.7s ease-in-out; }
@keyframes turn-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-1deg); }
  30% { transform: translateX(10px) rotate(1deg); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* Host-is-away takeover button in the room header */
.room-code-header .claim-host-btn { width: auto; margin: 0 0 0 8px; padding: 4px 10px; font-size: 0.75rem; }

/* ===== Poker table (shared by phone and TV; see public/shared/pokerTable.js) ===== */
.pk-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; margin: 0 auto; }
.pk-table {
  position: absolute;
  left: 9%; right: 9%; top: 13%; bottom: 13%;
  background: radial-gradient(ellipse at center, #1a6b3c, #0d4326);
  border: clamp(4px, 1.2vh, 10px) solid #5c3a1e;
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1vh;
}
.pk-community { display: flex; gap: clamp(3px, 0.8vw, 8px); min-height: clamp(34px, 7vh, 62px); }
.pk-pot { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--accent); font-size: clamp(0.8rem, 2.2vh, 1.3rem); align-items: center; }
.pk-pot-badge { background: rgba(0, 0, 0, 0.35); border-radius: 8px; padding: 2px 10px; }
.pk-deal-hint { color: var(--text-dim); font-size: clamp(0.7rem, 1.8vh, 1rem); min-height: 1.2em; }

.pk-card {
  width: clamp(24px, 5vh, 44px);
  height: clamp(34px, 7vh, 62px);
  background: #fff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.65rem, 1.8vh, 1.05rem);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  line-height: 1;
  gap: 2px;
}
.pk-card-black { color: #1a1a1a; }
.pk-card-red { color: #c0263a; }
.pk-card-back { background: repeating-linear-gradient(45deg, #2451a8, #2451a8 4px, #1b3d84 4px, #1b3d84 8px); border: 2px solid #14295c; }
.pk-card-empty { background: rgba(255, 255, 255, 0.08); box-shadow: none; border: 1px dashed rgba(255, 255, 255, 0.25); }

.pk-flip { perspective: 500px; }
.pk-flip-anim .pk-card { animation: pk-flip-in 0.5s ease-out; }
@keyframes pk-flip-in {
  0% { transform: rotateY(90deg) scale(0.85); opacity: 0; }
  60% { transform: rotateY(-8deg); opacity: 1; }
  100% { transform: rotateY(0); }
}

.pk-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: clamp(70px, 15vw, 130px);
  text-align: center;
}
.pk-seat-cards { display: flex; gap: 3px; justify-content: center; min-height: clamp(28px, 5.6vh, 46px); }
.pk-seat-cards .pk-card { width: clamp(18px, 4vh, 32px); height: clamp(26px, 5.6vh, 46px); font-size: clamp(0.55rem, 1.4vh, 0.8rem); }
.pk-seat-info {
  background: rgba(15, 18, 45, 0.85);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px 8px;
  min-width: 64px;
}
.pk-seat-name { font-weight: 700; font-size: clamp(0.7rem, 1.8vh, 1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.pk-seat-stack { color: var(--accent); font-weight: 700; font-size: clamp(0.65rem, 1.6vh, 0.9rem); }
.pk-seat-status { font-size: clamp(0.55rem, 1.3vh, 0.75rem); color: var(--text-dim); min-height: 1.1em; }
.pk-seat-bet {
  background: rgba(255, 204, 51, 0.18);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: clamp(0.6rem, 1.4vh, 0.85rem);
  font-weight: 700;
  align-self: center;
}
.pk-seat-badges { display: flex; gap: 3px; }
.pk-badge { width: clamp(16px, 3vh, 22px); height: clamp(16px, 3vh, 22px); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(0.55rem, 1.2vh, 0.7rem); font-weight: 800; }
.pk-badge-dealer { background: #fff; color: #1a1a1a; }
.pk-badge-sb { background: var(--team-a); color: #fff; }
.pk-badge-bb { background: var(--team-b); color: #fff; }

.pk-seat.pk-acting .pk-seat-info { border-color: var(--accent); animation: pk-pulse 1s ease-in-out infinite; }
@keyframes pk-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 204, 51, 0.4); }
  50% { box-shadow: 0 0 18px rgba(255, 204, 51, 0.9); }
}
.pk-seat.pk-folded { opacity: 0.4; }
.pk-seat.pk-allin .pk-seat-info { border-color: var(--bad); }
.pk-seat.pk-sitting-out .pk-seat-info, .pk-seat.pk-disconnected .pk-seat-info { opacity: 0.5; }
.pk-seat.pk-you .pk-seat-info { border-color: #3ddc84; }

/* Phone action bar */
.pk-action-bar { display: flex; gap: 8px; }
.pk-action-bar button { flex: 1; }
.pk-bet-presets { display: flex; gap: 6px; margin: 8px 0; }
.pk-bet-presets button { flex: 1; padding: 8px; font-size: 0.8rem; }
.pk-bet-stepper { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.pk-bet-stepper button { width: auto; padding: 10px 16px; }
.pk-bet-amount { flex: 1; text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--accent); }

/* Tournament blind clock */
.pk-blind-clock { text-align: center; }
.pk-blind-clock .pk-clock-time { font-size: clamp(1.6rem, 5vh, 3rem); font-weight: 800; color: var(--accent); }
.pk-blind-clock.pk-on-break .pk-clock-time { color: var(--good); }
.pk-blind-levels { display: flex; justify-content: center; gap: 16px; margin-top: 4px; font-size: 0.9rem; color: var(--text-dim); }

/* Phones: a squarer table gives the ring room to fit all 10 seats (positions set in pokerTable.js). */
@media (max-width: 480px) {
  .pk-wrap { aspect-ratio: 4 / 5; }
  .pk-seat { width: 68px; }
  .pk-seat-name { max-width: 68px; }
  .pk-seat-cards { min-height: 0; }
  .pk-seat-cards .pk-card { width: 20px; height: 30px; font-size: 0.5rem; }
  .pk-community { gap: 3px; min-height: 0; }
  .pk-community .pk-card { width: 30px; height: 42px; font-size: 0.6rem; }
}

/* Room code pinned to the bottom of the phone so anyone at the table can invite more people. */
#poker-root { padding-bottom: 44px; }
.pk-room-badge {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px; padding: 6px 14px; font-size: 0.8rem; color: var(--text-dim);
  white-space: nowrap; z-index: 5;
}
.pk-room-badge strong { color: var(--accent); letter-spacing: 0.15em; }
