/* Couch Club: printed board-game box. Warm paper, ink outlines, hard offset shadows, one tomato accent. */
:root {
  --paper: #F3ECDF;
  --paper-2: #E8DFCF;
  --paper-3: #FBF7F0;
  --ink: #1F1B16;
  --ink-2: #5E564B;
  --ink-3: #8C8274;
  --line: rgba(31, 27, 22, .14);
  --accent: #E2553A;
  --accent-ink: #B23A22;
  --good: #2F9C95;
  --felt: #2C5E4E;
  --felt-2: #244E41;
  --c: var(--ink);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 8px;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --f-display: "Bricolage Grotesque", Geist, system-ui, sans-serif;
  --f-body: Geist, system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, monospace;
  --f-tile: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --z-overlay: 10;
  --z-grain: 20;
  --ease: cubic-bezier(.2, .9, .3, 1.2);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
/* paper grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: var(--z-grain); opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hidden { display: none !important; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); font-weight: 500; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.sub { color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 30; background: var(--paper-3); padding: 8px 12px; border: 2px solid var(--ink); }

.logo { font: 800 22px/1 var(--f-display); letter-spacing: -.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.logo span { background: var(--accent); color: var(--paper-3); padding: 2px 7px 3px; border-radius: 6px; margin-left: 3px; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-3deg); }
.logo.sm { font-size: 18px; }
.link { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--r-md);
  background: var(--paper-3); border: 2px solid var(--ink); box-shadow: var(--shadow);
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--paper-3); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.big { min-height: 58px; font-size: 18px; width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input {
  font: 600 20px var(--f-body); color: var(--ink); padding: 14px 16px; border-radius: var(--r-md);
  border: 2px solid var(--ink); background: var(--paper-3); box-shadow: inset 2px 2px 0 var(--paper-2); width: 100%;
}
.field input::placeholder { color: var(--ink-3); font-weight: 500; }
.field input[maxlength="4"] { font-family: var(--f-mono); letter-spacing: .3em; text-transform: uppercase; }
.err { color: var(--accent-ink); font-weight: 600; min-height: 1.5em; }

/* ---------- avatars (squircles in player colour) ---------- */
.avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--c); color: var(--paper-3); border: 2px solid var(--ink);
  font: 800 18px/1 var(--f-display);
}

/* ---------- game list (landing + TV lobby) ---------- */
.game-list { list-style: none; border-top: 2px solid var(--ink); }
.game-row {
  display: grid; grid-template-columns: 3ch 1fr auto; column-gap: 16px; row-gap: 2px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.game-row .num { font: 700 14px var(--f-mono); color: var(--accent); }
.game-row .title { font: 800 22px/1.1 var(--f-display); letter-spacing: -.02em; }
.game-row .tag { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.game-row .desc { grid-column: 2 / -1; color: var(--ink-2); max-width: 62ch; }

/* ---------- landing ---------- */
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.intro { padding: clamp(24px, 6vw, 72px) 0 clamp(24px, 4vw, 48px); max-width: 860px; }
.intro h1 { font-size: clamp(44px, 8vw, 104px); letter-spacing: -.045em; margin: 14px 0 20px; }
.lede { font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); max-width: 58ch; }
.paths { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.path {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px; border-radius: var(--r-lg);
  background: var(--paper-3); border: 2px solid var(--ink); box-shadow: var(--shadow-lg); text-decoration: none; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.path:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
a.path:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.path.big { grid-row: span 2; background: var(--accent); color: var(--paper-3); min-height: 380px; }
.path.big p, .path.big .kicker { color: rgba(251, 247, 240, .85); }
.path h2 { font-size: clamp(28px, 3vw, 40px); }
.path.big h2 { font-size: clamp(40px, 5vw, 64px); }
.path p { color: var(--ink-2); max-width: 40ch; }
.kicker { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.go { margin-top: auto; padding-top: 12px; font-weight: 700; }
.path .art { position: absolute; right: -18px; bottom: -18px; display: grid; grid-template-columns: repeat(2, 72px); gap: 10px; transform: rotate(-8deg); }
.path .art span { width: 72px; height: 72px; border-radius: 22px; background: var(--c); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.path .art span:nth-child(1) { background: var(--paper-3); }
.joinbox { gap: 12px; }
.joinbox .btn { align-self: flex-start; }
.lineup { padding: clamp(40px, 7vw, 88px) 0 24px; display: grid; grid-template-columns: 1fr 2fr; gap: 32px; }
.lineup h2 { font-size: clamp(30px, 4vw, 48px); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0 40px; border-top: 1px solid var(--line); font-weight: 600; }
@media (max-width: 820px) {
  .paths { grid-template-columns: 1fr; }
  .path.big { grid-row: auto; min-height: 280px; }
  .joinbox { order: -1; }
  .lineup { grid-template-columns: 1fr; gap: 16px; }
  .path .art { grid-template-columns: repeat(2, 44px); right: -10px; bottom: -10px; }
  .path .art span { width: 44px; height: 44px; border-radius: 14px; }
  .path.big p { max-width: 28ch; }
}

/* ---------- TV: lobby (10-foot: everything scales with the screen) ---------- */
.tv { overflow-x: hidden; font-size: clamp(15px, 1.05vw, 30px); }
.screen { min-height: 100dvh; padding: clamp(14px, 2.2vw, 48px) clamp(16px, 3vw, 64px); }
.lobby { display: grid; grid-template-columns: minmax(18em, 26em) 1fr; grid-template-rows: auto auto 1fr; gap: 1.4em 3em; align-content: start; }
.lobby .topbar { grid-column: 1 / -1; padding: 0; }
.tv .logo { font-size: 1.6em; }
.phonehint { grid-column: 1 / -1; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--ink); font-weight: 600; }
.joinpanel {
  grid-row: span 2; align-self: start; position: sticky; top: 1.5em;
  background: var(--paper-3); border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 1.3em; display: grid; gap: 1em; transform: rotate(-.6deg);
}
.qrbox { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--paper-2); overflow: hidden; }
.qrbox::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); animation: shimmer 1.4s infinite; }
.qrbox:has(.qr.ready) { background: transparent; }
.qrbox:has(.qr.ready)::after { display: none; }
.qr { width: 100%; height: auto; aspect-ratio: 1; display: block; image-rendering: pixelated; opacity: 0; transition: opacity .3s; }
.qr.ready { opacity: 1; }
.qrbox.sm { width: 120px; flex: none; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.joininfo { display: grid; gap: .25em; }
.url { font: 600 .9em var(--f-mono); word-break: break-all; }
.code { font: 700 clamp(48px, 5.2em, 140px)/1 var(--f-mono); letter-spacing: .12em; color: var(--accent); }
.tip { margin-top: .6em; font-size: .85em; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: .6em; }
.slots { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: .8em; }
.slot {
  display: grid; justify-items: start; gap: .3em; padding: .9em; border-radius: var(--r-md);
  background: var(--paper-3); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--c);
  animation: pop .4s var(--ease) both;
}
.slot .avatar { width: 2.6em; height: 2.6em; font-size: 1.2em; border-radius: .75em; }
.slot .name { font: 800 1.2em/1.1 var(--f-display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .meta { font-size: .8em; color: var(--ink-2); font-weight: 600; }
.slot.empty { background: transparent; border: 2px dashed var(--line); box-shadow: none; color: var(--ink-3); animation: none; }
.slot.empty .avatar { background: transparent; border: 2px dashed var(--line); }
.slot.empty .name { font-family: var(--f-body); font-weight: 600; font-size: .95em; }
.slot.away { opacity: .5; }
.status { margin-top: .8em; font: 700 1.35em var(--f-display); }
.status::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--accent); margin-right: .55em; animation: blink 1.4s infinite; vertical-align: middle; }
.shelf h2 { font: 700 .95em var(--f-body); letter-spacing: 0; margin: 1.1em 0 .6em; }
.covers { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .9em; }
.cover { display: grid; gap: .15em; }
.cover img { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-md); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: block; background: var(--paper-2); }
.cover b { font: 800 1.05em/1.15 var(--f-display); margin-top: .35em; }
.cover span { font-size: .78em; color: var(--ink-2); font-weight: 600; }
@keyframes pop { from { transform: scale(.85) rotate(-2deg); opacity: 0; } }
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .joinpanel { position: static; grid-row: auto; grid-template-columns: 140px 1fr; align-items: center; transform: none; padding: 16px; }
  .code { font-size: 44px; }
}

/* ---------- TV: game ---------- */
.game, .tablescreen { display: flex; flex-direction: column; gap: 14px; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hud h1 { font-size: clamp(24px, 3vw, 40px); }
.chips { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; }
.chips li { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--paper-3); border: 2px solid var(--ink); font-weight: 700; }
.chips li::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--c); border: 2px solid var(--ink); }
.chips b { font: 700 16px var(--f-mono); font-variant-numeric: tabular-nums; }
.stage { flex: 1; display: grid; place-items: center; position: relative; min-height: 0; }
#cv { width: min(100%, calc((100dvh - 130px) * 16 / 9)); aspect-ratio: 16 / 9; border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); background: var(--paper); }
.result {
  position: absolute; inset: 0; margin: auto; width: min(640px, 90%); height: fit-content; text-align: center; padding: 36px 28px;
  background: var(--paper-3); border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: pop .45s var(--ease) both; z-index: var(--z-overlay);
}
.result h2 { font-size: clamp(34px, 5vw, 64px); margin-top: 8px; }

/* ---------- phone shell ---------- */
.phone { overscroll-behavior: none; touch-action: manipulation; }
.phone .pad, .phone .tiles, .phone .actions { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pscreen { min-height: 100dvh; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); gap: 14px; }
.pbar { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.pbar .me { font: 800 18px var(--f-display); display: inline-flex; align-items: center; gap: 8px; }
.pbar .me::before { content: ""; width: 14px; height: 14px; border-radius: 5px; background: var(--c); border: 2px solid var(--ink); }
.pbar .conn { color: var(--accent-ink); font-size: 13px; font-weight: 700; margin-left: auto; }
.pbar .link { margin-left: auto; font-size: 14px; }
.joinscreen { max-width: 460px; width: 100%; margin: 0 auto; justify-content: center; }
.joinscreen .logo { align-self: center; font-size: 28px; margin-bottom: 8px; }
.joinform { display: grid; gap: 16px; background: var(--paper-3); border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 24px 20px; }
.joinform h1 { font-size: 34px; }
.joinform .sub { margin-top: -8px; }
.alt { text-align: center; }

/* ---------- phone: controllers ---------- */
.ctrl { border-top: 6px solid var(--c); }
.prompt h2 { font-size: 28px; }
.prompt p { color: var(--ink-2); margin-top: 4px; }
.pad { flex: 1; min-height: 0; display: grid; gap: 14px; align-content: start; }
.pad button:not(.btn):not(.swatch):not(.size) {
  border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  font: 800 22px var(--f-display); transition: transform .08s, box-shadow .08s;
}
.pad button.down, .pad button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink) !important; }
.pad.wait { place-content: center; }
.pad.menu .eyebrow { margin-top: 6px; }
.menu-item { display: grid; gap: 2px; text-align: left; padding: 16px 18px; }
.menu-item b { font-size: 22px; }
.menu-item span { font: 500 14px var(--f-body); color: var(--ink-2); }
.pad.stickpad { grid-template-columns: 1fr auto; align-items: end; align-content: end; }
.stick { width: min(56vw, 48dvh, 280px); aspect-ratio: 1; border-radius: 50%; background: var(--paper-2); border: 3px solid var(--ink); display: grid; place-items: center; touch-action: none; box-shadow: inset 4px 4px 0 rgba(31, 27, 22, .1); }
.knob { width: 42%; aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); pointer-events: none; transition: transform .05s; }
.buttons { display: grid; gap: 12px; }
.buttons button { min-width: 112px; min-height: 76px; background: var(--c) !important; color: var(--paper-3); touch-action: none; }
.buttons button:first-child { min-height: 96px; }
.pad.dpad { grid-template: repeat(3, 1fr) / repeat(3, 1fr); grid-template-areas: ". up ." "left . right" ". down ."; aspect-ratio: 1; width: min(100%, 60dvh); margin: auto; flex: none; touch-action: none; }
.dpad .up { grid-area: up; } .dpad .down { grid-area: down; } .dpad .left { grid-area: left; } .dpad .right { grid-area: right; }
.dpad button { background: var(--c) !important; color: var(--paper-3); font-size: 30px !important; }
.pad.draw { align-content: start; }
.sketch { width: 100%; aspect-ratio: 4 / 3; border: 3px solid var(--ink); border-radius: var(--r-md); background: #FFFDF8; touch-action: none; box-shadow: var(--shadow); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 12px; background: var(--sw); border: 2px solid var(--ink); box-shadow: inset 0 0 0 3px var(--paper-3); }
.tools .swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.size { width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; }
.size i { background: var(--ink); border-radius: 50%; }
.size.on { border-color: var(--ink); background: var(--paper-3); }
.guess { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.guess input { font: 600 20px var(--f-body); padding: 14px; border-radius: var(--r-md); border: 2px solid var(--ink); background: var(--paper-3); min-width: 0; }
.guesses { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.guesses li { padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 14px; }

/* ---------- phone: table lobby ---------- */
.invite { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; background: var(--paper-3); border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 18px; }
.invite .code { font-size: 46px; margin: 2px 0 6px; }
.invite .sub { font-size: 14px; margin-bottom: 12px; }
.invite .qr { width: 132px; }
.plist h2, .picker h2 { font-size: 22px; margin-bottom: 10px; }
.plist h2 .muted { font: 600 14px var(--f-body); }
.plist ol, .picker ul { list-style: none; display: grid; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 12px; font-weight: 700; padding: 8px; border-radius: var(--r-md); background: var(--paper-3); border: 1px solid var(--line); }
.plist li .muted { margin-left: auto; font-size: 13px; }
.plist li.away { opacity: .5; }
.picker li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 16px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--ink); }
.picker li b { font: 800 20px var(--f-display); }
.picker li p { color: var(--ink-2); font-size: 14px; margin: 2px 0; }
.picker li .muted { font-size: 13px; }

/* ---------- table games (shared phone + TV) ---------- */
.ptable { gap: 10px; }
#tableview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.poker, .mahjong, .bigtwo, .dicegame, .spy, .charades { flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }
.timer { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.log { font-weight: 600; text-align: center; min-height: 1.5em; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--paper-3); }
.badge.good { background: var(--good); }
.badge.muted { background: var(--paper-2); color: var(--ink-3); }
.actions { display: grid; gap: 10px; position: sticky; bottom: 0; padding: 10px 0 2px; background: linear-gradient(transparent, var(--paper) 18%); }
.actions .row { display: grid; grid-template-columns: 1fr 1.2fr 1.5fr; gap: 8px; }
.actions .row .btn { padding-inline: 8px; }
.over {
  position: fixed; inset: auto 12px 12px; z-index: var(--z-overlay); display: grid; gap: 10px; justify-items: start;
  background: var(--paper-3); border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 20px;
  animation: pop .4s var(--ease) both; max-height: 80dvh; overflow: auto;
}
.over h2 { font-size: 30px; }
.standings { list-style: none; width: 100%; display: grid; gap: 6px; }
.standings li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: var(--r-sm); background: var(--paper); border-left: 6px solid var(--c); font-weight: 700; }
.standings b { font-family: var(--f-mono); }

/* cards */
.card {
  --w: 46px; width: var(--w); height: calc(var(--w) * 1.4); border-radius: 7px; flex: none;
  background: #FFFDF8; border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(31, 27, 22, .35);
  display: grid; grid-template-rows: auto 1fr; padding: 3px 4px; line-height: 1; color: var(--ink);
}
.card b { font: 800 calc(var(--w) * .36) var(--f-display); }
.card i { font-style: normal; font-size: calc(var(--w) * .52); place-self: center; }
.card.red { color: var(--accent-ink); }
.card.back { background: var(--accent) repeating-linear-gradient(45deg, transparent 0 5px, rgba(251, 247, 240, .25) 5px 7px); }
.card.slot { background: transparent; border: 2px dashed rgba(251, 247, 240, .35); box-shadow: none; }
.card.sm { --w: 24px; border-width: 1.5px; padding: 1px 2px; border-radius: 4px; }

/* poker */
.poker .seats { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.seat {
  flex: 1 0 104px; display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; position: relative;
  padding: 8px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line);
  transition: border-color .2s, transform .2s var(--ease);
}
.seat .avatar { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
.seat .who { display: grid; min-width: 0; }
.seat .who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.seat .chips { font: 600 13px var(--f-mono); color: var(--ink-2); }
.seat .hole { grid-column: 1 / -1; display: flex; gap: 3px; }
.seat .bet { position: absolute; top: -8px; right: 6px; font: 700 12px var(--f-mono); background: var(--paper-3); border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; }
.seat .badge { grid-column: 1 / -1; justify-self: start; }
.seat .handname { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.seat.turn { border-color: var(--ink); box-shadow: 3px 3px 0 var(--c); transform: translateY(-2px); }
.seat.folded, .seat.out { opacity: .5; }
.dealer { font: 800 10px/16px var(--f-body); width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--paper-3); border: 1.5px solid var(--ink); font-style: normal; }
.felt {
  border-radius: 28px; padding: 16px; display: grid; gap: 12px; justify-items: center; color: var(--paper-3);
  background: radial-gradient(ellipse at 50% 30%, #357060, var(--felt) 60%, var(--felt-2)); border: 3px solid var(--ink); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12), var(--shadow);
}
.felt .pot { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.felt .pot b { font: 700 22px var(--f-mono); }
.felt .board { display: flex; gap: 6px; }
.felt .log { color: rgba(251, 247, 240, .9); font-size: 14px; }
.mine { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--paper-3); border: 2px solid var(--line); }
.mine.turn { border-color: var(--ink); box-shadow: 4px 4px 0 var(--c); }
.mycards { display: flex; gap: 6px; }
.mycards .card { --w: 62px; }
.mystack { display: grid; }
.mystack span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mystack b { font: 700 26px var(--f-mono); }
.mystack em { font-style: normal; font-size: 13px; font-weight: 600; }
.mine .timer { grid-column: 1 / -1; }
.raise { display: grid; gap: 8px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip-btn { min-height: 38px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper-3); font-weight: 700; font-size: 14px; }
.chip-btn:active { background: var(--paper-2); }
.range input { width: 100%; accent-color: var(--accent); height: 28px; }

/* mahjong tiles */
.mj {
  --tw: 30px; width: var(--tw); height: calc(var(--tw) * 1.36); flex: none; border-radius: calc(var(--tw) * .16);
  background: #FFFDF6; border: 1.5px solid var(--ink); box-shadow: 0 calc(var(--tw) * .1) 0 #3E8E6E, 0 calc(var(--tw) * .1) 0 1.5px var(--ink);
  display: grid; place-items: center; align-content: center; line-height: 1; font-family: var(--f-tile); color: var(--ink);
  margin-bottom: calc(var(--tw) * .1 + 2px);
}
.mj b { font-weight: 700; font-size: calc(var(--tw) * .55); }
.mj i { font-style: normal; font-weight: 700; font-size: calc(var(--tw) * .38); }
.mj.s0 i { color: var(--accent-ink); }
.mj.s1 { color: #2F5FA8; }
.mj.s2 { color: #2E7D4F; }
.mj.s1 b, .mj.s2 b { font-family: var(--f-display); font-weight: 800; }
.mj.hon b { font-size: calc(var(--tw) * .7); }
.mj.h4 { color: var(--accent-ink); }
.mj.h5 { color: #2E7D4F; }
.mj.h6 b { color: #2F5FA8; border: 2px solid currentColor; border-radius: 3px; padding: 1px; font-size: calc(var(--tw) * .5); }
.mj.flo { color: #B5562D; }
.mj.flo i { font-family: var(--f-mono); font-size: calc(var(--tw) * .28); }
.mj.back { background: #3E8E6E; }
.mj.xs { --tw: 19px; border-width: 1px; }
.mj.sm { --tw: 23px; }
.mj.lg { --tw: 48px; }
.mj.last { outline: 2px solid var(--accent); outline-offset: 1px; }
.meld { display: inline-flex; gap: 1px; margin-right: 6px; }

/* mahjong layout */
.mjbar { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mjseats { list-style: none; display: grid; gap: 8px; }
.mjseat { padding: 8px 10px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); display: grid; gap: 6px; }
.mjseat.turn { border-color: var(--ink); box-shadow: 3px 3px 0 var(--c); }
.mjseat header { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mjseat header b { display: flex; gap: 6px; align-items: baseline; }
.mjseat header em { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.mjseat .wind { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--c); color: var(--paper-3); border: 2px solid var(--ink); font: 700 14px var(--f-tile); }
.mjseat .score { font: 700 13px var(--f-mono); margin-left: auto; }
.mjseat .count { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.melds { display: flex; flex-wrap: wrap; gap: 4px; align-items: end; }
.river { display: flex; flex-wrap: wrap; gap: 2px; }
.mjcenter { display: grid; justify-items: center; gap: 6px; padding: 6px 0; }
.lastdiscard { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink-2); }
.myriver { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.myhand { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-lg); background: var(--paper-3); border: 2px solid var(--line); }
.myhand.turn { border-color: var(--ink); box-shadow: 4px 4px 0 var(--c); }
.myhand .tiles { display: flex; gap: 2px; align-items: end; justify-content: center; padding-top: 10px; }
.myhand .mj.hand { --tw: min(44px, calc((100vw - 76px) / 14.6)); cursor: pointer; transition: transform .15s var(--ease); }
.myhand .mj.sel { transform: translateY(-10px); box-shadow: 0 4px 0 var(--accent), 0 4px 0 1.5px var(--ink); }
.myhand .drawn { margin-left: 8px; display: flex; }
.myhand .hint { font-size: 13px; text-align: center; color: var(--ink-2); font-weight: 600; }
.mj-actions { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.mj-actions .btn { font-family: var(--f-body); }
.chowset { display: inline-flex; gap: 1px; margin-left: 4px; }
.winhand { display: flex; flex-wrap: wrap; gap: 2px; align-items: end; }
.faan { list-style: none; width: 100%; display: grid; gap: 4px; }
.faan li { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 3px; }
.faan b { font-family: var(--f-mono); }

/* TV variants of the table views */
.tv-view { font-size: 18px; }
.tv-view .poker { display: grid; align-content: center; gap: 28px; }
.tv-view .poker .seats { justify-content: center; flex-wrap: wrap; overflow: visible; gap: 14px; }
.tv-view .seat { flex: 0 1 230px; padding: 16px; }
.tv-view .seat .avatar { width: 44px; height: 44px; font-size: 20px; }
.tv-view .seat .who b { font-size: 18px; }
.tv-view .seat .chips { font-size: 16px; }
.tv-view .card.sm { --w: 40px; }
.tv-view .felt { align-self: center; align-content: center; min-height: 40dvh; width: min(100%, 1200px); justify-self: center; border-radius: 200px; padding: 40px; }
.tv-view .felt .card { --w: 96px; }
.tv-view .felt .board { gap: 14px; }
.tv-view .felt .pot b { font-size: 40px; }
.tv-view .felt .log { font-size: 22px; }
.tv-view .mjseats { grid-template-columns: 1fr 1fr; gap: 16px; }
.tv-view .mjseat { padding: 16px; }
.tv-view .mjseat header { font-size: 20px; }
.tv-view .mj.xs { --tw: 34px; }
.tv-view .mj.sm { --tw: 34px; }
.tv-view .mj.lg { --tw: 80px; }
.tv-view .mjbar { font-size: 18px; }
.tv-view .log { font-size: 22px; }
.tv-view .over { inset: 0; margin: auto; width: min(680px, 90%); height: fit-content; }

/* big two + dice seats */
.b2seats { list-style: none; display: grid; gap: 8px; }
.b2seat { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); transition: border-color .2s; }
.b2seat .avatar { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
.b2seat .who { display: grid; min-width: 0; }
.b2seat .who b { font-size: 15px; display: flex; gap: 6px; align-items: baseline; }
.b2seat .who em { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.b2seat .chips { font: 600 13px var(--f-mono); color: var(--ink-2); }
.b2seat .last { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.b2seat.turn { border-color: var(--ink); box-shadow: 3px 3px 0 var(--c); }
.b2seat.out { opacity: .45; }
.b2seat.lost { border-color: var(--accent); }
.b2mine { grid-template-columns: 1fr; }
.b2hand { --cw: 46px; display: flex; justify-content: center; padding: 16px 0 4px; }
.cardbtn { margin-left: min(4px, calc((min(100vw, 760px) - 76px - var(--cw)) / max(1, var(--n, 13) - 1) - var(--cw))); transition: transform .15s var(--ease); border-radius: 7px; }
.cardbtn:first-child { margin-left: 0; }
.cardbtn .card { --w: var(--cw); }
.cardbtn.sel { transform: translateY(-16px); }
.cardbtn.sel .card { border-color: var(--accent); box-shadow: 0 4px 0 var(--accent); }
.hint { font-size: 13px; text-align: center; color: var(--ink-2); font-weight: 600; }
.hint.err { color: var(--accent-ink); }
.actions .row.two { grid-template-columns: 1fr 1.6fr; }

/* dice */
.die { --d: 40px; width: var(--d); height: var(--d); flex: none; border-radius: calc(var(--d) * .22); background: #FFFDF8; border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(31, 27, 22, .35); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: calc(var(--d) * .12); }
.die i { border-radius: 50%; margin: 18%; }
.die i.on { background: var(--ink); }
.die.one i.on { background: var(--accent); transform: scale(1.3); }
.die.cup { background: var(--accent) repeating-linear-gradient(-45deg, transparent 0 5px, rgba(251, 247, 240, .22) 5px 7px); }
.die.sm { --d: 24px; border-width: 1.5px; }
.die.hit { outline: 3px solid var(--good); outline-offset: 1px; }
.mydice { display: flex; gap: 8px; flex-wrap: wrap; }
.mydice .die { --d: 52px; }
.bid { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.bid b { font: 800 40px var(--f-display); }
.bid .die { --d: 48px; }
.dicepick .qty { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; text-align: center; gap: 8px; }
.dicepick .qty b { font: 800 30px var(--f-display); }
.dicepick .qty b span { font: 600 14px var(--f-body); color: var(--ink-2); }
.faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.facebtn { display: grid; place-items: center; padding: 8px 0; border-radius: 12px; border: 2px solid var(--line); background: var(--paper-3); }
.facebtn.on { border-color: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.facebtn:disabled { opacity: .3; }

/* spy + charades */
.wordcard { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 22px 16px; border-radius: var(--r-lg); background: var(--paper-3); border: 3px solid var(--ink); box-shadow: var(--shadow-lg); width: 100%; }
.wordcard b { font: 800 clamp(30px, 9vw, 48px)/1.1 var(--f-display); letter-spacing: -.02em; }
.wordcard.live { border-color: var(--c); box-shadow: 6px 6px 0 var(--c); }
.wordcard .timer { width: 100%; }
.wordcard.hidden-word b { color: var(--ink-3); letter-spacing: .2em; }
.felt h2.big { font-size: clamp(28px, 8vw, 44px); color: var(--paper-3); text-align: center; }
.felt .timer { width: 100%; background: rgba(251, 247, 240, .2); }
.speakorder { list-style: none; display: grid; gap: 6px; }
.speakorder li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); font-weight: 700; }
.speakorder li .avatar { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
.speakorder li .badge { margin-left: auto; }
.speakorder li.now { border-color: var(--ink); box-shadow: 3px 3px 0 var(--c); }
.speakorder li.out { opacity: .45; text-decoration: line-through; }
.votes { grid-template-columns: 1fr 1fr; }
.votes .eyebrow { grid-column: 1 / -1; }
.votes .btn.ghost { grid-column: 1 / -1; }
.dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); border: 2px solid var(--ink); flex: none; }
.wordlist { list-style: none; display: grid; gap: 4px; }
.wordlist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--paper-2); font-weight: 600; font-size: 14px; }
.wordlist li.ok { background: #D7EBDF; }
.tv-view .b2seats, .tv-view .speakorder { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tv-view .b2seat { padding: 14px; }
.tv-view .card.sm, .tv-view .die.sm { --w: 40px; --d: 36px; }
.tv-view .felt h2.big { font-size: 72px; }
.tv-view .bid b { font-size: 72px; }
.tv-view .bid .die { --d: 80px; }

@media (min-width: 700px) {
  .phone .pscreen:not(.joinscreen) { max-width: 760px; width: 100%; margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .slot, .result, .over, .status::before { animation: none !important; }
}
.picker li .eyebrow { display: block; font-size: 12px; }

/* ---------- phone lobby ---------- */
.boot { justify-content: center; align-items: center; }
.banner { padding: 10px 14px; border-radius: var(--r-md); background: var(--ink); color: var(--paper-3); font-weight: 600; font-size: 14px; }
.screencard { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); border: 2px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.screencard b { color: var(--ink); font-size: 15px; }
.screencard.on { border: 2px solid var(--good); background: #E3F1EC; }
.screencard.on b::before { content: "● "; color: var(--good); }
.invite { grid-template-columns: 1fr auto; }
.picker > .eyebrow { margin: 14px 0 8px; }
.gcards { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--ink); overflow: hidden; transition: box-shadow .2s; }
.gcard.open { grid-column: 1 / -1; box-shadow: 4px 4px 0 var(--accent); }
.gcard.locked .gcard-head img { filter: grayscale(.8) opacity(.6); }
.gcard-head { display: grid; gap: 2px; width: 100%; text-align: left; padding: 0 0 10px; }
.gcard-head img { width: 100%; height: auto; aspect-ratio: 16 / 10; display: block; border-bottom: 2px solid var(--ink); margin-bottom: 6px; background: var(--paper-2); }
.gcard.open .gcard-head img { aspect-ratio: 16 / 7; object-fit: cover; }
.gcard-head b { font: 800 16px/1.15 var(--f-display); padding: 0 10px; }
.gcard-head span { font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 0 10px; }
.gcard-body { display: grid; gap: 8px; padding: 0 12px 14px; }
.gcard-body .eyebrow { margin-top: 4px; }
.rules { padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.opts { list-style: none; display: grid; gap: 6px; }
.opts label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper); font-size: 14px; }
.opts input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.opts span { display: grid; }
.picker li .eyebrow { display: block; font-size: 12px; }

/* ---------- controllers: floating joystick, portrait + landscape ---------- */
.stick { position: relative; width: 100%; aspect-ratio: auto; height: 100%; min-height: 220px; border-radius: var(--r-lg); background: var(--paper-2); border: 2px dashed var(--line); display: block; touch-action: none; box-shadow: none; overflow: hidden; }
.stick .ring { position: absolute; left: 50%; top: 50%; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper-3); display: grid; place-items: center; transition: opacity .15s; opacity: .55; }
.stick.active .ring { opacity: 1; }
.stick .knob { width: 56px; height: 56px; }
.stickhint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); pointer-events: none; }
.pad.stickpad { flex: 1; grid-template-columns: 1fr 120px; align-items: stretch; align-content: stretch; }
.buttons { align-content: end; }
.buttons button { display: grid; place-content: center; gap: 2px; }
.buttons button small { font: 600 11px var(--f-body); opacity: .85; }
.level { width: min(70vw, 260px); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper-2); display: grid; place-items: center; margin: auto; box-shadow: inset 4px 4px 0 rgba(31,27,22,.1); }
.level i { width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); transition: transform .06s linear; }
.pad.tilt { align-content: center; justify-items: center; }
@media (orientation: landscape) and (max-height: 520px) {
  .ctrl .prompt h2 { font-size: 20px; }
  .ctrl .prompt p { display: none; }
  .ctrl { gap: 6px; }
  .pad.stickpad { grid-template-columns: 1fr 1fr; }
  .buttons { grid-template-columns: 1fr 1fr; align-content: center; }
  .buttons button, .buttons button:first-child { min-height: 110px; }
  .pad.dpad { width: min(100%, 78dvh); }
}

/* ---------- hidden roles ---------- */
.wordcard.role { text-align: center; }
.rolebody { font-size: 15px; color: var(--ink-2); max-width: 36ch; }
.rolesees { font-weight: 700; font-size: 15px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--paper-2); }
.row.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.center { text-align: center; }
.quests { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quests li { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: center; }
.quests li b { font: 800 22px var(--f-display); color: var(--ink); }
.quests li.now { border-color: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.quests li.ok { background: #D7EBDF; border-color: var(--good); }
.quests li.fail { background: #F6D6CE; border-color: var(--accent); }
.speakorder li.onteam { background: #FFF3D6; }
.badge.good { background: var(--good); }
.tokens { grid-template-columns: repeat(3, 1fr); }
.tokens .eyebrow { grid-column: 1 / -1; }
.tokenfeed { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tokenfeed li { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--paper-2); }
.tok-yes { background: #D7EBDF !important; } .tok-no { background: #F6D6CE !important; } .tok-close { background: #FFF3D6 !important; } .tok-correct { background: var(--good) !important; color: var(--paper-3) !important; }

/* ---------- co-op ---------- */
.numcard { display: inline-grid; place-items: center; min-width: 40px; height: 54px; padding: 0 6px; border-radius: 8px; background: #FFFDF8; border: 2px solid var(--ink); border-bottom: 5px solid var(--c, var(--ink)); font: 800 20px var(--f-display); color: var(--ink); }
.numcard.big { min-width: 56px; height: 76px; font-size: 28px; }
.mindhand, .pilecards { display: flex; flex-wrap: wrap; gap: 6px; }
.mindtop { font-size: 64px !important; }
.felt.oops { background: radial-gradient(ellipse at 50% 30%, #8A3B2B, #5E2A20); }
.mindplay { min-height: 76px; font-size: 24px; }
.hull { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 700; }
.hullbar { height: 14px; border-radius: 7px; background: var(--paper-2); border: 2px solid var(--ink); overflow: hidden; }
.hullbar i { display: block; height: 100%; background: var(--good); transition: width .3s; }
.wordcard.order b { font-size: clamp(24px, 7vw, 34px); }
.panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctl { display: grid; gap: 8px; align-content: space-between; padding: 12px; border-radius: var(--r-md); background: #3A3530; color: var(--paper-3); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); text-align: left; min-height: 110px; touch-action: manipulation; }
.ctl b { font-size: 15px; line-height: 1.2; }
.ctl i { font-style: normal; font-weight: 800; justify-self: start; padding: 6px 12px; border-radius: 8px; background: var(--accent); color: var(--paper-3); }
.ctl.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ctl.toggle i { background: #57504A; } .ctl.toggle.on i { background: var(--good); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps button { min-height: 40px; border-radius: 8px; background: #57504A; color: var(--paper-3); font-weight: 800; }
.steps button.on { background: #E0A526; color: var(--ink); }
.tv-view .panel { display: none; }
.tv-view .hull { font-size: 26px; } .tv-view .hullbar { height: 26px; }
.tv-view .quests li b { font-size: 48px; } .tv-view .quests li { font-size: 18px; padding: 18px 4px; }
.tv-view .numcard { min-width: 70px; height: 96px; font-size: 40px; }
.tv-view .mindtop { font-size: 160px !important; }
.tv-view .tokenfeed li { font-size: 22px; padding: 6px 16px; }
.opts .choice { display: grid; gap: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper); font-size: 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 7px 11px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper-3); font-weight: 600; font-size: 13px; }
.seg button.on { border-color: var(--ink); background: var(--ink); color: var(--paper-3); }
.seg button:disabled { opacity: .7; }
.buttons button.off { opacity: .45; }
.buttons button .lbl { font-size: clamp(16px, 4.6vw, 22px); line-height: 1.1; }

/* ---------- landing v2 ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(20px, 5vw, 64px) 0; }
.hero .intro { padding: 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.cta .btn.big { width: auto; padding-inline: 26px; }
.collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; transform: rotate(-4deg); }
.collage img { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); display: block; background: var(--paper-2); }
.collage img:nth-child(2n) { transform: translateY(18px); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin: 20px 0 36px; }
.steps article { padding: 22px 22px 26px 0; display: grid; gap: 6px; align-content: start; }
.steps article + article { padding-left: 22px; border-left: 1px solid var(--line); }
.steps .num { font: 700 14px var(--f-mono); color: var(--accent); }
.steps h2 { font-size: 24px; }
.steps p { color: var(--ink-2); }
.paths { grid-template-columns: 1fr 1fr; grid-template-rows: auto; margin-bottom: 48px; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .collage { order: -1; transform: rotate(-3deg) scale(.96); }
  .steps { grid-template-columns: 1fr; }
  .steps article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .paths { grid-template-columns: 1fr; }
}

/* mahjong v2: real faces, grouped hand, shared pond */
.mj.face svg { width: calc(var(--tw) * .82); height: calc(var(--tw) * 1.14); display: block; }
.myhand .tiles .gap { width: 6px; flex: none; }
.myhand .mj.hand { --tw: min(44px, calc((100vw - 96px) / 14.6)); }
.mjtable { display: grid; gap: 10px; justify-items: center; padding: 14px; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #357060, var(--felt) 60%, var(--felt-2)); border: 3px solid var(--ink); box-shadow: inset 0 0 0 6px rgba(0,0,0,.12); color: var(--paper-3); }
.mjtable .log { color: rgba(251, 247, 240, .9); font-size: 14px; }
.lastdiscard { display: flex; align-items: center; gap: 12px; color: rgba(251, 247, 240, .9); }
.lastdiscard .mj { box-shadow: 0 5px 0 #3E8E6E, 0 5px 0 1.5px var(--ink), 0 0 0 4px var(--c); }
.pond { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; max-width: 100%; }
.pondtile { display: inline-flex; border-bottom: 3px solid var(--c); border-radius: 0 0 4px 4px; padding-bottom: 1px; }
.pondtile .mj { margin-bottom: 3px; }
.pondtile.last .mj { outline: 2px solid #FFD66B; outline-offset: 1px; }
.tv-view .mjtable { padding: 28px; }
.tv-view .pond .mj.xs { --tw: 40px; }
.tv-view .mjseats { grid-template-columns: repeat(4, 1fr); }

/* ---------- batch 3 games ---------- */
.row.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.row.five { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.votes.one { grid-template-columns: 1fr; }
.lccard { --lc: #1F1B16; position: relative; flex: none; width: 52px; height: 76px; border-radius: 9px; background: var(--lc); border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(31,27,22,.35); display: grid; place-items: center; color: var(--lc); font: 800 22px var(--f-display); overflow: hidden; }
.lccard::before { content: ""; position: absolute; width: 74%; height: 62%; border-radius: 50%; background: #FFFDF8; transform: rotate(25deg); }
.lccard b { position: relative; }
.lccard i { position: absolute; top: 3px; left: 5px; font: 800 12px var(--f-display); font-style: normal; color: #FFFDF8; }
.lccard.wild { background: conic-gradient(#D9483B 0 25%, #E0A526 0 50%, #3E9A5B 0 75%, #3C7CC4 0); }
.lccard.wild b { color: var(--ink); }
.lchand { display: flex; gap: 6px; overflow-x: auto; padding: 14px 4px 6px; scrollbar-width: none; }
.lchand .lccard.ok { transform: translateY(-8px); box-shadow: 0 6px 0 var(--accent); cursor: pointer; }
.lchand .lccard.no { filter: saturate(.4) opacity(.6); }
.lctop { display: flex; align-items: center; gap: 16px; }
.lctop .lccard { width: 72px; height: 104px; font-size: 30px; }
.swatch-big { padding: 6px 14px; border-radius: 999px; background: var(--lc); color: #FFFDF8; font-weight: 800; border: 2px solid var(--ink); }
.colorbtn { background: var(--lc) !important; color: #FFFDF8; }
.tot { font: 700 13px var(--f-mono); margin-left: 4px; }
.pilestack { display: flex; align-items: center; gap: 12px; }
.rpiles { display: flex; gap: 18px; }
.pilebtn { display: grid; justify-items: center; gap: 4px; color: rgba(251,247,240,.85); font-size: 13px; font-weight: 600; }
.pilebtn:disabled { opacity: .6; }
.melds-table { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.meldbtn { display: flex; gap: 2px; padding: 4px; border-radius: 8px; background: rgba(251,247,240,.12); border-bottom: 3px solid var(--c); }
.cparrange { grid-template-columns: 1fr; gap: 8px; }
.cprow { display: grid; gap: 4px; padding: 8px; border-radius: var(--r-sm); background: var(--paper); border: 2px dashed var(--line); }
.cprow.active { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.cplabel { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cpcards { display: flex; gap: 3px; flex-wrap: wrap; min-height: 34px; }
.cpresults { list-style: none; display: grid; gap: 10px; }
.cpresults li { padding: 10px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); border-left: 6px solid var(--c); display: grid; gap: 6px; }
.cpresults header { display: flex; gap: 8px; align-items: center; }
.fireworks { display: flex; gap: 10px; }
.fw { width: 46px; height: 60px; border-radius: 10px; background: var(--hb); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 26px var(--f-display); color: #FFFDF8; box-shadow: 0 0 18px var(--hb); }
.hbseats { list-style: none; display: grid; gap: 8px; }
.hbseats li { padding: 8px 10px; border-radius: var(--r-md); background: var(--paper-3); border: 2px solid var(--line); display: grid; gap: 6px; }
.hbseats li.turn { border-color: var(--ink); box-shadow: 3px 3px 0 var(--c); }
.hbseats header { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.hbseats .avatar { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.hbhand { display: flex; gap: 6px; }
.hbcard { --hb: #CFC6B6; position: relative; width: 44px; height: 60px; border-radius: 8px; background: var(--hb); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 24px var(--f-display); color: #FFFDF8; }
.hbcard.mine { background: repeating-linear-gradient(45deg, var(--hb) 0 6px, #E8DFCF 6px 10px); color: var(--ink); }
.hbcard.sel { transform: translateY(-8px); box-shadow: 0 6px 0 var(--accent); }
.hbcard .knew { position: absolute; bottom: 2px; right: 4px; font: 700 10px var(--f-body); font-style: normal; }
.hbdiscard { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hbdiscard .mini { width: 20px; height: 26px; border-radius: 4px; background: var(--hb); color: #FFFDF8; font: 800 12px var(--f-display); display: grid; place-items: center; }
.canvaswrap { position: relative; }
.canvaswrap.live .sketch { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }
.canvashint { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper-3); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; pointer-events: none; }
.chain { list-style: none; display: grid; gap: 10px; }
.chain li { display: grid; gap: 4px; padding: 10px; border-radius: var(--r-md); background: var(--paper-3); border-left: 6px solid var(--c); }
.chain .by { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.chain .said { font: 800 20px var(--f-display); }
.wordcard.prompt b { font-size: clamp(20px, 6vw, 28px); }
.wordlist.reveal li { display: grid; gap: 2px; }
.dial { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; }
.dialbar { position: relative; height: 34px; border-radius: 17px; border: 2px solid var(--ink); background: linear-gradient(90deg, #3C7CC4, #F3ECDF 50%, #E2553A); }
.dialbar .target { position: absolute; top: -6px; bottom: -6px; width: 6px; margin-left: -3px; background: var(--ink); border-radius: 3px; }
.dialbar .guessmark { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.dialrange input { height: 44px; }
.tv-view .lccard { width: 90px; height: 130px; font-size: 40px; }
.tv-view .fw { width: 90px; height: 120px; font-size: 52px; }
.tv-view .hbcard { width: 64px; height: 88px; font-size: 34px; }
.tv-view .dialbar { height: 60px; border-radius: 30px; }
.tv-view .chain .said { font-size: 34px; }
.cardbtn { position: relative; } /* keep paint order = hand order, so a lifted card never covers the next one */
.tv-view .sketch { width: auto; height: min(56dvh, 62vw); max-width: 100%; margin: 0 auto; display: block; }
