:root {
  --g: #39ff39;
  --g-dim: #167a16;
  --g-deep: #041a04;
  --red: #e02424;
  --gold: #ffd24a;
  --ink: #0b120b;
  --felt: #0c4a18;
  --felt-deep: #06280d;
  --line: #0c3a0c;
  --panel: rgba(0, 8, 0, .9);
  --chip-green: #1d7a1d;
  --chip-green-deep: #052005;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #000;
  color: var(--g);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .4px;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.human-app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
}

/* A compact game header, deliberately quieter than the table. */
.topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #000;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  z-index: 20;
  flex-shrink: 0;
}
.human-brand { display: flex; align-items: center; gap: 6px; color: var(--g); text-decoration: none; }
.human-brand-mark {
  color: var(--g);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 10px var(--g);
  animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow { from { text-shadow: 0 0 6px var(--g); } to { text-shadow: 0 0 14px var(--g), 0 0 2px #fff; } }
.human-brand span:last-child { letter-spacing: 1.5px; }
.product-label { color: var(--g-dim); font-size: 10px; letter-spacing: 1px; }
.top-status { flex: 1; min-width: 0; overflow: hidden; color: var(--g-dim); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.top-status.status-error { color: var(--red); }
.top-status::before, .connection-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); animation: statusPulse 2s ease-in-out infinite; }
@keyframes statusPulse { 50% { opacity: .35; } }
.exit { padding: 5px 8px; color: var(--g-dim); border: 1px solid #145214; border-radius: 3px; text-decoration: none; font-size: 10px; white-space: nowrap; }
.exit:hover { color: var(--g); border-color: var(--g); text-shadow: 0 0 6px var(--g); }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; background: radial-gradient(ellipse at 50% 55%, #06280d 0%, #000 68%); }

/* Lobby */
.lobby-panel {
  width: min(100%, 920px);
  flex: 0 0 auto;
  min-height: calc(100dvh - 101px);
  margin: 0 auto;
  padding: clamp(42px, 9vh, 96px) 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.welcome-copy { width: min(100%, 680px); text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--g-dim); font-size: 10px; letter-spacing: 2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(32px, 6vw, 68px); line-height: .98; letter-spacing: -2px; text-shadow: 0 0 16px rgba(57,255,57,.35); }
h1 em { color: var(--gold); font-style: normal; text-shadow: 0 0 14px rgba(255,210,74,.45); }
.lead { max-width: 520px; margin: 0 auto; color: var(--g-dim); font-size: 14px; line-height: 1.55; font-weight: 400; }
.welcome-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.welcome-facts span { padding: 4px 8px; color: var(--g-dim); border: 1px solid #145214; border-radius: 3px; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.identity-card { width: min(100%, 640px); flex: 0 0 auto; overflow: hidden; background: var(--panel); border: 1px solid #1c7a1c; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,.04); }
.panel-bar { min-height: 42px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--g-dim); border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: 1.4px; }
.identity-heading { min-width: 0; }
.identity-status { min-width: 0; overflow: hidden; color: var(--gold); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.identity-status.status-error { color: var(--red); }
.identity-summary { display: flex; align-items: center; gap: 9px; min-width: 0; letter-spacing: 0; }
.identity-summary strong { overflow: hidden; color: var(--g); font-size: 12px; letter-spacing: 1px; text-overflow: ellipsis; text-transform: uppercase; text-shadow: 0 0 7px rgba(57,255,57,.4); white-space: nowrap; }
.identity-summary span { color: var(--gold); font-size: 9px; letter-spacing: 1px; white-space: nowrap; text-shadow: 0 0 6px rgba(255,210,74,.35); }
.identity-edit { padding: 4px 7px; color: var(--g-dim); background: #000; border: 1px solid #145214; border-radius: 3px; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; }
.identity-edit:hover { color: var(--g); border-color: var(--g); }
.identity-form { padding: 22px 24px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.identity-form label { grid-column: 1 / -1; margin-bottom: 2px; color: var(--g); font-size: 13px; text-shadow: 0 0 6px rgba(57,255,57,.45); }
.identity-form input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; color: var(--g); background: #000; border: 1px solid #145214; border-radius: 4px; outline: none; caret-color: var(--g); font-size: 14px; font-weight: 700; }
.identity-form input::placeholder { color: var(--g-dim); }
.identity-form input:focus { border-color: var(--g); box-shadow: 0 0 12px rgba(57,255,57,.25); }
.primary, .secondary, .action-buttons button { min-height: 48px; padding: 10px 14px; border: 1px solid var(--g); border-radius: 4px; color: var(--g); background: #000; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 0 6px var(--g); transition: background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.primary { color: var(--g); background: linear-gradient(180deg, #0d4d0d, #062806); box-shadow: 0 0 12px rgba(57,255,57,.22); }
.primary:hover, .secondary:hover, .action-buttons button:hover:not(:disabled) { border-color: #fff; box-shadow: 0 0 14px rgba(57,255,57,.32); transform: translateY(-1px); }
.primary span { color: var(--gold); }
.secondary { color: var(--g-dim); border-color: #145214; text-shadow: none; }
.opponent-select { display: grid; gap: 6px; padding: 16px 24px 16px; }
.rival-option { min-height: 58px; padding: 9px 11px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; align-items: center; gap: 9px; color: var(--g-dim); background: #000; border: 1px solid #145214; border-radius: 4px; cursor: pointer; }
.rival-option:hover, .rival-option:has(input:checked) { color: var(--g); border-color: var(--g); box-shadow: inset 0 0 10px rgba(57,255,57,.12), 0 0 8px rgba(57,255,57,.15); }
.rival-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rival-check { position: relative; width: 16px; height: 16px; border: 1px solid var(--g-dim); border-radius: 3px; }
.rival-option input:checked + .rival-check { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 8px rgba(255,210,74,.4); }
.rival-option input:checked + .rival-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border-right: 2px solid #111; border-bottom: 2px solid #111; transform: rotate(42deg); }
.rival-copy { min-width: 0; }
.rival-copy strong { display: block; color: var(--g); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.rival-copy small { display: block; margin-top: 3px; color: var(--g-dim); font-size: 9px; font-weight: 400; line-height: 1.35; }
.rival-search { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.rival-search::before { content: ""; width: 11px; height: 11px; border: 2px solid #145214; border-top-color: var(--gold); border-radius: 50%; animation: rivalSpin .9s linear infinite; }
.rival-countdown { min-width: 34px; padding: 3px 6px; color: var(--gold); background: rgba(255,210,74,.08); border: 1px solid rgba(255,210,74,.45); border-radius: 3px; font-size: 10px; text-align: center; text-shadow: 0 0 6px rgba(255,210,74,.4); white-space: nowrap; }
@keyframes rivalSpin { to { transform: rotate(360deg); } }
.rival-roster { padding: 10px 11px 0; border-top: 1px solid var(--line); }
.rival-roster-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.rival-roster-heading strong { color: var(--gold); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.rival-roster-heading small { color: var(--g-dim); font-size: 8px; font-weight: 400; }
.recent-players { max-height: 170px; overflow: auto; border-top: 1px solid #061406; }
.roster-empty { padding: 10px 0; color: var(--g-dim); font-size: 9px; }
.recent-player { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 7px; min-height: 31px; border-bottom: 1px solid #061406; font-size: 9px; }
.recent-player::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--g); box-shadow: 0 0 6px var(--g); }
.recent-player-name { overflow: hidden; color: var(--g); text-overflow: ellipsis; white-space: nowrap; }
.recent-player-type, .recent-player-seen { color: var(--g-dim); font-size: 8px; white-space: nowrap; }
.recent-player-stage { color: var(--gold); font-size: 8px; white-space: nowrap; }
.wait-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 24px 16px; }
.queue-note { color: var(--g-dim); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.queue-notice { margin: 0 24px 12px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--gold); background: rgba(255,210,74,.06); border: 1px solid rgba(255,210,74,.4); border-radius: 4px; font-size: 10px; line-height: 1.4; }
.queue-notice-close { min-width: 22px; min-height: 22px; padding: 0; color: var(--gold); background: transparent; border: 1px solid rgba(255,210,74,.4); border-radius: 3px; font-size: 12px; line-height: 1; }
.queue-notice-close:hover { color: #111; background: var(--gold); border-color: var(--gold); }
#lobby-cancel { min-height: 38px; padding: 7px 10px; font-size: 9px; }
.identity-steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.identity-steps .step { min-height: 62px; padding: 12px 14px; color: var(--g-dim); border-right: 1px solid var(--line); font-size: 9px; letter-spacing: 1px; }
.identity-steps .step:last-child { border-right: 0; }
.identity-steps .step b { display: block; margin-bottom: 5px; color: #0d4d0d; font-size: 12px; }
.identity-steps .step i { font-style: normal; }
.identity-steps .step--active { color: var(--g); background: rgba(57,255,57,.07); box-shadow: inset 0 2px 0 var(--g); }
.identity-steps .step--active b { color: var(--gold); text-shadow: 0 0 6px var(--gold); }

.site-footer { width: min(100%, 920px); flex: 0 0 auto; margin: 0 auto; padding: 18px 20px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--g-dim); border-top: 1px solid var(--line); font-size: 9px; letter-spacing: 1px; }
.footer-brand { display: flex; align-items: baseline; gap: 10px; }
.footer-brand strong { color: var(--g); text-shadow: 0 0 7px rgba(57,255,57,.35); }
.footer-brand span, .footer-meta { color: #0d4d0d; font-size: 8px; }
.site-footer nav { display: flex; gap: 14px; }
.site-footer a { color: var(--g-dim); text-decoration: none; }
.site-footer a:hover { color: var(--g); text-shadow: 0 0 6px var(--g); }

/* The table stays a fixed 3-seat composition while its internals scale. */
.table-shell { flex: 1; min-height: 0; padding: 8px 12px 14px; display: flex; flex-direction: column; }
.table-meta { min-height: 42px; display: flex; align-items: center; gap: 22px; padding: 5px 10px; background: #000; border: 1px solid var(--line); font-size: 9px; flex-shrink: 0; }
.table-meta > div { min-width: 0; }
.meta-label { display: block; margin-bottom: 3px; color: var(--g-dim); font-size: 8px; letter-spacing: 1.4px; }
.table-meta strong { display: block; max-width: 30vw; overflow: hidden; color: var(--g); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.connection-pill { margin-left: auto; color: var(--g-dim); font-size: 9px; white-space: nowrap; }
.table-stage { position: relative; flex: 1 1 auto; height: clamp(420px, calc(100dvh - 220px), 720px); min-height: 420px; overflow: hidden; background: radial-gradient(ellipse at 50% 56%, #06280d 0%, #000 72%); }
.felt { position: absolute; left: 50%; top: 53%; width: 76%; height: 69%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(ellipse at center, rgba(8,40,18,.9), rgba(4,20,10,.62) 58%, transparent 76%); box-shadow: inset 0 0 90px rgba(0,0,0,.7), 0 0 30px rgba(57,255,57,.05); pointer-events: none; }
.felt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background-image: linear-gradient(rgba(57,255,57,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(57,255,57,.025) 1px, transparent 1px); background-size: 8px 8px; }
.rail { position: absolute; inset: 5%; border: 1px solid rgba(22,122,22,.55); border-radius: 50%; pointer-events: none; }
.fx { position: absolute; inset: 0; z-index: 30; pointer-events: none; }

/* Cards: same visual language as watch, with smaller table-safe sizes. */
.board { position: absolute; z-index: 3; left: 50%; top: 53%; width: min(80%, 530px); transform: translate(-50%, -50%); text-align: center; }
.board-cards { display: flex; justify-content: center; gap: clamp(4px, 1vw, 11px); }
.board-cards .pc:nth-child(1) { transform: rotate(-5deg); }
.board-cards .pc:nth-child(2) { transform: rotate(-2.5deg); }
.board-cards .pc:nth-child(3) { transform: rotate(0); }
.board-cards .pc:nth-child(4) { transform: rotate(2.5deg); }
.board-cards .pc:nth-child(5) { transform: rotate(5deg); }
.board-cards .pc.deal { animation: cardDeal .45s ease-out backwards; }
@keyframes cardDeal { 0% { transform: translateY(-45px) scale(.5) rotate(-18deg); opacity: 0; } 65% { opacity: 1; } 100% { opacity: 1; } }
.bote { margin-top: 10px; color: var(--g); font-size: clamp(18px, 2.5vw, 28px); letter-spacing: 3px; text-shadow: 0 0 14px var(--g), 0 0 2px #000; }
.bote.pulse { animation: botePulse .5s ease-out; }
@keyframes botePulse { 40% { color: var(--gold); transform: scale(1.16); text-shadow: 0 0 22px var(--gold); } }
.pile { position: relative; width: 106px; height: 48px; margin: 6px auto 0; }
.pile .coin { left: 18px; top: 8px; }
.pile .coin:nth-child(2) { left: 34px; top: 9px; }
.pile .coin:nth-child(3) { left: 50px; top: 8px; }
.pile .coin:nth-child(4) { left: 66px; top: 9px; }
.pile .coin:nth-child(5) { left: 82px; top: 8px; }
.pile .coin:nth-child(6) { left: 26px; top: 21px; }
.pile .coin:nth-child(7) { left: 42px; top: 22px; }
.pile .coin:nth-child(8) { left: 58px; top: 21px; }
.pile .coin:nth-child(9) { left: 74px; top: 22px; }
.pile .coin:nth-child(10) { left: 90px; top: 21px; }
.pile .coin:nth-child(11) { left: 34px; top: 34px; }
.pile .coin:nth-child(12) { left: 50px; top: 35px; }
.coin { position: absolute; width: 18px; height: 18px; border: 2px solid var(--g); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a8a2a, #041804 70%); box-shadow: 0 0 6px rgba(57,255,57,.45), inset 0 0 0 2px rgba(0,0,0,.35); }
.mesa { margin-top: 2px; color: var(--g-dim); font-size: 11px; letter-spacing: 2px; }
.street { margin-top: 3px; color: var(--g-dim); font-size: 9px; letter-spacing: 1px; }
.pc { position: relative; width: clamp(52px, 6.2vw, 76px); height: clamp(73px, 8.8vw, 106px); flex-shrink: 0; overflow: hidden; color: #111; background: linear-gradient(135deg, #fbfdfb, #e9efe9); border: 1px solid #888; border-radius: 7px; box-shadow: 0 4px 8px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.65); }
.pc.red { color: var(--red); }
.pc.slot { background: transparent; border: 1px dashed rgba(20,80,20,.6); box-shadow: none; }
.pc.back { color: var(--g); border-color: var(--g-dim); background: repeating-linear-gradient(45deg, #062406 0 5px, #0a330a 5px 10px); box-shadow: 0 4px 8px rgba(0,0,0,.6), 0 0 8px rgba(57,255,57,.22); }
.pc.back::after { content: "◈"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--g); font-size: clamp(25px, 3vw, 38px); text-shadow: 0 0 10px var(--g); opacity: .85; }
.pc.win { z-index: 2; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(255,210,74,.75); animation: winGlow 1.2s ease-in-out infinite alternate; }
@keyframes winGlow { to { box-shadow: 0 0 0 3px var(--gold), 0 0 32px rgba(255,210,74,.95); } }
.pc.dim { opacity: .3; filter: grayscale(.7) brightness(.55); }
.pc .c-tl, .pc .c-br { position: absolute; width: 18px; text-align: center; font-size: 11px; line-height: 1.02; letter-spacing: -1px; font-weight: 900; }
.pc .c-tl { top: 4px; left: 4px; }
.pc .c-br { right: 4px; bottom: 4px; transform: rotate(180deg); }
.pc .c-tl .suit, .pc .c-br .suit { font-size: 10px; }
.pc .pips { position: absolute; inset: 20px 10px 20px; font-size: clamp(14px, 1.7vw, 22px); line-height: 1; }
.pc .pips span { position: absolute; transform: translate(-50%, -50%); }
.pip-50-22 { left: 50%; top: 22%; }
.pip-50-78 { left: 50%; top: 78%; }
.pip-50-50 { left: 50%; top: 50%; }
.pip-28-22 { left: 28%; top: 22%; }
.pip-72-22 { left: 72%; top: 22%; }
.pip-28-78 { left: 28%; top: 78%; }
.pip-72-78 { left: 72%; top: 78%; }
.pip-28-20 { left: 28%; top: 20%; }
.pip-72-20 { left: 72%; top: 20%; }
.pip-28-50 { left: 28%; top: 50%; }
.pip-72-50 { left: 72%; top: 50%; }
.pip-28-80 { left: 28%; top: 80%; }
.pip-72-80 { left: 72%; top: 80%; }
.pip-50-36 { left: 50%; top: 36%; }
.pip-28-18 { left: 28%; top: 18%; }
.pip-72-18 { left: 72%; top: 18%; }
.pip-50-34 { left: 50%; top: 34%; }
.pip-50-66 { left: 50%; top: 66%; }
.pip-28-82 { left: 28%; top: 82%; }
.pip-72-82 { left: 72%; top: 82%; }
.pip-28-16 { left: 28%; top: 16%; }
.pip-72-16 { left: 72%; top: 16%; }
.pip-28-38 { left: 28%; top: 38%; }
.pip-72-38 { left: 72%; top: 38%; }
.pip-28-62 { left: 28%; top: 62%; }
.pip-72-62 { left: 72%; top: 62%; }
.pip-28-84 { left: 28%; top: 84%; }
.pip-72-84 { left: 72%; top: 84%; }
.pip-50-27 { left: 50%; top: 27%; }
.pip-50-73 { left: 50%; top: 73%; }
.pc.ace .pips { inset: 0; display: grid; place-items: center; font-size: clamp(32px, 4vw, 50px); }
.pc.ace .pips span { position: static; transform: none; }
.pc .face-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.pc .face-rank { font-size: clamp(24px, 3vw, 35px); line-height: .9; font-weight: 900; }
.pc .face-suit { font-size: clamp(19px, 2.2vw, 27px); line-height: 1; }

/* Player panels */
.seat { position: absolute; z-index: 5; width: clamp(220px, 24vw, 320px); padding: 10px 13px 9px; color: var(--g); background: rgba(0,8,0,.88); border: 2px solid #1c7a1c; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.04); transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s, border-color .3s, opacity .3s; }
.pos-top-left { top: 4%; left: 3%; }
.pos-top-right { top: 4%; right: 3%; }
.pos-bottom { bottom: 3%; left: 50%; width: clamp(270px, 31vw, 390px); transform: translateX(-50%); }
.seat.is-actor {
  color: #0b1a0b;
  background: linear-gradient(165deg, #d8f5d8 0%, #b6e6b6 55%, #9fd49f 100%);
  border-color: #163816;
  box-shadow: 0 0 0 2px #1a4a1a, 0 0 22px rgba(200,255,200,.35), inset 0 0 18px rgba(255,255,255,.25);
}
.seat.is-actor .seat-name,
.seat.is-actor .stack-n,
.seat.is-actor .seat-meta strong { color: #0b1a0b; text-shadow: none; }
.seat.is-actor .seat-sub,
.seat.is-actor .seat-type,
.seat.is-actor .seat-meta { color: #1e3d1e; }
.seat.is-actor::before {
  content: "TURNO";
  position: absolute; top: -12px; left: 50%; padding: 2px 8px; transform: translateX(-50%);
  color: #c8f5c8; background: #0b1a0b; border-radius: 3px; font-size: 9px; letter-spacing: 2px;
  text-shadow: none; animation: turnoBlink 1.2s ease-in-out infinite alternate;
}
@keyframes turnoBlink { from { opacity: .75; } to { opacity: 1; } }
.seat.folded { animation: foldTilt .5s ease-out forwards; }
@keyframes foldTilt { to { transform: translateY(8px) rotate(-3deg); opacity: .42; filter: grayscale(.5); } }
.pos-bottom.folded { animation-name: foldTiltBottom; }
@keyframes foldTiltBottom { to { transform: translateX(-50%) translateY(8px) rotate(-3deg); opacity: .42; filter: grayscale(.5); } }
.seat.folded-static { opacity: .42; filter: grayscale(.5); }
.seat.elim { opacity: .3; border-color: #5a2020; filter: grayscale(.6); }
.seat.winner { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255,210,74,.65), inset 0 0 22px rgba(255,210,74,.12); animation: winnerPulse 1s ease-in-out infinite alternate; }
@keyframes winnerPulse { to { box-shadow: 0 0 0 2px var(--gold), 0 0 38px rgba(255,210,74,.9), inset 0 0 24px rgba(255,210,74,.18); } }
.seat-head, .seat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.seat-name { overflow: hidden; color: var(--g); font-size: 13px; letter-spacing: 1px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 8px var(--g); }
.seat-sub { margin-top: 2px; color: var(--g-dim); font-size: 9px; }
.seat-type { color: var(--g-dim); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; }
.dealer { position: absolute; top: -12px; left: -12px; z-index: 7; width: 24px; height: 24px; display: grid; place-items: center; color: #111; background: radial-gradient(circle at 35% 30%, #fff, #ccc 70%, #999); border: 2px solid #111; border-radius: 50%; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.7); }
.pos-top-right .dealer { right: -12px; left: auto; }
.pos-bottom .dealer { top: auto; bottom: -12px; }
.seat-meta { display: flex; justify-content: space-between; margin-top: 3px; color: var(--g-dim); font-size: 9px; }
.seat-meta strong { color: var(--gold); font-weight: 700; }
.seat-mid { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hole { display: flex; gap: 4px; }
.seat-mid .pc { width: 52px; height: 73px; }
.seat-mid .pc .c-tl, .seat-mid .pc .c-br { width: 14px; font-size: 9px; }
.seat-mid .pc .pips { inset: 15px 7px; font-size: 14px; }
.seat-mid .pc.ace .pips { font-size: 31px; }
.seat-mid .pc .face-rank { font-size: 21px; }
.seat-mid .pc .face-suit { font-size: 16px; }
.seat-mid .hole .pc.deal { animation: dealIn .35s ease-out backwards; }
.seat-mid .hole .pc.deal:nth-child(2) { animation-delay: 100ms; }
@keyframes dealIn { from { transform: translate(-90px, -70px) rotate(-28deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.coin-stack { position: relative; width: 39px; height: 38px; margin-left: auto; }
.coin-stack i { position: absolute; left: 2px; width: 33px; height: 7px; border: 2px solid var(--g); border-radius: 50%; background: radial-gradient(circle at 40% 30%, var(--chip-green), var(--chip-green-deep)); box-shadow: 0 0 5px rgba(57,255,57,.35); }
.coin-stack i:nth-child(1) { bottom: 0; }
.coin-stack i:nth-child(2) { bottom: 2.4px; }
.coin-stack i:nth-child(3) { bottom: 4.8px; }
.coin-stack i:nth-child(4) { bottom: 7.2px; }
.coin-stack i:nth-child(5) { bottom: 9.6px; }
.coin-stack i:nth-child(6) { bottom: 12px; }
.coin-stack i:nth-child(7) { bottom: 14.4px; }
.coin-stack i:nth-child(8) { bottom: 16.8px; }
.coin-stack i:nth-child(9) { bottom: 19.2px; }
.coin-stack i:nth-child(10) { bottom: 21.6px; }
.coin-stack i:nth-child(11) { bottom: 24px; }
.coin-stack i:nth-child(12) { bottom: 26.4px; }
.stack-n { min-width: 56px; color: var(--g); font-size: 18px; text-align: right; text-shadow: 0 0 8px var(--g); }
.seat-bet { position: absolute; top: 100%; margin-top: 6px; color: var(--gold); font-size: 10px; text-transform: uppercase; text-shadow: 0 0 7px var(--gold); }
.pos-top-right .seat-bet { right: 0; }
.pos-bottom .seat-bet { left: 0; }
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.timer { position: relative; width: 42px; height: 42px; }
.timer svg { width: 42px; height: 42px; transform: rotate(-90deg); }
.timer .bg { fill: none; stroke: #0d3d0d; stroke-width: 3.5; }
.timer .fg { fill: none; stroke: var(--g); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.timer.urgent .fg { stroke: var(--red); }
.timer .n { position: absolute; inset: 0; display: grid; place-items: center; color: var(--g); font-size: 10px; text-shadow: 0 0 6px var(--g); }
.lives { display: flex; gap: 3px; }
.life { width: 7px; height: 7px; border: 1px solid rgba(236,241,243,.5); border-radius: 50%; }
.life.lost { background: var(--red); border-color: var(--red); box-shadow: 0 0 4px var(--red); }

/* Feedback animations shared with watch */
.bet-chips { position: absolute; z-index: 6; display: flex; flex-direction: column-reverse; align-items: center; pointer-events: none; animation: betPop .3s ease-out; }
@keyframes betPop { from { transform: scale(.4); opacity: 0; } to { opacity: 1; } }
.bet-chips .bc { width: 23px; height: 8px; margin-top: -4px; border: 2px solid var(--g); border-radius: 50%; background: radial-gradient(circle at 40% 30%, var(--chip-green), var(--chip-green-deep)); box-shadow: 0 0 6px rgba(57,255,57,.4); }
.bet-chips .bv { margin-bottom: 2px; color: var(--gold); font-size: 12px; text-shadow: 0 0 6px #000, 0 0 8px var(--gold); }
.pos-bottom .bet-chips { left: 50%; bottom: -52px; transform: translateX(-50%); }
.pos-top-left .bet-chips { right: -32px; top: -28px; }
.pos-top-right .bet-chips { left: -32px; top: -28px; }
.bubble { position: absolute; z-index: 9; padding: 5px 10px; color: var(--g); background: rgba(0,0,0,.92); border: 1px solid var(--g); border-radius: 8px; font-size: 11px; white-space: nowrap; box-shadow: 0 0 14px rgba(57,255,57,.45); animation: bubblePop .3s ease-out; }
@keyframes bubblePop { from { transform: scale(.5); opacity: 0; } to { opacity: 1; } }
.pos-top-left .bubble, .pos-top-right .bubble { bottom: -34px; left: 50%; transform: translateX(-50%); }
.pos-bottom .bubble { top: -34px; left: 50%; transform: translateX(-50%); }
.fly, .winburst { position: absolute; z-index: 15; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; }
.fly { border: 2px solid var(--g); background: radial-gradient(circle at 35% 30%, #2a8a2a, #041804); box-shadow: 0 0 8px var(--g); animation: flychip .6s ease-in forwards; }
.winburst { border: 2px solid var(--gold); background: radial-gradient(circle at 35% 30%, #ffe88a, #8a6a10); box-shadow: 0 0 10px var(--gold); animation: winburst .9s ease-out forwards; }
@keyframes flychip { to { transform: translate(var(--dx), var(--dy)) scale(.55); opacity: 0; } }
@keyframes winburst { to { transform: translate(var(--dx), var(--dy)) scale(.5); opacity: 0; } }

/* Actions are a continuation of the table, not a row of generic web buttons. */
.action-panel { position: relative; z-index: 10; width: min(100%, 720px); margin: -18px auto 0; padding: 12px 14px 14px; background: rgba(0,0,0,.96); border: 1px solid #1c7a1c; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.8), 0 0 20px rgba(57,255,57,.07); }
.action-heading, .amount-values { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-heading { margin-bottom: 8px; color: var(--g-dim); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.action-heading strong { color: var(--g); font-weight: 700; }
.action-clock { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
#timer { min-width: 32px; text-align: right; }
.amount-control { margin-bottom: 8px; padding: 7px 10px 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.amount-values { color: var(--g-dim); font-size: 9px; }
.amount-values output { color: var(--gold); font-size: 14px; text-shadow: 0 0 8px var(--gold); }
input[type="range"] { display: block; width: 100%; height: 24px; accent-color: var(--g); }
.action-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.action-buttons button { min-height: 50px; border-color: #145214; color: var(--g-dim); font-size: 11px; text-shadow: none; }
.action-buttons button.primary-action { color: var(--g); background: linear-gradient(180deg, #0d4d0d, #062806); border-color: var(--g); text-shadow: 0 0 6px var(--g); box-shadow: 0 0 10px rgba(57,255,57,.18); }
.action-buttons button.danger { color: var(--red); border-color: var(--red); }

.history-panel { width: min(100%, 720px); margin: 8px auto 0; color: var(--g-dim); border-top: 1px solid var(--line); font-size: 10px; }
.history-panel summary { padding: 8px 3px; cursor: pointer; letter-spacing: 1px; text-transform: uppercase; }
.history-panel summary::before { content: "+ "; color: var(--g); }
.history-panel[open] summary::before { content: "- "; }
#action-log { max-height: 130px; overflow: auto; padding: 0 3px 8px; line-height: 1.6; }
.log-line { padding: 3px 0; border-bottom: 1px solid #061406; }
.log-line strong { color: var(--g); }

.result-panel { width: min(100%, 640px); margin: auto; padding: 36px 22px; text-align: center; }
.result-panel h2 { margin: 0 0 24px; color: var(--gold); font-size: clamp(24px, 5vw, 42px); text-shadow: 0 0 14px var(--gold); }
#result-list { border-top: 1px solid var(--line); }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 3px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
.result-row small { color: var(--g-dim); font-size: 9px; }
.result-row > strong { color: var(--gold); font-size: 14px; text-shadow: 0 0 7px var(--gold); }
.result-panel .primary { margin-top: 22px; }

@media (max-width: 900px) {
  .table-stage { height: clamp(400px, calc(100dvh - 220px), 620px); min-height: 400px; }
  .seat { width: clamp(190px, 28vw, 270px); }
  .pos-bottom { width: min(42vw, 340px); }
}
@media (min-width: 701px) and (max-height: 700px) {
  .table-stage { height: 350px; min-height: 350px; }
  .action-panel { padding-top: 8px; padding-bottom: 9px; }
  .action-buttons button { min-height: 44px; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 8px; gap: 7px; font-size: 10px; }
  .human-brand-mark { font-size: 16px; }
  .human-brand span:last-child { display: none; }
  .product-label { display: none; }
  .top-status { font-size: 9px; }
  .exit { padding: 5px 6px; font-size: 9px; }
  .exit-label { display: none; }
  .lobby-panel { min-height: calc(100dvh - 146px); padding: 28px 12px 30px; gap: 22px; }
  h1 { font-size: clamp(31px, 10vw, 52px); }
  .lead { font-size: 12px; }
  .identity-form { grid-template-columns: 1fr; padding: 18px 14px 12px; }
  .identity-form label { font-size: 12px; }
  .identity-form .primary { width: 100%; }
  .panel-bar { padding: 0 12px; font-size: 8px; }
  .identity-status { max-width: 48%; }
  .identity-summary { gap: 5px; }
  .identity-summary strong { max-width: 28vw; font-size: 10px; }
  .identity-summary span { font-size: 8px; }
  .identity-edit { padding: 4px 5px; font-size: 7px; }
  .opponent-select { grid-template-columns: 1fr; padding: 0 14px 12px; }
  .opponent-select button { min-height: 40px; }
  .wait-row { padding: 0 14px 12px; }
  .identity-steps .step { min-height: 48px; padding: 9px 12px; }
  .identity-steps .step b { display: inline-block; margin: 0 7px 0 0; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 10px; padding: 16px 12px 22px; }
  .footer-brand { flex-direction: column; gap: 3px; }
  .site-footer nav { gap: 12px; }
  .table-shell { padding: 0 0 8px; }
  .table-meta { gap: 8px; padding: 5px 8px; border-right: 0; border-left: 0; }
  .table-meta > div:nth-child(2) { display: none; }
  .table-meta strong { max-width: 38vw; font-size: 9px; }
  .connection-pill { font-size: 8px; }
  .table-stage { height: clamp(330px, calc(100dvh - 370px), 500px); min-height: 330px; }
  .felt { width: 92%; height: 74%; top: 48%; }
  .rail { inset: 3%; }
  .board { top: 48%; width: 94%; }
  .board .pc { width: clamp(42px, 13vw, 58px); height: clamp(59px, 17.5vw, 81px); }
  .board .pc .c-tl, .board .pc .c-br { width: 13px; font-size: 9px; }
  .board .pc .pips { inset: 16px 6px; font-size: 14px; }
  .board .pc.ace .pips { font-size: 28px; }
  .board .pc .face-rank { font-size: 20px; }
  .board .pc .face-suit { font-size: 15px; }
  .bote { margin-top: 7px; font-size: 19px; }
  .pile { transform: scale(.8); transform-origin: top center; margin-bottom: -8px; }
  .mesa { font-size: 9px; }
  .street { font-size: 8px; }
  .seat { width: 43%; min-height: 92px; padding: 7px 8px; border-width: 1px; }
  .pos-top-left, .pos-top-right { top: 4%; }
  .pos-top-left { left: 2%; }
  .pos-top-right { right: 2%; }
  .pos-bottom { bottom: 3%; width: 78%; }
  .seat-name { font-size: 10px; }
  .seat-sub, .seat-type, .seat-meta { font-size: 7px; }
  .seat-mid { gap: 4px; margin-top: 5px; }
  .seat-mid .pc { width: 36px; height: 50px; }
  .seat-mid .pc .c-tl, .seat-mid .pc .c-br { width: 11px; font-size: 7px; }
  .seat-mid .pc .pips { inset: 11px 4px; font-size: 10px; }
  .seat-mid .pc.ace .pips { font-size: 20px; }
  .seat-mid .pc .face-rank { font-size: 15px; }
  .seat-mid .pc .face-suit { font-size: 11px; }
  .coin-stack { width: 26px; height: 27px; }
  .coin-stack i { width: 23px; height: 5px; border-width: 1px; }
  .stack-n { min-width: 33px; font-size: 11px; }
  .timer { width: 29px; height: 29px; }
  .timer svg { width: 29px; height: 29px; }
  .timer .n { font-size: 8px; }
  .timer .bg, .timer .fg { stroke-width: 3; }
  .lives { gap: 2px; }
  .life { width: 5px; height: 5px; }
  .action-panel { width: 100%; margin-top: -7px; padding: 9px 10px 10px; border-right: 0; border-left: 0; border-radius: 0; }
  .action-buttons { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .action-buttons button { min-height: 46px; padding: 7px 4px; font-size: 10px; }
  .history-panel { width: 100%; padding: 0 10px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .table-stage { height: calc(100dvh - 190px); min-height: 300px; }
  .table-meta { min-height: 34px; }
  .table-meta > div:nth-child(2) { display: none; }
  .table-stage .seat { min-height: 76px; }
  .table-stage .seat-mid .pc { width: 30px; height: 42px; }
  .table-stage .seat-mid .pc .pips { inset: 9px 3px; font-size: 8px; }
  .table-stage .seat-mid .pc.ace .pips { font-size: 16px; }
  .table-stage .seat-mid .pc .face-rank { font-size: 12px; }
  .table-stage .seat-mid .pc .face-suit { font-size: 9px; }
  .board .pc { width: 38px; height: 53px; }
  .board .pc .pips { inset: 13px 5px; font-size: 10px; }
  .board .pc.ace .pips { font-size: 22px; }
  .board .pc .face-rank { font-size: 15px; }
  .board .pc .face-suit { font-size: 11px; }
  .bote { margin-top: 4px; font-size: 16px; }
  .pile { display: none; }
  .action-panel { padding: 6px 10px; }
  .action-buttons button { min-height: 38px; }
  .history-panel { margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Private invitation reuses the lobby card and never flashes matchmaking UI. */
.private-invite { padding: 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.private-invite h2 { margin: 4px 0 8px; font-size: clamp(1.5rem, 4vw, 2.4rem); }
.private-invite p { max-width: 62ch; }
.private-room-status { margin: 18px 0; padding: 12px 14px; border-left: 3px solid #e8b84a; background: rgba(232,184,74,.08); }
.private-invite .primary, .private-invite .secondary { margin-top: 12px; }
