:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #f2efe5;
  background: #141915;
  --canvas: #141915;
  --panel: #1b211c;
  --line: #313a30;
  --muted: #a2aea0;
  --gold: #dfb981;
  --green: #84c0a0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 48% -25%, #273327 0, transparent 65%), var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .53; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.topbar { border-bottom: 1px solid #323b31; background: #161c17e8; }
.top-inner { min-height: 72px; max-width: 1376px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; gap: 11px; align-items: center; font-weight: 800; font-size: 21px; line-height: 1; letter-spacing: -.04em; }
.wordmark > span > span { color: var(--gold); }
.wordmark small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .16em; }
.top-actions, .network { display: flex; align-items: center; gap: 12px; }
.network { gap: 7px; color: #b8cfbe; font-size: 12px; white-space: nowrap; }
.network i, .table-heading i, .table-meta i, .eyebrow i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #86c19e; display: inline-block; box-shadow: 0 0 9px #86c19e56; }
.network.offline i { background: #e3aa76; }
.quiet { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #222a22; color: #e8ebe1; padding: 0 11px; }
.quiet:hover { background: #303b31; }
.rules-button { font-size: 12px; }
.rules-button span { color: var(--gold); margin-right: 3px; }
main { max-width: 1376px; margin: 0 auto; padding: 32px 48px 0; }
.intro { margin-bottom: 26px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 10px; letter-spacing: .25em; font-weight: 750; }
.eyebrow i { width: 5px; height: 5px; flex-basis: 5px; background: var(--gold); }
h1 { font-size: clamp(30px, 4.7vw, 47px); letter-spacing: -.055em; line-height: 1.15; margin: 9px 0 8px; }
.intro p, .side-panel > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.table-meta { display: flex; gap: 8px; }
.table-meta span { display: flex; align-items: center; gap: 6px; padding: 7px 11px; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; background: #222b23; color: #bbc8b9; font-size: 11px; }
.table-meta strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.table-meta i { width: 5px; height: 5px; flex-basis: 5px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; align-items: start; gap: 17px; }
.table-panel, .side-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.table-panel { overflow: hidden; min-width: 0; }
.table-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 21px; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; gap: 8px; }
.table-heading > span:first-child { display: flex; align-items: center; gap: 8px; color: #e0e6da; font-weight: 650; }
.table-stage { isolation: isolate; position: relative; min-height: 396px; height: clamp(400px, 46vw, 520px); background: radial-gradient(ellipse at center, #2a3b2f, #1c241d 65%, #1a201b); }
.felt { position: absolute; inset: 17% 8% 19%; border: clamp(8px, 1.3vw, 16px) solid #252b23; border-radius: 45% / 50%; box-shadow: 0 13px 24px #0b100ebf, 0 0 0 2px #4d4735, inset 0 0 32px #08251b; background: radial-gradient(ellipse, #235340, #173b2e); }
.felt::before { position: absolute; inset: 0; border-radius: inherit; content: ''; background-image: radial-gradient(#d7efd5 0.5px, transparent 0.75px); background-size: 5px 5px; opacity: .13; }
.felt-rail { position: absolute; inset: 9% 5%; border: 1px solid #adba8a40; border-radius: inherit; }
.board-area { position: absolute; z-index: 1; top: 49%; left: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 12px; width: max-content; max-width: 63%; }
.pot { display: flex; align-items: center; gap: 6px; min-height: 27px; padding: 2px 11px; border: 1px solid #63816b70; border-radius: 99px; background: #102b22bb; color: #e1e8d9; font-size: 11px; white-space: nowrap; }
.pot > span, .pot strong { color: var(--gold); }
.pot strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.board { display: flex; gap: clamp(4px, .7vw, 8px); }
.card { width: clamp(33px, 4.2vw, 52px); aspect-ratio: 5 / 7; display: grid; place-content: center; gap: 1px; text-align: center; color: #26342c; background: #f6f0dc; border: 1px solid #e2d8bf; border-radius: 7px; font: 800 clamp(15px, 2vw, 24px)/1 Georgia, serif; box-shadow: 0 3px 7px #071a1490; }
.card.red { color: #aa382e; }
.card span { font-size: .88em; }
.card-slot { color: #a4cbb343; border: 1px solid #a6c2a575; background: #152f2670; box-shadow: none; }
.card-back { color: #e1c595; border-color: #c6a873; background: repeating-linear-gradient(135deg, #285244, #285244 3px, #346451 3px, #346451 5px); }
.table-message { min-height: 23px; max-height: 57px; overflow: auto; text-align: center; color: #bcd3c3; font-size: 12px; font-weight: 650; }
.table-message.your-turn { color: #f9d69b; }
.turn-timer { display: inline-block; margin-left: 7px; font-variant-numeric: tabular-nums; }
.turn-timer.urgent { color: #ffc098; }
.seats { position: absolute; inset: 0; pointer-events: none; }
.seat { position: absolute; width: min(143px, 25%); transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; z-index: 2; }
.seat-0 { left: 50%; top: 85%; }
.seat-1 { left: 17%; top: 70%; }
.seat-2 { left: 17%; top: 29%; }
.seat-3 { left: 50%; top: 15%; }
.seat-4 { left: 83%; top: 29%; }
.seat-5 { left: 83%; top: 70%; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; position: relative; border-radius: 50%; background: #77603c; color: #fff6d9; font-size: 15px; font-weight: 750; }
.avatar-1 { background: #3a6958; }
.avatar-2 { background: #68435b; }
.avatar-3 { background: #46637d; }
.avatar-4 { background: #795144; }
.avatar-5 { background: #625777; }
.empty-seat .avatar { width: 42px; height: 42px; border: 1px dashed #718271; background: #202e25eb; color: #b1c0ad; font-weight: 450; font-size: 23px; }
.empty-name { color: #b3c1b1; font-size: 10px; background: #1d2b23; padding: 1px 5px; border-radius: 4px; }
.seat-identity { display: flex; align-items: center; gap: 7px; min-width: 0; width: 100%; border-radius: 11px; border: 1px solid #617361; padding: 5px; background: #1b2820; box-shadow: 0 4px 10px #111a16a6; }
.seat.me .seat-identity { border-color: #9a835b; }
.seat.acting .seat-identity { border-color: #ebc689; box-shadow: 0 0 0 2px #dcb67c39, 0 4px 10px #111a16a6; }
.seat.folded .seat-identity, .seat.folded .hole-cards { opacity: .69; }
.seat-role { position: absolute; bottom: -4px; right: -3px; padding: 1px 3px; background: #ecd6aa; border-radius: 4px; font-size: 8px; color: #322719; white-space: nowrap; }
.seat-details { min-width: 0; flex: 1; }
.seat-title { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.seat-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { color: var(--gold); flex-shrink: 0; font-size: 9px; }
.stack { color: #c1ccbd; font-size: 11px; font-variant-numeric: tabular-nums; }
.hole-cards { display: flex; gap: 3px; }
.hole-cards .card { width: 25px; font-size: 13px; border-radius: 4px; }
.seat-bet { padding: 1px 6px; border-radius: 9px; color: #f4d69d; background: #1a2d22; border: 1px solid #68755b; font-size: 10px; white-space: nowrap; }
.action-area { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 72px; padding: 12px 17px; border-top: 1px solid var(--line); background: #1a211b; }
.action-caption { color: var(--muted); font-size: 12px; }
.action-row { display: flex; flex-wrap: wrap; gap: 7px; }
.action-row:empty { display: none; }
.action-row .button { min-width: 71px; }
.raise-controls { display: flex; align-items: center; gap: 7px; }
.raise-controls label { font-size: 12px; color: var(--muted); }
.raise-controls input { width: 86px; min-height: 39px; padding: 6px 8px; }
.rail { display: grid; gap: 13px; min-width: 0; }
.side-panel { padding: 20px; }
.panel-kicker { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 9px; letter-spacing: .22em; font-weight: 750; }
.panel-kicker span { font-size: 14px; line-height: 1; }
h2 { font-size: 20px; margin: 8px 0 6px; letter-spacing: -.04em; }
.side-panel > p { font-size: 12px; }
#join-form { display: grid; gap: 7px; margin-top: 17px; }
label { color: #d6ddd2; font-size: 12px; font-weight: 600; }
input { min-width: 0; width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #414d40; border-radius: 8px; color: #f4f1e9; background: #141b15; }
input::placeholder { color: #909e8f; }
input:focus { border-color: var(--gold); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; font-weight: 720; font-size: 13px; white-space: nowrap; }
#join-form .button { justify-content: space-between; margin-top: 2px; }
.primary { background: var(--gold); border-color: #ebc890; color: #231b12; }
.primary:hover:not(:disabled) { background: #efcb96; }
.secondary { background: #28342a; border-color: #4d5b4a; color: #edf0e5; }
.secondary:hover:not(:disabled) { background: #37463a; }
.danger { background: #352b28; border-color: #65504a; color: #f6d3c7; }
.danger:hover:not(:disabled) { background: #48332e; }
.divider { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 10px; color: var(--muted); }
.divider::before, .divider::after { content: ''; background: var(--line); height: 1px; flex: 1; }
.invite-row { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin: 15px 0 9px; }
.invite-row strong { font-family: ui-monospace, Consolas, monospace; color: var(--gold); letter-spacing: .14em; font-size: 19px; }
#share-link { display: grid; gap: 5px; margin-top: 8px; }
.room-footer { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.text-button { color: #e4c898; border: 0; padding: 7px 1px; background: transparent; font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.all-in { white-space: nowrap; }
.log-panel { padding-top: 16px; padding-bottom: 16px; }
.voice-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 13px; }
#voice-members { margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
#voice-members:empty { display: none; }
#voice-members li { padding: 5px 0; overflow-wrap: anywhere; }
.side-panel .voice-hint { margin-top: 11px; font-size: 11px; }
.log-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.log-title h2 { font-size: 14px; margin: 0; color: #eeeee4; }
#log { margin: 10px 0 0; padding: 0; list-style: none; max-height: 215px; overflow: auto; color: var(--muted); font-size: 12px; }
#log li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; padding: 7px 0; border-top: 1px solid #333e33; }
#log li::before { content: '·'; color: var(--gold); font-weight: 800; }
.notice { position: fixed; z-index: 4; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: calc(100% - 32px); margin: 0; transform: translateX(-50%); padding: 11px 15px; border-radius: 9px; border: 1px solid #77654a; background: #302a20; color: #f6e6c6; box-shadow: 0 6px 20px #0005; font-size: 13px; }
footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; padding: 12px 0 20px; border-top: 1px solid #2b352c; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
footer b { color: var(--gold); }
dialog { width: min(460px, calc(100% - 30px)); border: 1px solid #596952; border-radius: 14px; padding: 19px; background: #202922; color: #f1efe6; }
dialog::backdrop { background: #0a110cbd; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; }
dialog p { color: #c4cec1; font-size: 14px; line-height: 1.7; }

@media (max-width: 1000px) {
  .top-inner, main { padding-inline: 27px; }
  .layout { grid-template-columns: minmax(0, 1fr) 258px; gap: 13px; }
  .side-panel { padding-inline: 16px; }
}

@media (max-width: 730px) {
  .top-inner, main { padding-inline: 14px; }
  .top-inner { min-height: 58px; }
  main { padding-top: 21px; }
  .intro { margin-bottom: 16px; align-items: start; flex-direction: column; gap: 10px; }
  .intro p { font-size: 12px; }
  .layout { display: flex; flex-direction: column; gap: 13px; }
  .table-panel, .rail { width: 100%; }
  .layout:has(#room-panel[hidden]) .rail { display: contents; }
  .layout:has(#room-panel[hidden]) .lobby-panel { order: -1; width: 100%; }
  .layout:has(#room-panel[hidden]) .log-panel { width: 100%; }
  .table-heading { min-height: 41px; padding-inline: 12px; }
  .table-stage { min-height: 336px; height: min(465px, 88vw); }
  .felt { inset: 14% 6% 16%; }
  .seat { width: min(128px, 27%); }
  .seat-0 { top: 87%; }
  .seat-1, .seat-5 { top: 70%; }
  .seat-2, .seat-4 { top: 26%; }
  .seat-3 { top: 13%; }
  .seat-identity { gap: 4px; padding: 4px; }
  .avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 12px; }
  .seat-title { font-size: 10px; }
  .stack { font-size: 10px; }
  .hole-cards .card { width: 22px; font-size: 11px; }
  .action-area { min-height: 62px; padding: 9px 11px; }
  .action-row .button { min-width: 63px; }
  .board-area { gap: 8px; }
  .table-message { font-size: 11px; }
}
