/* Rigged! — back-room casino. One deliberate dark look: felt, mahogany, brass, cream. */
:root {
  color-scheme: dark;
  --felt: #0f3b2e;
  --felt-hi: #165140;
  --felt-lo: #0a2a21;
  --room: #0b1310;
  --wood: #4a2417;
  --wood-hi: #6b3622;
  --brass: #c9a24a;
  --brass-hi: #e6c46d;
  --brass-lo: #8f7130;
  --cream: #f3e9d2;
  --cream-dim: #c9bfa6;
  --ink: #1b1410;
  --panel: #13201b;
  --panel-hi: #1a2b24;
  --line: #2c4038;
  --danger: #d9534f;
  --ok: #6fcf8e;
  --warn: #e8a33d;
  --ember: #e4572e;
  --tide: #2f86d6;
  --moss: #3fa45b;
  --dusk: #8d5bd1;
  --special: #1d1a17;
  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --text: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 12px;
  --card-w: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at 50% -10%, #17271f 0%, var(--room) 60%) fixed, var(--room);
  color: var(--cream);
  font: 15px/1.45 var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
#app { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 16px 32px; max-width: 1180px; margin: 0 auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font: 700 1.05rem/1.2 var(--text); letter-spacing: .02em; }
h3 { font: 700 .95rem/1.2 var(--text); margin-top: 18px; margin-bottom: 8px; color: var(--brass-hi); }
p { margin: 0; }
.muted { color: var(--cream-dim); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.sel { user-select: all; word-break: break-all; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 8px; }
.end { justify-content: flex-end; }
.spacer { flex: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--brass); font-weight: 700; }

/* ---------- controls ---------- */
.btn {
  font: 700 .9rem/1 var(--text); color: var(--cream); background: var(--panel-hi);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; cursor: pointer;
  min-height: 40px; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--brass-lo); background: #22372e; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .hand-card:focus-visible, .pile:focus-visible, .swatch-btn:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.btn.brass { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--ink); border-color: var(--brass-hi); box-shadow: 0 2px 0 var(--brass-lo); }
.btn.brass:hover:not(:disabled) { background: linear-gradient(180deg, #f0d27f, var(--brass-hi)); }
.btn.ghost { background: transparent; }
.btn.danger { background: #4a1d1b; border-color: #7a2f2b; }
.btn.small { padding: 7px 12px; min-height: 32px; font-size: .8rem; }
.btn.big { padding: 14px 26px; font-size: 1.05rem; }
.btn.on { background: var(--brass); color: var(--ink); border-color: var(--brass-hi); }
.btn.call { background: #3a1430; border-color: #7a2d66; }
.btn.call.armed { background: #c23b8a; border-color: #f07ac0; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
select, input[type=text], input[type=number] {
  font: 600 .9rem var(--text); color: var(--cream); background: var(--felt-lo); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-height: 36px; max-width: 100%;
}
select:disabled { opacity: .6; }
input[type=range] { accent-color: var(--brass); width: 100%; min-width: 0; }
input[type=checkbox] { accent-color: var(--brass); width: 18px; height: 18px; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.field > span { font-size: .8rem; color: var(--cream-dim); text-transform: uppercase; letter-spacing: .08em; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.field.inline > span { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--cream); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.check.big { padding: 10px 12px; background: var(--felt-lo); border-radius: 10px; border: 1px solid var(--line); }
.panel { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.alert { background: #3d1a18; border: 1px solid #7a2f2b; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font: 700 .68rem/1 var(--text); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 6px; background: #22342c; color: var(--cream-dim); white-space: nowrap; }
.tag svg { width: 12px; height: 12px; }
.tag.you { background: var(--brass); color: var(--ink); }
.tag.bot { background: #23303a; color: #b7cde0; }
.tag.warn { background: #3d2c12; color: var(--warn); }
.tag.call { background: #c23b8a; color: #fff; }
.tag.jump { background: var(--brass); color: var(--ink); animation: pulse 1s ease-in-out infinite; }
.tag.curse { background: #1d1720; color: var(--cream); border: 1px solid currentColor; }
.tag.curse.s-ember { color: var(--ember); } .tag.curse.s-tide { color: var(--tide); } .tag.curse.s-moss { color: var(--moss); } .tag.curse.s-dusk { color: var(--dusk); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 400 .85rem var(--display); background: var(--wood); color: var(--brass-hi); border: 2px solid var(--brass-lo); }

/* ---------- home ---------- */
.home { display: grid; gap: 18px; max-width: 760px; margin: 0 auto; }
.marquee { text-align: center; padding: 26px 0 6px; }
.logo { font: 400 clamp(3rem, 12vw, 5.5rem)/1 var(--display); color: var(--brass-hi); letter-spacing: .02em; text-shadow: 0 3px 0 var(--wood), 0 0 30px rgba(201, 162, 74, .25); transform: rotate(-3deg); display: inline-block; }
.logo span { color: var(--ember); }
.tagline { display: block; max-width: 52ch; margin: 18px auto 0; color: var(--cream-dim); font-size: 1rem; }
.home-panel { display: grid; gap: 18px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.home-card { display: grid; gap: 12px; align-content: start; background: var(--felt); background-image: radial-gradient(circle at 30% 20%, var(--felt-hi), var(--felt) 70%); border: 1px solid #1e5a47; border-radius: 14px; padding: 16px; }
.home-card p { color: var(--cream-dim); font-size: .92rem; }
.muted-card { background: var(--panel); background-image: none; border-color: var(--line); }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; font-family: var(--mono); letter-spacing: .25em; text-transform: uppercase; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto-body { display: grid; gap: 10px; margin-top: 10px; color: var(--cream-dim); max-width: 68ch; }
.howto-body ul, .specials { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.howto-body b, .specials b { color: var(--cream); }

/* ---------- lobby ---------- */
.lobby { display: grid; gap: 16px; }
.lobby-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.code { font: 400 clamp(2rem, 7vw, 3rem)/1 var(--display); color: var(--brass-hi); letter-spacing: .12em; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share { color: var(--cream-dim); font-size: .9rem; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.count { color: var(--cream-dim); font-weight: 600; margin-left: 6px; }
.seat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.seat-row { background: var(--felt-lo); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.seat-row.bot { border-color: #24363f; }
.seat-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seat-name { font-weight: 800; }
.traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.trait { display: grid; grid-template-columns: 82px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: .82rem; color: var(--cream-dim); }
.trait output { font-family: var(--mono); text-align: right; color: var(--cream); }
.trait .bar { height: 6px; background: #22342c; border-radius: 3px; overflow: hidden; }
.trait .bar i { display: block; height: 100%; background: var(--brass); }
.add-bot { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-bot select { flex: 1; min-width: 0; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { font-weight: 800; color: var(--brass-hi); padding: 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; display: flex; gap: 6px; align-items: center; }
.lobby-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.waiting { color: var(--cream-dim); font-style: italic; }

/* ---------- cards ---------- */
.card {
  --c: var(--special);
  position: relative; display: inline-block; flex: none; width: var(--card-w); aspect-ratio: 5 / 7; border-radius: 9px;
  background: var(--c); color: #fff; border: 3px solid var(--cream); box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.3);
  overflow: hidden; font-family: var(--display); user-select: none;
}
.card.t-ember { --c: var(--ember); } .card.t-tide { --c: var(--tide); } .card.t-moss { --c: var(--moss); } .card.t-dusk { --c: var(--dusk); }
.card.t-wild, .card.t-special {
  background: radial-gradient(circle at 50% 45%, #2c2620 0%, #14110e 70%);
  border-color: var(--brass);
}
.card.t-wild::before {
  content: ''; position: absolute; inset: 0;
  background: conic-gradient(from 45deg, var(--ember) 0 25%, var(--tide) 0 50%, var(--moss) 0 75%, var(--dusk) 0) top left / 18px 18px no-repeat;
  opacity: .0;
}
.card .chip {
  position: absolute; left: 50%; top: 50%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--cream); color: var(--c);
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--c), 0 0 0 5px rgba(255,255,255,.55), inset 0 0 0 2px rgba(0,0,0,.08);
  background-image: repeating-conic-gradient(from 0deg, transparent 0 20deg, rgba(0,0,0,.05) 20deg 30deg);
}
.card.t-wild .chip, .card.t-special .chip { background-color: #1b1714; color: var(--brass-hi); box-shadow: 0 0 0 2px var(--brass), 0 0 0 4px rgba(201,162,74,.3); }
.card .chip svg { width: 58%; height: 58%; }
.card .num { font: 400 calc(var(--card-w) * .36)/1 var(--display); color: var(--c); }
.card.t-wild .num, .card.t-special .num { color: var(--brass-hi); }
.card .num.plus { font-size: calc(var(--card-w) * .27); }
.card .wheel { width: 70%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--ember) 0 25%, var(--tide) 0 50%, var(--moss) 0 75%, var(--dusk) 0); box-shadow: 0 0 0 2px #1b1714; }
.card .idx { position: absolute; font: 400 calc(var(--card-w) * .2)/1 var(--display); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.4); display: grid; place-items: center; min-width: 14px; }
.card .idx svg { width: calc(var(--card-w) * .2); height: calc(var(--card-w) * .2); }
.card.t-wild .idx, .card.t-special .idx { color: var(--brass-hi); }
.card .idx.tl { left: 5px; top: 4px; }
.card .idx.br { right: 5px; bottom: 4px; transform: rotate(180deg); }
.card .cname { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font: 800 calc(var(--card-w) * .12)/1.05 var(--text); color: var(--brass-hi); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; }
.card.small { --card-w: 34px; border-width: 2px; border-radius: 5px; }
.card.small .cname, .card.small .idx { display: none; }
.card.back { background: repeating-linear-gradient(45deg, var(--wood) 0 6px, var(--wood-hi) 6px 12px); border-color: var(--cream); color: var(--brass); }
.card.back .backmark { position: absolute; inset: 18% 14%; border: 2px solid var(--brass); border-radius: 6px; display: grid; place-items: center; background: var(--wood); }
.card.back .backmark svg { width: 60%; height: 60%; }
.card.mini { --card-w: 22px; border-width: 2px; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.card.mini .backmark { inset: 16% 12%; border-width: 1px; border-radius: 3px; }
.card.empty { background: transparent; border: 2px dashed var(--line); box-shadow: none; }
.card.pop { animation: pop .35s ease-out; }

/* ---------- table ---------- */
.table-screen { display: grid; gap: 12px; }
.topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { font: 400 1.4rem/1 var(--display); color: var(--brass-hi); }
.brand span { color: var(--ember); }
.meta { color: var(--cream-dim); font-size: .85rem; }
.opponents { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.pod { flex: 1 0 150px; max-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; transition: border-color .2s, box-shadow .2s; }
.pod.turn { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201,162,74,.35), 0 0 22px rgba(201,162,74,.25); }
.pod.out { opacity: .5; }
.pod-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pod-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fan { display: flex; align-items: center; height: 34px; }
.fan .card + .card { margin-left: -12px; }
.fan .cnt { margin-left: 10px; font: 400 1.2rem var(--display); color: var(--cream); }
.pod-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.felt {
  position: relative; border-radius: 26px; padding: 18px 16px 14px;
  background: radial-gradient(ellipse at 50% 40%, var(--felt-hi) 0%, var(--felt) 55%, var(--felt-lo) 100%);
  border: 10px solid var(--wood); box-shadow: inset 0 0 0 2px var(--brass-lo), inset 0 10px 40px rgba(0,0,0,.45), 0 8px 30px rgba(0,0,0,.4);
  display: grid; gap: 10px; justify-items: center;
}
.rail { display: flex; gap: clamp(16px, 6vw, 60px); align-items: center; justify-content: center; flex-wrap: wrap; --card-w: clamp(64px, 16vw, 92px); }
.piles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pile { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 6px; border-radius: 12px; padding: 4px; }
.pile[disabled] { cursor: default; }
.pile .stack { position: relative; display: block; }
.pile .stack .card { box-shadow: 2px 2px 0 var(--cream-dim), 4px 4px 0 rgba(0,0,0,.4); }
.pile.live .stack .card { box-shadow: 2px 2px 0 var(--cream-dim), 4px 4px 0 rgba(0,0,0,.4), 0 0 0 3px var(--brass-hi), 0 0 18px rgba(230,196,109,.45); }
.pile.live:hover .stack .card { transform: translateY(-3px); transition: transform .15s; }
.pile-label { font: 700 .78rem var(--text); color: var(--cream-dim); }
.discard-wrap { display: grid; justify-items: center; gap: 8px; }
.discard { position: relative; width: calc(var(--card-w) + 24px); height: calc(var(--card-w) * 1.4 + 8px); }
.discard .card { position: absolute; left: 12px; top: 4px; }
.discard .card:nth-last-child(4) { transform: rotate(-14deg) translate(-6px, 2px); }
.discard .card:nth-last-child(3) { transform: rotate(9deg) translate(5px, 1px); }
.discard .card:nth-last-child(2) { transform: rotate(-5deg); }
.now { display: flex; align-items: center; gap: 8px; font-weight: 800; background: rgba(0,0,0,.25); border-radius: 999px; padding: 5px 12px 5px 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.swatch svg, .swatch-btn svg { width: 62%; height: 62%; }
.s-ember { --s: var(--ember); } .s-tide { --s: var(--tide); } .s-moss { --s: var(--moss); } .s-dusk { --s: var(--dusk); } .s-special { --s: #4a4038; }
.swatch { background: var(--s); }
.dir { font-size: 1.3rem; line-height: 1; color: var(--brass-hi); }
.stack-banner { font: 400 1.05rem var(--display); color: #fff; background: var(--danger); padding: 6px 16px; border-radius: 999px; box-shadow: 0 3px 0 #7a2f2b; animation: pulse 1.4s ease-in-out infinite; }
.status { text-align: center; font-weight: 700; min-height: 1.4em; }
.timer { color: var(--brass-hi); font-family: var(--mono); }
.timer.low { color: var(--danger); }
.ticker { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; text-align: center; font-size: .82rem; color: var(--cream-dim); max-width: 60ch; }
.ticker li:last-child { color: var(--cream); }
.me { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: grid; gap: 10px; }
.me.turn { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201,162,74,.3); }
.me.watching { text-align: center; color: var(--cream-dim); }
.me-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hand { display: flex; gap: 6px; overflow-x: auto; padding: 14px 4px 8px; min-height: 140px; align-items: flex-end; --card-w: clamp(62px, 15vw, 84px); scrollbar-width: thin; }
.hand-card { all: unset; position: relative; flex: none; cursor: pointer; border-radius: 10px; transition: transform .15s; }
.hand-card .card { filter: saturate(.55) brightness(.7); }
.hand-card.ok .card { filter: none; }
.hand-card.ok { transform: translateY(-8px); }
.hand-card.ok:hover { transform: translateY(-16px); }
.hand-card.ok .card { box-shadow: 0 0 0 3px var(--brass-hi), 0 8px 16px rgba(0,0,0,.4); }
.hand-card.fresh::after { content: 'new'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font: 800 .62rem/1 var(--text); text-transform: uppercase; background: var(--cream); color: var(--ink); padding: 3px 6px; border-radius: 6px; }
.dbl { position: absolute; right: -4px; top: -6px; background: var(--brass); color: var(--ink); font: 400 .7rem/1 var(--display); padding: 4px 5px; border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drawctl { display: flex; align-items: center; gap: 6px; background: var(--felt-lo); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.drawn-n { padding: 0 6px; font-weight: 700; }

/* ---------- drawer, sheet, overlay ---------- */
.drawer-scrim, .sheet-scrim { position: fixed; inset: 0; background: rgba(5, 10, 8, .62); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 41; overflow-y: auto;
  background: var(--panel); border-left: 2px solid var(--brass-lo);
  padding: calc(18px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
  display: grid; gap: 12px; align-content: start;
}
.drawer .close { justify-self: end; }
.log { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: .88rem; }
.log li { padding: 5px 8px; border-radius: 6px; background: var(--felt-lo); }
.k-host { color: var(--brass-hi); }
.k-bad { color: #ff9d97; }
.k-good { color: var(--ok); }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(620px, 100vw); max-height: 88vh; overflow-y: auto; z-index: 41;
  background: var(--panel); border: 2px solid var(--brass-lo); border-bottom: none; border-radius: 20px 20px 0 0;
  padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: grid; gap: 14px; animation: rise .2s ease-out;
}
.sheet-card { display: flex; gap: 14px; align-items: center; --card-w: 70px; }
.sheet-card p { color: var(--cream-dim); font-size: .9rem; margin-top: 4px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row .btn small { color: var(--cream-dim); margin-left: 4px; }
.swatch-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--felt-lo); border: 2px solid var(--line); font-weight: 800; }
.swatch-btn svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--s); color: #fff; }
.swatch-btn.on { border-color: var(--s); box-shadow: 0 0 0 2px var(--s); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2px 14px; }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 10, 8, .72); padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.result { width: min(560px, 100%); display: grid; gap: 12px; text-align: center; justify-items: center; animation: rise .25s ease-out; }
.winner { font: 400 clamp(1.6rem, 6vw, 2.4rem)/1.1 var(--display); color: var(--brass-hi); }
.reveal { list-style: none; padding: 0; margin: 0; width: 100%; display: grid; gap: 8px; text-align: left; }
.reveal li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; background: var(--felt-lo); border-radius: 10px; padding: 8px 10px; }
.rv-name { font-weight: 800; }
.rv-cards { grid-column: 1 / -1; display: flex; gap: 3px; flex-wrap: wrap; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; gap: 6px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: #1d2c25; border: 1px solid var(--brass-lo); border-radius: 12px; padding: 10px 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: rise .2s ease-out; }

@keyframes pop { 0% { transform: scale(1.25) rotate(-6deg); } 100% { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), 14px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.sheet { --tx: -50%; }
@keyframes pulse { 50% { opacity: .72; } }

/* ---------- stats, sign-in, sharing ---------- */
.home-stats { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--cream-dim); font-size: .92rem; flex: 1 1 260px; min-width: 0; }
.account span { min-width: 0; }
.invite { display: grid; gap: 10px; justify-items: start; border-color: var(--brass-lo); }
.invite h2 { font: 400 1.4rem/1.1 var(--display); color: var(--cream); }
.share-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px; }
.share-box > div { flex: 1 1 220px; min-width: 0; display: grid; gap: 6px; }
.qr { width: 132px; height: 132px; border-radius: 10px; flex: none; }
.share-url { font-size: .85rem; color: var(--cream); }
.brief { display: block; font: 600 .74rem/1.3 var(--text); color: var(--cream-dim); }
.seat-name { min-width: 0; }

.stats-page { display: grid; gap: 14px; max-width: 980px; margin: 0 auto; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--felt-lo); border: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab { all: unset; cursor: pointer; white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--cream-dim); border: 1px solid var(--line); background: var(--panel); }
.tab:hover { color: var(--cream); border-color: var(--brass-lo); }
.tab.on { background: var(--brass); color: var(--ink); border-color: var(--brass-hi); }
.tab:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.stats-body { display: grid; gap: 14px; min-width: 0; }
.stats-body h3, .drawer h3 { font: 400 1rem/1.2 var(--display); color: var(--brass-hi); letter-spacing: .04em; margin-top: 6px; }
.pad { padding: 18px 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--felt); background-image: radial-gradient(circle at 30% 20%, var(--felt-hi), var(--felt) 75%); border: 1px solid #1e5a47; min-width: 0; }
.tile-v { font: 400 1.5rem/1.1 var(--display); color: var(--cream); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-l { font-weight: 700; font-size: .82rem; color: var(--brass-hi); text-transform: uppercase; letter-spacing: .06em; }
.tile-s { font-size: .8rem; color: var(--cream-dim); }
.form { display: flex; flex-wrap: wrap; gap: 4px; }
.form .dot { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font: 800 .66rem/1 var(--text); background: #2a2320; color: var(--cream-dim); }
.form .dot.w { background: var(--brass); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-award { padding: 6px 10px; border-radius: 999px; background: #2a2015; border: 1px solid var(--brass-lo); font-size: .85rem; }
.chip-award b { color: var(--brass-hi); margin-left: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.kv dt { color: var(--cream-dim); }
.kv dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; max-width: 100%; }
table.grid { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.grid th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brass-hi); padding: 6px 8px; border-bottom: 1px solid var(--brass-lo); white-space: nowrap; }
table.grid td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.grid tr.me td { background: rgba(201, 162, 74, .12); }
table.live td, table.live th { text-align: right; }
table.live td:first-child, table.live th:first-child { text-align: left; white-space: nowrap; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.board { background: var(--felt-lo); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.board ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.board li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; }
.board li.me { background: rgba(201, 162, 74, .16); }
.board li:first-child .rank { background: var(--brass); color: var(--ink); }
.rank { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #22342c; font: 800 .72rem/1 var(--text); }
.who { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.who small { display: block; font-weight: 600; color: var(--cream-dim); font-size: .76rem; }
.val { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cream); }
.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.games li { padding: 10px 12px; border-radius: 10px; background: var(--felt-lo); border: 1px solid var(--line); display: grid; gap: 6px; }
.g-head { font-size: .92rem; }
.g-players { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .85rem; color: var(--cream-dim); }
.g-players .win { color: var(--brass-hi); }
.g-players .me { text-decoration: underline; text-underline-offset: 3px; }

.round-stats { display: grid; gap: 10px; width: 100%; text-align: left; }
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.awards li { padding: 8px 12px; border-radius: 10px; background: #2a2015; border: 1px solid var(--brass-lo); font-size: .9rem; }
.awards b { color: var(--brass-hi); margin-right: 6px; }
.chart { margin: 0; display: grid; gap: 6px; }
.chart figcaption { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cream-dim); font-weight: 700; }
.chart svg { width: 100%; height: auto; background: var(--felt-lo); border-radius: 10px; border: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--cream-dim); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.rs-mini { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--cream-dim); }
.rs-mini b { color: var(--cream); }
.signin p { color: var(--cream-dim); }
.signin input#siCode { font: 700 1.6rem/1 var(--mono); letter-spacing: .3em; }

@media (max-width: 820px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  .traits { grid-template-columns: minmax(0, 1fr); }
  .pod { flex-basis: 128px; }
  .felt { border-width: 7px; border-radius: 20px; padding: 14px 10px 10px; }
  .topbar .meta { order: 9; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
