:root {
  color-scheme: dark;
  --ink: #faf4ee;
  --muted: #b8adb5;
  --edge: #45404a;
  --orange: #ff794d;
  --orange-light: #ffb091;
  --face: linear-gradient(145deg,#552e39,#311e29);
  --card-ink: #fff4e6;
  --red: #ff9daf;
  --card-edge: #ac665e;
  --card-back: repeating-linear-gradient(136deg,#723538 0 2px,#4c2831 3px 7px);
  --card-back-ink: #ffc9aa;
  --felt: radial-gradient(ellipse at 48% 34%,#563143 0,#402636 47%,#2a202c 82%);
  --felt-edge: #855651;
  --card-width: clamp(64px, 7.7vw, 98px);
  font: 16px/1.42 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #ffb294; outline-offset: 3px; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at 50% -30%,#352333 0,transparent 68%),#101116; }
body[data-page='playing'] { background: radial-gradient(ellipse at 52% 33%,#2e1d2a 0,#16141d 59%,#101116 95%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .57; cursor: default; }
h1, h2, h3, p, dl, dd { margin: 0; }
h2 { font-size: 1.14rem; font-weight: 630; line-height: 1.2; }
a { color: var(--orange-light); }

/* Navigation and account. */
.topbar { border-bottom: 1px solid #ffffff14; background: #101115e8; }
.topbar-inner { width: min(calc(100% - 46px), 1430px); min-height: 62px; margin-inline: auto; display: flex; align-items: center; gap: clamp(12px,3vw,48px); }
.site-brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--ink); font-size: 1.09rem; font-weight: 790; letter-spacing: -.02em; text-decoration: none; }
.site-brand span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #bd6048; border-radius: 9px; color: var(--orange); font-size: 21px; background: #3a2527; }
.page-nav { display: flex; align-items: center; gap: 5px; }
.page-nav button { padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .89rem; line-height: 1.18; }
.page-nav button:hover, .page-nav [aria-current='page'] { color: var(--ink); background: #ffffff0d; }
.page-nav [aria-current='page'] { color: var(--orange-light); font-weight: 670; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; color: var(--muted); font-size: .87rem; }
.account-name { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-login { text-underline-offset: 3px; }
.account .button { min-height: 34px; padding-inline: 9px; font-size: .84rem; }
.account [data-control='wallet-balance'] { color: #ffb99e; border-color: #704639; background: #382723; white-space: nowrap; }
.workspace { width: min(calc(100% - 46px), 1260px); min-width: 0; margin-inline: auto; padding: clamp(15px,2.65vw,35px) 0 26px; }
body[data-page='playing'] .workspace { width: min(calc(100% - 44px), 1370px); padding-top: 13px; }
.workspace-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 17px; }
.workspace-head h1 { font-size: clamp(1.58rem,3.28vw,2.75rem); font-weight: 725; line-height: 1.03; letter-spacing: -.045em; }
body[data-page='playing'] .workspace-head { margin-bottom: 5px; }
body[data-page='playing'] .workspace-head h1 { font-size: clamp(1.15rem,1.8vw,1.6rem); font-weight: 640; letter-spacing: -.02em; }
.workspace-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.workspace-tools .button { min-height: 34px; }
.notes { color: var(--muted); font-size: .875rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 7px 13px; border: 1px solid #ffffff26; border-radius: 9px; background: #27252e; color: var(--ink); font-size: .9rem; font-weight: 640; line-height: 1.18; text-align: center; transition: background-color .14s,border-color .14s,transform .14s; }
.button.quiet { background: transparent; }
.button:hover:enabled { border-color: #ffffff49; background: #39323b; }
.button.primary { border-color: var(--orange); background: var(--orange); color: #1f1517; font-weight: 780; }
.button.primary:hover:enabled { border-color: #ff9b73; background: #ff9b73; }
.button:enabled:active { transform: translateY(1px); }
a.button { text-decoration: none; }
.label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .88rem; }
.field { display: block; width: 100%; padding: 9px 11px; border: 1px solid #ffffff29; border-radius: 9px; background: #121218; color: var(--ink); font-size: .95rem; }
.field::placeholder { color: #aba1ad; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

/* Table setup. */
.game-lobby { display: grid; grid-template-columns: minmax(0,1fr) minmax(324px,.57fr); align-items: stretch; gap: clamp(14px,2.5vw,27px); }
.lobby-play { min-width: 0; display: flex; flex-direction: column; }
.lobby-intro { display: grid; gap: 4px; margin-bottom: 13px; }
.lobby-intro h2 { font-size: clamp(1.2rem,2.2vw,1.65rem); letter-spacing: -.025em; }
.mode-select { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); flex: 1; gap: 8px; }
.mode-select .mode-tile { --face: linear-gradient(145deg,#603345,#341f2b); position: relative; display: flex; min-width: 0; min-height: 245px; flex-direction: column; align-items: stretch; justify-content: end; overflow: hidden; padding: 10px; border: 1px solid #6e4b54; border-radius: 17px; background: radial-gradient(ellipse at 30% 24%,#59303c,#28202b 78%); text-align: left; }
.mode-select .mode-tile[data-mode='throw-in'] { background: radial-gradient(ellipse at 52% 21%,#66313b,#32212d 79%); }
.mode-select .mode-tile[data-mode='transfer'] { background: radial-gradient(ellipse at 65% 28%,#51354e,#24202e 80%); }
.mode-select .mode-tile[aria-pressed='true'] { border-color: var(--orange); box-shadow: inset 0 0 0 1px #ff794d; }
.mode-select .mode-tile:hover:enabled { border-color: #ffab88; }
.mode-tile[aria-pressed='true']::after { position: absolute; top: 11px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); content: ''; }
.mode-art { position: relative; flex: 1; min-height: 104px; display: flex; align-items: center; justify-content: center; padding: 3px 0 13px; pointer-events: none; }
.mode-art .card { --size: clamp(39px,5.4vw,76px); transform: rotate(-15deg) translateY(3px); }
.mode-art .card:nth-child(2) { margin-left: -18px; transform: rotate(12deg) translateY(7px); }
.mode-art .card:nth-child(3) { margin-left: -20px; transform: rotate(21deg) translateY(12px); }
.mode-caption { position: relative; display: grid; gap: 4px; padding: 3px 2px; }
.mode-caption strong { font-size: clamp(.91rem,1.5vw,1.16rem); font-weight: 760; }
.mode-caption span { color: #e7c6d0; font-size: .83rem; line-height: 1.24; font-weight: 510; }
.lobby-setup { display: grid; gap: 9px; align-content: start; padding: clamp(12px,1.9vw,21px); border: 1px solid #ffffff1d; border-radius: 19px; background: linear-gradient(145deg,#2b202a,#1b191f 66%); }
.size-select, .stake-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.size-select .label { width: 100%; margin-bottom: 0; }
.size-select .button { flex: 1 0 auto; }
.size-select [aria-pressed='true'], .stake-presets [aria-pressed='true'] { border-color: #bc654e; background: #5a302e; color: #ffe5d4; }
.stake-picker { display: grid; gap: 6px; }
.stake-title { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; }
.stake-title strong { font-size: .92rem; }
.stake-presets .button { min-height: 35px; padding-inline: 8px; }
.stake-picker .label { margin: 0; }
.lobby-options { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; }
.toggle { display: flex; align-items: center; gap: 7px; color: #efe4e8; font-size: .88rem; cursor: pointer; }
.toggle input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; accent-color: var(--orange); }
.lobby-actions { margin-top: 3px; }
.login-demand { margin-top: 2px; }
.game-lobby > .rooms-panel { grid-column: 1 / -1; }
.rooms-panel { min-width: 0; padding-block: 5px; }
.panel-title { margin-bottom: 8px; }
.rooms-panel > .nickname-field { max-width: 370px; margin-bottom: 9px; }
.listing { display: grid; gap: 6px; }
.listing-row, .invite { border: 1px solid #ffffff1d; border-radius: 12px; background: #211d26; }
.listing-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 11px; }
.listing-row div { min-width: 0; overflow-wrap: anywhere; }
.listing-row p { color: var(--muted); font-size: .88rem; }
.room-access, .room-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.room-access { justify-content: end; }
.room-toolbar { justify-content: space-between; margin-bottom: 7px; }
.room-status { color: var(--muted); font-size: .83rem; }
.room-status.can-join { color: #ffae93; }
.invite { margin: 6px 0 9px; padding: 10px; border-color: #865348; background: #35232a; }
.invite .action-row { margin-top: 5px; }
.room-stage { width: min(100%,860px); display: grid; gap: 14px; padding: 8px 0 25px; }
.result { display: grid; gap: 4px; }
.result h2 { font-size: clamp(1.35rem,2.9vw,2.35rem); letter-spacing: -.024em; }
.room-stage > .action-row { margin-top: 0; }
.stake-editor { display: grid; gap: 7px; justify-items: start; }
.share { display: flex; align-items: center; gap: 7px; max-width: 660px; }
.share .field { min-width: 0; }
.share .button { flex: 0 0 auto; }

/* Arena and seats. */
.game-board { position: relative; min-width: 0; }
.board-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; }
.table-money { display: flex; align-items: stretch; flex-wrap: wrap; gap: 5px; }
.money-item { display: grid; min-width: 90px; gap: 1px; padding: 4px 10px; border-left: 1px solid #ffffff30; }
.money-item span { color: var(--muted); font-size: .78rem; }
.money-item strong { color: #ffe5d4; font-size: .9rem; font-variant-numeric: tabular-nums; }
.board-clock { display: inline-flex; min-width: 53px; justify-content: center; padding: 5px 9px; border: 1px solid #ad695366; border-radius: 20px; color: #ffcdba; background: #3b2929; font-size: .88rem; font-weight: 660; font-variant-numeric: tabular-nums; }
.board-clock:empty { visibility: hidden; }
.table-stage { position: relative; margin: 0 auto; padding-top: 35px; width: min(100%,1260px); }
.felt { position: relative; display: grid; grid-template-columns: minmax(90px,.17fr) minmax(0,1fr) minmax(90px,.17fr); grid-template-rows: 28px 1fr 33px;
  align-items: center; min-height: clamp(326px,46vh,430px); padding: 62px clamp(20px,5vw,68px) 59px; border: 1px solid var(--felt-edge); border-radius: clamp(60px,13vw,188px);
  background: var(--felt); box-shadow: inset 0 0 0 9px #1d16248c,inset 0 0 0 10px #f7ab8835,inset 0 -18px 58px #150c1980,0 15px 45px #0007;
}
.felt > :is(.deck,.table-cards,.discard,.move-banner,.transfer-pad) { position: relative; z-index: 1; min-width: 0; }
.table-emblem { position: absolute; top: 50%; left: 50%; width: clamp(94px,17vw,205px); transform: translate(-50%,-50%); color: #ffc2a7; opacity: .1; pointer-events: none; }
.players { display: flex; flex-wrap: wrap; gap: 7px; }
.player { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 10px; border: 1px solid #ffffff22; border-radius: 12px; background: #24202a; }
.player.is-turn { border-color: #de8066; background: #492c32; box-shadow: 0 3px 16px #1b0b16a0; }
.seat-caption { min-width: 0; }
.player strong { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; line-height: 1.15; }
.player span { color: #d1bdc7; font-size: .8rem; white-space: nowrap; }
.player.is-turn .seat-caption > span { color: #ffc9b1; }
.player .button { min-height: 30px; padding-inline: 6px; font-size: .8rem; }
.table-seats { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.table-seats .player { position: absolute; min-width: 102px; pointer-events: auto; box-shadow: 0 8px 18px #160b19a0; }
.table-seats[data-count='1'] .player, .table-seats[data-count='3'] .player:nth-child(2) { left: 50%; top: 15px; transform: translateX(-50%); }
.table-seats[data-count='2'] .player:first-child { left: 25%; top: 17px; transform: translateX(-50%); }
.table-seats[data-count='2'] .player:last-child { right: 25%; top: 17px; transform: translateX(50%); }
.table-seats[data-count='3'] .player:first-child { left: 7%; top: 43px; }
.table-seats[data-count='3'] .player:last-child { right: 7%; top: 43px; }
.seat-cards { display: flex; align-items: center; flex: 0 0 auto; }
.seat-cards .card-back { width: 19px; border-width: 1px; border-radius: 3px; }
.seat-cards .card-back + .card-back { margin-left: -12px; }
.move-banner { grid-area: 1 / 2; justify-self: center; color: #ecd6df; font-size: .85rem; text-align: center; overflow-wrap: anywhere; }
.move-banner.is-playing { color: #fff1e5; }
.move-banner.is-resolved { color: #ffd1b9; }
.deck, .discard { display: grid; justify-items: center; gap: 4px; text-align: center; }
.deck { grid-area: 2 / 1; }
.discard { grid-area: 2 / 3; }
.deck strong { font-size: .9rem; white-space: nowrap; }
.deck .notes, .discard .notes { color: #dfbdce; font-size: .78rem; white-space: nowrap; }
.deck-anchor { display: flex; align-items: center; justify-content: center; min-width: 52px; min-height: 68px; }
.deck-anchor .card { --size: clamp(34px,4.5vw,60px); margin-right: -19px; transform: rotate(-11deg); }
.deck-anchor .card-back { transform: rotate(8deg); }
.discard-anchor { position: relative; width: clamp(34px,4.5vw,60px); aspect-ratio: 5 / 7; border: 1px solid #ffc5a25b; border-radius: 7px; background: #27162055; }
.discard-anchor::after { position: absolute; inset: 4px; border: 1px solid #ffc5a22b; border-radius: 5px; content: ''; }
.table-cards { grid-area: 2 / 2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; min-height: max(85px,calc(var(--card-width) * 1.4)); padding: 3px 4px; border-radius: 16px; }
.table-cards.drag-over { background: #ffffff12; }
.pair { display: flex; padding-bottom: 11px; }
.pair > :nth-child(2) { margin: 10px 0 -10px calc(var(--card-width) * -.43); box-shadow: -2px -2px 8px #110b12b5; }
.drop-pad { border: 0; min-height: 35px; color: #f3d1cf; font-weight: 570; }
.drop-pad.drag-over { background: #ffd9c029; box-shadow: 0 0 0 1px #ffd9c079; }
.empty-pad { padding: 12px 18px; background: #1e141a50 !important; }
.inline-pad { align-self: center; font-size: .8rem; opacity: .85; }
.transfer-pad { grid-area: 3 / 2; justify-self: center; padding-inline: 12px; border-radius: 18px; background: #201924a3 !important; }

/* A single-row hand dock connected to the front edge of the table. */
.hand-dock { position: relative; z-index: 4; margin: -25px auto 0; width: min(100%,1030px); }
.hand-head { display: grid; justify-items: center; gap: 3px; min-height: 47px; padding: 0 5px; text-align: center; }
.hand-person { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: 2px 6px; width: max-content; max-width: 100%; padding: 4px 10px; border-radius: 16px; background: #211820; }
.hand-person h2 { font-size: .9rem; }
.hand-person .notes { font-size: .84rem; }
.hand-head > .notes { align-self: end; color: #f5d4d6; }
.hand-head .is-your-turn { color: #ffc5a9; }
.hand { position: relative; display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; min-height: 65px; padding: 9px 6px 6px; overflow: auto hidden; scrollbar-width: thin; }
.hand > :first-child { margin-inline-start: auto; }
.hand > :last-child { margin-inline-end: auto; }
.hand.many-cards .card + .card { margin-left: clamp(-44px,-3.8vw,-16px); }
.hand .card { cursor: grab; touch-action: none; transition: translate 110ms ease,transform 110ms ease; }
.hand .card:active { cursor: grabbing; }
.hand .card:hover, .hand .card:focus-visible { z-index: 2; }
.hand .drag-origin { opacity: .25; }
.hand .insert-before { translate: 5px 0; }
.hand .insert-after { translate: -5px 0; }
.hand .insert-before::after, .hand .insert-after::after { position: absolute; inset: 4px auto 4px -4px; content: ''; width: 3px; border-radius: 2px; background: #fff5e8; }
.hand .insert-after::after { left: auto; right: -4px; }
.hand-dock .action-row { min-height: 39px; margin-top: 5px; }
.hand-dock .leave { margin-left: auto; }
.cheat-button[aria-pressed='true'] { color: #ffbc9d; border-color: #db8267; background: #482b2e; }
.review-time { margin-left: 4px; font-size: .82em; font-variant-numeric: tabular-nums; }
.keyboard-controls, .move-journal { width: min(100%,1030px); margin: 7px auto 0; color: var(--muted); font-size: .86rem; }
.keyboard-controls summary, .move-journal summary { width: max-content; max-width: 100%; cursor: pointer; }
.keyboard-controls .notes { margin-top: 5px; }
.move-journal ol { display: grid; gap: 3px; margin: 6px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.drag-ghost { position: fixed; z-index: 10; top: 0; left: 0; display: flex; pointer-events: none; will-change: transform; filter: drop-shadow(0 8px 10px #000a); }
.drag-ghost .card + .card { margin-left: calc(var(--card-width) * -.66); transform: translateY(5px) rotate(7deg); }
.flight-layer { position: fixed; z-index: 8; inset: 0; pointer-events: none; }
.flight-layer .flight-card { position: fixed; top: 0; left: 0; width: var(--card-width); height: auto; aspect-ratio: 5 / 7; margin: 0; }

/* Card themes. */
.card { --size: var(--card-width); position: relative; display: grid; place-items: center; width: var(--size); height: calc(var(--size) * 1.41); flex: 0 0 var(--size); padding: 0;
  border: 1px solid var(--card-edge); border-radius: clamp(5px,.75vw,10px); background: var(--face); color: var(--card-ink); text-align: center; font-family: 'Segoe UI Symbol',system-ui,sans-serif;
  box-shadow: 0 3px 10px #170d1aa6; user-select: none; -webkit-user-drag: none; }
.card::before { position: absolute; inset: 3px; border: 1px solid #ffc2a340; border-radius: 4px; content: ''; pointer-events: none; }
.card.red { color: var(--red); }
.card.is-selected { transform: translateY(-5px); box-shadow: 0 0 0 2px #fff2db,0 4px 10px #0009; }
.card.drag-over, .card.is-being-covered { box-shadow: 0 0 0 2px #ffe1be,0 5px 12px #000a; }
.card.is-arriving { animation: show-arrival .24s steps(1,end) both; }
.felt.is-clearing .pair .card { opacity: .25; transition: opacity .16s linear; }
@keyframes show-arrival { from { opacity: .07; } to { opacity: 1; } }
.rank { position: absolute; top: 5px; left: 6px; font: 750 clamp(.83rem,1.28vw,1.17rem)/1 'Segoe UI',system-ui,sans-serif; }
.rank.bottom { top: auto; left: auto; bottom: 5px; right: 6px; rotate: 180deg; }
.suit { font-size: clamp(1.24rem,3.15vw,2.6rem); line-height: 1; }
.deck-anchor .card .suit, .mode-art .card .suit { font-size: clamp(1rem,2.55vw,1.6rem); }
.card-back { display: grid; place-items: center; flex: none; width: clamp(34px,4.5vw,60px); aspect-ratio: 5 / 7; border: 1px solid var(--card-edge); border-radius: 6px; background: var(--card-back); color: var(--card-back-ink); box-shadow: inset 0 0 0 3px #17101c76,0 3px 8px #100911a6; }
.card-back .theme-emblem { width: 68%; filter: drop-shadow(0 1px 1px #0009); }
.card-back.flight-card { width: clamp(33px,5vw,65px); }
:root[data-card-theme='dark'] { --face: linear-gradient(145deg,#444656,#222431); --card-edge: #9692ab; --red: #ff9caf; --card-back: repeating-linear-gradient(135deg,#414453 0 2px,#272b36 3px 7px); --card-back-ink: #d9d2f1; }
:root[data-card-theme='spider'] { --face: linear-gradient(145deg,#554865,#392b50); --card-edge: #b386bf; --red: #ffb5d0; --card-back: repeating-conic-gradient(from 5deg at 15% 18%,#a888ba7d 0deg 1.25deg,transparent 2deg 40deg),#3e2e54; --card-back-ink: #e3c7f0; }
:root[data-card-theme='dragon'] { --face: linear-gradient(145deg,#693e33,#3e242b); --card-edge: #ce9271; --red: #ffb0a1; --card-back: repeating-linear-gradient(143deg,#945137 0 2px,#5e3232 3px 8px); --card-back-ink: #ffbc88; }
:root[data-table-theme='dark'] { --felt: radial-gradient(ellipse at center,#413a48,#292a35,#211f2b); --felt-edge: #77718a; }
:root[data-table-theme='spider'] { --felt: repeating-radial-gradient(circle at 11% 21%,transparent 0 24px,#d5a7f12a 26px 27px,transparent 28px 45px),repeating-conic-gradient(from 3deg at 11% 21%,#c4a5df29 0 1deg,transparent 1.5deg 36deg),radial-gradient(ellipse at center,#524162,#372c49 80%); --felt-edge: #9076a9; }
:root[data-table-theme='dragon'] { --felt: radial-gradient(ellipse at 50% 102%,transparent 0 10px,#d0785050 11px 12px,transparent 13px) 0 0 / 25px 15px,radial-gradient(ellipse at 50% 102%,transparent 0 10px,#b2644436 11px 12px,transparent 13px) 12px 7px / 25px 15px,linear-gradient(115deg,#643734,#3c2832); --felt-edge: #a5644f; }

/* Secondary views and forms. */
.panel { min-width: 0; padding: 12px 0; }
.wallet-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 12px 16px; border: 1px solid #a263505e; border-radius: 16px; background: #33252b; }
.wallet-balance, .wallet-claim { display: grid; justify-items: start; }
.wallet-balance strong { color: #ffe8d6; font-size: clamp(1.7rem,4vw,2.75rem); font-variant-numeric: tabular-nums; }
.wallet-claim { gap: 5px; }
.wallet-form { display: grid; justify-items: start; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--edge); }
.wallet-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr)); width: 100%; gap: 7px; }
.stat-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin-top: 8px; }
.stat-totals > div { padding: 7px 10px; border-left: 1px solid var(--edge); }
.stat-totals dt { color: var(--muted); font-size: .83rem; }
.stat-totals dd { font-size: 1.28rem; font-weight: 675; }
.stat-history { margin-top: 12px; }
.stat-history summary { cursor: pointer; }
.stat-history ul { display: grid; gap: 5px; list-style: none; padding: 0; margin: 6px 0 0; }
.stat-history li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; padding: 6px 8px; border-radius: 6px; background: #24202a; }
.stat-history li span, .stat-history time { color: var(--muted); font-size: .86rem; }
.stat-history time { margin-left: auto; }
.stat-result.is-win { color: #cfedbd; }
.stat-result.is-loss { color: #ffad9f; }
.feedback, .loading { padding: 8px 10px; border-left: 2px solid var(--orange); border-radius: 6px; background: #35282c; }
#feedback { width: min(100%,1030px); margin: 9px auto 0; }
.feedback.is-error { border-color: #ff9a7e; color: #ffeee8; }
.rules { color-scheme: dark; width: min(620px,calc(100% - 25px)); max-height: calc(100% - 28px); padding: 17px; border: 1px solid #82594f; border-radius: 15px; background: #242029; color: var(--ink); box-shadow: 0 16px 60px #0009; }
.rules::backdrop { background: #101016b8; }
.rules-header { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 10px; }
.rules > p + p { margin-top: 8px; }
.rules dl { margin-top: 9px; }
.rules dt { margin-top: 6px; color: #ffc1a4; font-weight: 680; }
.rules dd { color: var(--muted); }
.rename-error { margin-top: 7px; color: #ffb8aa; }
#leave-stake { margin-top: 8px; }
.design-section + .design-section { margin-top: 12px; }
.design-section h3 { margin-bottom: 5px; color: var(--muted); font-size: .88rem; }
.theme-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.theme-option { flex-direction: column; gap: 4px; padding: 5px; }
.theme-option[aria-pressed='true'] { border-color: var(--orange); background: #402c32; }
.theme-sample { position: relative; display: grid; place-items: center; width: 100%; height: 45px; border-radius: 5px; color: #fae4d6; background: var(--sample); }
.theme-sample .theme-emblem { height: 80%; max-width: 100%; }
.sample-rank { position: absolute; top: 2px; left: 5px; }
[data-theme='cassini'] { --sample: linear-gradient(132deg,#6d3434,#412936); }
[data-theme='dark'] { --sample: repeating-linear-gradient(135deg,#454457 0 4px,#333342 4px 8px); }
[data-theme='spider'] { --sample: repeating-conic-gradient(from 4deg at 15% 15%,#ad86be7e 0 1deg,transparent 2deg 39deg),#4b355a; }
[data-theme='dragon'] { --sample: repeating-linear-gradient(135deg,#8c5135 0 3px,#573637 3px 9px); }

@media (max-width: 910px) {
  .game-lobby { grid-template-columns: 1fr; }
  .mode-select .mode-tile { min-height: 188px; }
  .lobby-setup { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lobby-setup > :is(.stake-picker,.lobby-options,.lobby-actions,.login-demand) { grid-column: 1 / -1; }
  .table-seats[data-count='3'] .player:first-child { left: 4%; }
  .table-seats[data-count='3'] .player:last-child { right: 4%; }
}
@media (max-width: 645px) {
  .topbar-inner { width: calc(100% - 20px); display: grid; min-height: 0; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; padding-block: 6px 4px; }
  .page-nav { grid-area: 2 / 1 / 3 / -1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
  .page-nav button { flex: 0 0 auto; min-height: 32px; padding-inline: 5px; font-size: .83rem; white-space: nowrap; }
  .account { grid-area: 1 / 2; gap: 4px; }
  .account-name { max-width: 74px; }
  .workspace, body[data-page='playing'] .workspace { width: calc(100% - 18px); padding-top: 10px; }
  .workspace-head { margin-bottom: 8px; }
  .workspace-tools { gap: 4px 7px; }
  .workspace-tools .button { padding-inline: 7px; font-size: .8rem; }
  .lobby-setup { grid-template-columns: 1fr; }
  .board-info { margin-top: 3px; }
  .table-stage { padding-top: 26px; }
  .felt { grid-template-columns: 45px minmax(0,1fr) 40px; min-height: 230px; grid-template-rows: 27px 1fr 27px; padding: 40px 9px 37px; border-radius: 46px; box-shadow: inset 0 0 0 4px #1d16248c,inset 0 0 0 5px #f7ab8835,0 10px 24px #0007; }
  .table-seats .player, .table-seats[data-count='1'] .player, .table-seats[data-count='3'] .player:nth-child(2), .table-seats[data-count='2'] .player:first-child, .table-seats[data-count='2'] .player:last-child { min-width: 0; top: 5px; gap: 3px; padding: 4px 5px; }
  .table-seats[data-count='3'] .player:first-child { left: 2px; }
  .table-seats[data-count='3'] .player:last-child { right: 2px; }
  .table-seats .seat-cards .card-back { width: 13px; }
  .table-seats .seat-cards .card-back + .card-back { margin-left: -10px; }
  .table-seats .player strong { max-width: min(21vw,112px); font-size: .77rem; }
  .table-seats .player span { font-size: .69rem; }
  .move-banner { font-size: .77rem; }
  .deck strong, .deck .notes, .discard .notes { font-size: .72rem; }
  .deck-anchor { min-width: 36px; min-height: 51px; }
  .deck-anchor .card { margin-right: -19px; transform: rotate(-8deg); }
  .deck-anchor .card-back { transform: rotate(5deg); }
  .table-cards { gap: 4px; padding-inline: 2px; }
  .inline-pad, .transfer-pad { min-height: 28px; padding: 4px 6px; font-size: .74rem; }
  .hand-dock { margin-top: -19px; }
  .hand-head { min-height: 42px; }
  .hand-head > .notes { font-size: .8rem; }
  .hand { gap: 3px; padding-inline: 3px; }
  .hand .card + .card { margin-left: -7px; }
  .hand.many-cards .card + .card { margin-left: -15px; }
  .suit { font-size: 1.5rem; }
  .hand-dock .action-row { margin-top: 3px; }
}
@media (max-width: 435px) {
  .account .button { min-height: 29px; padding-inline: 5px; font-size: .77rem; }
  .button { min-height: 36px; padding-inline: 8px; }
  .mode-select { gap: 5px; }
  .mode-select .mode-tile { min-height: 168px; border-radius: 11px; padding: 6px; }
  .mode-art { min-height: 66px; padding-bottom: 8px; }
  .mode-caption span { font-size: .74rem; }
  .money-item { min-width: 74px; padding-inline: 5px 7px; }
  .board-clock { min-width: 44px; padding-inline: 5px; }
  .stat-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .share { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .hand .card, .felt.is-clearing .pair .card { transition: none; }
  .card.is-arriving { animation: none; }
}
