:root {
  color-scheme: dark;
  --background: #221c32;
  --surface: #30273f;
  --raised: #41354f;
  --edge: #8a739d;
  --border: #665475;
  --text: #fff0d7;
  --muted: #d0c0d9;
  --accent: #ffd598;
  --accent-text: #3b231d;
  --gold-edge: #eec38a;
  --primary-fill: linear-gradient(180deg, #ffdda1eb, #f4c589ed), url('/art/ui-cloth.webp') center / 17rem repeat;
  --primary-depth: inset 0 1px #fff0ce, inset 0 -2px #b77d4a8c, 0 2px 3px #140b215e;
  --danger: #ffc1ce;
  --danger-fill: #503344;
  --danger-edge: #a86e85;
  --mint: #c1e7d5;
  --status-mint: #aed2c0;
  --status-peach: #f3ba89;
  --chip-gold: #f5d098;
  --chip-blue: #b6d7ff;
  --tool-border: #c9b5c8;
  --tool-fill: #352d44;
  --tool-depth: inset 0 1px #f6dfc826, 0 1px 2px #150f235c;
  --card: #fff0d3;
  --shadow: #190f26;
  --surface-sheen: linear-gradient(180deg, #c3a9e119, transparent 8rem);
  --panel-depth: inset 0 0 0 2px #c9afd61c, inset 0 1px #d4bde137, 0 3px 3px #160f225e;
  --selected-surface: #50405c;
  --selected-edge: #b99a76;
  --radius-field: .55rem;
  --radius-action: .53rem;
  --radius-plaque: .6rem;
  --radius-panel: .9rem;
  --radius-pill: 99rem;
  --control-height: 2.8rem;
  --tool-visual-height: 1.7rem;
  --tool-hit-size: 3rem;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cloth: url('/art/ui-cloth.webp') center / 17rem repeat;
  --portraits: url('/art/players.webp');
  font: 15px/1.45 var(--font-ui);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0, #7a51a447, transparent 38rem),
    radial-gradient(circle, #ad8ccb1a 1px, transparent 1px) 0 0 / 8px 8px,
    var(--background);
}
.app {
  --app-gutter: .8rem;
  width: min(100%, 35rem);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  margin: auto;
  padding: 0 var(--app-gutter) calc(1rem + env(safe-area-inset-bottom, 0px));
}
.app:is([data-screen="profile"], [data-screen="home"]) { padding-bottom: calc(5.65rem + env(safe-area-inset-bottom, 0px)); }
.top { min-height: 3.5rem; display: flex; align-items: center; gap: .55rem; }
.top a { color: var(--text); font-weight: 700; text-decoration: none; }
.app[data-screen="login"] .top { min-height: clamp(1rem, 6vh, 3.5rem); }
.app[data-screen="room"] {
  height: 100dvh;
  min-height: 0;
  padding-bottom: calc(.35rem + env(safe-area-inset-bottom, 0px));
  background: var(--cloth), radial-gradient(ellipse at 50% 45%, #3a304e, #211d34 71%);
  background-blend-mode: soft-light, normal;
}
.app[data-screen="room"] .top {
  z-index: 1;
  flex: none;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(3rem, max-content);
  grid-template-rows: minmax(3.55rem, auto) auto;
  row-gap: 0;
}
.wordmark { display: inline-flex; align-items: center; gap: .3rem; color: var(--text); font-family: var(--font-ui); font-weight: 900; font-size: 1.12rem; letter-spacing: .025em; white-space: nowrap; }
#brand { gap: .13rem; }
.wordmark-accent { color: var(--accent); }
.brand-cards { display: inline-block; width: 1.85rem; height: 1.85rem; object-fit: contain; }
.avatar-art {
  display: inline-block;
  flex: none;
  width: 1.45rem;
  aspect-ratio: 1;
  background: var(--portraits) var(--avatar-x, 100%) var(--avatar-y, 100%) / var(--avatar-sheet-size, 400%) 300% no-repeat;
  translate: var(--avatar-shift-x, 0%) var(--avatar-shift-y, 0%);
}
.avatar-art[data-atlas="clever"] { background-image: url('/art/skins-clever.webp'); }
.avatar-art[data-atlas="table"] { background-image: url('/art/skins-table.webp'); }
.avatar-art[data-atlas="lounge"] { background-image: url('/art/skins-lounge.webp'); }
.avatar-art[data-atlas="safari"] { background-image: url('/art/skins-safari.webp'); }
.avatar-art[data-atlas="wild"] { background-image: url('/art/skins-wild.webp'); }
.lobby-tabs {
  position: fixed;
  z-index: 3;
  inset-inline: 0;
  bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
  width: calc(min(100%, 35rem) - var(--app-gutter) * 2);
  display: flex;
  gap: .27rem;
  margin-inline: auto;
  padding: .3rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-panel);
  background: var(--surface-sheen), #251e34;
  box-shadow: var(--panel-depth);
}
.lobby-tabs a {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 3.2rem;
  gap: .13rem;
  padding: .28rem;
  border: 1px solid transparent;
  border-radius: var(--radius-action);
  color: var(--muted);
  font-size: .84rem;
  text-decoration: none;
}
.lobby-tabs a[aria-current="page"] { background: var(--selected-surface); border-color: var(--selected-edge); color: var(--accent); font-weight: 700; }
.tab-games-icon { font-size: 1.1rem; line-height: 1.05rem; }
.tab-profile-icon { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .11rem; height: 1.05rem; }
.tab-profile-icon::before { content: ''; width: .43rem; height: .43rem; border-radius: 50%; background: currentColor; }
.tab-profile-icon::after { content: ''; width: .8rem; height: .42rem; border-radius: .4rem .4rem .12rem .12rem; background: currentColor; }
#roomMenu { position: relative; margin: 0; }
#roomMenu summary { display: grid; place-items: center; list-style: none; width: var(--tool-hit-size); height: var(--tool-hit-size); min-height: var(--tool-hit-size); padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text); cursor: pointer; }
#roomMenu[open] summary .tool-face { border-color: var(--selected-edge); color: var(--accent); }
#roomMenu summary::-webkit-details-marker { display: none; }
.room-menu-icon { width: .92rem; height: 1.5px; border-radius: 1px; background: currentColor; box-shadow: 0 -.25rem currentColor, 0 .25rem currentColor; }
.tool-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.85rem;
  height: var(--tool-visual-height);
  padding-inline: .7rem;
  border: 1px solid var(--tool-border);
  border-radius: calc(var(--tool-visual-height) / 2);
  background: linear-gradient(#352d44eb, #352d44ed), var(--cloth);
  box-shadow: var(--tool-depth);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: .91rem;
  line-height: 1;
  letter-spacing: .045em;
}
.room-menu-items { position: absolute; z-index: 2; width: 9rem; display: grid; gap: .13rem; padding: .28rem; border: 1px solid var(--edge); border-radius: var(--radius-action); background: var(--surface-sheen), var(--surface); box-shadow: var(--panel-depth); }
.room-menu-items > :is(a, button) { display: flex; align-items: center; font: inherit; font-family: var(--font-ui); font-weight: 900; font-size: .88rem; min-height: var(--control-height); background: transparent; color: var(--text); border: 1px solid transparent; border-radius: var(--radius-field); text-align: left; margin: 0; padding: .4rem .55rem; }
.room-menu-items #leaveRoom { color: var(--danger); }
.room-menu-items > :is(a, button):focus-visible { outline-offset: -2px; }
.room-fund {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: var(--tool-hit-size);
  min-width: 4.1rem;
  max-width: 6.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  font-size: .92rem;
  font-weight: 680;
}
#fundLabel { min-width: 3.9rem; overflow: hidden; text-overflow: ellipsis; }
h1, h2 { margin: 0 0 .65rem; font-family: var(--font-ui); font-size: 1.35rem; font-weight: 900; letter-spacing: .025em; }
p { margin: .35rem 0; }
button, input, select, textarea, .link-button { border: 1px solid var(--border); font: inherit; min-height: var(--control-height); }
button, .link-button { background: var(--raised); color: var(--text); border-radius: var(--radius-action); padding: .4rem .65rem; font-family: var(--font-ui); font-size: 1.02rem; font-weight: 900; letter-spacing: .025em; cursor: pointer; text-decoration: none; }
button:disabled { cursor: default; opacity: .57; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary, #resume { background: var(--primary-fill); color: var(--accent-text); border-color: var(--gold-edge); font-weight: 780; box-shadow: var(--primary-depth); }
button.danger-action { color: var(--danger); background: var(--danger-fill); border-color: var(--danger-edge); }
button:enabled:active, .link-button:active { filter: brightness(.9); }
input, select { background: var(--background); color: var(--text); border-radius: var(--radius-field); padding: .45rem .55rem; width: 100%; font-family: var(--font-ui); font-size: 16px; }
select:not([multiple]):is(:not([size]), [size="1"]) {
  --select-arrow: var(--muted);
  appearance: none;
  padding-inline-end: 2rem;
  background-image: linear-gradient(45deg, transparent 42%, var(--select-arrow) 43% 57%, transparent 58%),
    linear-gradient(135deg, transparent 42%, var(--select-arrow) 43% 57%, transparent 58%);
  background-position: right 1.15rem center, right .8rem center;
  background-size: .35rem .35rem;
  background-repeat: no-repeat;
}
@media (forced-colors: active) {
  select:not([multiple]):is(:not([size]), [size="1"]) {
    appearance: auto;
    padding-inline-end: .55rem;
    background-image: none;
  }
}
input::placeholder { color: var(--muted); opacity: .75; }
label { display: grid; gap: .2rem; min-width: 0; }
form { display: grid; gap: .65rem; }
form > button { justify-self: start; }
.panel { background: var(--surface-sheen), var(--cloth), var(--surface); background-blend-mode: normal, soft-light, normal; border: 1px solid var(--edge); border-radius: var(--radius-panel); padding: .95rem; margin-bottom: .65rem; box-shadow: var(--panel-depth); }
.login-panel { width: min(100%, 29rem); margin-inline: auto; padding: 0; overflow: hidden; }
.login-cover { display: block; width: 100%; height: auto; border-radius: inherit; }
.login-content { padding: 1rem clamp(1rem, 5vw, 1.65rem) 1.35rem; }
.login-content h1 { font-size: clamp(1.65rem, 6vw, 2.2rem); letter-spacing: .055em; text-align: center; line-height: 1.25; }
.login-content h1::before, .login-content h1::after { content: '♦' / ''; color: var(--accent); font-size: .38em; vertical-align: .38em; margin-inline: .4em; }
#inviteNote { text-align: center; margin-bottom: .8rem; }
#loginForm button { width: 100%; margin-top: .2rem; min-height: 3.2rem; border-radius: var(--radius-pill); }
.game-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.game-actions > * { justify-content: center; min-height: 3.2rem; margin: 0; border-radius: var(--radius-pill); }
.game-actions > #resume { grid-column: 1 / -1; }
.game-history-section { margin-top: 1.1rem; padding-top: .95rem; border-top: 1px dashed var(--border); }
.game-history-section h2 { margin-bottom: .45rem; font-size: .95rem; font-weight: 680; }
.history-periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .16rem; padding: .2rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--background); }
.history-periods button { min-height: 2.45rem; padding: .2rem; font-size: .78rem; color: var(--muted); border-color: transparent; border-radius: var(--radius-pill); background: transparent; }
.history-periods button[aria-pressed="true"] { color: var(--accent); border-color: var(--selected-edge); background: var(--selected-surface); }
.history-total {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin: .5rem 0 .25rem;
  padding: .3rem 0;
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
#historyNet { font-size: 1rem; color: var(--text); overflow-wrap: anywhere; }
#historyNet[data-sign="win"] { color: var(--mint); }
#historyNet[data-sign="loss"] { color: var(--danger); }
#historyCount { margin-inline-start: auto; white-space: nowrap; }
.row, .room-tools, .your-status { display: flex; align-items: center; gap: .45rem; }
.row { align-items: end; }
.row label, .row input { flex: 1; }
.link-button { display: inline-flex; align-items: center; margin-bottom: .6rem; }
details { margin-top: 1rem; } summary { cursor: pointer; padding: .2rem 0; }
.checkbox-field { display: flex; align-items: center; gap: .4rem; }
.checkbox-field input { width: auto; min-height: 0; accent-color: var(--accent); }
.preview { align-self: end; padding: .55rem 0; }
#notice {
  position: fixed;
  inset: calc(4.1rem + env(safe-area-inset-top, 0px)) 0 auto;
  z-index: 10;
  width: min(calc(100% - 1.4rem), 28rem);
  margin: 0 auto;
  padding: .6rem .77rem;
  border: 1px solid #926277;
  border-radius: var(--radius-action);
  background: rgb(48 39 63 / .86);
  color: var(--danger);
  box-shadow: 0 3px 8px #170f23c0;
  pointer-events: none;
}
#notice[data-tone="success"] { border-color: #689981; color: var(--mint); }
#notice[data-tone="info"] { border-color: var(--edge); color: var(--text); }
.muted { color: var(--muted); font-size: .86rem; }
.your-status { justify-content: space-between; min-height: 2.9rem; }
#yourDetails { display: grid; gap: .24rem; min-width: 0; overflow-wrap: anywhere; }
.your-heading, #yourAmounts { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; }
#role { color: var(--muted); font-size: .86rem; }
#yourAmounts { font-size: .84rem; }
#yourCards { position: relative; flex: none; align-items: center; padding: 0; border: 0; border-radius: var(--radius-field); background: transparent; }
#yourCards:disabled { opacity: 1; }
#yourCards:enabled { box-shadow: 0 0 .55rem #e8b67453; }
#yourCards .card { flex: none; width: clamp(1.65rem, 9.5vw, 2.5rem); height: auto; aspect-ratio: 5 / 7; }
.card-look-prompt {
  position: absolute;
  z-index: 1;
  inset: 50% 0 auto;
  transform: translateY(-50%);
  padding: .17rem .25rem;
  border-block: 1px solid #eacc9c42;
  border-radius: .23rem;
  background: linear-gradient(90deg, #160e25a6, #160e25ed 22% 78%, #160e25a6);
  color: #fff0d2;
  font-size: .73rem;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}
#yourCards:disabled .card-look-prompt { display: none; }
#room {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}
.room-table {
  min-height: 0;
  container: table-stage / size;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
.room-table:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
#seats {
  --slot-max: 8.6rem;
  --slot-min: 4.55rem;
  --slot-height: var(--slot-max);
  --table-height: 9.7rem;
  --seat-gap: .24rem;
  --board-padding: .28rem;
  --seat-width: 6.15rem;
  --portrait-slot: clamp(1.35rem, calc(var(--slot-height) - 4.8rem), 3.55rem);
  --nameplate-height: 2.33rem;
  display: grid;
  min-block-size: 100%;
  align-content: safe center;
  gap: var(--seat-gap);
  padding-block: var(--board-padding);
}
#seats[data-sides="2"] { --table-height: calc(2 * var(--slot-height) + var(--seat-gap)); }
@supports (height: 1cqh) {
  #seats {
    --seat-width: min(6.15rem, calc((100cqw - 2 * var(--seat-gap)) / 3));
    --seat-budget: calc(100cqh - 2 * var(--board-padding) - 2 * var(--seat-gap));
    --table-height: min(9.7rem, 44cqh);
    --slot-height: clamp(var(--slot-min), calc((var(--seat-budget) - var(--table-height)) / 2), var(--slot-max));
  }
  #seats[data-sides="2"] {
    --slot-height: clamp(var(--slot-min), calc((var(--seat-budget) - var(--seat-gap)) / 4), var(--slot-max));
  }
}
.chip-legend, .seat-chips { display: flex; justify-content: center; flex-wrap: wrap; }
.chip-legend { grid-column: 1 / -1; gap: .14rem clamp(.32rem, 2vw, .85rem); padding-bottom: .2rem; font-size: .69rem; line-height: 1.2; }
.chip-legend > span, .seat-chips > span { display: inline-flex; align-items: center; gap: .16rem; min-width: 0; }
.chip-legend > span { white-space: nowrap; }
.chip-balance { color: var(--chip-gold); }
.chip-bet { color: var(--chip-blue); }
.chip-symbol {
  flex: none;
  width: .68em;
  aspect-ratio: 1;
  border: 1px dashed currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 1px currentColor, inset 0 0 0 1px #2a2138;
  background: currentColor;
}
.seat-row { --size: 1; display: grid; grid-template-columns: repeat(var(--size), var(--seat-width)); justify-content: center; gap: var(--seat-gap); width: 100%; margin-inline: auto; }
.seat-row[data-size="2"] { --size: 2; }
.seat-row[data-size="3"] { --size: 3; }
.seat-column { display: grid; align-content: center; gap: var(--seat-gap); min-width: 0; }
.table-ring-middle {
  display: grid;
  grid-template-columns: var(--seat-width) minmax(0, 1fr) var(--seat-width);
  grid-template-rows: var(--table-height);
  align-items: stretch;
  gap: var(--seat-gap);
}
#seats[data-sides="0"] .table-ring-middle { grid-template-columns: minmax(0, 1fr); width: min(100%, 26rem); margin-inline: auto; }
.table-felt {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .23rem;
  min-width: 0;
  min-height: 0;
  padding: .6rem .7rem;
  text-align: center;
}
.table-felt::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 1.5rem;
  background: radial-gradient(ellipse at 50% 42%, #6a527a66, #49365342 58%, transparent 85%), var(--cloth);
  mask-image: radial-gradient(ellipse 50% 50% at center, #000 35%, #000b 60%, transparent 100%);
  opacity: .78;
  pointer-events: none;
}
.table-felt p { margin: 0; }
.table-felt > :not(.table-log) { flex: none; }
.table-felt:has(#handInfo:not([hidden])) { justify-content: flex-start; }
.hand-tag { align-self: center; padding-inline: .45rem; border: 1px solid #b799b96b; border-radius: var(--radius-pill); color: #f4dfcc; font-size: .73rem; font-weight: 680; letter-spacing: .04em; }
.table-start { align-self: center; width: min(100%, 8rem); min-height: 2.25rem; padding: .3rem .15rem; font-size: .8rem; line-height: 1.15; }
.table-detail { font-size: .68rem; line-height: 1.1; }
.seat {
  min-width: 0;
  height: var(--slot-height);
  padding: .24rem .15rem .12rem;
  display: grid;
  grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  overflow: hidden;
  font-weight: 400;
  line-height: 1.13;
  background: transparent;
  border-color: transparent;
  border-radius: .75rem;
}
.seat-identity, .seat-body { display: grid; min-width: 0; align-content: center; justify-items: center; }
.seat-identity { position: relative; grid-template-rows: var(--portrait-slot) auto; align-items: start; isolation: isolate; }
.seat-identity .avatar-art { width: min(calc(var(--portrait-slot) + .16rem), 3.7rem, 87%); margin-top: .08rem; translate: var(--avatar-shift-x, 0%) 0; }
.seat-nameplate {
  position: relative;
  z-index: 1;
  width: min(100%, 5.7rem);
  min-height: var(--nameplate-height);
  display: grid;
  align-content: center;
  gap: .09rem;
  padding: .19rem .14rem .21rem;
  border: 1px solid #927c9f;
  border-radius: var(--radius-plaque);
  background: linear-gradient(180deg, #4c415e, #31293f 78%);
  color: var(--text);
  box-shadow: inset 0 1px #ccafdf21, 0 2px 2px #1814239c;
}
.seat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-family: var(--font-ui);
  font-weight: 400;
}
.seat-chips { gap: .08rem .31rem; font-size: .69rem; font-family: var(--font-ui); font-weight: 400; font-variant-numeric: tabular-nums; }
.seat-chips > span { max-width: 100%; }
.chip-value { overflow-wrap: anywhere; }
.seat-badges, .seat-badges-leading { display: inline-flex; align-items: center; gap: .1rem; }
.seat-badges-leading { flex-direction: column; }
.seat-identity .seat-badges {
  position: absolute;
  z-index: 2;
  inset: 0 max(0px, calc((100% - var(--portrait-slot) - 2.25rem) / 2)) auto;
  align-items: flex-start;
  justify-content: space-between;
}
.seat-identity .seat-badges-leading:has(.dealer-badge + .ante-badge) {
  --badge-size: min(calc((var(--portrait-slot) - 1px) / 2), .94rem);
  gap: 1px;
}
.seat-badge {
  display: inline-grid;
  flex: none;
  width: var(--badge-size, clamp(.8rem, 3.6vw, .94rem));
  height: var(--badge-size, clamp(.8rem, 3.6vw, .94rem));
  place-items: center;
  border: 1px solid #c0a4d8;
  border-radius: .21rem;
  background: #39284e;
  color: #f4e0ff;
  font-size: min(.64rem, calc(var(--badge-size, .94rem) - 2px));
  font-weight: 800;
  line-height: 1;
}
.ante-badge { border-color: #dfb97a; background: #523726; color: var(--accent); }
.blind-badge { width: .68rem; border: 0; border-radius: .13rem; background: url('/art/room-card.webp') center / 100% 100% no-repeat; }
.blind-badge.blind-looking { animation: blind-look-away 680ms ease-in-out calc(-1 * var(--look-elapsed, 0ms)) both; }
@keyframes blind-look-away {
  0% { transform: perspective(4rem) rotateY(0deg); opacity: 1; }
  72% { transform: perspective(4rem) rotateY(720deg); opacity: 1; }
  100% { transform: perspective(4rem) rotateY(720deg) translateY(-.25rem) scale(.55); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .blind-badge.blind-looking { display: none; animation: none; } }
.seat-body { min-height: 0; align-content: start; gap: .16rem; padding-top: .27rem; line-height: 1.1; overflow-y: auto; scrollbar-width: none; font-variant-numeric: tabular-nums; }
.seat-body:empty { display: none; }
.seat .seat-meta { color: var(--muted); font-size: .63rem; }
.seat .seat-action { font-size: .69rem; }
.seat-body > span { max-width: 100%; overflow-wrap: anywhere; }
.seat-action { color: var(--mint); font-weight: 690; }
.seat .seat-action { padding: .05rem .25rem; border-radius: var(--radius-pill); color: #1e302d; background: var(--status-mint); }
.seat .seat-action[data-tone="raise"] { color: #472c26; background: var(--status-peach); }
.seat:disabled { opacity: 1; }
.seat-chair {
  display: block;
  width: auto;
  height: calc(var(--portrait-slot) - .05rem);
  max-width: 86%;
  margin-top: .05rem;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #130e21a6);
}
.empty-seat .seat-nameplate {
  place-items: center;
  border-color: var(--selected-edge);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 730;
}
.empty-seat:disabled .seat-chair { opacity: .64; }
.empty-seat:disabled .seat-nameplate { border-color: var(--border); color: var(--muted); }
.seat.available-seat { border-style: dashed; }
.seat-result { align-content: center; gap: .1rem; padding-top: .1rem; }
.seat-nameplate.seat-reveal {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.seat-cards {
  --card-gap: clamp(2px, .75vw, 4px);
  --card-height-budget: clamp(1.55rem, calc(var(--slot-height) - var(--portrait-slot) - 1.15rem), 2.85rem);
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
  width: min(100%, calc(var(--card-height-budget) * 15 / 7 + 2 * var(--card-gap)));
  margin-inline: auto;
}
.seat-card-slot { position: relative; aspect-ratio: 5 / 7; perspective: 8rem; }
.seat-card-turn { position: absolute; inset: 0; transform-style: preserve-3d; }
.seat .seat-cards .card, .seat-card-back { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.seat .seat-cards .card {
  grid-template-rows: auto minmax(0, 1fr);
  place-content: stretch;
  align-items: center;
  padding: 2px 2px 1px;
  border: 1px solid #d6ad78;
  border-radius: .25rem;
  background: linear-gradient(#fff8e9, #f5e4c6);
  box-shadow: inset 0 0 0 1px #fff6e4, 0 2px 3px #120d2260;
  font-size: .75rem;
  white-space: nowrap;
}
.seat-cards .card-rank { justify-self: start; }
.seat-cards .card-suit { font-size: 1.3em; }
.seat-card-back { border-radius: .25rem; background: url('/art/room-card.webp') center / 100% 100% no-repeat; transform: rotateY(180deg); }
.seat-cards.flipping .seat-card-turn { animation: seat-card-flip 360ms ease-in-out calc(var(--flip-stagger, 0ms) - var(--flip-elapsed)) both; }
.seat-card-slot:nth-child(2) { --flip-stagger: 55ms; }
.seat-card-slot:nth-child(3) { --flip-stagger: 110ms; }
@keyframes seat-card-flip { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
.seat.own-seat .seat-nameplate { border-color: #b49dcb; }
.seat.current .seat-identity::before {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: calc(var(--portrait-slot) * .52 + .28rem);
  left: 50%;
  width: min(110%, calc(var(--portrait-slot) + 2.1rem));
  height: calc(var(--portrait-slot) + .7rem);
  translate: -50% -50%;
  background: radial-gradient(ellipse, #ffe5ada6 0%, #efbd8275 29%, #bc91dc59 52%, #9974b800 74%);
  opacity: .84;
  animation: turn-glow-breathe 2.8s ease-in-out var(--turn-glow-delay, 0s) infinite;
}
@keyframes turn-glow-breathe {
  0%, 100% { opacity: .64; }
  50% { opacity: 1; }
}
.seat.current .seat-name { color: var(--accent); }
.seat[data-cue="deal"] .seat-identity::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: .15rem .28rem auto auto;
  width: .8rem;
  aspect-ratio: 5 / 7;
  border-radius: .13rem;
  background: url('/art/room-card.webp') center / 100% 100% no-repeat;
  box-shadow: -.18rem .12rem 0 #584369;
  pointer-events: none;
  animation: deal-to-seat 420ms ease-out var(--cue-delay, 0ms) both;
}
#yourCards[data-cue="deal"] .card { animation: deal-cards 210ms ease-out var(--cue-delay, 0ms) both; }
#yourCards[data-cue="deal"] .card:nth-child(2) { animation-delay: calc(var(--cue-delay, 0ms) + 45ms); }
#yourCards[data-cue="deal"] .card:nth-child(3) { animation-delay: calc(var(--cue-delay, 0ms) + 90ms); }
#yourCards[data-cue="look"] .card { animation: private-card-flip 270ms ease-out var(--cue-delay, 0ms) both; }
.seat:is([data-cue="call"], [data-cue="raise"], [data-cue="compare"]) .seat-nameplate {
  animation: action-gleam 330ms ease-out var(--cue-delay, 0ms) both;
}
.seat:is([data-cue="call"], [data-cue="raise"]) .seat-action { animation: action-gleam 330ms ease-out var(--cue-delay, 0ms) both; }
.seat[data-cue="compare"] .seat-nameplate { animation-duration: 480ms; }
.seat[data-ante-cue] .seat-nameplate { animation: action-gleam 310ms ease-out calc(var(--cue-delay, 0ms) + 120ms) both; }
.seat:is([data-cue="fold"], [data-cue="timeout"]) .seat-identity {
  animation: fold-out 300ms ease-out var(--cue-delay, 0ms) both;
}
@keyframes deal-cards { from { opacity: .58; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes deal-to-seat { 0% { opacity: 0; transform: translate(-.65rem, -.55rem) rotate(-13deg); } 38% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes private-card-flip { from { transform: perspective(150px) rotateY(88deg); } to { transform: none; } }
@keyframes action-gleam { from { filter: brightness(1.46); } to { filter: none; } }
@keyframes fold-out { from { filter: brightness(1.25); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .seat[data-cue] :is(.seat-identity, .seat-nameplate, .seat-action), #yourCards[data-cue] .card { animation: none !important; }
  .seat[data-cue="deal"] .seat-identity::after { display: none; }
}
.seat.inactive-seat .avatar-art { opacity: .45; filter: grayscale(.9) brightness(.72); }
.seat.inactive-seat .seat-nameplate:not(.seat-reveal) { opacity: .6; filter: saturate(.2); }
.seat.inactive-seat .seat-badges { opacity: .5; }
.inactive-mark {
  position: absolute;
  z-index: 3;
  top: max(.18rem, calc(var(--portrait-slot) - .72rem));
  left: 50%;
  translate: -50% 0;
  rotate: -7deg;
  padding: .08rem .35rem;
  border: 1px solid #a99aaf;
  border-radius: .23rem;
  background: #292435eb;
  color: #eee5ed;
  font-size: .62rem;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px #130e23a6;
}
.seat-info { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .08rem .2rem; }
.seat-connection { display: inline-flex; align-items: center; gap: .15rem; color: #cbbbd3; font-size: .57rem; line-height: 1.1; white-space: nowrap; }
.seat-connection::before { content: ''; width: .25rem; height: .25rem; border: 1px solid #c6b7ce; border-radius: 50%; background: #52455e; }
.seat-reason { color: #c9bbce; font-size: .62rem; }
.seat.waiting-seat .avatar-art { opacity: .74; filter: saturate(.55); }
.seat.waiting-seat .seat-nameplate { opacity: .85; }
.seat.waiting-seat .seat-state-label { padding: .07rem .3rem; border: 1px solid #9582a14d; border-radius: var(--radius-pill); background: #3c314866; }
.seat.funding-seat .seat-nameplate { border-color: #c3a36a; background: linear-gradient(#53414f, #35283f); }
.seat.funding-seat .seat-state-label, .seat-countdown { color: var(--chip-gold); font-size: .63rem; }
.seat-action[data-tone="inactive"] { color: var(--muted); font-weight: 400; }
.seat.inactive-seat .seat-action { color: #d5cbd9; background: #4d4358; font-weight: 400; }
.seat.comparison-option .seat-nameplate {
  border-color: #d3bee6;
  background: linear-gradient(180deg, #685478, #40324f);
  box-shadow: inset 0 1px #f2e5ff38, 0 0 0 2px #c4a4e024, 0 2px 4px #170d2580;
}
.seat.comparison-option .avatar-art { filter: drop-shadow(0 0 3px #d3b4ed70); }
.compare-seat-hint { padding: .1rem .36rem; border: 1px solid #bda5d278; border-radius: var(--radius-pill); background: #49395b; color: #f2e4ff; font-size: .65rem; line-height: 1.15; }
.seat.comparison-target .seat-nameplate {
  border-color: var(--accent);
  background: linear-gradient(180deg, #74604f, #473549);
  box-shadow: inset 0 1px #ffe6b34d, 0 0 0 2px #ffd59850, 0 2px 5px #170d2580;
}
.seat.comparison-target .compare-seat-hint { background: var(--accent); border-color: var(--gold-edge); color: var(--accent-text); }
@container table-stage (min-height: 376px) and (max-height: 500px) {
  #seats { --portrait-slot: clamp(1.35rem, calc(var(--slot-height) - 4.25rem), 3.55rem); --nameplate-height: 2.05rem; }
  .seat-nameplate { gap: .04rem; padding-block: .07rem .1rem; }
  .seat-body { gap: .1rem; padding-top: .18rem; }
  .seat-result { gap: .04rem; padding-top: 0; }
  .seat-result .seat-action { font-size: .62rem; }
  .seat .seat-cards .card { font-size: .71rem; }
}
@container table-stage (max-height: 375px) {
  #seats { --seat-gap: .18rem; --nameplate-height: 1.65rem; }
  .seat {
    --portrait-slot: clamp(1.23rem, calc(var(--slot-height) - 4.18rem), 2.42rem);
    padding-block: .16rem .05rem;
  }
  .seat-identity .avatar-art { max-width: 83%; }
  .seat-nameplate { gap: 0; padding: .05rem .075rem; line-height: 1.06; }
  .empty-seat .seat-nameplate { font-size: .72rem; }
  .seat-name { font-size: .72rem; }
  .seat-chips { column-gap: .23rem; font-size: .61rem; }
  .seat-chips > span { gap: .12rem; }
  .seat-body { gap: .08rem; padding-top: .14rem; }
  .seat-result { gap: .02rem; padding-top: 0; }
  .seat .seat-action { font-size: .62rem; }
  .seat .seat-cards .card { font-size: .65rem; }
  .table-felt { padding-block: .42rem; }
}
.room-dock { position: relative; z-index: 1; padding-top: .25rem; }
.room-dock > #leaveRoomPrimary { width: 100%; min-height: 3rem; }
.table-log {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  gap: .14rem;
  border-top: 1px solid #ad93bd2b;
  padding-top: .28rem;
}
.table-log p { flex: none; }
.table-log > button { flex: none; }
.table-felt:is([data-state="ready"], [data-state="lobby-wait"], [data-state="waiting"], [data-state="funding"], [data-state="finished"]) .table-log {
  justify-content: center;
  border: 0;
  padding: 0;
  gap: .3rem;
}
.table-log .table-connection { color: #d8c1a6; font-size: .6rem; line-height: 1.15; padding: .12rem .15rem; border-radius: .25rem; background: #3c304480; }
.table-log .table-detail { font-size: .65rem; line-height: 1.2; }
.table-last-result { max-height: 2.5em; overflow: auto; font-size: .62rem; line-height: 1.2; overflow-wrap: anywhere; scrollbar-width: thin; }
.table-felt[data-state="finished"] #turnLabel { color: var(--text); }
.table-log.lobby-wait { border: 0; padding: 0; }
.table-log.has-winners { flex: 1; min-height: 0; gap: .15rem; }
.has-winners #turnLabel { font-size: .74rem; color: var(--accent); }
.winner-spotlight {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
  min-width: 0;
  min-height: 0;
  padding: .18rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: radial-gradient(ellipse 50% 50% at center, #e8ba6514, #4934491a 60%, transparent 100%);
}
.victory-title { flex: none; color: #ffe6b5; font-size: .64rem; line-height: 1.15; letter-spacing: .06em; }
.victory-title::before, .victory-title::after { content: '✧'; margin-inline: .2em; color: #d9b87b; }
.victory-list { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d8b87e66 transparent; }
.victory-player { display: flex; align-items: center; justify-content: center; gap: .24rem; min-width: 0; padding: .1rem 0; }
.victory-player + .victory-player { border-top: 1px solid #d4b77d26; }
.victory-player .avatar-art { flex: none; width: 2rem; filter: drop-shadow(0 0 4px #ffce7780); }
.victory-details { display: grid; min-width: 0; text-align: start; gap: .08rem; }
.victory-name { color: #fff2d9; font-size: .74rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.victory-amount { color: #ffd58e; font-size: .69rem; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.winner-spotlight.celebrating { animation: victory-arrive 650ms ease-out calc(-1 * var(--victory-elapsed, 0ms)) both; }
.winner-spotlight.celebrating::after {
  content: '✦'; position: absolute; top: .15rem; right: .3rem; color: #ffe7b4;
  pointer-events: none; animation: winner-sparkles 1.3s ease-out both;
}
@container table-stage (min-height: 376px) {
  #seats[data-sides="2"] .winner-spotlight[data-count="1"] .victory-player { flex-direction: column; gap: .12rem; }
  #seats[data-sides="2"] .winner-spotlight[data-count="1"] .avatar-art { width: clamp(2.2rem, 8cqh, 3.5rem); }
  #seats[data-sides="2"] .winner-spotlight[data-count="1"] .victory-details { max-width: 100%; text-align: center; }
}
@container table-stage (max-height: 375px) {
  .hand-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding-inline: .1rem; font-size: .61rem; letter-spacing: 0; white-space: nowrap; }
  .table-felt:has(.has-winners) .hand-tag { max-width: 100%; padding-inline: .1rem; font-size: .61rem; letter-spacing: 0; white-space: nowrap; }
  .winner-spotlight { padding: .12rem; gap: .1rem; }
  .victory-title { font-size: .59rem; letter-spacing: 0; }
  .victory-player { gap: .18rem; padding-block: .05rem; }
  .victory-player .avatar-art { width: 1.4rem; }
  .victory-name { font-size: .62rem; line-height: 1.1; }
  .victory-amount { font-size: .6rem; line-height: 1.1; }
}
.seat.winning-seat {
  position: relative;
  border: 1px solid #efd18c;
  background: radial-gradient(ellipse at 50% 20%, #ffd98430, transparent 75%);
  box-shadow: inset 0 0 0 2px #efc76b29, inset 0 0 13px #e8b75430;
}
.seat.winning-seat .avatar-art { filter: drop-shadow(0 0 5px #ffd583cc); }
.seat.winning-seat .seat-nameplate:not(.seat-reveal) { border-color: #ebcd87; background: linear-gradient(#6a554f, #3a2c3f); }
.seat.winning-seat .seat-name { color: #ffe5ad; }
.seat.winning-seat .seat-action { background: linear-gradient(#ffe9b8, #eac279); color: #513117; box-shadow: 0 0 5px #e8b95d55; }
.seat.winning-seat.winner-entrance { animation: winner-glow 1.5s ease-out calc(-1 * var(--victory-elapsed, 0ms)) both; }
.seat.winner-entrance::after {
  content: '✦ · ✧ · ✦';
  position: absolute;
  inset: 3px 0 auto;
  color: #ffe4a5;
  font-size: .8rem;
  letter-spacing: .13em;
  pointer-events: none;
  animation: winner-sparkles 1.3s ease-out calc(-1 * var(--victory-elapsed, 0ms)) both;
}
@keyframes victory-arrive { from { opacity: .4; transform: translateY(5px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes winner-glow { 0%, 35% { box-shadow: inset 0 0 0 2px #ffe8ad99, inset 0 0 22px #f1c45a88; } 100% { box-shadow: inset 0 0 0 2px #efc76b29, inset 0 0 13px #e8b75430; } }
@keyframes winner-sparkles { from { opacity: 0; transform: translateY(15px) scale(.7); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-3px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .winner-spotlight.celebrating, .winner-spotlight.celebrating::after, .seat.winning-seat.winner-entrance, .seat.winner-entrance::after { animation: none; }
  .winner-spotlight.celebrating::after, .seat.winner-entrance::after { display: none; }
}
.room-settings-brief { display: inline-flex; align-items: center; gap: .2rem; }
.room-separator { color: #b19cbc; }
.room-brief { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: clamp(.35rem, 2vw, .68rem); min-width: 0; font-size: .76rem; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.room-brief > span { text-shadow: 0 1px 3px #161021; }
#roomLimit { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#copyRoomCode { display: inline-flex; align-items: center; gap: .28rem; min-height: 2.75rem; padding: .2rem .3rem; border: 0; color: var(--accent); background: transparent; }
#roomCode { letter-spacing: .04em; }
.copy-icon { position: relative; width: .76rem; height: .78rem; flex: none; }
.copy-icon::before, .copy-icon::after { content: ''; position: absolute; width: .51rem; height: .6rem; border: 1px solid currentColor; border-radius: .12rem; }
.copy-icon::before { right: 0; top: 0; }
.copy-icon::after { left: 0; bottom: 0; background: #282139; }
#turnLabel { max-height: 2.36em; overflow: auto; overflow-wrap: anywhere; font-size: .79rem; line-height: 1.18; font-weight: 690; }
#turnLabel.your-turn { color: var(--accent); }
#turnLabel.turn-urgent { color: var(--danger); }
.table-pot {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  width: fit-content;
  max-width: 100%;
  padding: .2rem .56rem;
  border: 1px solid var(--gold-edge);
  border-radius: .7rem / .58rem;
  background: #40364f;
  box-shadow: inset 0 1px #f9d6a82b, 0 2px 2px #2116285e;
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: clamp(.83rem, 4vw, 1.1rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.table-pot .chip-symbol { color: var(--chip-gold); }
#pot { min-width: 0; }
.pot-digit {
  display: inline-block;
  height: 1lh;
  overflow: hidden;
  vertical-align: bottom;
}
.pot-reel { display: block; position: relative; }
.pot-reel::before {
  content: attr(data-previous);
  position: absolute;
  inset-inline: 0;
  inset-block-end: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .pot-reel { animation: pot-roll .32s cubic-bezier(.18, .74, .29, 1) both; }
}
@keyframes pot-roll {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
#handLog {
  margin: 0;
  padding: 0 .35rem;
  height: 4.96em;
  min-height: 0;
  font-size: .7rem;
  line-height: 1.24;
  list-style: none;
  text-align: start;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
#handLog .hand-log-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: .6em;
}
.hand-log-name {
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hand-log-description { min-width: 0; text-align: start; }
#handLog:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.cards { display: flex; gap: .25rem; }
.card {
  position: relative;
  display: inline-grid;
  grid-auto-rows: min-content;
  place-content: center;
  justify-items: center;
  width: 2.5rem;
  height: 3rem;
  background: var(--card);
  border: 1px solid #d8a973;
  border-radius: .32rem;
  color: #352343;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: .97;
  box-shadow: inset 0 -2px #d9b89a;
}
.card.red { color: #9b2948; }
.card-suit { font-family: inherit; font-size: 1.02em; }
.card.back {
  background: url('/art/room-card.webp') center / 100% 100% no-repeat;
  border: 0;
  box-shadow: 0 2px 3px #1610208c;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.controls {
  position: relative;
  display: flex;
  flex-direction: column;
  block-size: clamp(11.4rem, 26dvh, 12rem);
  margin: 0;
  padding: .45rem .68rem .5rem;
  border-color: #a58ab5;
  border-radius: 1.05rem;
  background: linear-gradient(155deg, #ac93c744, #8673ad12 55%, #211a3633), var(--cloth), #3d3555;
  box-shadow: inset 0 0 0 3px #9e86b431, inset 0 0 0 4px #ded0f035, 0 3px 5px #100c20a1;
}
.controls.own-turn {
  --turn-shine: var(--accent);
  --turn-edge: color-mix(in srgb, var(--accent) 38%, transparent);
}
.controls.urgent-turn { --turn-edge: color-mix(in srgb, var(--accent) 72%, transparent); }
.controls.own-turn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--turn-edge);
  pointer-events: none;
}
@property --turn-sweep {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes turn-sweep { to { --turn-sweep: 360deg; } }
@supports (mask-composite: exclude) {
  @media (prefers-reduced-motion: no-preference) {
    .controls.own-turn::after {
      padding: 2px;
      background: conic-gradient(from var(--turn-sweep), var(--turn-edge) 0% 63%,
        var(--turn-shine) 88%, #fff4de 95%, var(--turn-edge) 100%);
      mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
      mask-composite: exclude;
      animation: turn-sweep 5s linear infinite;
    }
  }
}
.controls .your-status, .controls .utility { flex: none; }
.turn-actions {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-inline: -.22rem;
  padding-inline: .22rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
.utility { display: flex; flex-wrap: wrap; gap: .4rem; }
#moves, #comparePanel { flex: none; margin: auto 0 .3rem; }
#moves { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .28rem; }
#moves:empty { display: none; }
#moves button { min-width: 0; font-size: .86rem; line-height: 1.18; overflow-wrap: anywhere; padding-inline: .3rem; }
#moves .raise-move { background: #624345; color: #ffe0bc; border-color: #a77a70; }
#moves .compare-move { background: var(--selected-surface); color: #f5dfff; border-color: var(--edge); }
#moves .fold-move { background: var(--surface); color: var(--danger); border-color: var(--danger-edge); }
#comparePanel .row { justify-content: space-between; }
#comparePanel > .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: .28rem; }
#compareTarget { display: grid; align-content: center; margin: 0; min-width: 0; min-height: var(--control-height); padding: .4rem .45rem; border: 1px solid var(--border); border-radius: var(--radius-action); background: #30263c80; color: var(--muted); font-size: .86rem; line-height: 1.12; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cancelCompare { flex: none; min-height: var(--control-height); padding: .4rem .45rem; font-size: .86rem; border-radius: var(--radius-action); }
.controls:has(#compareForm:not([hidden])) #yourAmounts .seat-action { display: none; }
#comparePanel:has(#compareForm:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .13rem .25rem; align-items: end; }
#comparePanel:has(#compareForm:not([hidden])) > div.row { display: contents; }
#comparePanel:has(#compareForm:not([hidden])) #compareTarget { grid-column: 1 / -1; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: .77rem; line-height: 1.2; }
#comparePanel:has(#compareForm:not([hidden])) #cancelCompare { grid-column: 2; grid-row: 2; min-height: var(--control-height); }
#compareForm { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.5rem, .95fr); align-items: stretch; min-width: 0; gap: .22rem; }
#compareForm label { display: flex; align-items: center; gap: .23rem; font-size: .72rem; }
#compareForm label span { flex: none; }
#compareForm input { min-width: 2.6rem; padding-inline: .35rem; }
#submitCompare { width: 100%; padding: .3rem .41rem; font-size: .86rem; line-height: 1.12; }
#submitCompare.compare-cover { font-size: .72rem; }
.utility { justify-content: flex-end; gap: .3rem; padding-top: .4rem; border-top: 1px solid #b19ac244; }
.utility .chat-content { width: 100%; }
.utility .chat-log { display: none; }
#room[data-dock="chat"] .turn-actions { flex: none; }
#room[data-dock="chat"] #moves button { min-height: 2.25rem; }
#room[data-dock="chat"] #moves { min-height: 0; margin: .05rem 0 .2rem; }
#room[data-dock="chat"] .table-chat, .room-dock:has(#leaveRoomPrimary:not([hidden])) .table-chat { display: none; }
.spectator-dock, .spectator-chat, .spectator-chat .chat-content { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.spectator-title { display: flex; align-items: center; gap: .42rem; flex: none; margin: .25rem .17rem .14rem; color: var(--text); font-family: var(--font-ui); font-size: .88rem; line-height: 1.36; font-weight: 800; }
#seatsFull { margin-inline-start: auto; font-family: var(--font-ui); font-size: .72rem; font-weight: 400; }
.table-chat { position: absolute; inset-inline: .65rem; bottom: 100%; pointer-events: none; }
.floating { display: grid; justify-items: start; gap: .1rem; padding-bottom: .25rem; }
.float-message { display: block; text-align: left; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: .76rem; line-height: 1.2; padding: .12rem .42rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: enter .22s ease-out, vanish .6s 4.4s forwards; }
@keyframes enter { from { transform: translateY(.45rem); opacity: 0; } }
@keyframes vanish { to { transform: translateY(-.4rem); opacity: 0; } }
dialog { width: min(calc(100% - 1.4rem), 31rem); max-height: 90dvh; overflow-y: auto; background: var(--surface-sheen), var(--cloth), var(--surface); background-blend-mode: normal, soft-light, normal; color: var(--text); border: 1px solid var(--edge); border-radius: var(--radius-panel); padding: 1rem; box-shadow: var(--panel-depth), 0 12px 32px #110b1b89; }
dialog::backdrop { background: #170f24bf; }
dialog > h2, dialog > form > h2, .dialog-heading { padding-bottom: .4rem; border-bottom: 1px dashed var(--border); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.dialog-heading h2 { min-width: 0; margin: 0; }
.dialog-heading button { flex: none; border-radius: var(--radius-pill); }
#tableSoundOptions { display: grid; gap: .24rem; margin-top: .4rem; }
.sound-option { display: flex; justify-content: space-between; align-items: center; min-height: 3rem; padding-inline: .2rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.sound-option input {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.55rem;
  height: 1.5rem;
  min-height: 0;
  margin: .25rem .1rem;
  padding: 0;
  border: 1px solid #8e7a9d;
  border-radius: var(--radius-pill);
  background: #30263e;
  box-shadow: inset 0 1px 3px #160e2566;
  cursor: pointer;
}
.sound-option input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: #c9b7d2;
  box-shadow: 0 1px 2px #160e2580;
  transition: transform .16s ease, background-color .16s ease;
}
.sound-option input:checked { background: #b9955b; border-color: #e9ca91; box-shadow: inset 0 1px #ffe6b24d; }
.sound-option input:checked::before { transform: translateX(1.05rem); background: #fff0d3; }
@media (prefers-reduced-motion: reduce) { .sound-option input::before { transition: none; } }
@media (forced-colors: active) {
  .sound-option input { forced-color-adjust: none; border-color: ButtonText; background: Canvas; box-shadow: none; }
  .sound-option input::before { background: ButtonText; box-shadow: none; }
  .sound-option input:checked { border-color: Highlight; background: Canvas; }
  .sound-option input:checked::before { background: Highlight; }
}
.table-voice-style, .table-voice-volume, .table-music-tracks { min-width: 0; display: grid; gap: .3rem; margin: .2rem 0 0; padding: 0; border: 0; }
.table-voice-style { grid-template-columns: repeat(4, minmax(0, 1fr)) 3rem; }
.table-voice-volume { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block-end: .3rem; font-size: .85rem; }
.table-voice-volume legend, .table-music-tracks legend { margin-block-end: .28rem; }
:is(.table-voice-style, .table-voice-volume) label { position: relative; cursor: pointer; }
:is(.table-voice-style, .table-voice-volume) input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
:is(.table-voice-style, .table-voice-volume) label span, #previewTableVoice { display: grid; place-items: center; min-height: 2.65rem; padding: .2rem; border: 1px solid var(--border); border-radius: var(--radius-field); }
:is(.table-voice-style, .table-voice-volume) input:checked + span { border-color: var(--selected-edge); background: var(--selected-surface); color: var(--accent); }
:is(.table-voice-style, .table-voice-volume) input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
#previewTableVoice { width: 3rem; height: 3rem; min-height: 3rem; padding: .65rem; border-radius: var(--radius-pill); color: var(--accent); }
#previewTableVoice svg { width: 100%; height: 100%; }
#tableVoiceHint { margin: 0 .2rem .2rem; font-size: .76rem; }
.table-music-tracks { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: .85rem; }
.table-music-tracks label { display: flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.65rem; padding: .2rem; border: 1px solid var(--border); border-radius: var(--radius-field); cursor: pointer; }
.table-music-tracks input { flex: none; width: .9rem; height: .9rem; min-height: 0; margin: 0; accent-color: var(--accent); cursor: inherit; }
.table-music-tracks label:has(:checked) { border-color: var(--selected-edge); background: var(--selected-surface); color: var(--accent); }
.table-music-tracks label:has(:disabled) { cursor: default; }
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding-top: .4rem; border-top: 1px solid var(--border); }
#betForm { gap: 0; }
#betTitle { margin: 0; }
.bet-picker { display: grid; justify-items: center; gap: .4rem; padding-block: .55rem; touch-action: none; cursor: ns-resize; }
.bet-selected { display: flex; align-items: center; gap: .42rem; color: var(--accent); font-size: 1.9rem; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bet-selected .chip-symbol { width: .58em; }
#betLimits { margin: 0; text-align: center; font-size: .78rem; }
.bet-slider {
  display: grid;
  justify-items: center;
  gap: .12rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-plaque);
  background: var(--background);
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
#betAmount {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 2.7rem;
  height: clamp(6rem, 19dvh, 8rem);
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  touch-action: none;
  cursor: ns-resize;
}
#joinForm input { letter-spacing: .085em; font-variant-numeric: tabular-nums; }
#createDialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#createDialog h2 { flex: none; margin-bottom: .48rem; }
.room-settings { display: flex; flex-direction: column; min-height: 0; gap: .52rem; }
.create-options { display: grid; gap: .44rem; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.setup-group {
  min-inline-size: 0;
  margin: 0;
  padding: .29rem .52rem .48rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-plaque);
  background: var(--background);
}
.setup-group { display: grid; gap: .35rem; }
.setup-group legend { padding: 0 .24rem; color: var(--accent); font-size: .82rem; font-weight: 700; }
.setup-choices { display: grid; gap: .25rem; }
.seat-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mode-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.response-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setup-response { display: grid; gap: .4rem; margin-bottom: .4rem; font-size: .83rem; }
.setup-choices label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 2.65rem;
  padding: .27rem .08rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  background: var(--raised);
  color: var(--text);
  font-size: .84rem;
  cursor: pointer;
  box-shadow: inset 0 -2px #1a10294d;
}
.setup-choices label:has(:checked) { border-color: var(--selected-edge); color: var(--accent); background: var(--selected-surface); font-weight: 750; }
.setup-choices label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.setup-choices input { min-height: 0; padding: 0; }
.setup-number { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.6rem, 42%); align-items: center; font-size: .83rem; }
.setup-number :is(input, .setup-value) { min-height: 2.55rem; padding: .3rem .4rem; text-align: end; font-variant-numeric: tabular-nums; }
.setup-value { display: grid; align-content: center; border: 1px solid var(--border); border-radius: var(--radius-field); background: var(--background); color: var(--text); font-size: 16px; }
.setup-label { display: inline-flex; align-items: center; gap: .3rem; }
.setup-help { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; min-height: 0; padding: 0; border-radius: 50%; color: var(--muted); font-size: .78rem; font-weight: 750; }
.setup-infinity { display: grid; align-items: center; justify-items: end; min-height: 2.55rem; padding-inline: .4rem; border: 1px solid var(--border); border-radius: var(--radius-field); color: var(--accent); background: var(--background); font-size: 1.2rem; }
.room-settings .checkbox-field { min-height: 2rem; font-size: .83rem; color: var(--muted); }
.room-settings .dialog-actions { flex: none; }
#chatDialog { margin-block: auto max(1rem, env(safe-area-inset-bottom, 0px)); }
.chat-composer { --composer-height: 2.7rem; --composer-label-size: .91rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem; }
.chat-log { overflow-y: auto; max-height: 42vh; min-height: 7rem; overflow-wrap: anywhere; padding: .4rem 0; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.chat-log:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.chat-line, .chat-empty { margin: 0 0 .18rem; }
.chat-author { color: var(--accent); }
#chatForm input { min-width: 0; }
.chat-composer button { white-space: nowrap; }
.spectator-chat .chat-content { position: relative; --composer-height: 2.7rem; gap: .26rem; }
.spectator-chat .chat-log { flex: 1; min-height: 0; max-height: none; padding: .24rem .24rem .16rem; font-size: .82rem; line-height: 1.32; }
.spectator-chat .chat-log p { font-size: inherit; }
.chat-composer > * { min-height: var(--composer-height); }
.chat-composer input { background: #20192fba; border-color: #a68ebd96; border-radius: var(--radius-plaque); }
.chat-composer input::placeholder { font-size: var(--composer-label-size); }
.chat-composer button { padding: .26rem .62rem; border-radius: var(--radius-pill); font-size: var(--composer-label-size); }
.standings { width: 100%; text-align: right; border-collapse: collapse; font-size: .86rem; overflow-wrap: anywhere; }
.standings th:first-child, .standings td:first-child { text-align: left; }
.standings td, .standings th { padding: .3rem .15rem; border-bottom: 1px solid var(--border); }
.summary-identity { display: inline-flex; align-items: center; gap: .28rem; }
.summary-identity .avatar-art { width: 1.35rem; }
.standing-rank { color: var(--accent); font-weight: 750; font-variant-numeric: tabular-nums; }
.standings-history { margin-top: .65rem; }
:is(#historyDialog, #standings, #rulesDialog)[open] { display: flex; flex-direction: column; gap: .65rem; max-height: 85dvh; overflow: hidden; }
:is(#historyDialog, #standings, #rulesDialog) .dialog-heading { flex: none; }
#standingsContent > p:first-child { margin: 0 0 .25rem; }
.standings-footer { flex: none; border-top: 1px solid var(--border); padding-top: .5rem; }
.standings-footer button { width: 100%; }
#historyTurn { margin: 0; background: var(--accent); color: var(--accent-text); padding: .4rem .65rem; border-radius: var(--radius-action); }
.history-scroll, .rules-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.rules-content { font-size: .9rem; line-height: 1.55; padding-inline-end: .3rem; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.rules-content p { margin: .2rem 0 0; }
.rules-content .rules-room-settings { margin: 0; padding: .35rem .55rem; border-radius: var(--radius-field); background: var(--raised); color: var(--accent); }
.rules-content section { margin-block-start: .7rem; }
.rules-content h3 { margin: 0; font-size: .95rem; }
.rules-ranks { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .65rem; margin: .3rem 0; }
.rules-ranks dt { font-weight: 700; }
.rules-ranks dd { margin: 0; }
#historyDialog .history-scroll { font-size: .84rem; line-height: 1.4; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
#historySelection select { min-height: 2.35rem; padding-block: .24rem; }
#historyDetail h3 { margin: .55rem 0 .25rem; font-size: .91rem; }
#historyDetail p { margin: .25rem 0; }
.history-players { list-style: none; padding: 0; margin: 0; }
.history-players li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: baseline; padding: .28rem 0; border-bottom: 1px solid var(--border); }
.history-players li > :first-child { overflow-wrap: anywhere; }
.history-hand-text { display: inline-flex; justify-content: flex-end; gap: .3rem; color: #ffe8b7; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-hand-text.muted { color: var(--muted); font-size: .78rem; font-weight: 400; }
.history-red-suit { color: #f7aab6; }
.history-actions { padding-inline-start: 1.4rem; margin: 0; }
.history-actions li { padding: .13rem 0; overflow-wrap: anywhere; }
.profile-card {
  display: grid;
  justify-items: center;
  gap: .38rem;
  overflow-wrap: anywhere;
  text-align: center;
  padding: .65rem .85rem;
}
#profile { margin-top: clamp(3.1rem, 12vh, 6.25rem); }
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .3rem;
}
.profile-actions button {
  min-width: 6rem;
  border-color: var(--edge);
  border-radius: var(--radius-pill);
  background: #2b1d3ce8;
  color: var(--text);
}
.profile-actions #logout { color: var(--muted); border-color: var(--border); }
.profile-actions #editProfile { color: var(--accent); border-color: var(--selected-edge); }
.profile-appearance { display: inline-grid; place-items: center; width: 4.6rem; aspect-ratio: 1; border: 1px solid var(--edge); border-radius: var(--radius-plaque); background: #2b1f3a; }
.profile-appearance .avatar-art { width: 4.25rem; }
#profileAppearance {
  width: clamp(7rem, 26vw, 8.5rem);
  border-radius: 50%;
  border: 1px solid #bb906196;
  box-shadow: 0 0 0 4px #3e254e8f, inset 0 -3px #10091f59;
  background: radial-gradient(circle at 50% 30%, #74508793, #281a37a8 75%);
}
#profileAppearance .avatar-art { width: 92%; }
#profileName { font-family: var(--font-ui); font-weight: 900; font-size: 1.6rem; color: #ffedcb; text-shadow: 0 1px #21152f; }
.profile-form { margin-top: .65rem; }
.profile-editor-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: center; }
.profile-editor-identity .profile-appearance { width: 4.15rem; }
.profile-editor-identity .avatar-art { width: 3.95rem; }
.profile-editor-identity .muted { margin: .25rem 0 0; }
.appearance-picker { position: relative; min-inline-size: 0; border: 0; margin: 0; padding: .45rem 0 0; }
.appearance-picker legend { padding: 0; font-weight: 700; }
.appearance-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(4.75rem, 27%, 5.85rem);
  gap: .43rem;
  padding: 0 0 .25rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) var(--background);
}
.appearance-choice {
  position: relative;
  display: grid;
  gap: .12rem;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding: .25rem .15rem .35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-plaque);
  background: var(--background);
  color: var(--muted);
  font-size: .79rem;
  white-space: nowrap;
  scroll-snap-align: start;
  cursor: pointer;
}
.appearance-choice .avatar-art { width: min(100%, 3.8rem); }
.appearance-choice:has(input:checked) { border-color: var(--selected-edge); color: var(--accent); background: var(--selected-surface); box-shadow: inset 0 0 0 2px #f4ce9d20; }
.appearance-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.appearance-choice input { min-height: 0; padding: 0; }
.picker-arrows { display: flex; gap: .28rem; position: absolute; top: -1.57rem; inset-inline-end: 0; }
.picker-arrows button { display: grid; place-items: center; width: 2.25rem; min-height: 1.7rem; padding: 0; border-radius: var(--radius-pill); font-size: 1.23rem; line-height: 1; }
.game-history { margin: 0; padding: 0; list-style: none; }
.game-history-row { display: flex; justify-content: space-between; align-items: center; gap: .4rem; width: 100%; min-height: 2.45rem; padding: .28rem .32rem; font-size: .82rem; text-align: left; white-space: nowrap; border-radius: 0; border-width: 0 0 1px; background: transparent; }
.game-history-row strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.game-history-row span { overflow: hidden; text-overflow: ellipsis; }
#summaryDialog[open] { display: flex; flex-direction: column; max-height: 85dvh; gap: .65rem; }
#summaryContent > h2 { margin: .7rem 0 .4rem; }
.summary-player { padding: .25rem; text-align: left; color: var(--accent); overflow-wrap: anywhere; }
.profile-history { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.profile-history > li { display: grid; justify-items: start; gap: .2rem; padding: .45rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.player-hand-actions { padding-inline-start: 1.2rem; margin: 0; }
@media (hover: hover) {
  .empty-seat:enabled:hover .seat-nameplate { background: var(--selected-surface); border-color: var(--accent); }
  .room-menu-items > :is(a, button):hover { background: var(--raised); border-color: var(--border); }
  :is(button:not(.seat):enabled, .link-button):hover { filter: brightness(1.07); }
  :is(button:not(.seat), .link-button):active { filter: brightness(.9); }
}
@media (max-height: 620px) {
  #moves, #comparePanel { margin-block: auto .1rem; }
  .utility { padding-top: .16rem; }
}
@media (max-width: 360px) {
  .app { --app-gutter: .45rem; }
  .app[data-screen="room"] .top { column-gap: .28rem; }
  .room-brief { gap: .31rem; font-size: .71rem; }
  .room-fund { max-width: 5.55rem; }
  button { padding-inline: .43rem; }
  #yourAmounts { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .float-message, .seat-cards.flipping .seat-card-turn, .seat.current .seat-identity::before { animation: none; }
}
