:root {
  color-scheme: dark;
  font: 16px/1.45 Inter, system-ui, sans-serif;
  color: #eef4ed;
  background: #101719;
  --surface: #192325;
  --line: #334244;
  --muted: #adc0ba;
  --gold: #f0c985;
  --mint: #a9edc9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 30%, #1d2b2c, #101719 72%); }
main { max-width: 1050px; margin: auto; padding: 18px clamp(12px, 4vw, 40px) 32px; }
.masthead { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font-size: 1.24rem; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 30px; aspect-ratio: 1; background: var(--gold); color: #212a27; border-radius: 7px; }
.model { font-size: .88rem; color: var(--muted); }
.top-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .55rem; }
.top-tools button { min-height: 34px; font-size: .9rem; }
.setup { max-width: 570px; margin: clamp(32px, 8vh, 85px) auto; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
h1 { margin: 0 0 24px; font-size: 1.75rem; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 24px; }
.join { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.join label { flex: 1 1 190px; }
.network-lobby { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.network-lobby p { color: var(--muted); font-size: .9rem; }
.room-list { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
#club-tables { display: grid; gap: 8px; margin-top: 12px; }
.club-table { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
#club-profile label { flex: 1 1 170px; }
.lobby-results { margin-top: 18px; }
.results-scroll { overflow-x: auto; }
.cash-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cash-table :is(th, td) { padding: 8px 5px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cash-table :is(th, td):first-child { text-align: left; }
.cash-table thead th { color: var(--muted); font-weight: 500; }
.cash-profit { color: var(--mint); }
.cash-loss { color: #ffb6ad; }
#manual-room { margin-top: 16px; }
.share-panel { margin-top: 12px; }
.invite-line { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 8px 0; }
.invite-line label { flex: 1 1 220px; }
.decision-clock { font-size: .88rem; color: var(--muted); }
label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
input, select, button { font: inherit; }
input:not([type=range]), select { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid #536565; border-radius: 8px; background: #121b1e; color: #f0f3ef; }
button, .primary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #293737; color: #f6f7f0; font-weight: 650; cursor: pointer; text-decoration: none; }
button:hover:enabled { border-color: var(--mint); background: #354b46; }
button:disabled { opacity: .43; cursor: default; }
.primary, .primary:hover:enabled { background: var(--mint); color: #14281e; border-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.table-info { display: flex; justify-content: space-between; gap: 10px; align-items: start; padding: 14px 0 0; }
.table-info div { display: grid; min-width: 0; }
.table-info div:nth-child(2) { text-align: center; }
.table-info div:last-child { text-align: right; }
.table-info strong { font-variant-numeric: tabular-nums; }
.table-info span { font-size: .82rem; color: var(--muted); }
.arena { min-height: 390px; position: relative; isolation: isolate; margin: 12px 0; }
.felt { position: absolute; z-index: -1; inset: 56px 5% 22px; border: 9px solid #4d594c; border-radius: 49% / 46%; background: radial-gradient(ellipse at 50% 34%, #2d694e, #163c32 78%); box-shadow: inset 0 0 0 3px #8f917069, inset 0 0 46px #0e2e25, 0 8px 0 #252e2b, 0 16px 32px #0006; }
.felt::before { content: ''; position: absolute; inset: 14px; border: 1px solid #bdc3a645; border-radius: inherit; }
.seat { position: absolute; max-width: 33%; text-align: center; width: 156px; display: grid; justify-items: center; gap: 4px; }
.seat.left { top: 8px; left: 10%; }
.seat.right { top: 8px; right: 10%; }
.seat.you { bottom: 0; left: 50%; transform: translateX(-50%); }
.seat.dim { opacity: .55; }
.seat-info { width: 100%; border: 1px solid #556866; border-radius: 11px; background: #182528; padding: 6px 8px; text-overflow: ellipsis; box-shadow: 0 4px 10px #0005; }
.seat.active .seat-info { border-color: var(--gold); box-shadow: 0 0 0 2px #f0c98538; }
.seat strong, .seat-meta { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seat-meta { font-size: .8rem; color: var(--muted); }
.seat .dealer { display: inline-grid; place-items: center; background: var(--gold); width: 1.2rem; height: 1.2rem; color: #342b1d; border-radius: 50%; font-weight: 800; margin-right: 4px; }
.contribution { color: #ffe2aa; font-size: .83rem; font-variant-numeric: tabular-nums; }
.center { position: absolute; top: 45%; left: 50%; width: 88%; text-align: center; transform: translate(-50%, -36%); }
.tournament-start { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 82%; padding: 12px 20px; border: 1px solid #e8c98480; border-radius: 12px; background: #182b26; color: #ffe2aa; font-size: clamp(1rem, 3vw, 1.35rem); font-weight: 750; text-align: center; pointer-events: none; }
.street { font-weight: 700; color: #dae9de; margin-bottom: 7px; }
.cards { display: flex; justify-content: center; gap: 5px; }
.card { display: inline-flex; flex-direction: column; align-items: start; justify-content: center; width: clamp(35px, 7vw, 51px); height: clamp(48px, 9.5vw, 69px); padding: 3px 6px; border-radius: 6px; background: #f5f0e2; color: #182528; font-size: 1.25rem; font-weight: 800; line-height: .96; box-shadow: 0 2px 6px #0006; }
.card.red { color: #a82738; }
.card.back { background: repeating-linear-gradient(45deg, #274457 0 4px, #35596e 4px 7px); border: 2px solid #d5d9c8; }
.card.empty { background: #132d2540; border: 1px solid #b1c2a75a; box-shadow: none; }
.seat .cards { min-width: 69px; justify-content: flex-start; }
.seat .card { width: 32px; height: 42px; font-size: .98rem; }
.pot { color: #fff0c8; font-weight: 700; margin-top: 10px; }
.hand-result { margin: 3px 0; min-height: 1.3em; font-size: .87rem; }
.decision, .panel { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.turn { min-height: 23px; color: var(--gold); font-weight: 700; }
.action-row, .quick-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.action-row button { flex: 1; }
.action-row .fold { background: #4a2d32; }
.wager-inputs { display: grid; grid-template-columns: 1fr minmax(90px, 128px); gap: 12px; margin: 9px 0; align-items: end; }
input[type=range] { width: 100%; min-height: 32px; accent-color: var(--mint); margin: 0; }
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
h2 { font-size: 1rem; margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: 1fr auto; margin: 0 0 7px; gap: 3px 8px; }
.stats dt, .history, details { font-size: .88rem; color: var(--muted); }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.history { padding-left: 1rem; margin: 0 0 6px; max-height: 112px; overflow-y: auto; }
summary { cursor: pointer; }
code { overflow-wrap: anywhere; }
#notice { color: #ffb6ad; margin: 10px 0 0; }
@media (max-width: 540px) {
  .arena { min-height: 340px; }
  .felt { inset: 63px 0 19px; border-width: 6px; }
  .seat.left { left: 3%; }
  .seat.right { right: 3%; }
  .center { top: 47%; }
  .support { grid-template-columns: 1fr; }
  .action-row button { flex-basis: 44%; }
}
