/* Plus44 poker presentation. Gameplay and amounts always come from server snapshots. */
:root {
  --p-bg: #101b19;
  --p-surface: #1b2a27;
  --p-surface-raised: #22352f;
  --p-line: #385249;
  --p-text: #edf5ee;
  --p-muted: #adc2b4;
  --p-gold: #e5c778;
  --p-green: #19795b;
  color: var(--p-text);
  background: var(--p-bg);
}
body { background: var(--p-bg); color: var(--p-text); }
.topbar { position: relative; z-index: 8; background: #14241e; border-bottom: 1px solid #365247; box-shadow: 0 8px 24px #0002; }
.brand { letter-spacing: -.035em; font-size: 21px; }
.brand em { color: var(--p-gold); }
.brand-mark { background: #263e32; color: var(--p-gold); border: 1px solid #6f8a64; }
.topbar nav a.active { border-bottom-color: var(--p-gold); }
.userbar { color: #dcebdc; }
main { max-width: 1680px; }
.intro { background: linear-gradient(120deg, #174536, #102922); border: 1px solid #456b56; box-shadow: inset 0 1px #ffffff18; }
.intro small, .section-head small { color: #a9cabb; }
.section-head h2 { color: var(--p-text); }
.section-head p { color: var(--p-muted); }
.section-head #back-to-lobby { display: block; margin-bottom: 10px; }
body:has(#table-view:not([hidden])) .intro { display: none; }
.quiet, .back { color: var(--p-text); background: var(--p-surface); border-color: var(--p-line); }
.back { background: transparent; }
.quiet:hover, .back:hover { border-color: var(--p-gold); }
.filters, .join-code-form, .auth-panel, .admin-form, .table-side section, .hand-detail {
  color: var(--p-text); background: var(--p-surface); border: 1px solid var(--p-line);
  box-shadow: 0 10px 26px #0002;
}
.filters label, .auth-panel label, .join-panel label, .admin-form label { color: var(--p-muted); }
.filters input, .filters select, .auth-panel input, .join-panel input, .join-panel select,
.admin-form input, .admin-form select, .raise-input {
  background: #12211d; color: var(--p-text); border: 1px solid #587367;
  border-radius: 9px; min-height: 44px;
}
.auth-panel p, .join-panel p, .fx-note { color: var(--p-muted); }
.table-list { gap: 11px; }
.table-card, .admin-row, .hand-row {
  background: var(--p-surface); border: 1px solid var(--p-line);
  color: var(--p-text); box-shadow: 0 8px 22px #0002;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.table-card:hover, .hand-row:hover { transform: translateY(-2px); border-color: #849e79; box-shadow: 0 12px 27px #0004; }
.hand-row span, .hand-row time, .hand-detail p { color: var(--p-muted); }
.hand-summary { background: #263e32; border: 1px solid #668271; }
.hand-summary span span { background: #fbf9ef; color: #1d2a24; }
.hand-summary strong { color: #f4dfa9; font-variant-numeric: tabular-nums; }
.hand-detail li { border-bottom-color: var(--p-line); color: #e0ecdf; }
.table-name { color: #fff; }
.table-name small, .metric small { color: var(--p-muted); }
.badge { background: #244b3b; color: #b6e9c7; }
.badge.paused { background: #473d2c; color: #eed7a9; }
.table-card button, .auth-panel form button, .join-panel button, .admin-form button,
.action-panel button.primary { background: var(--p-gold); color: #15241e; min-height: 44px; }
.table-card button:focus-visible, .action-panel button:focus-visible { outline-color: #fff; }
.connection { color: #f0d29f; background: #493b28; border: 1px solid #806841; }
.connection.online { color: #bcecc8; background: #214b36; border-color: #4b8a65; }

.game-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 328px); gap: 18px; }
.felt-wrap {
  overflow: visible; isolation: isolate; min-height: 600px;
  padding: clamp(38px, 5vw, 72px) clamp(36px, 5vw, 75px);
  background: radial-gradient(ellipse at 50% 18%, #253c34, #101b19 76%);
  border: 1px solid #334e41; border-radius: 20px;
}
.felt {
  width: min(100%, 1000px); aspect-ratio: 1.72; border: clamp(12px, 1.5vw, 19px) solid #272c28;
  border-radius: 50%; isolation: isolate;
  background:
    radial-gradient(circle at 49% 38%, #217a5c 0%, #13573f 58%, #0b3c2d 100%),
    repeating-linear-gradient(25deg, #ffffff05 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 0 3px #a68e5f, inset 0 0 0 8px #0b3127,
    inset 0 22px 75px #00180b9c, 0 0 0 5px #484438, 0 25px 50px #0009;
}
.felt::after { content: none; }
.felt-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 0; pointer-events: none; user-select: none;
  color: #e5f0da; opacity: .25; font: 900 clamp(32px, 6vw, 80px)/1 Arial, sans-serif;
  letter-spacing: -.075em; white-space: nowrap; text-shadow: 0 1px #fff5, 0 -2px #001b10;
}
.felt-logo span { color: #f3dcaa; }
.seats { z-index: 3; pointer-events: none; }
.seat {
  width: clamp(100px, 11vw, 142px); min-height: 91px; padding: 8px 9px;
  border-radius: 14px; border: 1px solid #668776;
  background: linear-gradient(165deg, #243d33f5, #12251ff7);
  color: #f7faf6; box-shadow: 0 9px 19px #00160d9c, inset 0 1px #ffffff25;
  transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.seat.active { border: 2px solid var(--p-gold); box-shadow: 0 0 0 3px #e5c77844, 0 9px 19px #00160d9c; }
.seat.folded { opacity: .55; }
.seat.winner { border-color: #f4db91; box-shadow: 0 0 0 4px #e5c77855, 0 9px 19px #00160d9c; }
.seat.empty { background: #0b432fb5; border: 1px dashed #8dac91; color: #c7dfce; box-shadow: none; }
.seat .avatar {
  width: 30px; height: 30px; margin-bottom: 4px;
  color: #203024; background: linear-gradient(145deg, #f5dda0, #c19e52);
  border: 1px solid #fff7bf; font-size: 12px;
}
.seat .name { font-size: 12px; }
.seat .stack { color: #eed893; font-size: 12px; font-variant-numeric: tabular-nums; }
.seat .cards { min-height: 20px; }
.seat .cards span { display: inline-grid; place-items: center; width: 25px; height: 34px; padding: 0; border: 1px solid #d7d8d0; border-radius: 4px; font-size: 14px; font-weight: 800; box-shadow: 0 2px 4px #001b1540; }
.seat .cards .back-card { background: #d8c482; color: #204d37; border-color: #f5e6a9; }
.seat .dealer { z-index: 2; right: -12px; top: -13px; width: 25px; height: 25px; background: #f7f4e7; border: 2px solid #bba57b; }
.seat .blind-tag, .seat .action-tag {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 10px; font-weight: 800; letter-spacing: .02em; border-radius: 999px;
  padding: 2px 7px; background: #213b31; border: 1px solid #8ea584;
}
.seat .blind-tag { top: -11px; }
.seat .action-tag { bottom: -12px; color: #f9e8af; background: #334027; }
.seat .turn-ring {
  position: absolute; inset: -5px; border-radius: 17px; pointer-events: none;
  border: 2px solid transparent;
}
.seat.active .turn-ring { border-color: #e5c77866; }
.seat.active .turn-ring::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 3px;
  width: calc(100% * var(--turn-progress, 1)); border-radius: 5px; background: var(--p-gold);
  transition: width .25s linear;
}
.center { z-index: 4; left: 0; top: 0; transform: none; width: 100%; height: 100%; }
.board { position: absolute; left: 50%; top: 31%; transform: translate(-50%,-50%); gap: clamp(3px, .6vw, 7px); min-height: 68px; align-items: center; }
.card {
  width: clamp(34px, 4vw, 48px); height: clamp(48px, 5.6vw, 66px);
  border-radius: 6px; background: #fffdf5; border: 1px solid #dfdccc;
  color: #17251d; box-shadow: 0 2px 5px #001b1540, inset 0 0 0 2px #fff;
  font-size: clamp(16px, 1.6vw, 22px); font-variant-numeric: tabular-nums;
}
.card.red { color: #ae2f39; }
.card.dealt { animation: board-deal .38s cubic-bezier(.2,.7,.2,1) both; }
.card.dealt:nth-child(2) { animation-delay: 65ms; } .card.dealt:nth-child(3) { animation-delay: 130ms; }
.card.dealt:nth-child(4) { animation-delay: 65ms; } .card.dealt:nth-child(5) { animation-delay: 65ms; }
.seat .cards .dealt { animation: hole-deal .35s cubic-bezier(.2,.7,.2,1) both; }
.seat .cards .dealt:nth-child(2) { animation-delay: 90ms; }
.seat .cards .revealed { animation: card-reveal .3s ease-out both; }
.seat .cards .revealed:nth-child(2) { animation-delay: 110ms; }
.pot-line { position: absolute; left: 50%; top: 64%; transform: translate(-50%,-50%); display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.chip-stack {
  width: 23px; height: 18px; border-radius: 50%;
  background: repeating-linear-gradient(90deg, #f6dd9b 0 4px, #8c5532 4px 7px, #f6dd9b 7px 11px);
  border: 2px solid #efddaa; box-shadow: 0 4px #9b633c, 0 7px #e5be79, 0 9px #4c3b2c;
}
.pot { margin-top: 0; background: #092d23e0; border: 1px solid #7b9975; color: #f5dda2; font-variant-numeric: tabular-nums; }
.side-pots { position: absolute; left: 50%; top: 72%; transform: translateX(-50%); width: 65%; color: #e7deae; font-size: 10px; line-height: 1.35; }
.street { position: absolute; left: 50%; top: 77%; transform: translateX(-50%); width: 70%; color: #e4efe2; text-shadow: 0 1px #0a2a20; }
.hand-result {
  position: absolute; left: 50%; top: 85%; transform: translateX(-50%); width: max-content; max-width: 75%;
  background: #112e25ed; color: #ffe9b2; border: 1px solid #e2c375;
  padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 800;
}
.table-effects { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; border-radius: 50%; }
.flying-chip {
  position: absolute; width: 19px; height: 19px; border-radius: 50%;
  border: 3px dashed #f3e3aa; background: #7b4330; box-shadow: 0 3px 7px #0007;
  transform: translate(-50%, -50%); animation: chip-flight .48s cubic-bezier(.2,.7,.3,1) forwards;
}
.flying-chip.payout { background: #d0a450; border-color: #fff1c4; }
.table-side section { border-radius: 13px; }
.table-side h3 { color: #f7f5e6; }
.action-panel #turn-status { color: #c6d9cb; }
.action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-panel button { color: #eaf2e8; background: #284238; border-color: #638474; min-height: 44px; }
.action-panel button:hover:not(:disabled) { background: #355746; }
.action-panel button:disabled { opacity: .5; }
.raise-controls { margin: 14px 0; }
.raise-controls input[type=range] { accent-color: var(--p-gold); }
.raise-hint { color: var(--p-muted); font-size: 11px; margin: 0; }
.size-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.size-presets button { font-size: 11px; padding: 5px 2px; min-height: 33px; }
.history-panel li { color: #c7d9cc; border-bottom-color: var(--p-line); }
.notice { background: #263e32; border: 1px solid #9bb88b; }
footer { background: #162720; color: #a7bfb0; border-top: 1px solid #33483c; }

/* Seat coordinates are percentages of the oval and stay fixed through a hand. */
.seat-2-0, .seat-6-0, .seat-9-0 { --x: 50%; --y: 94%; }
.seat-2-1, .seat-6-3, .seat-9-5 { --x: 50%; --y: 6%; }
.seat-6-1 { --x: 13%; --y: 79%; } .seat-6-2 { --x: 13%; --y: 21%; }
.seat-6-4 { --x: 87%; --y: 21%; } .seat-6-5 { --x: 87%; --y: 79%; }
.seat-9-1 { --x: 22%; --y: 91%; } .seat-9-2 { --x: 8%; --y: 64%; }
.seat-9-3 { --x: 8%; --y: 35%; } .seat-9-4 { --x: 29%; --y: 6%; }
.seat-9-5 { --x: 71%; --y: 6%; } .seat-9-6 { --x: 92%; --y: 35%; }
.seat-9-7 { --x: 92%; --y: 64%; } .seat-9-8 { --x: 78%; --y: 91%; }

@keyframes board-deal {
  from { opacity: .3; transform: translateY(-46px) scale(.78) rotate(-7deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes hole-deal {
  from { opacity: .2; transform: translateY(-23px) scale(.75) rotate(-10deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes chip-flight {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: .15; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.72); }
}
@keyframes card-reveal {
  from { opacity: .45; transform: scaleX(.15); }
  to { opacity: 1; transform: scaleX(1); }
}

@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .table-side { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .history-panel { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; gap: 2px 12px; padding: 4px 12px; }
  .brand { font-size: 17px; }
  .topbar nav { order: 3; width: 100%; height: 36px; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; }
  .userbar { max-width: 48%; justify-content: flex-end; }
  #wallet { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .felt-wrap { min-height: 0; padding: 36px 8px; border-radius: 12px; overflow: hidden; }
  .felt { width: 100%; aspect-ratio: 1.11; border-width: 8px; }
  .felt-logo { font-size: 34px; opacity: .22; }
  .seat { width: clamp(64px, 21vw, 82px); min-height: 62px; padding: 3px 4px; border-radius: 9px; }
  .seat[class*="seat-9-"] { width: clamp(60px, 19vw, 76px); }
  .seat .avatar { display: none; }
  .seat .name, .seat .stack { font-size: 9px; }
  .seat .cards { min-height: 14px; }
  .seat .cards span { width: 17px; height: 22px; padding: 0; font-size: 10px; }
  .seat .dealer { width: 17px; height: 17px; right: -6px; top: -8px; font-size: 8px; }
  .seat .blind-tag, .seat .action-tag { font-size: 8px; padding: 1px 3px; }
  .seat .blind-tag { top: -8px; } .seat .action-tag { bottom: -8px; }
  .seat-9-2, .seat-9-3 { --x: 12%; } .seat-9-6, .seat-9-7 { --x: 88%; }
  .seat-6-1, .seat-6-2 { --x: 14%; } .seat-6-4, .seat-6-5 { --x: 86%; }
  .center { top: 0; width: 100%; }
  .board { min-height: 42px; gap: 3px; }
  .card { width: clamp(25px, 7vw, 31px); height: clamp(36px, 10vw, 43px); font-size: 12px; }
  .pot-line { gap: 5px; }
  .chip-stack { width: 15px; height: 12px; }
  .pot { padding: 3px 6px; font-size: 9px; }
  .street { font-size: 8px; letter-spacing: .08em; }
  .hand-result { font-size: 9px; padding: 3px 5px; }
  .table-side { grid-template-columns: 1fr; }
  .filters { gap: 8px; }
  .table-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-card .metric { min-width: 0; }
  .table-card .metric:nth-of-type(4), .table-card .metric:nth-of-type(5) { display: block; }
}
@media (max-width: 390px) {
  .felt { aspect-ratio: 1.04; }
  .seat-9-1 { --x: 24%; } .seat-9-4 { --x: 30%; }
  .seat-9-5 { --x: 70%; } .seat-9-8 { --x: 76%; }
  .table-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
