/* Felt — "Midnight Felt" theme. Dark first; tokens on :root. */
:root {
  --bg: #0F1A17;
  --surface: #16241F;
  --surface-2: #1D2F29;
  --line: #2B4038;
  --felt: #1F6B4A;
  --felt-dark: #154A34;
  --rail: #3A2A1C;
  --gold: #D4A941;
  --gold-soft: rgba(212, 169, 65, 0.16);
  --gold-ink: #1C1505;
  --red: #C0392B;
  --ivory: #F5F1E6;
  --text: #F2EEE3;
  --muted: #9AAEA5;
  --pos: #6CCB94;
  --neg: #E8796B;
  --g-best: #5CC08A;
  --g-good: #9CC46A;
  --g-inacc: #E3C04D;
  --g-mistake: #E58D3E;
  --g-blunder: #E05A4F;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'DM Serif Display', Georgia, serif;
  --suit-s: #15130F; --suit-h: #C0392B; --suit-d: #C0392B; --suit-c: #15130F;
  color-scheme: dark;
}
body.four-color { --suit-d: #2C6BC4; --suit-c: #23864F; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 0; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 0.6rem; letter-spacing: 0.01em; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.row.gap > .btn { flex: 1; }

#app { max-width: 560px; margin: 0 auto; }
.screen { padding: max(12px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.topbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 44px; }
.topbar h1 { text-align: center; font-size: 1.3rem; }
.topbar > :last-child { justify-self: end; }
.logo { font-family: var(--display); font-size: 1.6rem; color: var(--gold); }

.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; font-size: 1.1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: 1rem; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.danger { background: #3A1E1A; border-color: #6B2C24; color: #FFD9D3; }
.btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; margin-top: 14px; }
.link { background: none; border: 0; color: var(--gold); padding: 4px 0; font-weight: 600; font-size: 0.9rem; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 8px 12px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

/* ---------- cards ---------- */
.card { width: 46px; height: 64px; border-radius: 7px; background: var(--ivory); color: var(--suit-s); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-weight: 700; flex: none; }
.card .r { font-size: 1.2rem; letter-spacing: -0.03em; }
.card .s { font-size: 1.15rem; margin-top: 2px; }
.card.suit-h { color: var(--suit-h); } .card.suit-d { color: var(--suit-d); } .card.suit-c { color: var(--suit-c); }
.card.sm { width: 28px; height: 39px; border-radius: 5px; }
.card.sm .r { font-size: 0.82rem; } .card.sm .s { font-size: 0.78rem; margin-top: 1px; }
.card.back { background: repeating-linear-gradient(45deg, #7A1F17 0 4px, #9B2A20 4px 8px); border: 2px solid var(--ivory); }
.card.slot { background: rgba(0,0,0,.14); box-shadow: none; border: 1px dashed rgba(245,241,230,.18); }
.card.dim { opacity: .45; }

/* ---------- avatars & crowns ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; border: 2px solid rgba(255,255,255,.25); flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.bot-card .avatar { width: 60px; height: 60px; }
.seat .avatar { width: 56px; height: 56px; }
.seat-plate { position: relative; }
.avatar.lg { width: 72px; height: 72px; }
.avatar.locked { background: var(--surface-2); color: var(--muted); }
.av-badge { position: absolute; right: -6px; bottom: -4px; font-size: .8rem; background: var(--bg); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); }
.crowns { display: inline-flex; gap: 1px; font-size: .9rem; }
.crown { color: #3A4A44; }
.crown.on { color: var(--gold); }

/* ---------- login & home ---------- */
.login { text-align: center; padding-top: 18vh; }
.logo-big { font-family: var(--display); font-size: 3.2rem; color: var(--gold); }
.login-form { display: grid; gap: 8px; text-align: left; margin: 28px 0 10px; }
.login-form label, .field-label { font-weight: 600; font-size: .9rem; display: block; margin: 16px 0 8px; }
input[type=text], input:not([type]), input[type=number] { width: 100%; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 14px; font: inherit; font-size: 1.05rem; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hello { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.hello-name { font-family: var(--display); font-size: 1.9rem; }
.rating-pill { border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; border-radius: 999px; font-size: .9rem; }
.rating-pill b { color: var(--gold); }
.habit { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.streak, .goal { flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.goal.done { border-color: var(--g-best); color: var(--g-best); }
.tile-big { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile-big.play { background: linear-gradient(135deg, var(--felt), var(--felt-dark)); border-color: #2C8A61; padding: 22px 18px; margin-bottom: 12px; }
.tb-icon { font-size: 1.8rem; width: 44px; height: 44px; border-radius: 12px; background: rgba(0,0,0,.2); display: grid; place-items: center; color: var(--gold); flex: none; }
.tb-title { font-weight: 700; font-size: 1.1rem; }
.tile-big.play .tb-title { font-family: var(--display); font-weight: 400; font-size: 1.6rem; }
.tb-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.tile-big.play .tb-sub { color: #D5E8DE; }
.quick-reference { margin: 14px 0; }
.quick-reference > h2 { margin: 0 0 9px; }
.reference-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.reference-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reference-head b { font-size: 1.05rem; }
.reference-head .link { font-size: .82rem; text-align: right; }
.reference-card p { margin: 7px 0 10px; }
.home-position-order { display: flex; flex-wrap: wrap; gap: 6px; }
.home-position-order span { display: inline-flex; align-items: baseline; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; font-size: .76rem; font-weight: 700; color: var(--gold); }
.home-position-order small { color: var(--ivory); font-size: .72rem; }
.home-hand-odds-head, .home-hand-ranks li { display: grid; grid-template-columns: minmax(0, 1fr) 66px 92px; gap: 6px; align-items: center; }
.home-hand-odds-head { color: var(--muted); font-size: .7rem; font-weight: 700; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.home-hand-odds-head span:not(:first-child), .home-hand-ranks li > span:not(:first-child) { text-align: right; }
.home-hand-ranks { display: grid; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.home-hand-ranks li { font-size: .78rem; line-height: 1.25; }
.home-hand-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.home-hand-name b { color: var(--gold); min-width: 15px; }
.home-starting-examples { display: flex; flex-wrap: wrap; gap: 7px; }
.home-starting-examples span { background: var(--surface-2); border-radius: 8px; padding: 6px 9px; font-size: .78rem; }
.home-starting-examples b { color: var(--gold); }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile-grid .tile-big { flex-direction: column; align-items: flex-start; gap: 8px; }
.hand-rank-list { display: grid; gap: 10px; }
.hand-rank-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.hand-rank-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hand-rank-heading h2 { margin: 0; font-size: 1.05rem; }
.hand-rank-example { display: flex; flex-wrap: wrap; gap: 5px; }
.hand-rank-card p { margin: 10px 0 0; font-size: .9rem; }
.hand-rank-card p.small { font-size: .82rem; }
.hand-odds-explainer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: .88rem; }
.hand-odds-explainer p { margin: 6px 0 0; }
.hand-rank-odds { display: flex; gap: 8px; margin-top: 10px; }
.hand-rank-odds span { display: grid; gap: 3px; flex: 1; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.hand-rank-odds small { color: var(--muted); font-size: .72rem; }
.hand-rank-odds b { color: var(--gold); font-size: 1rem; }
.starting-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.starting-legend span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: .75rem; }
.starting-cutoffs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 14px 0; }
.starting-cutoffs p { margin: 6px 0 10px; }
.starting-seat-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.starting-seat-picker button { display: grid; place-items: center; gap: 2px; min-height: 48px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: .74rem; text-align: center; }
.starting-seat-picker button b { color: var(--gold); }
.starting-seat-picker button.on { border-color: var(--gold); background: var(--gold-soft); }
.starting-chart-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.starting-chart { display: grid; grid-template-columns: 26px repeat(13, 44px); grid-auto-rows: 44px; gap: 1px; width: max-content; padding: 4px; }
.chart-axis { display: grid; place-items: center; color: var(--gold); font-size: .72rem; font-weight: 700; }
.starting-cell { min-width: 0; border: 1px solid var(--line); border-radius: 5px; display: grid; place-content: center; gap: 1px; padding: 2px 0; line-height: 1; text-align: center; }
.starting-cell b { font-size: .72rem; }
.starting-cell small { font-size: .59rem; }
.starting-cell.core-open { background: #594A1C; border-color: #8A7127; }
.starting-cell.seat-open { background: #235A42; border-color: #347956; }
.starting-cell.not-open { background: var(--surface-2); color: var(--muted); }
.starting-decisions { display: grid; gap: 5px; margin-top: 12px; }
.starting-decisions > div { display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: .84rem; }
.starting-decisions span, .starting-decisions strong { text-align: right; }
.position-sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 14px 0; }
.position-sizes button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; }
.position-sizes button.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.position-table { position: relative; height: 280px; border: 10px solid var(--rail); border-radius: 48%; background: radial-gradient(ellipse, var(--felt), var(--felt-dark)); margin: 18px 0; box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.position-felt { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #D5E8DE; font-family: var(--display); font-size: 1.2rem; opacity: .75; white-space: nowrap; }
.position-seat { position: absolute; transform: translate(-50%, -50%); width: 76px; min-height: 48px; display: grid; place-content: center; text-align: center; border: 1px solid #8BA79A; border-radius: 12px; background: var(--surface); box-shadow: 0 3px 8px rgba(0,0,0,.35); line-height: 1.15; }
.position-seat b { color: var(--ivory); font-size: .84rem; }
.position-seat small { color: var(--muted); font-size: .65rem; }
.position-seat em { color: var(--gold); font-size: .72rem; font-style: normal; font-weight: 700; }
.position-seat.button { border-color: var(--gold); }
.position-seat.button b { color: var(--gold); }
.position-seat.blind { border-color: #7DAA8E; }
.position-orders { display: grid; gap: 9px; margin: 16px 0; }
.position-orders > div, .position-why { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.position-orders b { font-size: .9rem; }
.position-orders p { margin: 7px 0 0; }
.position-order-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.position-order-chips span { display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; background: var(--surface-2); color: var(--gold); padding: 6px 8px; font-size: .78rem; font-weight: 700; }
.position-order-chips small { color: var(--muted); font-size: .67rem; }
.position-order-chips i { color: var(--muted); font-style: normal; }
.position-list { display: grid; gap: 8px; }
.position-item { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.position-badge { min-width: 62px; text-align: center; color: var(--gold); background: var(--surface-2); border-radius: 8px; padding: 6px; font-size: .8rem; font-weight: 700; }
.position-item b { font-size: .9rem; }
.position-open-pct { display: inline-block; margin-left: 8px; color: var(--gold); font-size: .8rem; font-weight: 700; }
.position-item p { margin: 4px 0 0; }
.position-range-note { margin: 0 0 12px; }
.position-note { margin-top: 16px; }
.position-why { margin-top: 14px; }
.position-why h2 { margin: 0; }
.position-why p { margin: 8px 0 0; font-size: .88rem; }

/* ---------- bots ---------- */
.style-row { margin: 18px 0; }
.style-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.style-icon { font-size: 1.5rem; }
.bot-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.bot-card { flex: 0 0 96px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.bot-card.locked { opacity: .55; }
.bc-name { font-weight: 600; font-size: .85rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bc-rating { color: var(--gold); font-weight: 700; font-size: .85rem; }
.bc-level { color: var(--muted); font-size: .7rem; }
.setup-head { display: flex; gap: 14px; align-items: center; }
.setup-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: none; border: 0; border-radius: 9px; min-height: 42px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; }
.seg button small { font-weight: 400; font-size: .68rem; color: var(--muted); }
.seg button.on { background: var(--gold); color: var(--gold-ink); }
.seg button.on small { color: var(--gold-ink); opacity: .75; }

/* ---------- sheet / toast ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0; transition: .25s; background: var(--ivory); color: var(--gold-ink); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- table ---------- */
.table-screen { height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.tbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; gap: 8px; }
.tinfo { font-size: .85rem; text-align: center; }
.felt-wrap { flex: 1; min-height: 0; padding: 4px 14px; display: flex; }
.felt { position: relative; flex: 1; border-radius: 46% / 40%; background: radial-gradient(ellipse at 50% 40%, #27845B 0%, var(--felt) 45%, var(--felt-dark) 100%); border: 10px solid var(--rail); box-shadow: inset 0 0 0 2px rgba(212,169,65,.35), inset 0 0 50px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.4); margin: 30px 18px 34px; }
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 78%; }
.board { display: flex; gap: 4px; }
.board .card { width: 40px; height: 56px; }
.board .card .r { font-size: 1.05rem; } .board .card .s { font-size: 1rem; }
.pot { font-size: .85rem; background: rgba(0,0,0,.25); padding: 3px 10px; border-radius: 999px; }
.pot-space { height: 22px; }
.pot b { color: var(--gold); }
.banner { font-size: .8rem; text-align: center; color: #E2EFE8; min-height: 2.4em; line-height: 1.2; max-width: 100%; }
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 2; width: 88px; }
.seat-cards { display: flex; gap: 2px; height: 39px; margin-bottom: -10px; z-index: 1; }
.seat-plate { background: rgba(10,18,15,.88); border: 1px solid var(--line); border-radius: 10px; padding: 3px 8px; text-align: center; margin-top: -6px; min-width: 70px; z-index: 2; }
.seat-name { font-size: .74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; }
.seat-stack { font-size: .74rem; color: var(--gold); font-weight: 700; }
.seat.folded { opacity: .5; }
.seat.out { opacity: .3; }
.seat.folded.revealed, .seat.out.revealed { opacity: 1; }
.seat.turn .avatar, .seat.turn .seat-plate { box-shadow: 0 0 0 2px var(--gold); }
.hero-seat .seat-plate { margin-top: 0; }
.hero-seat.turn .seat-plate { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--gold-soft), 0 0 0 2px var(--gold); } }
.dbtn { position: absolute; right: -2px; top: 36px; width: 20px; height: 20px; border-radius: 50%; background: var(--ivory); color: var(--gold-ink); font-size: .65rem; font-weight: 800; display: grid; place-items: center; z-index: 3; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.hero-seat .dbtn { top: -8px; right: -4px; }
.bet { position: absolute; transform: translate(-50%, -50%); font-size: .75rem; font-weight: 700; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.3); padding: 2px 7px 2px 3px; border-radius: 999px; z-index: 1; }
.chip-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 3px dashed var(--ivory); }
.act-tag, .style-tag { position: absolute; bottom: -18px; font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; z-index: 3; }
.act-raise, .act-bet, .act-all { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.act-fold { color: var(--muted); }
.style-tag { background: var(--ivory); color: var(--gold-ink); border-color: var(--ivory); }
.bubble { position: absolute; bottom: calc(100% + 2px); background: var(--ivory); color: var(--gold-ink); font-size: .74rem; padding: 5px 9px; border-radius: 12px; max-width: 140px; width: max-content; text-align: center; z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.4); animation: fade .2s; }
.reveal-timer { position: absolute; top: -24px; left: 0; background: var(--ivory); color: var(--gold-ink); font-weight: 700; font-size: .8rem; padding: 3px 10px; border-radius: 999px; z-index: 4; }
.hero-zone { display: flex; align-items: center; gap: 12px; padding: 4px 16px 8px; min-height: 76px; }
.hero-cards { display: flex; gap: 6px; }
.hero-cards .card { width: 50px; height: 70px; }
.hero-cards .card .r { font-size: 1.35rem; } .hero-cards .card .s { font-size: 1.25rem; }
.made { font-weight: 700; font-size: 1rem; }
.last-hand-mini { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.last-hand-mini .grade { font-size: .68rem; padding: 1px 6px; }
.actions { display: flex; gap: 8px; padding: 0 12px 8px; min-height: 56px; }
.actions .btn { flex: 1; min-height: 52px; }
.next-row { align-items: center; }
.next-row .btn { flex: 1.4; }
.hand-result { flex: 1; font-weight: 700; font-size: .95rem; text-align: center; }
kbd { font: 600 .68rem var(--font); border: 1px solid rgba(28,21,5,.35); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; margin-left: 6px; opacity: .75; }
.seat.winner .avatar, .seat.winner .seat-plate { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(212,169,65,.7); }
.seat.winner .seat-plate::before { content: '♛ '; color: var(--gold); font-size: .7rem; }
.actions.waiting { justify-content: center; align-items: center; color: var(--muted); font-size: .9rem; }
.raise-panel { flex-direction: column; gap: 10px; }
.presets { display: flex; gap: 6px; overflow-x: auto; }
.presets .chip { flex: 1; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input { flex: 1; accent-color: var(--gold); height: 32px; }
.amt { font-weight: 700; color: var(--gold); min-width: 64px; text-align: right; }
.phrases { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; }
.tools { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); }
.tools button { background: none; border: 0; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--text); min-height: 54px; }
.tools button span { font-size: 1.15rem; }
.tools button:disabled { opacity: .35; }
.tools button.voice-on { color: var(--gold); }
.dock { position: relative; }
.dock > .hint-panel { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px); margin: 0; z-index: 20; box-shadow: 0 -8px 30px rgba(0,0,0,.5); max-height: 52dvh; }
.hint-panel { margin: 0 12px 8px; background: var(--surface-2); border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; max-height: 40dvh; overflow-y: auto; }
.hint-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.hint-head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.hint-head b { color: var(--gold); }
.hint-panel p { margin: 8px 0; font-size: .92rem; }
.maths { width: 100%; border-collapse: collapse; font-size: .8rem; margin: 6px 0; }
.maths th { text-align: left; font-weight: 600; padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap; }
.maths td { padding: 4px 0; color: var(--muted); }
.evs { display: grid; gap: 4px; }
.ev { display: flex; justify-content: space-between; font-size: .82rem; background: var(--surface); padding: 4px 8px; border-radius: 6px; }
.log { display: grid; gap: 4px; font-size: .85rem; }
.log-line { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.log-line.dealer b { color: var(--gold); }

/* ---------- review ---------- */
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; display: grid; gap: 6px; }
.result-card.won { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.result-title { font-family: var(--display); font-size: 1.9rem; }
.result-crowns .crowns { font-size: 2rem; gap: 6px; }
.unlock { background: var(--felt-dark); border-radius: 10px; padding: 8px; margin-top: 4px; }
.acc-row { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.ring { width: 120px; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; }
.ring-num { fill: var(--text); font-size: 30px; font-weight: 700; text-anchor: middle; font-family: var(--font); }
.ring-lbl { fill: var(--muted); font-size: 11px; text-anchor: middle; font-family: var(--font); }
.grade-counts { display: grid; gap: 5px; flex: 1; }
.gc { display: flex; justify-content: space-between; align-items: center; }
.grade { display: inline-flex; gap: 4px; align-items: center; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.g-best { color: var(--g-best); } .g-good { color: var(--g-good); } .g-inaccuracy { color: var(--g-inacc); } .g-mistake { color: var(--g-mistake); } .g-blunder { color: var(--g-blunder); }
.hand { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 0 12px; }
.hand > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; flex-wrap: wrap; }
.hand > summary::-webkit-details-marker { display: none; }
.hand-no { color: var(--muted); font-size: .8rem; min-width: 26px; }
.mini-board { display: inline-flex; gap: 2px; }
.board-cards { margin-right: auto; }
.net { font-weight: 700; font-size: .85rem; }
.decision { border-top: 1px solid var(--line); padding: 10px 0; }
.dec-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.dec-top .grade { margin-left: auto; }
.street { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dec-body { font-size: .9rem; display: grid; gap: 4px; }
.better b { color: var(--gold); }
.why { font-size: .85rem; line-height: 1.45; }
.hand-log { padding-bottom: 8px; font-size: .8rem; }
.key-moment { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.km-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.table-list { display: grid; gap: 8px; }
.tl-row { display: flex; gap: 10px; align-items: center; }
.sticky-bottom { position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 12px; }

/* ---------- study ---------- */
.modules { display: grid; gap: 8px; }
.module { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.mod-num { width: 32px; height: 32px; border-radius: 50%; background: var(--felt-dark); display: grid; place-items: center; font-weight: 700; color: var(--gold); flex: none; }
.mod-text { flex: 1; }
.mod-right { text-align: right; }
.progress { display: flex; gap: 5px; justify-content: center; margin-bottom: 16px; }
.dot { width: 22px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.dot.ok { background: var(--g-best); } .dot.bad { background: var(--g-blunder); } .dot.now { background: var(--gold); }
.q-visual { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; background: radial-gradient(ellipse, var(--felt), var(--felt-dark)); border-radius: var(--radius); padding: 14px; }
.q-cards, .q-player { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.q-cards > :not(.muted), .q-player > :not(.muted) { display: inline-flex; }
.q-cards { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
.q-cards .muted, .q-player .muted { width: 100%; text-align: center; color: #D5E8DE; }
.q-player { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; width: 40%; }
.q-players { display: flex; gap: 12px; width: 100%; justify-content: center; }
.prompt { font-size: 1.05rem; font-weight: 500; margin: 16px 0; }
.choices { display: grid; gap: 8px; }
.choice { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-align: left; padding: 10px 14px; }
.choice.right { border-color: var(--g-best); background: rgba(92,192,138,.15); }
.choice.wrong { border-color: var(--g-blunder); background: rgba(224,90,79,.15); }
.num-form { display: flex; gap: 8px; align-items: center; }
.num-form .unit { color: var(--muted); }
.num-form .btn { flex: none; }
.feedback { margin-top: 14px; border-radius: 12px; padding: 12px 14px; border: 1px solid; }
.feedback.ok { border-color: var(--g-best); background: rgba(92,192,138,.1); }
.feedback.bad { border-color: var(--g-mistake); background: rgba(229,141,62,.1); }
.feedback p { margin: 6px 0 0; font-size: .92rem; }
.study-run .hint-panel { margin: 14px 0 0; }
.study-tools { margin-top: 18px; display: grid; gap: 10px; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.tile-v { font-size: 1.3rem; font-weight: 700; }
.tile-l { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.tile-s { font-size: .7rem; color: var(--muted); }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; margin-top: 12px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 9px; font-family: var(--font); }
.chart .label { fill: var(--text); font-size: 10px; font-weight: 700; font-family: var(--font); }
.chart .bar { fill: var(--gold); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--gold); }
.chart .dot-end { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart g[data-tip]:hover .bar { fill: #E6C268; }
.heat-scroll { overflow-x: auto; }
.heat { stroke: var(--surface); stroke-width: 1; }
.h0 { fill: #22332D; background: #22332D; } .h1 { fill: #4E5530; background: #4E5530; } .h2 { fill: #7C7432; background: #7C7432; } .h3 { fill: #AA8F38; background: #AA8F38; } .h4 { fill: #D4A941; background: #D4A941; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.heat-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 8px; font-size: .82rem; }
.hb-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.hb-v { text-align: right; font-weight: 700; }
.tooltip { position: fixed; z-index: 70; background: var(--ivory); color: var(--gold-ink); font-size: .78rem; font-weight: 600; padding: 5px 9px; border-radius: 8px; pointer-events: none; max-width: 240px; }
.ladder { display: grid; gap: 4px; margin-top: 8px; }
.ld-row { display: grid; grid-template-columns: 30px repeat(5, 1fr); gap: 4px; align-items: center; }
.ld-head span { font-size: .66rem; color: var(--muted); text-align: center; }
.ld-style { font-size: 1.05rem; text-align: center; }
.ld-cell { height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: .7rem; background: var(--surface-2); color: var(--muted); }
.ld-cell.open { border: 1px dashed var(--gold); color: var(--gold); }
.ld-cell.beat { background: var(--gold-soft); color: var(--gold); }
.ld-cell.locked { opacity: .45; }

/* ---------- settings ---------- */
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { width: 50px; height: 30px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: .2s; }
.toggle .sw::after { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); top: 2px; left: 2px; transition: .2s; }
.toggle input:checked + .sw { background: var(--gold); border-color: var(--gold); }
.toggle input:checked + .sw::after { left: 22px; background: var(--gold-ink); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-preview { display: flex; gap: 8px; margin: 18px 0; }

@media (min-width: 700px) {
  .felt { margin: 40px 60px 44px; }
  .seat { width: 100px; }
}
@media (max-height: 640px) {
  .hero-cards .card { width: 42px; height: 58px; }
  .felt { margin: 26px 16px 30px; }
}
