/* Next Signal - dark, gold, cinematic. Phone-first controller + TV-scaled display. */
:root {
  --bg: #07070b;
  --bg-2: #0d0d14;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3efe6;
  --muted: #9b968b;
  --dim: #6a665e;
  --gold: #c9a96e;
  --gold-2: #e6cf9f;
  --gold-3: #8a7041;
  --good: #7fd36b;
  --bad: #f27e63;
  --ga: #5ad1c5; /* active game accent */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.kicker { font-size: .72em; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.glow-a { width: 70vmax; height: 70vmax; left: -25vmax; top: -30vmax; background: radial-gradient(circle, rgba(201,169,110,.35), transparent 65%); animation: drift 28s ease-in-out infinite alternate; }
.glow-b { width: 60vmax; height: 60vmax; right: -25vmax; bottom: -30vmax; background: radial-gradient(circle, color-mix(in srgb, var(--ga) 30%, transparent), transparent 65%); animation: drift 34s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
.waves { position: absolute; left: -5%; width: 110%; top: 55%; height: 40vh; opacity: .16; }
.waves path { fill: none; stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 6 10; animation: flow 40s linear infinite; }
.waves path:nth-child(2) { stroke: var(--ga); opacity: .7; animation-duration: 55s; animation-direction: reverse; }
.waves path:nth-child(3) { opacity: .5; animation-duration: 70s; }
@keyframes flow { to { stroke-dashoffset: -1000; } }
.grain { position: absolute; inset: -50%; opacity: .05; 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) { .glow, .waves path { animation: none; } }

#app { position: relative; z-index: 1; min-height: 100svh; }
.screen { min-height: 100svh; }
body.offline::after { content: 'Reconnecting...'; position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%); z-index: 99; background: #2a1712; color: var(--bad); border: 1px solid rgba(242,126,99,.4); padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .55em; color: var(--text); }
.brand-mark { width: 2em; height: 2em; color: var(--gold); }
.brand-name { font-family: var(--serif); font-size: 1.5em; font-weight: 600; letter-spacing: -.01em; }
.brand-name em { font-style: italic; font-weight: 400; color: var(--gold-2); margin-left: .15em; }
.brand.small { font-size: .8em; }

/* ---------- buttons & fields ---------- */
.btn { --b: var(--panel-2); display: inline-flex; align-items: center; justify-content: center; gap: .55em; padding: .9em 1.3em; border-radius: 14px; border: 1px solid var(--line-2); background: var(--b); font-weight: 700; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #a98a52); color: #1a140a; border-color: rgba(255,240,200,.35); box-shadow: 0 10px 30px -10px rgba(201,169,110,.6), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.primary:not(:disabled):hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel); border-color: var(--gold-3); }
.btn.block { width: 100%; }
.btn.xl { font-size: 1.25em; padding: .95em 2em; border-radius: 18px; }
.icon-btn { width: 2.6em; height: 2.6em; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--muted); transition: color .2s, border-color .2s, background .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn.armed { color: var(--bad); border-color: var(--bad); background: rgba(242,126,99,.1); }
.text-field { width: 100%; padding: .95em 1.1em; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); font-size: 1.1em; font-weight: 600; outline: none; transition: border-color .2s, box-shadow .2s; }
.text-field:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,169,110,.15); }
.text-field.mono { letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 800; }
.field-label { display: block; font-size: .72em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 .6em .2em; }
.row { display: flex; gap: .6em; }
.row > * { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .3em .75em; border-radius: 99px; font-size: .78em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.badge.gold { background: rgba(201,169,110,.14); color: var(--gold-2); border: 1px solid rgba(201,169,110,.35); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); z-index: 100; background: #16151c; border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 20px 50px rgba(0,0,0,.5); max-width: calc(100vw - 32px); animation: toastIn .35s var(--ease); }
.toast.bad { border-color: rgba(242,126,99,.5); color: #ffc2b3; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- avatars & chips ---------- */
.avatar { --pc: var(--gold); --s: 2.4em; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; flex: none; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--pc) 75%, white), var(--pc) 55%, color-mix(in srgb, var(--pc) 55%, black)); color: #121016; font-weight: 800; box-shadow: 0 0 0 2px rgba(0,0,0,.4), 0 0 0 3.5px color-mix(in srgb, var(--pc) 45%, transparent), 0 8px 20px -8px var(--pc); }
.avatar span { font-size: calc(var(--s) * .38); letter-spacing: .02em; line-height: 1; }
.avatar.sm { --s: 1.9em; }
.avatar.lg { --s: 4.2em; }
.avatar.xl { --s: 6em; }
.avatar.xxl { --s: 9em; }
.avatar.ghost { background: transparent; border: 2px dashed var(--line-2); box-shadow: none; color: var(--dim); }
.avatar.ghost .icon { width: 40%; height: 40%; }
.chips { display: flex; flex-wrap: wrap; gap: .5em; }
.chip { display: inline-flex; align-items: center; gap: .45em; padding: .4em .8em .4em .5em; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; font-size: .9em; }
.chip i { width: .7em; height: .7em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.chip.away { opacity: .45; }
.room-chip { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; padding: .35em .8em; border-radius: 12px; border: 1px solid rgba(201,169,110,.35); background: rgba(201,169,110,.08); }
.room-chip small { font-size: .6em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.room-chip b { font-size: 1.1em; letter-spacing: .18em; color: var(--gold-2); font-weight: 800; }
.dots { display: inline-flex; gap: .25em; align-items: center; }
.dots i { width: .4em; height: .4em; border-radius: 50%; background: currentColor; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- landing ---------- */
.landing { display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.landing-inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; }
.landing-head { display: flex; justify-content: center; padding-top: 8px; }
.hero { text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.3rem, 10vw, 3.3rem); line-height: 1.02; margin: 6px 0 12px; letter-spacing: -.02em; }
.hero h1 em { color: var(--gold-2); font-style: italic; }
.lede { color: var(--muted); margin: 0 auto; max-width: 34ch; }
.join-card { padding: 22px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.05); backdrop-filter: blur(10px); }
.code-wrap { position: relative; margin-bottom: 18px; }
.code-field { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; caret-color: transparent; }
.code-input { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.code-input span { aspect-ratio: 1 / 1.08; display: grid; place-items: center; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(0,0,0,.4); font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--gold-2); transition: border-color .2s, transform .2s var(--ease), background .2s; position: relative; }
.code-input span.filled { border-color: rgba(201,169,110,.55); background: rgba(201,169,110,.08); transform: translateY(-2px); }
.code-input span.caret::after { content: ''; width: 2px; height: 40%; background: var(--gold); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code-input.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.join-card .text-field { margin-bottom: 18px; }
.display-btn { justify-content: flex-start; padding: 14px 18px; border-radius: 18px; text-align: left; background: var(--panel); }
.display-btn > .icon:first-child { width: 2.2em; height: 2.2em; padding: .45em; border-radius: 12px; background: rgba(201,169,110,.12); color: var(--gold); }
.display-btn > span:not(.icon) { display: flex; flex-direction: column; flex: 1; line-height: 1.2; }
.display-btn small { color: var(--muted); font-weight: 600; }
.display-btn > .icon:last-child { color: var(--muted); }
.landing-foot { text-align: center; color: var(--dim); font-size: .85em; }
.device-settings { display: flex; flex-direction: column; gap: 8px; }
.ds-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); }
.ds-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ds-txt small { color: var(--muted); font-size: .8em; line-height: 1.35; }
.ds-row .rm-seg { flex: none; }
.sheet { overscroll-behavior: contain; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: grid; align-items: end; justify-items: center; }
.sheet-card { max-height: calc(100svh - env(safe-area-inset-top, 0px) - 16px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; width: 100%; max-width: 480px; background: #111018; border: 1px solid var(--line-2); border-radius: 26px 26px 0 0; padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-card { border-radius: 26px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.4em; }
.sheet-card p { margin: 0; }
.or { text-align: center; color: var(--dim); font-size: .85em; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: #111018; padding: 0 10px; }
.sheet .row .text-field { flex: 1.6; }

/* ---------- display base (scales with the screen) ---------- */
.display { font-size: clamp(12px, .92vw, 30px); padding: 2.2em 2.6em 2em; min-height: 100svh; display: flex; flex-direction: column; }
.d-top, .g-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.d-top-tools, .g-tools { display: flex; gap: .6em; align-items: center; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 1.6em 0 .8em; }
.section-head h2, .section-head h3 { margin: 0; font-size: .78em; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.section-head .count { color: var(--dim); font-weight: 700; font-size: .85em; }

/* lobby grid */
.d-lobby { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); grid-template-rows: auto 1fr; column-gap: 3.5em; }
.d-lobby .d-top { grid-column: 1 / -1; }
.join-panel { align-self: center; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1.2em; padding-top: 1em; }
.join-kicker { display: inline-flex; align-items: center; gap: .6em; color: var(--muted); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85em; }
.join-kicker .icon { color: var(--gold); }
.join-url { font-family: var(--serif); font-size: 2.3em; line-height: 1; letter-spacing: -.01em; }
.code-tiles { display: flex; gap: .3em; }
.code-tiles span { display: grid; place-items: center; width: 1.25em; height: 1.4em; border-radius: .18em; background: linear-gradient(180deg, rgba(201,169,110,.18), rgba(201,169,110,.05)); border: 1px solid rgba(201,169,110,.45); font-family: var(--serif); font-weight: 600; color: var(--gold-2); text-shadow: 0 0 30px rgba(201,169,110,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 20px 40px -20px rgba(201,169,110,.5); }
.code-tiles.xl { font-size: 4.6em; }
.qr-wrap { display: flex; align-items: center; gap: 1.2em; color: var(--muted); font-size: .95em; }
.qr-wrap p { margin: 0; max-width: 10em; }
.qr-card { width: 8.5em; height: 8.5em; padding: .8em; border-radius: 1em; background: var(--text); box-shadow: 0 20px 50px -20px rgba(201,169,110,.5); }
.qr { width: 100%; height: 100%; }
.lobby-main { display: flex; flex-direction: column; min-width: 0; padding-bottom: 1em; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 1.2em 1.4em; min-height: 6.5em; }
.lobby-player { display: flex; flex-direction: column; align-items: center; gap: .45em; width: 5em; position: relative; }
.lobby-player .pname { font-weight: 700; font-size: .95em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player .vip { display: none; position: absolute; top: -.6em; left: 50%; transform: translateX(-50%); align-items: center; gap: .2em; font-size: .6em; font-weight: 800; letter-spacing: .1em; color: #1a140a; background: var(--gold); padding: .2em .6em; border-radius: 99px; }
.lobby-player.is-vip .vip { display: inline-flex; }
.lobby-player.away { opacity: .4; }
.lobby-player .kick { position: absolute; top: 0; right: .1em; width: 1.6em; height: 1.6em; border-radius: 50%; border: 1px solid var(--line-2); background: #18161e; color: var(--muted); display: grid; place-items: center; opacity: 0; cursor: pointer; transition: opacity .2s; padding: .3em; }
.lobby-player:hover .kick { opacity: 1; }
.empty-slot .pname { color: var(--dim); font-weight: 600; }
.lobby-players .avatar.lg { --s: 3.8em; }
.empty-slot .avatar { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.game-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5em, 1fr)); gap: .9em; overflow: visible; }
.game-shelf .cover { aspect-ratio: 16 / 8; }
.game-tile { text-align: left; padding: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; display: flex; flex-direction: column; }
.game-tile:hover { transform: translateY(-3px); }
.game-tile.on { border-color: color-mix(in srgb, var(--ga) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ga) 50%, transparent), 0 24px 60px -24px var(--ga); }
.game-tile.soon { cursor: default; opacity: .5; border-style: dashed; }
.game-tile.soon:hover { transform: none; }
.game-tile-text { padding: .8em 1em 1em; display: flex; flex-direction: column; }
.game-tile-text b { font-family: var(--serif); font-size: 1.25em; font-weight: 600; }
.game-tile-text span { color: var(--muted); font-size: .9em; }
.cover { aspect-ratio: 16 / 7; display: grid; place-items: center; background: radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--ga) 28%, transparent), transparent 60%), #0c0c12; color: var(--ga); font-family: var(--serif); font-size: 3em; position: relative; overflow: hidden; }
.cover svg { width: 100%; height: 100%; }
.cover-soon { color: var(--dim); }
.cover-soon .icon { width: 2rem; height: 2rem; }
.cover-rewind rect { fill: rgba(255,255,255,.05); stroke: currentColor; stroke-width: 1.4; }
.cover-rewind line { stroke: currentColor; stroke-width: 1.4; opacity: .7; }
.cover-rewind circle { fill: currentColor; }
.cover-rewind text { fill: var(--text); font-family: var(--serif); font-size: 13px; text-anchor: middle; font-weight: 600; }
.cover-rewind text.q { fill: currentColor; font-size: 26px; }
.cover-rewind .hot rect { fill: color-mix(in srgb, var(--ga) 18%, transparent); stroke-width: 2; }
.cover-rewind .rw-card { animation: bob 3.2s var(--d) ease-in-out infinite; }
.cover-rewind .hot { animation: hover 2.4s ease-in-out infinite; }
.cover-bluff rect { fill: rgba(255,255,255,.05); stroke: currentColor; stroke-width: 1.4; }
.cover-bluff .ln { stroke: var(--text); stroke-width: 5; stroke-linecap: round; opacity: .35; }
.cover-bluff .blank { stroke: currentColor; stroke-width: 3; stroke-dasharray: 6 5; animation: flow 4s linear infinite; }
.cover-bluff .bl-tile { animation: bob 3.2s var(--d) ease-in-out infinite; }
.cover-bluff .truth rect { fill: color-mix(in srgb, var(--gold) 22%, transparent); stroke: var(--gold); stroke-width: 2; animation: truthGlow 3s ease-in-out infinite; }
@keyframes truthGlow { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 8px rgba(201,169,110,.8)); } }
.cover-pinit .pi-globe { fill: rgba(255,255,255,.03); stroke: currentColor; stroke-width: 1.4; opacity: .7; }
.cover-pinit .pi-lat, .cover-pinit .pi-lon { fill: none; stroke: currentColor; stroke-width: 1; opacity: .3; }
.cover-pinit .pi-target circle { fill: var(--gold); }
.cover-pinit .pi-target .ring { fill: none; stroke: var(--gold); stroke-width: 2; transform-origin: 196px 88px; animation: coverPulse 2s ease-out infinite; }
@keyframes coverPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }
.cover-pinit .pi-dpin path { stroke: var(--text); stroke-width: 2; opacity: .7; }
.cover-pinit .pi-dpin circle { fill: var(--text); opacity: .85; }
.cover-pinit .pi-dpin.hot circle { fill: currentColor; opacity: 1; }
.cover-pinit .pi-dpin { animation: bob 3s var(--d) ease-in-out infinite; }
.cover-sketch .sk-sheet { fill: rgba(251,250,246,.9); }
.cover-sketch .sk-doodle { fill: none; stroke: #2a2833; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: doodle 4s ease-in-out infinite; }
@keyframes doodle { 0% { stroke-dashoffset: 260; } 55%, 100% { stroke-dashoffset: 0; } }
.cover-sketch .sk-pencil path { fill: currentColor; }
.cover-sketch .sk-pencil .tip { fill: var(--gold-2); }
.cover-sketch .sk-pencil { animation: bob 2s ease-in-out infinite; }
.cover-sketch .sk-q text { fill: currentColor; font-family: var(--serif); font-size: 34px; opacity: .7; }
.cover-rewind .rw-arrow { stroke: currentColor; stroke-width: 1.6; stroke-dasharray: 3 4; animation: flow 6s linear infinite; }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes hover { 50% { transform: translateY(-6px); } }
.game-detail { margin-top: 1.2em; padding: 1.3em 1.5em; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--ga) 9%, transparent), transparent 60%), var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2em; }
.detail-text h3 { font-family: var(--serif); font-weight: 500; font-size: 2.2em; margin: 0 0 .25em; }
.detail-text p { color: var(--muted); margin: 0 0 1em; }
.how summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .5em; font-weight: 700; color: var(--gold-2); font-size: .95em; }
.how summary::-webkit-details-marker { display: none; }
.rules { margin: .8em 0 0; padding-left: 1.3em; color: var(--muted); display: grid; gap: .4em; font-size: .95em; }
.rules li::marker { color: var(--gold); font-weight: 800; }
.settings { display: grid; gap: .75em; }
.setting { display: grid; grid-template-columns: 8.5em 1fr; gap: 1em; align-items: center; }
.setting.multi { align-items: start; }
.setting-label { font-weight: 700; font-size: .9em; display: flex; flex-direction: column; }
.setting-label small { color: var(--dim); font-weight: 600; font-size: .85em; }
.segs { display: flex; flex-wrap: wrap; gap: .4em; }
.seg { display: inline-flex; align-items: center; gap: .4em; padding: .5em .9em; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; font-weight: 700; font-size: .85em; cursor: pointer; color: var(--muted); transition: all .2s var(--ease); }
.seg .icon { width: 1em; height: 1em; }
.seg.on { color: #12100c; background: var(--ga); border-color: var(--ga); box-shadow: 0 6px 18px -8px var(--ga); }
.seg:disabled { cursor: default; }
.last-results { margin-top: 1em; display: inline-flex; align-items: center; gap: .6em; color: var(--muted); }
.last-results .icon { color: var(--gold); }
.last-results b { color: var(--text); }
.detail-text { display: flex; flex-direction: column; }
.detail-text .start-btn { margin-top: auto; align-self: flex-start; }
.detail-text .how { margin-bottom: 1.4em; }

/* portrait display (iPad / phone used as the board) */
@media (max-aspect-ratio: 1/1) {
  .display { font-size: clamp(13px, 2.2vw, 26px); padding: calc(env(safe-area-inset-top, 0px) + 1.2em) 1.2em 1.4em; }
  .d-lobby { grid-template-columns: 1fr; }
  .join-panel { align-items: center; text-align: center; }
  .code-tiles.xl { font-size: 4.5em; }
  .game-detail { grid-template-columns: 1fr; }
  .detail-text .start-btn { align-self: stretch; }
}

/* ---------- phone base ---------- */
.phone { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 110px); }
.p-head, .p-top { display: flex; align-items: center; gap: 10px; }
.p-head .brand { flex: 1; }
.p-hero { text-align: center; padding: 26px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.p-hero h2 { font-family: var(--serif); font-weight: 500; font-size: 2.2em; margin: 6px 0 0; }
.p-hero p { margin: 0; max-width: 30ch; }
.hero-avatar { position: relative; }
.hero-avatar .pulse { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--pc); opacity: 0; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.4); opacity: 0; } }
.p-games { display: grid; gap: 10px; }
.p-game { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; }
.p-game.on { border-color: color-mix(in srgb, var(--ga) 60%, transparent); background: color-mix(in srgb, var(--ga) 7%, transparent); }
.p-game .cover { border-radius: 10px; font-size: 1.6em; }
.p-game b { display: block; font-family: var(--serif); font-size: 1.3em; font-weight: 600; }
.p-game span { color: var(--muted); font-size: .9em; }
.phone .how { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.phone .how[open] summary { margin-bottom: 4px; }
.phone .settings { margin-top: 12px; }
.phone .setting { grid-template-columns: 1fr; gap: 6px; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); margin-top: 22px; font-weight: 600; }
.sticky-cta, .p-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 14px); background: linear-gradient(180deg, transparent, rgba(7,7,11,.92) 35%); }
.sticky-cta > *, .p-foot > * { max-width: 528px; margin: 0 auto; }
.p-foot:empty { display: none; }
.sticky-cta .btn, .p-foot .btn { padding: 1.1em; font-size: 1.05em; }
.sticky-cta .btn.primary, .p-foot .btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #a98a52); }

/* =================== REWIND =================== */
.rewind { --ga: #5ad1c5; }
.g-top { margin-bottom: 1.4em; }
.g-title { display: flex; align-items: baseline; gap: 1em; flex-wrap: wrap; }
.g-name { font-family: var(--serif); font-style: italic; font-size: 2em; color: var(--ga); }
.g-meta { display: inline-flex; align-items: center; gap: .7em; color: var(--muted); font-weight: 700; font-size: .9em; letter-spacing: .06em; text-transform: uppercase; }
.g-meta i { width: .3em; height: .3em; border-radius: 50%; background: var(--dim); }
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.dock { position: fixed; right: 2.2em; bottom: 1.8em; display: flex; gap: .6em; z-index: 10; }
.dock .btn { font-size: .95em; backdrop-filter: blur(10px); background: rgba(20,19,26,.7); }
.dock .btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #a98a52); }

/* event card */
.ev-card { position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #17161f, #0f0e15); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02), inset 0 1px 0 rgba(255,255,255,.06); }
.ev-img { position: relative; aspect-ratio: 16 / 9; background: #0b0b10; display: grid; place-items: center; overflow: hidden; color: var(--ga); }
.ev-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.ev-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #15141c); }
.ev-img > .icon { width: 30%; height: 50%; opacity: .5; }
.ev-body { padding: 1em 1.3em 1.3em; display: flex; flex-direction: column; gap: .35em; }
.ev-kicker { display: inline-flex; align-items: center; gap: .45em; color: var(--ga); font-weight: 800; font-size: .72em; letter-spacing: .18em; text-transform: uppercase; }
.ev-title { font-family: var(--serif); font-weight: 600; font-size: 1.5em; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
.ev-desc { margin: 0; color: var(--muted); }
.ev-blurb { margin: .3em 0 0; color: #c9c3b6; font-size: .92em; line-height: 1.5; }
.ev-year { position: absolute; top: .8em; right: .8em; font-family: var(--serif); font-weight: 700; font-size: 1.3em; padding: .15em .6em; border-radius: 99px; background: rgba(10,10,14,.75); border: 1px solid rgba(201,169,110,.5); color: var(--gold-2); backdrop-filter: blur(6px); }
.ev-year.hidden-year { color: var(--ga); border-color: color-mix(in srgb, var(--ga) 50%, transparent); }
.ev-card.sm { font-size: .7em; border-radius: 16px; }
.ev-card.sm .ev-desc { display: none; }
.ev-card.xl { font-size: 1.35em; }
.ev-card.xl .ev-title { font-size: 2.1em; }
.ev-card.xl .ev-year { display: none; }
.ev-card.lg .ev-year { display: none; }

/* intro */
.intro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2em; text-align: center; }
.intro-title h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 7em; margin: .05em 0 0; line-height: 1; color: var(--ga); text-shadow: 0 0 80px color-mix(in srgb, var(--ga) 40%, transparent); }
.intro-title p { color: var(--muted); font-size: 1.3em; margin: .4em 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2em; max-width: 60em; width: 100%; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .7em; padding: 1.4em; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
.step > .icon { width: 2.2em; height: 2.2em; color: var(--ga); }
.step b { position: absolute; top: .6em; left: .9em; font-family: var(--serif); color: var(--dim); }
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2em; }
.starter { width: 12em; display: flex; flex-direction: column; gap: .5em; }
.starter-who { display: flex; align-items: center; gap: .5em; font-weight: 700; }
.starter-who .avatar { --s: 1.8em; }
.pbar { width: min(40em, 100%); height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--ga); transform-origin: left; }

/* placing */
.placing { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3em; align-items: start; position: relative; }
.stage-card { position: relative; max-width: 40em; width: 100%; justify-self: center; }
.ask { font-family: var(--serif); font-style: italic; font-size: 1.8em; color: var(--muted); margin-bottom: .5em; display: flex; align-items: center; gap: .6em; }
.steal-tag { display: inline-flex; align-items: center; gap: .35em; font-family: var(--sans); font-style: normal; font-size: .55em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #1a0c08; background: var(--bad); padding: .35em .8em; border-radius: 99px; }
.timer-ring { position: absolute; top: 1.6em; right: -1.6em; width: 6.5em; height: 6.5em; border-radius: 50%; background: #0c0c12; box-shadow: 0 20px 40px -10px rgba(0,0,0,.8); display: grid; place-items: center; z-index: 2; }
.timer-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 6; }
.timer-ring .bg { stroke: var(--line); }
.timer-ring .fg { stroke: var(--ga); stroke-linecap: round; transition: stroke .3s; }
.timer-ring.urgent .fg { stroke: var(--bad); }
.timer-ring.urgent { animation: thump 1s infinite; }
@keyframes thump { 10% { transform: scale(1.08); } 30% { transform: scale(1); } }
.timer-num { font-family: var(--serif); font-size: 2.3em; font-weight: 600; }
.board { display: flex; flex-direction: column; gap: .8em; min-width: 0; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; }
.board-head h2 { margin: 0; font-size: .78em; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.locked-count { color: var(--ga); font-weight: 800; }
.board-rows, .results { display: flex; flex-direction: column; gap: .6em; }
.board-row, .result-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1em; padding: .75em 1em; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.board-row.locked { border-color: color-mix(in srgb, var(--pc) 55%, transparent); background: color-mix(in srgb, var(--pc) 7%, transparent); }
.board-row.away { opacity: .45; }
.br-main { min-width: 0; display: flex; flex-direction: column; gap: .35em; }
.br-name { display: flex; align-items: baseline; gap: .6em; }
.br-name b { font-size: 1.05em; }
.br-count { color: var(--dim); font-weight: 700; font-size: .85em; }
.lock-state { display: inline-flex; align-items: center; gap: .4em; font-weight: 800; color: var(--muted); font-size: .9em; min-width: 5.5em; justify-content: flex-end; }
.board-row.locked .lock-state { color: var(--pc); }
.mini-tl { display: flex; align-items: center; gap: .3em; flex-wrap: wrap; }
.mt-chip { font-size: .8em; font-weight: 700; padding: .15em .55em; border-radius: 99px; background: rgba(255,255,255,.06); color: #cfc9bd; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mt-chip.new { background: var(--good); color: #0e1a0a; border-color: var(--good); box-shadow: 0 0 18px -4px var(--good); }
.mt-mark { display: inline-flex; align-items: center; gap: .2em; font-size: .8em; font-weight: 800; padding: .15em .5em; border-radius: 99px; }
.mt-mark .icon { width: .95em; height: .95em; }
.mt-mark.bad { background: rgba(242,126,99,.15); color: var(--bad); border: 1px dashed var(--bad); }
.mt-mark.good { color: var(--good); border: 1px dashed var(--good); }
.mini-tl.dense .mt-chip { font-size: .7em; padding: .1em .4em; }

/* classic spotlight */
.spot { display: flex; flex-direction: column; gap: 1.2em; min-width: 0; }
.spot-who { display: flex; align-items: center; gap: 1.2em; }
.spot-who h2 { font-family: var(--serif); font-size: 3em; font-weight: 500; margin: 0; line-height: 1; }
.track-label { margin: 0; font-size: .75em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.track { display: flex; flex-wrap: wrap; align-items: stretch; gap: .4em; }
.track-card { display: flex; flex-direction: column; gap: .15em; padding: .7em .9em; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); max-width: 11em; }
.track-card b { font-family: var(--serif); font-size: 1.3em; color: var(--gold-2); }
.track-card span { font-size: .8em; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.track-gap { width: .5em; border-radius: 4px; display: grid; place-items: center; }
.track-gap.miss { width: 2.2em; background: rgba(242,126,99,.15); border: 1px dashed var(--bad); color: var(--bad); }
.queue { display: flex; align-items: center; gap: .5em; color: var(--muted); margin: 0; }
.queue .icon { color: var(--bad); }
.standings-strip { display: flex; flex-wrap: wrap; gap: .8em; margin-top: .4em; }
.ss { display: inline-flex; align-items: center; gap: .45em; padding: .3em .8em .3em .3em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.ss b { font-family: var(--serif); font-size: 1.15em; }
.ss small { color: var(--muted); font-weight: 600; }
.banner { position: absolute; left: 50%; bottom: 1em; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .7em; padding: .9em 1.6em; border-radius: 99px; font-size: 1.4em; font-weight: 600; background: #22130f; border: 1px solid var(--bad); color: #ffd7cc; box-shadow: 0 20px 60px -20px var(--bad); white-space: nowrap; z-index: 3; }
.banner .icon { color: var(--bad); }

/* reveal */
.reveal { flex: 1; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3em; align-items: start; }
.reveal-card { display: flex; flex-direction: column; align-items: flex-start; gap: .4em; }
.reveal-card .ev-card { width: 100%; margin-top: .8em; }
.year-reveal { font-family: var(--serif); font-weight: 600; font-size: 7em; line-height: .95; color: var(--gold-2); letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 60px rgba(201,169,110,.45); transform-origin: left center; }
.reveal-side { display: flex; flex-direction: column; gap: 1em; min-width: 0; }
.outcome { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 2.3em; margin: 0; }
.result-row.good { border-color: rgba(127,211,107,.4); background: rgba(127,211,107,.06); }
.result-row.bad { border-color: rgba(242,126,99,.25); }
.rtag { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; padding: .35em .8em; border-radius: 99px; font-size: .9em; white-space: nowrap; }
.rtag.good { background: var(--good); color: #0e1a0a; }
.rtag.bad { background: rgba(242,126,99,.14); color: var(--bad); }
.rtag.idle { color: var(--muted); }

/* final */
.final { flex: 1; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3em; align-items: center; }
.winner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4em; }
.winner .crown { color: var(--gold); width: 4em; height: 4em; filter: drop-shadow(0 0 30px rgba(201,169,110,.7)); margin-bottom: -.4em; }
.winner .crown .icon { width: 100%; height: 100%; }
.winner h1 { font-family: var(--serif); font-size: 5.5em; font-weight: 500; margin: 0; line-height: 1; }
.winner p { color: var(--muted); margin: 0; font-size: 1.1em; }
.winner .avatar { margin-bottom: .6em; }
.final-side { display: flex; flex-direction: column; gap: 1em; min-width: 0; }
.win-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); gap: .6em; }
.wt-card { border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; }
.wt-card .icon.fallback { aspect-ratio: 4 / 3; width: 100%; height: auto; padding: 22%; color: var(--ga); background: #0c0c12; }
.wt-card img, .wt-noimg { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.wt-noimg { display: grid; place-items: center; color: var(--ga); background: #0c0c12; }
.wt-card b { font-family: var(--serif); color: var(--gold-2); padding: .4em .6em 0; font-size: 1.1em; }
.wt-card span { padding: 0 .6em .6em; font-size: .75em; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ranking { display: flex; flex-direction: column; gap: .5em; margin-top: .6em; }
.rank-row { display: grid; grid-template-columns: 1.6em auto 1fr repeat(3, auto); align-items: center; gap: 1em; padding: .6em 1em; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.rank-row.first { border-color: rgba(201,169,110,.5); background: rgba(201,169,110,.07); }
.rank-n { font-family: var(--serif); color: var(--dim); font-size: 1.3em; }
.rank-stat { display: flex; flex-direction: column; align-items: flex-end; font-size: .7em; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.rank-stat b { font-size: 1.6em; color: var(--text); letter-spacing: 0; text-transform: none; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.center-msg { flex: 1; display: grid; place-items: center; color: var(--muted); }

@media (max-aspect-ratio: 1/1) {
  .placing, .reveal, .final { grid-template-columns: 1fr; gap: 1.6em; }
  .timer-ring { right: .6em; }
  .intro-title h1 { font-size: 4.5em; }
  .steps { grid-template-columns: 1fr; }
  .year-reveal { font-size: 5em; }
  .dock { left: 1.2em; right: 1.2em; justify-content: flex-end; }
  .display.rewind { padding-bottom: 6em; }
}

/* ---------- Rewind phone ---------- */
.p-top { position: sticky; top: 0; z-index: 15; margin: calc(-1 * env(safe-area-inset-top, 0px) - 12px) -16px 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: rgba(7,7,11,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.p-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-who b { display: block; line-height: 1.1; }
.p-who small { color: var(--muted); font-weight: 700; font-size: .78em; }
.p-progress { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.p-progress i { display: block; height: 100%; border-radius: 4px; transition: width .6s var(--ease); }
.room-chip.sm { padding: .25em .6em; }
.room-chip.sm b { font-size: .9em; }
.p-stage { display: flex; flex-direction: column; gap: 14px; }
.p-timer { position: relative; height: 30px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; }
.p-timer i { position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ga) 35%, transparent), color-mix(in srgb, var(--ga) 15%, transparent)); transform-origin: left; }
.p-timer span { position: relative; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .9em; }
.p-timer.urgent i { background: linear-gradient(90deg, rgba(242,126,99,.5), rgba(242,126,99,.2)); }
.p-card { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, #17161f, #0f0e15); border: 1px solid color-mix(in srgb, var(--ga) 35%, var(--line)); box-shadow: 0 20px 50px -25px color-mix(in srgb, var(--ga) 60%, transparent); }
.p-card-img { border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #0b0b10; display: grid; place-items: center; color: var(--ga); }
.p-card-img img { width: 100%; height: 100%; object-fit: cover; }
.p-card-img.noimg .icon { width: 45%; height: 45%; }
.p-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; justify-content: center; }
.p-card-body h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.25em; line-height: 1.1; }
.p-card-body p { margin: 0; color: var(--muted); font-size: .88em; line-height: 1.3; }
.p-prompt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.p-prompt b { font-family: var(--serif); font-size: 1.3em; font-weight: 500; }
.p-prompt small { color: var(--muted); font-weight: 600; }
.p-prompt .steal-tag { font-size: .7em; }

/* the placer: cards with tappable gaps */
.placer { display: flex; flex-direction: column; position: relative; }
.placer::before { content: ''; position: absolute; left: 31px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, transparent, var(--line-2) 8%, var(--line-2) 92%, transparent); }
.tl-card { position: relative; display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; padding: 10px 12px 10px 0; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); margin: 3px 0; }
.tl-year { justify-self: center; font-family: var(--serif); font-weight: 700; color: var(--gold-2); font-size: 1.05em; background: #121119; padding: 2px 6px; border-radius: 8px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.tl-text { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: .95em; line-height: 1.25; }
.tl-text > span:last-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-cat { color: var(--muted); display: inline-flex; flex: none; }
.tl-card.new { border-color: var(--good); background: rgba(127,211,107,.1); box-shadow: 0 0 30px -10px var(--good); animation: popin .6s var(--ease); }
@keyframes popin { from { transform: scale(.9); opacity: 0; } }
.slot { position: relative; display: flex; flex-direction: column; align-items: stretch; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; min-height: 14px; }
.slot-line { display: none; }
.slot-label { display: none; }
.placer.live .slot { min-height: 50px; justify-content: center; }
.placer.live .slot-label { display: flex; align-items: center; gap: 8px; margin-left: 20px; padding: 9px 14px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--ga) 35%, transparent); color: color-mix(in srgb, var(--ga) 85%, white); font-weight: 700; font-size: .85em; transition: all .2s var(--ease); background: rgba(0,0,0,.25); }
.placer.live .slot-label .icon { width: 1.3em; height: 1.3em; padding: 3px; border-radius: 50%; background: color-mix(in srgb, var(--ga) 20%, transparent); }
.placer.live .slot:active .slot-label { transform: scale(.98); }
.slot-ghost { display: none; }
.slot.sel .slot-label { display: none; }
.slot.sel .slot-ghost { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; padding: 12px 12px 12px 0; margin: 4px 0; border-radius: 14px; border: 2px solid var(--ga); background: color-mix(in srgb, var(--ga) 14%, #0f0e15); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ga) 12%, transparent), 0 16px 40px -16px var(--ga); transform-origin: center; }
.slot-ghost b { justify-self: center; font-family: var(--serif); font-size: 1.4em; color: var(--ga); position: relative; z-index: 1; background: #10131a; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ga); }
.slot-ghost span { font-weight: 700; line-height: 1.25; }
.slot.missed .slot-ghost { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; padding: 10px 12px 10px 0; border-radius: 14px; border: 2px dashed var(--bad); background: rgba(242,126,99,.08); }
.slot.missed .slot-ghost b { color: var(--bad); border-color: var(--bad); }
.p-locked { text-align: center; padding: 6px 0 2px; }
.p-locked h2 { font-family: var(--serif); font-weight: 500; margin: 6px 0 2px; font-size: 1.8em; }
.p-locked p { margin: 0; }
.lock-badge { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #10131a; background: var(--ga); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ga) 15%, transparent), 0 20px 40px -10px var(--ga); }
.lock-badge .icon { width: 30px; height: 30px; }
.p-watch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--pc) 8%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 40%, transparent); }
.p-watch small { display: block; color: var(--muted); font-weight: 700; font-size: .75em; letter-spacing: .14em; text-transform: uppercase; }
.p-watch b { font-size: 1.1em; }
.p-center { min-height: 55svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.p-center h2 { font-family: var(--serif); font-weight: 500; font-size: 2.2em; margin: 8px 0 0; }
.p-center p { margin: 0; max-width: 28ch; }
.big-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; }
.big-icon .icon { width: 42px; height: 42px; }
.big-icon.good { background: var(--good); color: #0e1a0a; box-shadow: 0 0 0 10px rgba(127,211,107,.15), 0 20px 50px -10px var(--good); }
.big-icon.bad { background: rgba(242,126,99,.15); color: var(--bad); border: 2px solid var(--bad); }
.big-icon.idle { background: var(--panel-2); color: var(--muted); }
.p-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 0 4px; }
.p-result h2 { font-family: var(--serif); font-weight: 500; font-size: 2.4em; margin: 6px 0 0; line-height: 1; }
.p-result p { margin: 0; color: var(--muted); }
.p-result p b { color: var(--gold-2); font-family: var(--serif); font-size: 1.3em; }
.p-blurb { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: #c9c3b6; font-size: .9em; }
.p-intro { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 10px; }
.p-intro .ev-card { width: 100%; max-width: 360px; }
.p-intro .ev-card .ev-year { font-size: 1.6em; }
.p-final { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 0 6px; position: relative; }
.p-final .crown { width: 56px; height: 56px; color: var(--muted); }
.p-final.won .crown { color: var(--gold); filter: drop-shadow(0 0 20px rgba(201,169,110,.8)); }
.p-final .crown .icon { width: 100%; height: 100%; }
.p-final h2 { font-family: var(--serif); font-weight: 500; font-size: 2.6em; margin: 0; }
.p-final p { margin: 0; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 12px; }
.p-stats div { padding: 12px 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.p-stats b { font-family: var(--serif); font-size: 1.7em; }
.p-stats small { color: var(--muted); font-weight: 700; font-size: .72em; text-transform: uppercase; letter-spacing: .1em; }
.placer.readonly .tl-card { margin: 4px 0; }
.tl-card.belongs { border: 1.5px dashed var(--good); background: rgba(127,211,107,.06); }
.tl-card.belongs .tl-year { color: var(--good); }
.tl-card.belongs .tl-text { flex-direction: column; align-items: flex-start; gap: 0; }
.tl-card.belongs small { color: var(--good); font-weight: 700; font-size: .75em; letter-spacing: .08em; text-transform: uppercase; }
.p-foot .row .btn { flex: 1; }

/* ---------- music ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 14px; flex: none; }
.eq i { flex: 1; height: 30%; border-radius: 1px; background: currentColor; transition: height .3s; }
.playing .eq i, .station.on .eq i { animation: eq 1s ease-in-out infinite; }
.playing .eq i:nth-child(2), .station.on .eq i:nth-child(2) { animation-delay: -.35s; }
.playing .eq i:nth-child(3), .station.on .eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.music-dock { position: fixed; left: 2.2em; bottom: 1.8em; z-index: 30; font-size: clamp(12px, .92vw, 30px); display: flex; flex-direction: column; align-items: flex-start; gap: .8em; }
.music-chip { display: flex; align-items: center; gap: .8em; max-width: 26em; padding: .6em 1.1em .6em .9em; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(20,19,26,.72); backdrop-filter: blur(10px); cursor: pointer; text-align: left; opacity: .75; transition: opacity .2s; }
.music-chip:hover, .music-chip.playing { opacity: 1; }
.music-chip .eq { color: var(--gold); }
.music-chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.music-chip-text b, .music-chip-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-chip-text small { color: var(--muted); font-size: .8em; }
.music-pop { width: 30em; max-width: calc(100vw - 3em); background: #111018; border: 1px solid var(--line-2); border-radius: 22px; padding: 1.2em; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.music-pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6em; }
.music-pop-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.4em; }

.music-ctl { display: flex; flex-direction: column; gap: .9em; }
.stations { display: grid; gap: .45em; }
.station { display: grid; grid-template-columns: auto 1fr; column-gap: .8em; align-items: center; text-align: left; padding: .7em .9em; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.station .eq { grid-row: span 2; color: var(--dim); }
.station small { color: var(--muted); font-size: .82em; }
.station.on { border-color: rgba(201,169,110,.55); background: rgba(201,169,110,.1); }
.station.on .eq, .station.on b { color: var(--gold-2); }
.music-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; }
.btn.sm { padding: .55em .9em; font-size: .9em; border-radius: 12px; }
.vol-wrap { display: flex; align-items: center; gap: .5em; flex: 1; min-width: 9em; color: var(--muted); }
.vol-wrap .icon { width: 1.2em; height: 1.2em; }
.vol { flex: 1; accent-color: var(--gold); }
.music-credit { margin: 0; color: var(--dim); font-size: .72em; line-height: 1.4; }
.music-open { margin-top: 14px; }
.p-host-tools { display: flex; gap: 6px; }
@media (max-aspect-ratio: 1/1) { body[data-role="display"] .music-dock { left: 1.2em; bottom: 5.6em; } }

/* ---------- how-to-play tutorial (TV) ---------- */
.tut { flex: 1; display: grid; grid-template-columns: 26em 1fr; grid-template-rows: 1fr auto auto; gap: 1.2em 3em; align-items: center; padding-top: 1em; }
.tut-side h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 4.6em; margin: .05em 0 .35em; line-height: 1; color: var(--ga); }
.tut-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; }
.tut-step { display: flex; gap: .9em; align-items: flex-start; padding: .75em .9em; border-radius: 14px; border: 1px solid transparent; opacity: .38; transition: opacity .4s, background .4s, border-color .4s; }
.tut-step > b { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center; font-size: .9em; background: var(--panel-2); border: 1px solid var(--line-2); }
.tut-step strong { display: block; font-size: 1.1em; }
.tut-step span { display: block; color: var(--muted); font-size: .9em; line-height: 1.35; }
.tut-step.done { opacity: .6; }
.tut-step.done > b { background: rgba(127,211,107,.15); border-color: rgba(127,211,107,.5); color: var(--good); }
.tut-step.on { opacity: 1; background: color-mix(in srgb, var(--ga) 9%, transparent); border-color: color-mix(in srgb, var(--ga) 40%, transparent); }
.tut-step.on > b { background: var(--ga); border-color: var(--ga); color: #07070b; }
.tut-stage { position: relative; height: 40em; }
.tut-card { position: absolute; width: 14.5em; }
.tut-card .ev-card { width: 100%; }
.tut-line { position: absolute; left: 4%; right: 4%; top: calc(62% + 8em); height: 2px; background: linear-gradient(90deg, transparent, var(--line-2) 10%, var(--line-2) 90%, transparent); transform-origin: 50% 50%; }
.tut-badge { position: absolute; width: 3.2em; height: 3.2em; border-radius: 50%; display: grid; place-items: center; z-index: 3; }
.tut-badge .icon { width: 1.7em; height: 1.7em; }
.tut-badge.good { background: var(--good); color: #07070b; box-shadow: 0 0 40px rgba(127,211,107,.6); }
.tut-badge.bad { background: var(--bad); color: #07070b; box-shadow: 0 0 40px rgba(242,126,99,.6); }
.tut-note { position: absolute; left: 50%; top: 52%; white-space: nowrap; padding: .45em 1em; border-radius: 99px; background: rgba(242,126,99,.14); border: 1px solid rgba(242,126,99,.5); color: var(--bad); font-weight: 700; z-index: 3; }
.tut-pips { position: absolute; left: 50%; top: 8%; display: flex; gap: .7em; align-items: center; }
.tut-pips i { width: 1.6em; height: 2.2em; border-radius: 6px; border: 2px solid var(--line-2); background: var(--panel); }
.tut-crown { color: var(--gold); margin-left: .4em; }
.tut-crown .icon { width: 2.4em; height: 2.4em; }
.tut-phone { position: absolute; right: 0; top: 0; width: 17em; height: 34em; border-radius: 2.4em; border: .5em solid #23222b; background: #0b0b10; box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 1px var(--line-2); padding: 1.4em .9em; z-index: 4; }
.tp-screen { display: flex; flex-direction: column; gap: .55em; height: 100%; font-size: .85em; }
.tp-card { padding: .8em; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); display: flex; gap: .6em; align-items: center; margin-bottom: .6em; }
.tp-card b { width: 2em; height: 2em; border-radius: 8px; display: grid; place-items: center; background: rgba(201,169,110,.15); color: var(--gold); flex: none; }
.tp-slot { display: flex; align-items: center; gap: .5em; padding: .8em; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--ga) 55%, transparent); color: var(--ga); font-weight: 700; }
.tp-row { display: flex; gap: .7em; align-items: center; padding: .8em; border-radius: 12px; background: var(--panel-2); }
.tp-row b { font-family: var(--serif); color: var(--gold-2); font-size: 1.2em; }
.tp-foot { margin-top: auto; position: relative; height: 3.2em; }
.tp-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .5em; border-radius: 12px; font-weight: 800; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1408; }
.tp-lock.done { background: rgba(127,211,107,.18); color: var(--good); border: 1px solid rgba(127,211,107,.5); }
.tut-finger { position: absolute; width: 2.4em; height: 2.4em; margin: -1.2em 0 0 -1.2em; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 .5em rgba(255,255,255,.18), 0 6px 20px rgba(0,0,0,.5); z-index: 5; pointer-events: none; }
.tut-progress { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tut-progress i { display: block; height: 100%; background: var(--ga); transform-origin: left; transform: scaleX(0); }
.tut .ready-strip { grid-column: 1 / -1; }
.ready-strip { display: flex; align-items: center; justify-content: center; gap: 1.4em; flex-wrap: wrap; }
.ready-hint { color: var(--muted); }
.ready-hint b { color: var(--text); }
.ready-people { display: flex; gap: .7em; }
.ready-p { position: relative; opacity: .45; transition: opacity .3s; }
.ready-p.on { opacity: 1; }
.ready-tick { position: absolute; right: -.35em; bottom: -.35em; width: 1.3em; height: 1.3em; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #07070b; visibility: hidden; }
.ready-tick .icon { width: .8em; height: .8em; }
.ready-p.on .ready-tick { visibility: visible; }
.p-watch { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ga) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ga) 35%, transparent); color: var(--ga); font-weight: 700; font-size: .92em; }
.p-ready { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; background: rgba(127,211,107,.12); border: 1px solid rgba(127,211,107,.45); color: var(--good); font-weight: 800; }
.p-skip { margin-top: 8px; }
@media (max-aspect-ratio: 1/1) {
  .tut { grid-template-columns: 1fr; }
  .tut-side h1 { font-size: 3em; margin-bottom: .2em; }
  .tut-step:not(.on) { display: none; }
  .tut-phone { font-size: .68em; }
  .tut-stage { height: 36em; }
  .ready-hint { display: none; }
}

/* =================== BLUFF =================== */
.bluff { --ga: #f27e63; }
.bluff .timer-ring { position: relative; top: auto; right: auto; flex: none; }
.bl-prompt { font-family: var(--serif); font-weight: 400; line-height: 1.25; margin: 0; text-wrap: balance; }
.bl-blank { display: inline-block; min-width: 4.5em; border-bottom: .09em solid var(--ga); margin: 0 .12em; padding: 0 .15em; color: var(--ga); text-align: center; line-height: 1.1; }
.bl-blank.filled { color: var(--gold-2); border-bottom-color: var(--gold); font-style: italic; }
.bl-q { display: flex; flex-direction: column; gap: .8em; max-width: 66em; }
.bl-q .bl-prompt { font-size: 3.4em; }
.bl-q.small .bl-prompt { font-size: 2.1em; }
.bl-cat { align-self: flex-start; font-size: .8em; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--ga); padding: .35em .9em; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--ga) 45%, transparent); background: color-mix(in srgb, var(--ga) 10%, transparent); }
.bl-writing { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.6em; padding-left: 2em; }
.bl-under { display: flex; align-items: center; gap: 1.6em; }
.bl-instr { display: flex; flex-direction: column; }
.bl-instr b { font-size: 1.5em; }
.bl-instr span { color: var(--muted); font-size: 1.1em; }
.bl-status { display: flex; align-items: center; gap: 1.2em; }
.bl-status-label { color: var(--muted); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .8em; }
.bl-status-people { display: flex; gap: .7em; flex-wrap: wrap; }
.bl-choosing { flex: 1; display: flex; flex-direction: column; gap: 2em; justify-content: center; padding: 0 2em; }
.bl-choosing-head { display: flex; justify-content: space-between; align-items: center; gap: 2em; }
.bl-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(17em, 1fr)); gap: 1em; }
.bl-option { display: grid; place-items: center; min-height: 3.6em; padding: .8em 1.2em; border-radius: 18px; background: linear-gradient(180deg, #19181f, #121118); border: 1px solid var(--line-2); font-size: 1.55em; font-weight: 700; text-align: center; box-shadow: 0 20px 40px -24px rgba(0,0,0,.9); }
.bl-reveal { flex: 1; display: flex; flex-direction: column; gap: 2em; justify-content: center; padding: 0 2em; }
.bl-reveal-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3em; align-items: center; }
.bl-focus { position: relative; padding: 2.2em 2em 2.6em; border-radius: 26px; text-align: center; background: linear-gradient(180deg, #1b1a22, #121118); border: 2px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: .9em; box-shadow: 0 40px 90px -40px rgba(0,0,0,.9); }
.bl-focus-text { font-family: var(--serif); font-size: 3.2em; line-height: 1.1; }
.bl-focus.truth { border-color: var(--gold); background: radial-gradient(120% 120% at 50% 0%, rgba(201,169,110,.22), transparent 60%), #15131a; box-shadow: 0 0 80px rgba(201,169,110,.25); }
.bl-focus.lie { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.bl-stamp { font-size: 1.15em; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; padding: .4em 1em; border-radius: 10px; border: 3px solid currentColor; transform: rotate(-4deg); }
.bl-stamp.truth { color: var(--gold-2); }
.bl-stamp.lie { color: var(--pc, var(--bad)); transform: rotate(4deg); }
.bl-stamp.house { color: var(--muted); transform: rotate(3deg); }
.bl-pts { font-weight: 800; color: var(--good); font-size: 1.2em; }
.bl-likes { position: absolute; top: 1em; right: 1.2em; display: flex; align-items: center; gap: .3em; color: var(--gold); font-weight: 800; }
.bl-picked-by { display: flex; flex-direction: column; gap: 1em; }
.bl-pickers { display: flex; flex-wrap: wrap; gap: 1.2em; }
.bl-picker { display: flex; flex-direction: column; align-items: center; gap: .4em; font-weight: 700; }
.bl-nobody { color: var(--muted); font-size: 1.3em; }
.bl-done { display: flex; flex-wrap: wrap; gap: .6em; min-height: 2.6em; }
.bl-done-chip { padding: .45em 1em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.bl-done-chip s { text-decoration-color: color-mix(in srgb, var(--bad) 70%, transparent); text-decoration-thickness: 2px; }
.bl-round { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .4em; }
.bl-round h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 8em; margin: 0; line-height: 1; color: var(--ga); text-shadow: 0 0 80px color-mix(in srgb, var(--ga) 40%, transparent); }
.bl-round p { color: var(--muted); font-size: 1.5em; margin: 0; }
.bl-scores .pbar { width: 100%; }
.bl-scores { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.6em; max-width: 62em; width: 100%; margin: 0 auto; }
.bl-scores-head h2 { font-family: var(--serif); font-weight: 500; font-size: 3.4em; margin: .1em 0; }
.bl-truth-line { color: var(--muted); font-size: 1.2em; margin: 0; }
.bl-truth-line b { color: var(--gold-2); }
.bl-rows { display: flex; flex-direction: column; gap: .6em; }
.bl-row { display: grid; grid-template-columns: 1.6em auto 9em 1fr 6em 6em; align-items: center; gap: 1em; padding: .7em 1.1em; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.bl-rank { font-family: var(--serif); color: var(--dim); font-size: 1.4em; }
.bl-name { font-weight: 800; font-size: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-bar { height: .8em; border-radius: 99px; background: var(--line); overflow: hidden; }
.bl-bar i { display: block; height: 100%; border-radius: 99px; background: var(--pc); }
.bl-delta { color: var(--good); font-weight: 800; text-align: right; }
.bl-delta.zero { color: var(--dim); }
.bl-score { font-family: var(--serif); font-size: 1.5em; text-align: right; font-variant-numeric: tabular-nums; }
.bl-final { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.bl-final .ranking { grid-column: 2; }
.bl-final .winner { grid-row: span 2; }
.bl-awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12em, 1fr)); gap: .8em; }
.bl-award { display: flex; flex-direction: column; gap: .4em; padding: 1em 1.1em; border-radius: 16px; background: rgba(201,169,110,.06); border: 1px solid rgba(201,169,110,.3); }
.bl-award > .icon { color: var(--gold); width: 1.6em; height: 1.6em; }
.bl-award-who { display: flex; flex-wrap: wrap; gap: .6em; font-weight: 800; font-size: 1.1em; }
.bl-award-who > span { display: inline-flex; align-items: center; gap: .4em; }
.bl-award small { color: var(--muted); }
.win-avatars { display: flex; gap: .8em; }
.rk-name { font-weight: 700; }
.rk-stats { color: var(--muted); font-size: .85em; }
.rk-cards { font-family: var(--serif); font-size: 1.3em; }
/* tutorial scene */
.tb-stage { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2.4em; text-align: center; }
.tb-fact { max-width: 34em; }
.tb-fact .bl-prompt { font-size: 2.6em; }
.tb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8em 1.4em; width: 34em; }
.tb-tile { position: relative; padding: 1em 1.2em; border-radius: 16px; background: #17161e; border: 2px solid var(--line-2); font-size: 1.35em; font-weight: 700; text-align: center; }
.tb-stamp { position: absolute; top: -1.3em; left: 50%; width: max-content; white-space: nowrap; padding-inline: .9em !important; font-size: .6em; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; padding: .35em 0; border-radius: 8px; border: 2px solid currentColor; background: #111018; }
.tb-stamp.truth { color: var(--gold-2); }
.tb-stamp.lie { color: var(--bad); }
.tb-points { position: absolute; bottom: -1.5em; right: .4em; font-size: .7em; color: var(--good); font-weight: 900; }
.tb-tile > .avatar { position: absolute; top: 50%; right: -1em; margin-top: -1em; }
.tb-fooled { position: absolute; top: 50%; left: -1.2em; margin-top: -1em; display: flex; flex-direction: column; gap: .2em; }
.tb-phone { top: 6%; height: 24em; }
.tb-phone .tp-label { color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .75em; }
.tp-input { display: flex; align-items: center; min-height: 3em; padding: 0 .9em; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.4); font-weight: 700; font-size: 1.1em; }
.tp-caret { width: 2px; height: 1.2em; background: var(--ga); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tb-mults { position: absolute; inset: auto 0 6% 0; display: flex; justify-content: center; gap: 1.4em; }
.tb-mult { display: flex; flex-direction: column; align-items: center; gap: .3em; padding: 1em 1.6em; border-radius: 18px; background: #15141c; border: 1px solid var(--line-2); }
.tb-mult b { font-family: var(--serif); font-size: 3em; color: var(--gold-2); line-height: 1; }
.tb-mult:last-child b { color: var(--ga); }
.tb-mult span { color: var(--muted); font-weight: 700; }
/* phone */
.p-spacer { flex: 1; }
.p-big-icon { width: 3em; height: 3em; color: var(--ga); opacity: .8; }
.bl-pq { padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.bl-pq .bl-prompt { font-size: 1.35em; }
.bl-pq.small .bl-prompt { font-size: 1.05em; }
.bl-pq .bl-blank { min-width: 3.5em; }
.bl-input { font-size: 1.25em; }
.bl-err { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--bad); font-weight: 700; }
.bl-lfm { align-self: flex-start; }
.bl-suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bl-suggest small { width: 100%; color: var(--muted); font-weight: 700; }
.chip-btn { padding: 10px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 700; cursor: pointer; }
.bl-mylie { font-family: var(--serif); font-size: 1.8em; color: var(--ga); margin: 6px 0; }
.bl-picks { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.bl-pick-row { display: flex; gap: 8px; }
.bl-pick { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 800; font-size: 1.05em; cursor: pointer; transition: transform .15s, opacity .2s; }
.bl-pick:active { transform: scale(.98); }
.bl-pick.own { opacity: .45; border-style: dashed; }
.bl-pick.own small { color: var(--muted); font-weight: 700; }
.bl-pick.on { border-color: var(--ga); background: color-mix(in srgb, var(--ga) 16%, transparent); color: var(--text); opacity: 1; }
.bl-pick.dim { opacity: .45; }
.bl-like { width: 52px; flex: none; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--dim); display: grid; place-items: center; cursor: pointer; }
.bl-like.on { color: var(--gold); border-color: rgba(201,169,110,.5); background: rgba(201,169,110,.1); }
.bl-like-gap { width: 52px; flex: none; }
.bl-mydelta { font-family: var(--serif); font-size: 4em; color: var(--good); line-height: 1; }
.bl-mydelta.zero { color: var(--dim); }
.bl-myawards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
@media (max-aspect-ratio: 1/1) {
  .bl-q .bl-prompt { font-size: 2.4em; }
  .bl-reveal-main, .bl-final { grid-template-columns: 1fr; }
  .bl-final .ranking { grid-column: auto; }
  .bl-row { grid-template-columns: 1.6em auto 1fr 5em 5em; }
  .bl-row .bl-bar { display: none; }
  .display.bluff { padding-bottom: 6em; }
}

/* =================== PIN IT =================== */
.pinit { --ga: #7fd36b; }
.pinit .timer-ring { position: relative; top: auto; right: auto; }
.pm { position: relative; width: 100%; height: 100%; overflow: hidden; background: radial-gradient(120% 100% at 50% 40%, #0f1a22, #090b10); border-radius: inherit; }
.pm.interactive { touch-action: none; cursor: crosshair; }
.pm-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pm-land path { fill: #1d2430; stroke: rgba(127,211,107,.35); stroke-width: .8; vector-effect: non-scaling-stroke; }
.pm-grid line { stroke: rgba(255,255,255,.05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pm-lines line { stroke-width: 2.5; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; }
.pm-markers { position: absolute; inset: 0; pointer-events: none; }
.pm-mark { position: absolute; width: 0; height: 0; }
.pm-pin { position: absolute; left: 0; bottom: 0; transform: translate(-50%, 0); display: flex; flex-direction: column; align-items: center; }
.pm-pin::after { content: ''; width: 3px; height: .9em; background: var(--pc); border-radius: 2px; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.pm-pin .avatar { box-shadow: 0 0 0 2px #0b0b10, 0 4px 14px rgba(0,0,0,.6); }
.pm-pin-lbl { position: absolute; left: 0; bottom: 0; }
.pm-pin-lbl > .pm-pin { position: relative; transform: translate(-50%, 0); }
.pm-pin-lbl > span { position: absolute; left: 1.4em; bottom: 1.4em; white-space: nowrap; padding: .2em .6em; border-radius: 8px; background: rgba(11,11,16,.85); border: 1px solid var(--line-2); font-weight: 800; font-size: .85em; }
.pm-truth { position: absolute; left: 0; top: 0; width: 1.8em; height: 1.8em; transform: translate(-50%, -50%); display: grid; place-items: center; color: #1a1408; }
.pm-truth .icon { position: relative; width: 1.3em; height: 1.3em; z-index: 2; }
.pm-truth i { position: absolute; inset: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 24px rgba(201,169,110,.9); }
.pm-truth i:first-child { animation: truthPulse 1.8s ease-out infinite; opacity: .6; }
@keyframes truthPulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }
.pi-card { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #17161f, #0f0e15); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -40px rgba(0,0,0,.9); }
.pi-img { aspect-ratio: 16 / 10; background: #0b0b10; display: grid; place-items: center; overflow: hidden; color: var(--ga); }
.pi-img img { width: 100%; height: 100%; object-fit: cover; }
.pi-img > .icon { width: 30%; height: 40%; opacity: .5; }
.pi-body { padding: 1em 1.3em 1.2em; display: flex; flex-direction: column; gap: .35em; }
.pi-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.7em; line-height: 1.1; }
.pi-blurb { margin: .2em 0 0; color: var(--muted); font-size: .92em; line-height: 1.4; }
.pi-card.big .pi-img { aspect-ratio: 16 / 9; }
.pi-guess { flex: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3em; align-items: center; padding: 0 1em; }
.pi-guess .pi-card.big .pi-body { display: none; }
.pi-guess-side { display: flex; flex-direction: column; gap: .8em; align-items: flex-start; }
.pi-guess-side h2 { font-family: var(--serif); font-weight: 500; font-size: 3.6em; line-height: 1.05; margin: 0; }
.pi-guess-side .timer-ring { margin: .6em 0; }
.pi-locked { display: flex; flex-direction: column; gap: .6em; }
.pi-reveal { flex: 1; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.6em; min-height: 0; padding-bottom: 4.5em; }
.pi-map-wrap { border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); min-height: 30em; }
.pi-reveal-side { display: flex; flex-direction: column; gap: 1em; min-width: 0; }
.pi-reveal-side .pi-card .pi-img { aspect-ratio: 16 / 8; }
.pi-rows { display: flex; flex-direction: column; gap: .45em; }
.pi-row { display: grid; grid-template-columns: 1.4em auto 1fr auto 4.5em 5em; align-items: center; gap: .7em; padding: .5em .8em; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.pi-km { color: var(--muted); font-weight: 700; font-size: .9em; }
.pi-row .bl-score { font-size: 1.2em; }
/* tutorial */
.pi-tstage { display: grid; place-items: center; }
.pi-tstage > * { grid-area: 1 / 1; }
.pi-tstage .pi-card { width: 24em; }
.pi-tphone { position: absolute; right: 4%; top: 2%; width: 18em; height: 34em; padding: .7em; }
.pi-tscreen { width: 100%; height: 100%; border-radius: 1.6em; overflow: hidden; }
.pi-tmap { width: 100%; height: 100%; border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); }
/* phone */
.pinit.pi-mapmode .p-stage { height: calc(100svh - 170px - env(safe-area-inset-bottom, 0px)); }
.pi-mini { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.pi-mini > img, .pi-mini > .icon { width: 74px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.pi-mini small { display: block; color: var(--ga); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .7em; }
.pi-mini b { font-family: var(--serif); font-weight: 500; font-size: 1.25em; line-height: 1.15; }
.pi-phone-map { position: relative; flex: 1; min-height: 260px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); }
.pi-phone-map.locked { opacity: .8; }
.pi-phone-map.small { flex: none; height: 46svh; width: 100%; }
.pi-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.pi-zoom .icon-btn { background: rgba(11,11,16,.85); backdrop-filter: blur(6px); }
.pi-minus span { font-size: 1.6em; line-height: 1; font-weight: 600; margin-top: -3px; }
.pi-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; padding: 8px 14px; border-radius: 99px; background: rgba(11,11,16,.85); border: 1px solid var(--line-2); font-weight: 700; font-size: .9em; pointer-events: none; z-index: 3; }
.pi-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 8px; }
.pi-result .bl-mydelta { font-size: 3.4em; }
@media (max-aspect-ratio: 1/1) {
  .pi-guess, .pi-reveal { grid-template-columns: 1fr; }
  .pi-map-wrap { min-height: 24em; }
  .display.pinit { padding-bottom: 6em; }
}

/* =================== QUICK DRAW =================== */
.sketch { --ga: #9b8cf2; }
.sketch .timer-ring { position: absolute; top: -1.6em; right: -1.6em; }
.sk-paper { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #fbfaf6; box-shadow: 0 30px 70px -30px rgba(0,0,0,.9), inset 0 0 0 1px rgba(0,0,0,.08); }
.sk-paper.interactive { touch-action: none; cursor: crosshair; }
.sk-canvas { display: block; width: 100%; height: 100%; }
.sk-hint { display: flex; justify-content: center; gap: .35em; flex-wrap: wrap; }
.sk-hint span { width: 1.4em; height: 1.7em; border-bottom: .14em solid var(--line-2); display: grid; place-items: center; font-family: var(--serif); font-size: 2.2em; text-transform: uppercase; color: var(--gold-2); }
.sk-hint span.on { border-bottom-color: var(--gold); }
.sk-hint i.gap { width: 1.2em; }
.sk-hint.sm span { font-size: 1.3em; }
.sk-drawing .sk-hint { margin-top: .4em; }
.sk-drawing, .sk-reveal { flex: 1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2.4em; align-items: center; padding: 0 1em 3em; }
.sk-board { display: flex; flex-direction: column; gap: 1em; min-width: 0; }
.sk-canvas-wrap { position: relative; max-width: calc((100svh - 24em) * 4 / 3); width: 100%; margin: 0 auto; }
.sk-artist { display: flex; align-items: center; gap: .6em; font-weight: 800; font-size: 1.2em; padding-right: 5em; }
.sk-letters { margin-left: auto; color: var(--muted); font-weight: 700; font-size: .85em; }
.sk-side { display: flex; flex-direction: column; gap: .8em; min-width: 0; align-self: stretch; justify-content: center; }
.sk-feed { display: flex; flex-direction: column; gap: .45em; max-height: 22em; overflow: hidden; justify-content: flex-end; }
.sk-msg { display: flex; align-items: center; gap: .6em; padding: .45em .8em; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 1.1em; }
.sk-msg.close { color: var(--gold-2); border-color: rgba(201,169,110,.4); background: rgba(201,169,110,.08); }
.sk-msg.correct { color: var(--good); border-color: rgba(127,211,107,.45); background: rgba(127,211,107,.1); }
.sk-scores, .sk-gains { display: flex; flex-direction: column; gap: .4em; margin-top: .6em; }
.sk-score { display: flex; align-items: center; gap: .6em; padding: .4em .8em; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; }
.sk-score b { margin-left: auto; font-family: var(--serif); font-size: 1.15em; }
.sk-score b.plus { color: var(--good); font-family: var(--sans); }
.sk-score.got { border-color: rgba(127,211,107,.5); background: rgba(127,211,107,.08); }
.sk-score.drawer { border-color: color-mix(in srgb, var(--ga) 50%, transparent); }
.sk-word { font-family: var(--serif); font-size: 4.2em; line-height: 1; color: var(--gold-2); text-transform: capitalize; }
.sk-choosing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5em; text-align: center; }
.sk-choosing h1 { font-family: var(--serif); font-weight: 500; font-size: 5em; margin: 0; }
.sk-choosing .pbar { width: 30em; margin-top: 1em; }
.sk-final { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; padding-bottom: 4em; }
.sk-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: 1em; max-height: calc(100svh - 12em); overflow: hidden; }
.sk-tile { display: flex; flex-direction: column; gap: .4em; }
.sk-tile .sk-paper { border-radius: 12px; }
.sk-tile-cap { display: flex; justify-content: space-between; align-items: baseline; gap: .5em; }
.sk-tile-cap b { text-transform: capitalize; }
.sk-tile-cap small { color: var(--muted); }
/* tutorial */
.sk-tstage { display: grid; grid-template-columns: 1fr 15em; grid-template-rows: 1fr; gap: 2em; align-items: center; }
.sk-tphone { position: absolute; left: 30%; top: 4%; width: 17em; height: 30em; }
.sk-tword { padding: 1em; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); display: flex; justify-content: space-between; align-items: center; }
.sk-tword small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .7em; font-weight: 800; }
.sk-tboard { display: flex; flex-direction: column; gap: 1em; }
.sk-tcanvas { width: 100%; max-width: 38em; }
.sk-thints { position: relative; height: 4em; }
.sk-thints .sk-hint { position: absolute; inset: 0; }
.tut-feed { align-self: center; }
/* phone */
.sketch .p-stage { gap: 10px; }
.sk-mine { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ga) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ga) 45%, transparent); }
.sk-mine small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .7em; }
.sk-mine b { font-family: var(--serif); font-size: 1.6em; text-transform: capitalize; }
.sk-tools { display: flex; flex-direction: column; gap: 10px; }
.sk-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sk-swatch { aspect-ratio: 1; border-radius: 12px; background: var(--sw); border: 2px solid rgba(255,255,255,.15); cursor: pointer; }
.sk-swatch.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,110,.35); }
.sk-row { display: flex; gap: 8px; align-items: center; }
.sk-sizes { display: flex; gap: 8px; flex: 1; }
.sk-size { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; }
.sk-size i { border-radius: 50%; background: var(--text); }
.sk-size.on { border-color: var(--gold); }
.icon-btn.armed { border-color: var(--bad); color: var(--bad); }
.sk-guessbar { display: flex; gap: 8px; position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
.sk-guessbar .btn { flex: none; width: 56px; padding: 0; }
.sk-input { font-size: 1.15em; }
.sk-close { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(201,169,110,.12); border: 1px solid rgba(201,169,110,.45); color: var(--gold-2); font-weight: 800; }
.sk-pick { display: flex; flex-direction: column; gap: 12px; }
.sk-pick h2 { font-family: var(--serif); font-weight: 500; font-size: 2.2em; margin: 0; }
.sk-choice { display: flex; justify-content: space-between; align-items: center; padding: 20px 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; }
.sk-choice b { font-family: var(--serif); font-size: 1.6em; font-weight: 500; text-transform: capitalize; }
.sk-choice small { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .7em; padding: 4px 8px; border-radius: 99px; }
.sk-choice[data-tier="easy"] small { color: var(--good); background: rgba(127,211,107,.12); }
.sk-choice[data-tier="medium"] small { color: var(--gold-2); background: rgba(201,169,110,.14); }
.sk-choice[data-tier="hard"] small { color: var(--bad); background: rgba(242,126,99,.14); }
.sk-preveal .sk-word { font-size: 2.6em; margin-bottom: 8px; }
.sk-preveal .sk-paper { width: 100%; margin: 6px 0; }
@media (max-aspect-ratio: 1/1) {
  .sk-drawing, .sk-reveal, .sk-final { grid-template-columns: 1fr; }
  .sk-tstage { grid-template-columns: 1fr; }
  .display.sketch { padding-bottom: 6em; }
}

/* =================== REMOTE TABLES (landing) =================== */
.remote { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(229,56,59,.06), transparent 60%), var(--panel); }
.rm-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6em; margin: 2px 0 4px; }
.rm-head p { margin: 0; font-size: .92em; }
.rm-mine { display: flex; flex-direction: column; gap: 8px; }
.rm-mine:empty { display: none; }
.rm-mine .section-head h3 { margin: 0; }
button.rm-saved { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; text-align: left; }
.rm-badge { font-family: ui-monospace, monospace; font-size: .85em; letter-spacing: .1em; color: var(--muted); margin-left: .6em; opacity: .7; }
.rm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.rm-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.rm-saved > .icon { flex-shrink: 0; color: var(--muted); }
button.rm-saved.turn { border-color: rgba(201,169,110,.45); box-shadow: inset 3px 0 0 var(--gold); }
button.rm-saved.turn > .icon { color: var(--gold-2); }
.rm-turn { flex-shrink: 0; white-space: nowrap; font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); padding: .3em .7em; border-radius: 99px; background: rgba(201,169,110,.14); border: 1px solid rgba(201,169,110,.35); }
.rm-games { display: flex; flex-direction: column; gap: 10px; }
.rm-game { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--ga) 35%, transparent); background: color-mix(in srgb, var(--ga) 6%, transparent); }
.rm-game-txt { flex: 1; min-width: 10em; display: flex; flex-direction: column; }
.rm-game-txt b { font-family: var(--serif); font-size: 1.35em; font-weight: 600; }
.rm-game-txt span { color: var(--muted); font-size: .9em; }
.rm-game-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-game-btns .btn { white-space: nowrap; }
.rm-seg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rm-seg small { color: var(--muted); font-weight: 700; margin-right: 4px; }
.mono { font-family: ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }

/* =================== RUMMY TABLE =================== */
.rummy-screen { --ga: #e5383b; max-width: 760px; margin: 0 auto; min-height: 100svh; display: flex; flex-direction: column; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px); }
.rm-top { display: flex; align-items: center; gap: 10px; }
.rm-title { font-family: var(--serif); font-size: 1.4em; font-weight: 600; }
.rm-hand { color: var(--muted); font-weight: 700; font-size: .85em; }
.rm-opp, .rm-mine-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.rm-who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 8em; position: relative; }
.rm-opp .rm-who { padding-left: 16px; }
.rm-who small { color: var(--muted); font-weight: 600; font-size: .8em; }
.rm-dot { position: absolute; left: 0; top: .45em; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.rm-dot.on { background: var(--good); box-shadow: 0 0 10px var(--good); }
.rm-backs { display: flex; align-items: center; }
.rm-backs small { margin-left: 8px; color: var(--muted); font-weight: 800; }
.rm-score { position: relative; width: 120px; height: 22px; border-radius: 99px; background: var(--line); overflow: hidden; display: grid; place-items: center; }
.rm-score i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ga) 55%, transparent), var(--ga)); border-radius: 99px; }
.rm-score span { position: relative; font-size: .75em; font-weight: 800; }
.rm-table { display: flex; flex-wrap: wrap; gap: 10px; min-height: 84px; padding: 12px; border-radius: 18px; background: radial-gradient(120% 140% at 50% 0%, #17321f, #0d1b12); border: 1px solid rgba(127,211,107,.18); align-content: flex-start; }
.rm-empty { margin: auto; color: rgba(255,255,255,.35); font-weight: 600; }
.rm-meld { position: relative; display: flex; padding: 4px 6px; border-radius: 12px; border: 1px solid transparent; background: rgba(0,0,0,.18); cursor: default; }
.rm-meld .pc + .pc { margin-left: -22px; }
.rm-meld.theirs { background: rgba(0,0,0,.32); }
.rm-meld.target { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,110,.35), 0 0 24px rgba(201,169,110,.35); cursor: pointer; animation: rmPulse 1.4s ease-in-out infinite; }
@keyframes rmPulse { 50% { box-shadow: 0 0 0 4px rgba(201,169,110,.2), 0 0 30px rgba(201,169,110,.5); } }
.rm-plus { position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1a1408; display: grid; place-items: center; }
.rm-plus .icon { width: 14px; height: 14px; }
.rm-piles { display: flex; justify-content: center; gap: 28px; }
.rm-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 4px; cursor: default; border-radius: 14px; }
.rm-pile small { color: var(--muted); font-weight: 700; font-size: .8em; }
.rm-pile.go { cursor: pointer; }
.rm-pile.go .pc, .rm-pile.go .pc-back { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(201,169,110,.55); animation: rmPulse 1.4s ease-in-out infinite; }
.rm-status { text-align: center; min-height: 2.6em; display: flex; justify-content: center; }
.rm-status > div { display: flex; flex-direction: column; gap: 2px; }
.rm-status small { color: var(--muted); }
.rm-mine { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.rm-who > b { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rm-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-hintflag { display: inline-block; white-space: nowrap; margin-left: 0; font-family: var(--sans); font-size: .62em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; vertical-align: 2px; color: var(--muted); border: 1px solid var(--line-2); }
.rm-hintflag.on { color: var(--gold-2); border-color: rgba(201,169,110,.45); background: rgba(201,169,110,.1); }
.rm-toggles { display: flex; gap: 6px; }
.rm-toggles .btn.off { color: var(--muted); }
.rm-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rm-suggest small { color: var(--muted); font-weight: 700; margin-right: 4px; }
.rm-suggest .chip-btn { display: inline-flex; gap: 6px; padding: 6px 10px; }
.rm-handcards { display: flex; justify-content: center; padding: 34px 4px 4px; overflow-x: auto; }
.rm-handcards .pc + .pc { margin-left: -14px; }
.rm-handcards.tight .pc + .pc { margin-left: -26px; }
.rm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rm-actions .btn:disabled { opacity: .55; }
.rm-actions .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-actions .btn.nudge { animation: rmPulse 1.4s ease-in-out infinite; }
.rummy-screen.waiting .rm-opp, .rummy-screen.waiting .rm-table, .rummy-screen.waiting .rm-piles, .rummy-screen.waiting .rm-mine { display: none; }
.rm-recovery { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(201,169,110,.06); border: 1px solid rgba(201,169,110,.3); }
.rm-recovery p { margin: 0; font-size: .88em; }
.rm-recovery b.mono { color: var(--gold-2); font-size: 1.15em; }
.rm-move { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rm-move-qr { width: 150px; height: 150px; border-radius: 12px; background: #fff; padding: 6px; }
.rm-move-codes { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 12em; }
.rm-movelink { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--muted); font-weight: 700; cursor: pointer; padding: 4px 0; }
.rm-movelink:hover { color: var(--gold-2); }
.rm-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-top: 10vh; }
.rm-wait h2 { font-family: var(--serif); font-weight: 500; font-size: 2em; margin: 0; }
.rm-invite { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; padding: 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line-2); }
.rm-invite-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rm-invite-row small { color: var(--muted); font-weight: 700; }
.rm-invite-row b { font-size: 1.3em; color: var(--gold-2); }
.rm-invite-btns { display: flex; gap: 8px; justify-content: center; }
.rm-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5,5,8,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.rm-result { position: relative; width: 100%; max-width: 440px; padding: 22px; border-radius: 24px; background: #111018; border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; text-align: center; overflow: hidden; }
.rm-result h2 { font-family: var(--serif); font-weight: 500; font-size: 2em; margin: 0; }
.rm-result p { margin: 0; }
.rm-result .bl-mydelta small { font-family: var(--sans); font-size: .25em; color: var(--muted); }
.rm-left { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rm-left small { color: var(--muted); font-weight: 700; }
.rm-left-cards { display: flex; flex-wrap: wrap; justify-content: center; }
.rm-left-cards .pc + .pc { margin-left: -16px; }
.rm-scores { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.rm-srow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rm-srow .rm-score { width: 60%; }
.ctext { display: inline-flex; align-items: center; gap: 1px; font-weight: 800; margin: 0 2px; color: var(--text); }
.ctext.red { color: #ff6b6b; }
.ctext .suit { width: .95em; height: .95em; display: inline-flex; }
/* playing cards */
.pc { position: relative; flex: none; width: 58px; height: 84px; border-radius: 8px; background: #fbfaf6; color: #17161c; border: 1px solid rgba(0,0,0,.25); box-shadow: 0 6px 14px rgba(0,0,0,.45); padding: 0; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.pc.red { color: #c8202a; }
.pc.small { width: 40px; height: 58px; border-radius: 6px; cursor: inherit; }
.pc .suit { display: inline-flex; }
.pc .suit svg { width: 100%; height: 100%; }
.pc-corner { position: absolute; top: 4px; left: 5px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pc-corner b { font-size: 15px; font-weight: 800; letter-spacing: -.04em; }
.pc-corner .suit { width: 12px; height: 12px; margin-top: 2px; }
.pc-corner.flip { top: auto; left: auto; bottom: 4px; right: 5px; transform: rotate(180deg); }
.pc .pc-big { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -40%); opacity: .9; }
.pc.small .pc-corner b { font-size: 12px; }
.pc.small .pc-corner .suit { width: 9px; height: 9px; }
.pc.small .pc-corner.flip { display: none; }
.pc.small .pc-big { width: 18px; height: 18px; }
.pc.sel { transform: translateY(-30px); box-shadow: 0 0 0 3px var(--gold), 0 14px 26px rgba(0,0,0,.5); }
/* Rummy: selected cards bob and wiggle with a pulsing gold glow (same feel as Rummikub tiles). Transform only,
   so the hand never re-lays out. */
.rummy-play .pc.sel:not(.small) { z-index: 2; animation: pcBob .9s ease-in-out infinite, pcGlow 1.4s ease-in-out infinite; }
.rummy-play .pc.sel:not(.small):nth-child(even) { animation-delay: -.45s, -.7s; }
.rummy-play .pc.sel:not(.small):nth-child(3n) { animation-duration: 1.05s, 1.4s; }
@keyframes pcBob {
  0%, 100% { transform: translateY(-28px) rotate(0deg); }
  25% { transform: translateY(-38px) rotate(-4deg); }
  50% { transform: translateY(-30px) rotate(0deg); }
  75% { transform: translateY(-38px) rotate(4deg); }
}
@keyframes pcGlow {
  0%, 100% { box-shadow: 0 0 0 3px #f3c74f, 0 0 18px 3px rgba(243,199,79,.6), 0 14px 26px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 0 3px #ffe08a, 0 0 28px 7px rgba(243,199,79,.9), 0 14px 26px rgba(0,0,0,.5); }
}
@media (prefers-reduced-motion: reduce) { .rummy-play .pc.sel { animation: none; } }
.pc.fresh::after { content: 'new'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #1a1408; background: var(--gold); padding: 2px 5px; border-radius: 99px; }
.pc-back { width: 58px; height: 84px; border-radius: 8px; border: 1px solid rgba(201,169,110,.5); background: repeating-linear-gradient(45deg, #2a1416 0 6px, #3a1c1f 6px 12px); box-shadow: inset 0 0 0 4px #1a0d0e, inset 0 0 0 5px rgba(201,169,110,.5), 0 6px 14px rgba(0,0,0,.45); }
.pc-back.mini { width: 16px; height: 24px; border-radius: 3px; box-shadow: inset 0 0 0 2px #1a0d0e; }
.pc-back.mini + .pc-back.mini { margin-left: -8px; }
.pc-empty { width: 58px; height: 84px; border-radius: 8px; border: 2px dashed var(--line-2); }
@media (min-width: 700px) {
  .pc { width: 70px; height: 100px; }
  .pc-back, .pc-empty { width: 70px; height: 100px; }
  .pc .pc-big { width: 32px; height: 32px; }
  .pc-corner b { font-size: 17px; }
  .rm-handcards .pc + .pc { margin-left: -12px; }
  .rm-handcards.tight .pc + .pc { margin-left: -18px; }
}

/* =================== TABLE CHAT =================== */
.tc-tab { position: fixed; right: 0; top: 46%; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px 0 0 14px; border: 1px solid var(--line-2); border-right: 0; background: rgba(17,16,24,.92); backdrop-filter: blur(10px); color: var(--gold-2); cursor: pointer; font-weight: 800; font-size: .72em; letter-spacing: .08em; text-transform: uppercase; box-shadow: -10px 10px 30px rgba(0,0,0,.4); }
.tc-tab .icon { width: 1.6em; height: 1.6em; }
.tc-badge { position: absolute; top: -8px; left: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; letter-spacing: 0; }
.tc.open .tc-tab { display: none; }
.tc-panel { overscroll-behavior: contain; position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(380px, 92vw); display: none; flex-direction: column; background: rgba(13,12,19,.96); backdrop-filter: blur(16px); border-left: 1px solid var(--line-2); box-shadow: -30px 0 60px rgba(0,0,0,.5); padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.tc.open .tc-panel { display: flex; animation: tcIn .3s var(--ease); }
@keyframes tcIn { from { transform: translateX(40px); opacity: 0; } }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tc-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.3em; }
.tc-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; }
.tc-empty { margin: auto; text-align: center; color: var(--muted); max-width: 26ch; font-size: .9em; }
.tc-msg { align-self: flex-start; max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.tc-msg.mine { align-self: flex-end; align-items: flex-end; }
.tc-text, .tc-voice { padding: 9px 12px; border-radius: 16px 16px 16px 4px; background: var(--panel-2); border: 1px solid var(--line); line-height: 1.35; overflow-wrap: anywhere; }
.tc-msg.mine .tc-text, .tc-msg.mine .tc-voice { border-radius: 16px 16px 4px 16px; background: rgba(201,169,110,.16); border-color: rgba(201,169,110,.35); }
.tc-voice { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tc-voice small { color: var(--muted); font-weight: 600; }
.tc-voice > .icon { color: var(--gold); }
.tc-msg time { font-size: .7em; color: var(--dim); padding: 0 4px; }
.tc-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--gold); color: #1a1408; display: grid; place-items: center; cursor: pointer; flex: none; }
.tc-play.playing { animation: rmPulse 1s ease-in-out infinite; }
.tc-rechint { text-align: center; color: var(--bad); font-weight: 800; padding: 6px; }
.tc-form { display: flex; gap: 8px; align-items: center; }
.tc-input { flex: 1; font-size: 1em; padding: .8em 1em; }
.tc-send { width: 48px; height: 48px; padding: 0; flex: none; }
.tc-mic { position: relative; width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tc-mic .icon { width: 22px; height: 22px; position: relative; }
.tc-mic.recording { background: var(--bad); border-color: var(--bad); color: #fff; transform: scale(1.12); }
.tc-rec-ring { --p: 0; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--bad) calc(var(--p) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); }

/* quick reactions */
.tc-react { position: fixed; right: 0; top: calc(46% + 92px); z-index: 30; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px 0 0 14px; border: 1px solid var(--line-2); border-right: 0; background: rgba(17,16,24,.92); backdrop-filter: blur(10px); color: var(--gold-2); cursor: pointer; box-shadow: -10px 10px 30px rgba(0,0,0,.4); }
.tc-react .icon { width: 24px; height: 24px; }
.tc-react.on { background: var(--gold); color: #1a1408; }
.tc.open .tc-react, .tc.open .tc-wheel { display: none; }
.tc-wheel { position: fixed; right: 54px; top: calc(46% + 115px); z-index: 31; width: 0; height: 0; }
.tc-emo { --r: 118px; --a: calc(98deg + var(--i) * 20.5deg); position: absolute; left: 0; top: 0; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(17,16,24,.96); font-size: 28px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5); transform: translate(calc(cos(var(--a)) * var(--r)), calc(sin(var(--a)) * var(--r) * -1)); }
.tc-emo:active { transform: translate(calc(cos(var(--a)) * var(--r)), calc(sin(var(--a)) * var(--r) * -1)) scale(.9); }
.tc-emoji { font-size: 2.4em; line-height: 1.1; padding: 2px 4px; }
.tc-burst { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.tc-burst span { position: absolute; left: 50%; bottom: 18%; font-size: calc(54px * var(--s)); transform: translateX(var(--x)); animation: tcBurst 1.9s var(--d) cubic-bezier(.2,.8,.3,1) both; }
@keyframes tcBurst { 0% { opacity: 0; transform: translate(var(--x), 40px) scale(.4); } 18% { opacity: 1; transform: translate(var(--x), -10vh) scale(1.15); } 100% { opacity: 0; transform: translate(var(--x), -55vh) scale(1); } }

.tc-emo.edit { width: 40px; height: 40px; margin: -20px 0 0 -20px; color: var(--gold-2); }
.tc-emo.edit .icon { width: 18px; height: 18px; }
.tc-pick-sheet .sheet-card { max-height: 88svh; overflow-y: auto; }
.tc-pick-count { color: var(--gold-2); font-weight: 800; }
.tc-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.tc-pick { position: relative; aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 26px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.tc-pick.on { border-color: var(--gold); background: rgba(201,169,110,.16); box-shadow: 0 0 0 2px rgba(201,169,110,.35); }
.tc-pick b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--gold); color: #1a1408; font: 800 11px/18px var(--sans); text-align: center; }
.tc-pick-btns { display: flex; gap: 8px; justify-content: center; }

.tc-pick-section { display: flex; flex-direction: column; gap: 6px; }
.tc-pick-section > small { color: var(--muted); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .7em; }
.tc-add-row { display: flex; gap: 8px; }
.tc-add { flex: 1; font-size: 1.2em; padding: .6em .9em; }
.tc-pick-grid.own:empty { display: none; }
.tc-pick-grid.own small { grid-column: 1 / -1; }
.tc-pick-wrap { position: relative; }
.tc-pick-wrap .tc-pick { width: 100%; }
.tc-pick-del { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); background: #1b1a22; color: var(--muted); display: grid; place-items: center; padding: 0; cursor: pointer; }
.tc-pick-del .icon { width: 11px; height: 11px; }

/* Opponent tile: fixed slots so nothing moves when the status text or card count changes. */
.rm-opp { display: grid; grid-template-columns: minmax(0, 1fr) 132px; grid-template-rows: 26px 22px; gap: 6px 14px; align-items: center; flex-wrap: nowrap; }
.rm-opp-name { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; }
.rm-opp-name .rm-dot { position: static; flex: none; }
.rm-opp-name b { font-size: 1.05em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-opp-name .rm-hintflag { flex: none; }
.rm-opp-status { grid-column: 1; grid-row: 2; padding-left: 17px; color: var(--muted); font-weight: 600; font-size: .82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-opp-status.away { color: var(--dim); }
.rm-opp-cards { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 22px; align-items: center; gap: 6px; height: 26px; }
.rm-opp-cards .rm-backs { --n: 10; display: flex; justify-content: flex-end; overflow: hidden; height: 24px; }
/* Mini backs squeeze together as the hand grows, so the fan never changes width. */
.rm-opp-cards .pc-back.mini + .pc-back.mini { margin-left: calc(-16px + min(8px, 88px / max(var(--n), 1))); }
.rm-opp-count { text-align: right; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.rm-opp .rm-score { grid-column: 2; grid-row: 2; width: 100%; }

.rm-hist { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.rm-hist-row { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; font-size: .88em; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rm-hist-row span:first-child { color: var(--muted); }
.rm-hist-tot { font-variant-numeric: tabular-nums; color: var(--gold-2); font-weight: 700; }

/* Rummy 500 */
.rm-pile-fan { max-width: 62%; }
.rm-fan { display: flex; align-items: flex-end; overflow-x: auto; max-width: 100%; padding: 6px 4px 4px; scrollbar-width: none; }
.rm-fan::-webkit-scrollbar { display: none; }
.rm-fan .pc { flex: none; }
.rm-fan .pc.small + .pc, .rm-fan .pc + .pc { margin-left: -18px; }
.rm-fan.go .pc { box-shadow: 0 0 0 2px rgba(201,169,110,.55), 0 6px 14px rgba(0,0,0,.45); }
.rm-fan.go .pc:last-child { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(201,169,110,.55); }
.rm-dig-cards { display: flex; justify-content: center; flex-wrap: wrap; padding: 14px 0 4px; }
.rm-dig-cards .pc + .pc { margin-left: -14px; }
.rm-dig-cards .pc.sel { transform: translateY(-10px); }
.rm-switch { color: var(--gold-2); font-weight: 700; }
.rm-rules-hint { color: var(--muted); margin-top: -6px; }
.rm-r500 { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.rm-r500-row { display: grid; grid-template-columns: 1fr 4.5em 4.5em 5em; gap: 8px; align-items: center; text-align: right; font-variant-numeric: tabular-nums; }
.rm-r500-row b { text-align: left; }
.rm-r500-row.head span { color: var(--muted); font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rm-r500-row .minus { color: var(--bad); }
.rm-r500-row .net { font-weight: 800; color: var(--good); font-size: 1.1em; }
.rm-r500-row .net.neg { color: var(--bad); }

.rm-top .rm-title, .rm-top .rm-hand { white-space: nowrap; }
.rm-top .rm-title { font-size: 1.25em; }
.rm-status { padding: 0 56px; }

/* =================== CRIBBAGE =================== */
.crib-screen { --ga: #c9a96e; }
.cb-board { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 6px; border-radius: 16px; background: linear-gradient(180deg, #2a1d10, #1b130b); border: 1px solid rgba(201,169,110,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.cb-lane { display: grid; grid-template-columns: 4.6em 1fr 2.6em; align-items: center; gap: 10px; }
.cb-lane-name { font-weight: 800; font-size: .82em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-lane.me .cb-lane-name { color: var(--gold-2); }
.cb-lane-score { text-align: right; font-family: var(--serif); font-size: 1.15em; font-variant-numeric: tabular-nums; }
.cb-track { position: relative; height: 14px; border-radius: 99px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.45) 0 2px, transparent 2px 100%), rgba(0,0,0,.35); background-size: calc(100% / 24) 100%; box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.cb-skunk { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(242,126,99,.6); }
.cb-peg { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; transition: left .6s var(--ease); }
.cb-peg.front { background: #e5383b; box-shadow: 0 0 0 2px #1b130b, 0 0 10px rgba(229,56,59,.6); z-index: 2; }
.cb-peg.back { background: #7a2a2c; box-shadow: 0 0 0 2px #1b130b; }
.cb-lane.me .cb-peg.front { background: var(--gold); box-shadow: 0 0 0 2px #1b130b, 0 0 10px rgba(201,169,110,.7); }
.cb-lane.me .cb-peg.back { background: #7c6640; }
.cb-board-foot { display: flex; justify-content: space-between; padding: 0 2.6em 0 5.3em; color: var(--dim); font-size: .7em; }
.cb-play { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: radial-gradient(120% 140% at 50% 0%, #17321f, #0d1b12); border: 1px solid rgba(127,211,107,.18); }
.cb-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cb-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cb-slot small { color: rgba(255,255,255,.55); font-weight: 700; font-size: .78em; white-space: nowrap; }
.cb-crib { display: flex; height: 84px; align-items: center; }
.cb-crib .pc-back.mini2 { width: 40px; height: 58px; border-radius: 6px; }
.cb-crib .pc-back.mini2 + .pc-back.mini2 { margin-left: -28px; }
.cb-count { display: flex; flex-direction: column; align-items: center; min-width: 5.5em; }
.cb-count b { font-family: var(--serif); font-size: 3em; line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.cb-count small { color: rgba(255,255,255,.55); font-weight: 700; font-size: .75em; }
.cb-count.idle b { font-size: 2em; color: var(--text); }
.cb-seq { display: flex; justify-content: center; min-height: 62px; align-items: center; }
.cb-seq .pc + .pc { margin-left: -14px; }
.cb-seq.empty small { color: rgba(255,255,255,.45); }
.cb-events { display: flex; flex-direction: column; gap: 2px; text-align: center; font-size: .85em; color: rgba(255,255,255,.75); min-height: 3.6em; }
.cb-pts { color: var(--gold-2); }
.crib-screen .pc.dim { opacity: .38; }
.cb-result { max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; text-align: left; }
.cb-result h2, .cb-result .kicker { text-align: center; }
.cb-part { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.cb-part-head { display: flex; justify-content: space-between; align-items: baseline; }
.cb-part-total { color: var(--good); font-size: 1.2em; }
.cb-part-cards { display: flex; align-items: center; flex-wrap: wrap; }
.cb-part-cards .pc + .pc { margin-left: -12px; }
.cb-plus { margin: 0 8px; color: var(--muted); font-weight: 800; }
.cb-items { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cb-item { display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px; border-radius: 99px; background: var(--panel-2); font-size: .8em; font-weight: 700; }
.cb-item b { color: var(--gold-2); margin-left: 4px; }
.cb-item.none { color: var(--muted); }

/* ---- Mind Meld (remote co-op word game) */
.mm-screen { --mm: #8e7cc3; gap: 14px; }
.mm-screen.waiting .mm-status { display: block; }
.mm-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 14px 18px; border-radius: 20px; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--mm) 22%, transparent), transparent 70%), var(--panel); border: 1px solid color-mix(in srgb, var(--mm) 35%, transparent); text-align: center; }
.mm-stage:empty { display: none; }
.mm-start h2 { font-family: var(--serif); font-size: 2em; margin: .2em 0; }
.mm-start p { max-width: 28em; margin: 0 auto; }
.mm-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 100%; }
.mm-word { display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; border-radius: 16px; background: rgba(0,0,0,.35); border: 1px solid var(--line-2); min-width: 0; }
.mm-word small { color: var(--muted); font-size: .72em; letter-spacing: .14em; text-transform: uppercase; }
.mm-word b { font-family: var(--serif); font-size: clamp(1.3em, 6vw, 1.9em); color: var(--gold-2); overflow-wrap: anywhere; line-height: 1.15; }
.mm-plus { font-family: var(--serif); font-size: 1.6em; color: var(--mm); }
.mm-prompt { margin: 0; color: var(--muted); }
.mm-prompt:empty { display: none; }
.mm-status { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); min-height: 1.6em; }
.mm-status .mm-in { color: var(--gold-2); }
.mm-status .icon { width: 1em; height: 1em; color: var(--gold); }
.mm-entry { display: flex; flex-direction: column; gap: 10px; }
.mm-form { display: flex; gap: 8px; }
.mm-form .mm-input { flex: 1; min-width: 0; font-size: 1.15em; }
.mm-form .btn { flex: none; }
.mm-locked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(201,169,110,.08); border: 1px solid rgba(201,169,110,.35); }
.mm-locked div { display: flex; flex-direction: column; min-width: 0; }
.mm-locked small { color: var(--muted); font-size: .75em; }
.mm-locked b { font-size: 1.25em; color: var(--gold-2); overflow-wrap: anywhere; }
.mm-wait { text-align: center; margin: 0; }
.mm-link { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: .9em; padding: 4px; cursor: pointer; align-self: center; }
.mm-asked { text-align: center; }
.mm-claim { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--mm) 14%, transparent); border: 1px solid color-mix(in srgb, var(--mm) 45%, transparent); }
.mm-claim p { margin: 0 0 10px; }
.mm-claim b { color: var(--gold-2); }
.mm-chain { display: flex; flex-direction: column; gap: 4px; }
.mm-chain-head { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .7em; margin-bottom: 2px; }
.mm-link-row { display: grid; grid-template-columns: 1.8em 1fr auto 1fr; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--panel); font-size: .92em; }
.mm-link-row span { overflow-wrap: anywhere; }
.mm-link-row span:last-child { text-align: right; }
.mm-link-row i { color: var(--mm); font-style: normal; }
.mm-rn { color: var(--muted); font-size: .8em; }
.mm-result h2 { overflow-wrap: anywhere; }
.mm-path { display: flex; flex-direction: column; gap: 4px; max-height: 32vh; overflow-y: auto; margin: 6px 0; text-align: left; }
.mm-statrow { display: flex; gap: 8px; justify-content: center; }
.mm-stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.3); }
.mm-stat b { font-family: var(--serif); font-size: 1.4em; color: var(--gold-2); }
.mm-stat small { color: var(--muted); font-size: .72em; }
.mm-claim .btn { white-space: nowrap; }
.mm-status .rm-dot { position: static; flex: none; }

/* ---- Wordstorm (Boggle-style word hunt) */
.cover-wordstorm .ws-ct rect { fill: rgba(255,255,255,.06); stroke: currentColor; stroke-opacity: .5; stroke-width: 1.4; }
.cover-wordstorm .ws-ct text { fill: var(--text); font: 700 20px var(--serif, serif); text-anchor: middle; opacity: .85; }
.cover-wordstorm .ws-ct { animation: wsDrop 4s ease-in-out infinite; animation-delay: var(--d); }
.cover-wordstorm .ws-ctrail { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; stroke-dasharray: 200; stroke-dashoffset: 200; animation: doodle 4s ease-in-out infinite; }
@keyframes wsDrop { 0%, 100% { transform: translateY(0); } 8% { transform: translateY(-3px); } 16% { transform: translateY(0); } }

.ws-grid { --n: 4; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 100%; user-select: none; -webkit-user-select: none; }
.ws-tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; margin: 5%; border-radius: 18%; background: linear-gradient(180deg, #f6f1e4, #ddd3bc); box-shadow: 0 .25em 0 #a99a78, 0 .5em 1em rgba(0,0,0,.45); color: #1b1712; transition: background .12s, box-shadow .12s; z-index: 1; }
.ws-tile span { font-family: var(--serif); font-weight: 700; font-size: calc(var(--fs, 1em) * 1); line-height: 1; }
.ws-tile.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); transform: translateY(2px); box-shadow: 0 .12em 0 #8a7041, 0 .3em .6em rgba(0,0,0,.4); }
.ws-tile.good { background: linear-gradient(180deg, #b9f0a8, #7fd36b); }
.ws-tile.dup { background: linear-gradient(180deg, #d9d4c8, #a9a395); }
.ws-tile.bad { background: linear-gradient(180deg, #f6b3a3, #f27e63); animation: wsShake .3s; }
.ws-tile.blank { background: linear-gradient(180deg, #3a3542, #25212c); box-shadow: 0 .25em 0 #15131a, 0 .5em 1em rgba(0,0,0,.45); }
.ws-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.ws-trail polyline { fill: none; stroke: rgba(201,169,110,.75); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.ws-trail[data-state="good"] polyline { stroke: rgba(127,211,107,.8); }
.ws-trail[data-state="dup"] polyline { stroke: rgba(200,195,185,.6); }
.ws-trail[data-state="bad"] polyline { stroke: rgba(242,126,99,.8); }
.ws-grid.shaking .ws-tile { animation: wsRattle .5s infinite; }
.ws-grid.shaking .ws-tile:nth-child(odd) { animation-delay: -.25s; }
@keyframes wsRattle { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-4%, 3%) rotate(-8deg); } 50% { transform: translate(3%, -3%) rotate(6deg); } 75% { transform: translate(-2%, -4%) rotate(-4deg); } }
@keyframes wsShake { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-6%); } 70% { transform: translateX(6%); } }

/* TV */
.wordstorm.display .ws-grid.big { width: min(44em, 62vh); }
.wordstorm.display .ws-grid.big .ws-tile span { font-size: calc(min(44em, 62vh) / var(--n) * .5); }
.ws-shake, .ws-play { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5em; }
.ws-shake-side, .ws-play-side { display: flex; flex-direction: column; gap: .8em; min-width: 18em; }
.ws-shake-side h2 { font-family: var(--serif); font-size: 2.6em; margin: 0; }
.ws-count { font-family: var(--serif); font-size: 7em; color: var(--ga); line-height: 1; }
.ws-clock { display: flex; flex-direction: column; gap: .5em; margin-bottom: 1.2em; }
.ws-clock b { font-family: var(--serif); font-size: 5.5em; line-height: 1; font-variant-numeric: tabular-nums; }
.ws-clock-bar { height: .5em; border-radius: 1em; background: var(--line); overflow: hidden; }
.ws-clock-bar i { display: block; height: 100%; background: var(--ga); transform-origin: left; }
.ws-clock.urgent b { color: var(--bad); animation: thump 1s infinite; }
.ws-clock.urgent .ws-clock-bar i { background: var(--bad); }
.ws-counts { display: flex; flex-direction: column; gap: .5em; }
.ws-countrow { display: flex; align-items: center; gap: .7em; padding: .5em .8em; border-radius: .8em; background: var(--panel); border: 1px solid var(--line); font-size: 1.2em; }
.ws-countrow span { flex: 1; }
.ws-countrow b { font-family: var(--serif); font-size: 1.4em; color: var(--pc); font-variant-numeric: tabular-nums; }
.ws-reveal { flex: 1; display: grid; grid-template-columns: 22em 1fr; gap: 3em; min-height: 0; }
.ws-right { display: flex; flex-direction: column; gap: 1em; min-height: 0; }
.ws-reveal-side { display: flex; flex-direction: column; gap: 1.2em; }
.ws-grid.small { width: 100%; }
.ws-grid.small .ws-tile span { font-size: 2.2em; }
.ws-reveal-side .ws-grid.small .ws-tile span { font-size: calc(22em / var(--n) * .42); }
.ws-longest b { display: block; font-family: var(--serif); font-size: 2.4em; color: var(--gold-2); letter-spacing: .05em; }
.ws-longest small { color: var(--muted); }
.ws-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(22em, 1fr)); gap: 1em; align-content: start; overflow-y: auto; min-height: 0; }
.ws-pcard { padding: 1em 1.2em; border-radius: 1em; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--pc); }
.ws-pcard-head { display: flex; align-items: center; gap: .6em; margin-bottom: .7em; }
.ws-pcard-head b { flex: 1; font-size: 1.15em; }
.ws-pcard-pts { font-family: var(--serif); font-size: 1.8em; color: var(--good); }
.ws-pcard-head small { color: var(--muted); }
.ws-chips { display: flex; flex-wrap: wrap; gap: .4em; }
.ws-chip { display: inline-flex; align-items: baseline; gap: .35em; padding: .25em .6em; border-radius: .5em; background: rgba(201,169,110,.12); border: 1px solid rgba(201,169,110,.3); color: var(--gold-2); font-weight: 600; }
.ws-chip small { font-size: .75em; color: var(--muted); font-weight: 700; }
.ws-chip.big { background: rgba(127,211,107,.14); border-color: rgba(127,211,107,.4); color: #c6f0b8; }
.ws-chip.shared { background: transparent; border-color: var(--line); color: var(--dim); text-decoration: line-through; }
.ws-chip.missed { background: rgba(90,169,242,.1); border-color: rgba(90,169,242,.35); color: #b9daf9; }
.ws-missed .kicker, .ws-longest .kicker { display: block; margin-bottom: .5em; }
/* tutorial */
.ws-tstage { display: flex; align-items: center; justify-content: center; }
.ws-tgrid { position: relative; width: 26em; }
.ws-tgrid .ws-tile span { font-size: 3.2em; }
.ws-bubble { position: absolute; left: 50%; top: -3.4em; transform: translateX(-50%); display: flex; align-items: baseline; gap: .5em; padding: .5em 1em; border-radius: 1em; background: #0c0c12; border: 1px solid var(--good); white-space: nowrap; z-index: 6; }
.ws-bubble b { font-family: var(--serif); font-size: 1.6em; letter-spacing: .06em; }
.ws-bubble small { color: var(--good); font-weight: 800; font-size: 1.2em; }
.ws-tcards { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 1em; width: 20em; }
.ws-tcard { padding: 1em; border-radius: 1em; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--pc); }
.ws-tcard-head { display: flex; align-items: center; gap: .6em; margin-bottom: .6em; }
.ws-tcard .ws-chip { font-size: 1.3em; }
.ws-ttable { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; grid-template-columns: repeat(2, 9em); gap: .7em; }
.ws-ttable div { display: flex; flex-direction: column; align-items: center; padding: .8em; border-radius: .9em; background: var(--panel); border: 1px solid var(--line); }
.ws-ttable b { font-family: var(--serif); font-size: 2.2em; color: var(--gold-2); }
.ws-ttable small { color: var(--muted); }

/* Phone */
.wordstorm.phone.ws-playmode { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); overscroll-behavior: none; }
.ws-playmode .p-stage { gap: 10px; }
.ws-grid.touch { touch-action: none; max-width: min(100%, 52svh); margin: 0 auto; }
.ws-grid.touch .ws-tile span { font-size: min(9.5vw, 2.6rem); }
.ws-grid.touch.ws-n5 .ws-tile span { font-size: min(7.5vw, 2rem); }
.ws-grid.touch.ws-n6 .ws-tile span { font-size: min(6.4vw, 1.7rem); }
.ws-grid.touch.ws-n6 .ws-tile { margin: 4%; }
.ws-word { height: 2.6em; display: flex; align-items: center; justify-content: center; gap: .5em; }
.ws-word b { font-family: var(--serif); font-size: 1.9em; letter-spacing: .08em; color: var(--gold-2); }
.ws-word small { font-weight: 800; color: var(--muted); }
.ws-word.good b, .ws-word.good small { color: var(--good); }
.ws-word.dup b { color: var(--dim); }
.ws-word.bad b, .ws-word.bad small { color: var(--bad); }
.ws-stat { display: flex; align-items: baseline; justify-content: center; gap: .4em; color: var(--muted); }
.ws-stat b { font-family: var(--serif); font-size: 1.4em; color: var(--text); }
.ws-stat i { width: 1px; height: 1em; background: var(--line-2); margin: 0 .5em; align-self: center; }
.ws-found { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 22svh; overflow-y: auto; }
.ws-found .ws-chip { font-size: .9em; }
.phone-shake { width: min(70vw, 300px); margin: 18px 0; }
.ws-presult { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 10px; }
.ws-presult .ws-chips { justify-content: center; }
.ws-presult .ws-missed { margin-top: 10px; }

/* TV lobby on a landscape screen: everything fits one screen, no scrolling. Sizes follow whichever of width or
   height is tighter, so a 16:9 TV, a laptop or a 4:3 projector all fit. */
@media (min-aspect-ratio: 1/1) {
  .d-lobby { font-size: clamp(11px, min(.92vw, 1.64vh), 30px); height: 100svh; overflow: hidden; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.6fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 3em; padding-bottom: 1.6em; }
  .d-lobby .lobby-main { min-height: 0; padding-bottom: 0; }
  /* Left column: players on top, then how to join. */
  .d-lobby { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr); }
  .d-lobby .join-panel { align-self: stretch; justify-content: flex-start; gap: 1em; padding-top: 0; min-height: 0; padding-bottom: 5.4em; }
  .d-lobby .lobby-roster { width: 100%; margin-bottom: .6em; }
  .d-lobby .join-panel .join-kicker { margin-top: auto; }
  .d-lobby .join-panel .qr-wrap { margin-bottom: auto; }
  .d-lobby .qr-card { width: 10em; height: 10em; }
  .d-lobby .qr-wrap { font-size: 1.05em; }
  .d-lobby .code-tiles.xl { font-size: 5em; }
  .d-lobby .join-url { font-size: 2.4em; }
  .d-lobby .section-head { margin: 1em 0 .6em; }
  .d-lobby .lobby-players { gap: .8em 1em; min-height: 0; }
  .d-lobby .lobby-player { width: 4.9em; }
  .d-lobby .lobby-players .avatar.lg { --s: 3.9em; }
  .d-lobby .game-shelf { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .d-lobby .game-shelf .cover { aspect-ratio: 16 / 8.5; }
  .d-lobby .game-tile-text { padding: .65em .9em .8em; }
  .d-lobby .game-tile-text b { font-size: 1.25em; }
  .d-lobby .game-tile-text span { font-size: .88em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
  .d-lobby .game-detail { flex: 1; min-height: 0; overflow: hidden; margin-top: 1em; padding: 1.1em 1.4em; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 1.6em; }
  .d-lobby .detail-text h3 { font-size: 2.6em; }
  .d-lobby .detail-text p { font-size: 1.12em; }
  .d-lobby .settings { gap: 1em; align-content: start; font-size: 1.12em; }
  .d-lobby .setting { grid-template-columns: 7.5em 1fr; }
  .d-lobby .setting-label { font-size: 1em; }
  .d-lobby .seg { padding: .5em .95em; font-size: .9em; }
  /* Opening "How to play" swaps out the description instead of pushing the page down. */
  .d-lobby .detail-text:has(.how[open]) > p { display: none; }
  .d-lobby .detail-text .how { margin-bottom: 1em; }
  .d-lobby .rules { font-size: 1em; gap: .35em; }
  .d-lobby .last-results { margin-top: .6em; }
}

/* ---- One Clue (Just One-style co-op word game) */
.avatar.xs { --s: 1.4em; font-size: .7em; }
.cover-oneclue .oc-hidden rect { fill: rgba(242,161,78,.14); stroke: var(--ga); stroke-width: 2; }
.cover-oneclue .oc-hidden text { fill: var(--ga); font: 700 30px var(--serif, serif); text-anchor: middle; }
.cover-oneclue .oc-cc rect { fill: rgba(255,255,255,.06); stroke: currentColor; stroke-opacity: .5; stroke-width: 1.4; }
.cover-oneclue .oc-cc line { stroke: currentColor; stroke-width: 3; stroke-linecap: round; opacity: .55; }
.cover-oneclue .oc-cc .x { stroke: #f27e63; stroke-width: 3; stroke-linecap: round; fill: none; }
.cover-oneclue .oc-cc { animation: wsDrop 4s ease-in-out infinite; animation-delay: var(--d); }
.cover-oneclue .oc-cc.out { opacity: .6; }

.oc-score { display: flex; align-items: baseline; gap: .35em; padding: .35em .9em; border-radius: 99px; background: rgba(242,161,78,.12); border: 1px solid rgba(242,161,78,.35); }
.oc-score small { color: var(--muted); font-size: .75em; }
.oc-score b { font-family: var(--serif); font-size: 1.5em; color: var(--ga); }
.oc-cards { display: flex; flex-wrap: wrap; gap: .9em; justify-content: center; perspective: 800px; }
.oc-card { position: relative; min-width: 9em; padding: 1em 1.3em; border-radius: .9em; background: linear-gradient(180deg, #fbf7ee, #e9dfca); color: #1b1712; box-shadow: 0 .3em 0 #b3a27e, 0 1em 2em rgba(0,0,0,.4); display: flex; flex-direction: column; align-items: center; gap: .35em; border-top: .35em solid var(--pc, var(--ga)); }
.oc-card b { font-family: var(--serif); font-size: 1.7em; letter-spacing: .02em; text-transform: uppercase; overflow-wrap: anywhere; text-align: center; }
.oc-card .oc-by { display: inline-flex; align-items: center; gap: .35em; font-size: .8em; color: #5b5244; font-weight: 700; }
.oc-card .oc-why { font-size: .75em; font-weight: 800; color: #b5462f; text-transform: uppercase; letter-spacing: .08em; }
.oc-card.out { background: linear-gradient(180deg, #4a4452, #37323e); color: var(--dim); box-shadow: 0 .3em 0 #1d1a22; }
.oc-card.out b { text-decoration: line-through; }
.oc-card.out .oc-by { color: var(--dim); }
.oc-card.out .oc-why { color: #f27e63; }
.oc-card.down { min-width: 7em; min-height: 5.2em; justify-content: center; background: repeating-linear-gradient(45deg, #2b2733, #2b2733 .6em, #322d3b .6em, #322d3b 1.2em); box-shadow: 0 .3em 0 #15131a; color: var(--dim); border-top-color: transparent; }
.oc-card.down .icon { width: 1.6em; height: 1.6em; }
.oc-cards.big .oc-card { min-width: 12em; padding: 1.5em 1.8em; }
.oc-cards.big .oc-card b { font-size: 2.6em; }
.oc-cards.big .oc-card.down { min-width: 10em; min-height: 7.5em; }
.oc-wait { flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4em; }
.oc-guesser { display: flex; align-items: center; gap: 1.6em; }
.oc-guesser .avatar.xl { --s: 8em; box-shadow: 0 0 0 .3em color-mix(in srgb, var(--pc) 40%, transparent), 0 0 4em color-mix(in srgb, var(--pc) 50%, transparent); }
.oc-guesser h2 { font-family: var(--serif); font-size: 3em; margin: .1em 0; }
.oc-wait-side { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2em; position: relative; }
.oc-wait-side .timer-ring { position: relative; top: auto; right: auto; }
.oc-wait-side .oc-cards { justify-content: flex-start; }
.oc-wait-side .pbar { width: 100%; }
.oc-guess { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3em; }
.oc-guess-head { display: flex; align-items: center; gap: 1.4em; justify-content: center; }
.oc-guess-head h2 { font-family: var(--serif); font-size: 2.8em; margin: .1em 0 0; }
.oc-guess-head .timer-ring { position: relative; top: auto; right: auto; margin-left: 2em; }
.oc-result { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2.2em; text-align: center; }
.oc-result .pbar { width: min(40em, 80%); }
.oc-word { font-family: var(--serif); font-size: 5.5em; margin: .05em 0 .1em; color: var(--gold-2); text-transform: uppercase; letter-spacing: .03em; }
.oc-verdict { display: inline-flex; align-items: center; gap: .5em; font-size: 1.8em; }
.oc-verdict .icon { width: 1.2em; height: 1.2em; }
.oc-result.right .oc-verdict, .oc-verdict.right { color: var(--good); }
.oc-result.miss .oc-verdict, .oc-verdict.miss { color: var(--bad); }
.oc-close { color: var(--gold-2); font-weight: 700; }
.oc-final .oc-big { font-size: 7em; color: var(--ga); }
.oc-final .oc-big small { font-size: .4em; color: var(--muted); }
.oc-history { display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .5em; align-content: start; }
.oc-hrow { display: flex; align-items: center; gap: .5em; padding: .5em .8em; border-radius: .7em; background: var(--panel); border: 1px solid var(--line); }
.oc-hrow b { flex: 1; text-transform: uppercase; letter-spacing: .03em; }
.oc-hrow small { color: var(--muted); }
.oc-hrow.right .icon { color: var(--good); } .oc-hrow.wrong .icon { color: var(--bad); } .oc-hrow.pass .icon { color: var(--dim); }
/* tutorial */
.oc-tstage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6em; }
.oc-tguesser { display: flex; align-items: center; gap: .8em; }
.oc-tguesser b { font-size: 1.4em; } .oc-tguesser small { color: var(--muted); }
.oc-secret { display: flex; flex-direction: column; align-items: center; padding: .8em 2em; border-radius: 1em; border: 1px dashed var(--ga); }
.oc-secret small { color: var(--muted); } .oc-secret b { font-family: var(--serif); font-size: 2.6em; color: var(--ga); letter-spacing: .05em; }
.oc-tguess { display: flex; align-items: center; gap: .8em; padding: .8em 1.6em; border-radius: 1em; background: rgba(127,211,107,.12); border: 1px solid rgba(127,211,107,.4); }
.oc-tguess b { font-family: var(--serif); font-size: 2em; } .oc-tguess small { color: var(--muted); }
.oc-ok { display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--good); color: #10200c; }
.oc-tscore { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1.4em; }
.oc-tscore div { display: flex; flex-direction: column; align-items: center; padding: 1.2em 2em; border-radius: 1em; background: var(--panel); border: 1px solid var(--line); }
.oc-tscore b { font-family: var(--serif); font-size: 3em; color: var(--gold-2); } .oc-tscore small { color: var(--muted); }
/* phone */
.oc-center { text-align: center; margin: 0; }
.oc-pword { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, rgba(242,161,78,.16), rgba(242,161,78,.05)); border: 1px solid rgba(242,161,78,.4); }
.oc-pword small { color: var(--muted); font-size: .75em; letter-spacing: .14em; text-transform: uppercase; }
.oc-pword b { font-family: var(--serif); font-size: 2.3em; color: #f6c48e; text-transform: uppercase; letter-spacing: .03em; overflow-wrap: anywhere; text-align: center; }
.oc-input { font-size: 1.25em; text-align: center; }
.oc-mine { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.oc-mine small { color: var(--muted); }
.oc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.oc-chip { padding: 8px 14px; border-radius: 10px; background: #f3ecdc; color: #1b1712; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.oc-chips.big .oc-chip { font-size: 1.3em; padding: 12px 18px; }
.oc-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.oc-rclue { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 12px; background: #f3ecdc; color: #1b1712; border: 2px solid transparent; font: inherit; cursor: pointer; }
.oc-rclue b { text-transform: uppercase; letter-spacing: .04em; overflow-wrap: anywhere; }
.oc-rclue small { color: #6b6252; font-size: .75em; font-weight: 700; }
.oc-rclue.mine { border-color: var(--ga); }
.oc-rclue.out { background: #2c2832; color: var(--dim); }
.oc-rclue.out b { text-decoration: line-through; }
.oc-rclue.out small { color: #f27e63; }
.oc-you h2 { margin-top: 0; }
.wordstorm { --ga: #5aa9f2; }
.oneclue { --ga: #f2a14e; }
.oc-leaders { display: flex; gap: .4em; }
.oc-lead { display: inline-flex; align-items: center; gap: .35em; padding: .3em .7em .3em .35em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.oc-lead b { font-family: var(--serif); color: var(--ga); }

/* ---- Fast Fingers (list-it-fast party game) */
.fastfingers { --ga: #e85d9c; }
.cover-fastfingers .ff-bar { fill: rgba(232,93,156,.16); stroke: var(--ga); stroke-width: 2; }
.cover-fastfingers .ff-ln { stroke: var(--ga); stroke-width: 4; stroke-linecap: round; opacity: .8; }
.cover-fastfingers .ff-c rect { fill: rgba(201,169,110,.14); stroke: var(--gold); stroke-opacity: .55; stroke-width: 1.4; }
.cover-fastfingers .ff-c line { stroke: var(--gold-2); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.cover-fastfingers .ff-c { opacity: 0; animation: ffPop 4s ease-out infinite; animation-delay: var(--d); }
@keyframes ffPop { 0% { opacity: 0; transform: translateY(6px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.ff-cat { display: flex; flex-direction: column; align-items: center; gap: .3em; text-align: center; }
.ff-cat h1 { font-family: var(--serif); font-weight: 500; margin: 0; font-size: 2.2em; line-height: 1.1; }
.ff-cat.big h1 { font-size: 4.6em; max-width: 18em; }
.ff-letter { display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: .25em; font-family: var(--serif); font-size: 3em; color: #1b1712; background: linear-gradient(180deg, #f6f1e4, #ddd3bc); box-shadow: 0 .1em 0 #a99a78; }
.ff-cat.big .ff-letter { font-size: 5em; }
.ff-play { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3em; }
.ff-play-row { display: flex; align-items: center; gap: 3em; flex-wrap: wrap; justify-content: center; }
.ff-clock b { font-family: var(--serif); font-size: 6em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ga); }
.ff-clock.urgent b { color: var(--bad); animation: thump 1s infinite; }
.ff-counts { display: flex; gap: 1em; flex-wrap: wrap; max-width: 50em; }
.ff-countp { display: flex; align-items: center; gap: .5em; padding: .4em .8em .4em .4em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.ff-countp b { font-family: var(--serif); font-size: 1.5em; color: var(--pc); min-width: 1.2em; text-align: center; }
.ff-getready { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; text-align: center; }
.ff-getready h2 { font-family: var(--serif); font-size: 3.4em; margin: 0; }
.ff-getready .pbar { width: min(40em, 80%); }
.ff-count { font-family: var(--serif); font-size: 8em; color: var(--ga); line-height: 1; }
.ff-reveal { flex: 1; display: grid; grid-template-columns: 22em 1fr; gap: 3em; min-height: 0; }
.ff-reveal-side { display: flex; flex-direction: column; gap: 1.6em; }
.ff-reveal-side .ff-cat { align-items: flex-start; text-align: left; }
.ff-shared { display: flex; flex-direction: column; gap: .4em; }
.ff-srow { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: .4em .7em; border-radius: .6em; background: var(--panel); }
.ff-sby { display: inline-flex; gap: .15em; }
.ws-chip.ff-out { background: transparent; border-color: rgba(242,126,99,.45); color: #f27e63; text-decoration: line-through; }
.ff-tstage { display: flex; align-items: center; justify-content: center; }
.ff-tphone { width: 20em; padding: 1em; border-radius: 1.6em; border: .4em solid #23222b; background: #0b0b10; display: flex; flex-direction: column; gap: .8em; }
.ff-tinput { display: flex; align-items: center; height: 2.6em; padding: 0 .9em; border-radius: .7em; border: 1px solid var(--gold); font-weight: 700; }
.ff-tinput i { width: 2px; height: 1.2em; background: var(--gold); animation: blink 1s steps(2) infinite; margin-left: 2px; }
.ff-tlist { display: flex; flex-wrap: wrap; gap: .4em; min-height: 6em; align-content: flex-start; }
.ff-tcards { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 1em; }
.ff-tcards .ws-chip { font-size: 1.25em; }
/* phone */
.fastfingers.phone.ff-typing { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
.ff-typing .p-stage { gap: 10px; }
.ff-typing .ff-cat h1 { font-size: 1.7em; }
.ff-typing .ff-letter { font-size: 2em; }
.ff-form { display: flex; gap: 8px; }
.ff-form .ff-input { flex: 1; min-width: 0; font-size: 1.15em; }
.ff-mycount { display: flex; align-items: baseline; justify-content: center; gap: .35em; color: var(--muted); }
.ff-mycount b { font-family: var(--serif); font-size: 1.5em; color: var(--text); }
.ff-mine { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ff-mychip { cursor: pointer; font: inherit; font-weight: 600; }
.ff-mychip .icon { width: .8em; height: .8em; opacity: .6; }
.ff-check { padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pc); }
.ff-check-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ff-flag { cursor: pointer; font: inherit; font-weight: 600; }
.ff-flag.on { border-color: #f27e63; box-shadow: 0 0 0 1px #f27e63; }
.ff-flag small { color: #f27e63; }
.ff-warn { color: #f6b3a3; text-align: center; margin: 0; }

/* ---- The Herd (Herd Mentality-style) */
.herd { --ga: #f28cc0; }
.cover-herd .hd-pen { fill: rgba(242,140,192,.06); stroke: var(--ga); stroke-width: 2; stroke-dasharray: 6 6; }
.cover-herd .hd-cd circle:first-child { fill: #efe6d6; }
.cover-herd .hd-cd circle:not(:first-child) { fill: #1b1712; }
.cover-herd .hd-cd ellipse { fill: #f6d5c6; }
.cover-herd .hd-cd { animation: wsDrop 4s ease-in-out infinite; animation-delay: var(--d); }
.cover-herd .hd-cd.pink circle:first-child { fill: #f28cc0; }

.hd-cow { display: inline-grid; width: 2.4em; height: 2.4em; color: #efe6d6; flex: none; }
.hd-cow svg { width: 100%; height: 100%; }
.hd-cow.pink { color: #f28cc0; filter: drop-shadow(0 0 .5em rgba(242,140,192,.6)); }
.hd-cow.mini { width: 1.3em; height: 1.3em; }
.hd-cow.big { width: 5em; height: 5em; }
.hd-cow.tut { position: absolute; right: 8%; bottom: 14%; width: 6em; height: 6em; }
.hd-q { display: flex; flex-direction: column; gap: .3em; }
.hd-q h1 { font-family: var(--serif); font-weight: 500; margin: 0; font-size: 3em; line-height: 1.1; }
.hd-q h2 { font-family: var(--serif); font-weight: 500; margin: 0; font-size: 2.2em; }
.hd-q.big h1 { font-size: 4.4em; }
.hd-answer, .hd-result { flex: 1; display: grid; grid-template-columns: 1fr 20em; gap: 3em; align-items: center; min-height: 0; }
.hd-answer-main, .hd-result-main { display: flex; flex-direction: column; gap: 2.4em; min-width: 0; }
.hd-answer-foot { display: flex; align-items: center; gap: 2em; }
.hd-answer-foot .timer-ring { position: relative; top: auto; right: auto; }
.hd-tally { display: flex; flex-direction: column; gap: .45em; align-self: center; }
.hd-trow { display: flex; align-items: center; gap: .6em; padding: .45em .8em .45em .45em; border-radius: .8em; background: var(--panel); border: 1px solid var(--line); }
.hd-trow span { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-trow b { font-family: var(--serif); font-size: 1.4em; color: var(--pc); }
.hd-trow.haspink { border-color: rgba(242,140,192,.5); }
.hd-pens { display: flex; flex-wrap: wrap; gap: 1em; align-content: flex-start; }
.hd-pen { position: relative; min-width: 12em; padding: .9em 1.1em; border-radius: 1em; background: var(--panel); border: 2px dashed var(--line-2); display: flex; flex-direction: column; gap: .5em; transition: border-color .3s, background .3s; }
.hd-pen-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.hd-pen-head b { font-size: 1.5em; font-family: var(--serif); }
.hd-pen-n { display: grid; place-items: center; min-width: 1.8em; height: 1.8em; border-radius: 99px; background: rgba(255,255,255,.08); font-weight: 800; }
.hd-pen-also { color: var(--muted); }
.hd-pen-who { display: flex; flex-wrap: wrap; gap: .3em; }
.hd-pen.lead { border-color: var(--ga); border-style: solid; }
.hd-pen.herd { border-color: var(--good); border-style: solid; background: rgba(127,211,107,.08); }
.hd-pen.odd { border-color: #f28cc0; border-style: solid; }
.hd-plus { display: inline-flex; align-items: center; gap: .3em; align-self: flex-start; padding: .2em .7em; border-radius: 99px; background: var(--good); color: #10200c; font-weight: 800; }
.hd-group { flex: 1; display: flex; flex-direction: column; gap: 1.6em; min-height: 0; }
.hd-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2em; }
.hd-group-head p { max-width: 26em; margin: 0; text-align: right; }
.hd-group .hd-pens { flex: 1; min-height: 0; overflow: hidden; }
.hd-group-foot { display: flex; align-items: center; gap: 1.4em; flex-wrap: wrap; padding-left: 17em; padding-right: 13em; }
.hd-group-foot .pbar { flex: 1; min-width: 10em; }
.hd-pinknote { display: flex; align-items: center; gap: 1.2em; padding: 1em 1.4em; border-radius: 1em; background: rgba(242,140,192,.1); border: 1px solid rgba(242,140,192,.4); align-self: flex-start; }
.hd-pinknote b { display: block; font-size: 1.4em; } .hd-pinknote small { color: var(--muted); }
.hd-tstage { display: flex; flex-direction: column; justify-content: center; gap: 2em; }
/* phone */
.hd-pq { font-family: var(--serif); font-size: 1.8em; text-align: center; line-height: 1.15; }
.hd-pq.small { font-size: 1.3em; }
.hd-input { font-size: 1.2em; text-align: center; }
.hd-locked { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 14px; background: rgba(242,140,192,.1); border: 1px solid rgba(242,140,192,.4); }
.hd-locked small { color: var(--muted); } .hd-locked b { font-size: 1.5em; }
.hd-mgroups { display: flex; flex-direction: column; gap: 8px; }
.hd-mg { display: flex; gap: 6px; }
.hd-mg-main { flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hd-mg-main b { font-size: 1.1em; }
.hd-mg-main small { grid-column: 1; color: var(--muted); }
.hd-mg-n { grid-row: 1 / span 2; grid-column: 2; font-family: var(--serif); font-size: 1.4em; color: var(--ga); }
.hd-mg.mine .hd-mg-main { border-color: rgba(242,140,192,.45); }
.hd-mg.picked .hd-mg-main { border-color: var(--gold); background: rgba(201,169,110,.14); }
.hd-split { padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.hd-mycows { white-space: nowrap; }
/* Eight or more games: two rows of tiles in the lobby. */
@media (min-aspect-ratio: 1/1) {
  .d-lobby .game-shelf.two-rows { grid-auto-flow: row; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
  .d-lobby .game-shelf.two-rows .cover { aspect-ratio: 16 / 5; }
  .d-lobby:has(.game-shelf.two-rows) .settings { gap: .75em; }
  .d-lobby:has(.game-shelf.two-rows) .game-detail { margin-top: .8em; }
  .d-lobby .game-shelf.two-rows .game-tile-text { padding: .5em .8em .6em; }
  .d-lobby .game-shelf.two-rows .game-tile-text span { min-height: 0; -webkit-line-clamp: 1; }
}

/* ---- Zoom In (remote photo guessing): one tile that flips between steps ---- */
.zi-screen { --zi: #4fc3a1; gap: 10px; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.zi-screen.waiting { height: auto; min-height: 100svh; overflow: visible; }
.zi-score { display: flex; gap: 8px; flex: none; }
.zi-score:empty { display: none; }
.zi-sc { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); min-width: 0; }
.zi-sc small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zi-sc b { font-family: var(--serif); font-size: 1.4em; color: var(--gold-2); }
.zi-tabs { display: flex; flex-direction: column; gap: 8px; flex: none; }
.zi-tabs:empty { display: none; }
.zi-steps { display: flex; align-items: center; gap: 6px; font-size: .82em; color: var(--muted); }
.zi-rnd { font-family: var(--serif); color: var(--text); font-size: 1.15em; margin-right: 4px; }
.zi-steps > i { flex: 1; height: 1px; background: var(--line-2); min-width: 8px; }
.zi-step { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.zi-step b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .85em; border: 1px solid var(--line-2); }
.zi-step b .icon { width: 12px; height: 12px; }
.zi-step.on { color: var(--text); font-weight: 600; }
.zi-step.on b { background: var(--zi); border-color: var(--zi); color: #06110d; }
.zi-step.done b { border-color: color-mix(in srgb, var(--zi) 60%, transparent); color: var(--zi); }
.zi-tabrow { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.zi-tabbtn { position: relative; flex: 1; padding: 8px 10px; border-radius: 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .92em; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zi-tabbtn.on { background: color-mix(in srgb, var(--zi) 20%, transparent); color: var(--text); font-weight: 600; }
.zi-due { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--zi); box-shadow: 0 0 8px var(--zi); }
.zi-tile { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 22px; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--zi) 14%, transparent), transparent 70%), var(--panel); border: 1px solid color-mix(in srgb, var(--zi) 35%, transparent); overflow-y: auto; overscroll-behavior: contain; position: relative; backface-visibility: hidden; }
.zi-tile > * { flex: none; }
.zi-tile.zi-summary, .zi-tile.zi-final { text-align: center; }
.zi-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zi-head .kicker { margin-right: auto; }
.zi-worth { color: var(--zi); font-size: .85em; }
.zi-diff { padding: 2px 9px; border-radius: 999px; font-size: .78em; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); }
.zi-diff small { font-size: .9em; }
.zi-diff.d1 { color: var(--gold-2); border-color: rgba(201,169,110,.5); }
.zi-diff.d2 { color: #f27e63; border-color: rgba(242,126,99,.55); background: rgba(242,126,99,.08); }
.zi-stagebox { flex: 1 1 auto !important; min-height: 150px; container-type: size; display: grid; place-items: center; }
.zi-view { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #000; touch-action: manipulation; }
.zi-view img:not([src]), .zi-gallery img:not([src]) { visibility: hidden; }
.zi-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.zi-view.full img { object-fit: contain; }
.zi-pips { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.zi-pips i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); box-shadow: 0 0 4px rgba(0,0,0,.6); }
.zi-pips i.used { background: rgba(255,255,255,.75); }
.zi-pips i.on { background: var(--zi); width: 20px; border-radius: 4px; }
.zi-form { display: flex; gap: 8px; }
.zi-form .zi-input { flex: 1; min-width: 0; font-size: 1.1em; }
.zi-form .btn { flex: none; }
.zi-actions { display: flex; justify-content: center; }
.zi-guesses { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.zi-summary .zi-guesses, .zi-rbody .zi-guesses { flex-wrap: wrap; }
.zi-guess { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); font-size: .9em; }
.zi-guess:has(.zi-count) { padding-right: 5px; }
.zi-guess small { color: var(--muted); font-size: .75em; }
.zi-guess b { font-weight: 500; text-decoration: line-through; text-decoration-color: rgba(242,126,99,.7); }
.zi-guess.right { border-color: color-mix(in srgb, var(--zi) 60%, transparent); }
.zi-guess.right b { text-decoration: none; color: var(--zi); }
.zi-count { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(201,169,110,.5); background: rgba(201,169,110,.12); color: var(--gold-2); font: inherit; font-size: .82em; cursor: pointer; }
.zi-count .icon { width: .95em; height: .95em; }
.zi-answer { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.zi-answer b { font-family: var(--serif); font-size: 1.35em; color: var(--gold-2); overflow-wrap: anywhere; }
.zi-tile .good { color: var(--zi); font-weight: 600; }
.zi-tile .bad { color: #f27e63; }
.zi-empty { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 10px 4px; }
.zi-empty > .icon { width: 48px; height: 48px; color: var(--zi); }
.zi-empty h3 { font-family: var(--serif); font-size: 1.6em; margin: 0; }
.zi-empty p { margin: 0; max-width: 28em; }
.zi-ready { display: inline-flex; align-items: center; gap: 4px; color: var(--zi); }
.zi-ready .icon { width: 1em; height: 1em; }
.zi-waitline { display: flex; align-items: flex-start; gap: 6px; margin: 0; }
.zi-tile .rm-dot { position: static; flex: none; margin-top: .45em; }
.zi-waitline .rm-dot { position: static; flex: none; margin-top: .45em; }
.zi-snapbtns { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; max-width: 420px; }
.zi-snapbtns .btn { flex: 1 1 10em; }
.zi-result { display: flex; flex-direction: column; gap: 10px; }
.zi-result h2 { font-family: var(--serif); margin: 0; font-size: 1.9em; }
.zi-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.zi-sum-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.zi-sum-tile small { color: var(--muted); font-size: .72em; letter-spacing: .1em; text-transform: uppercase; }
.zi-sum-tile b { color: var(--gold-2); overflow-wrap: anywhere; }
.zi-sum-tile .muted { font-size: .82em; }
.zi-sum-pts { font-family: var(--serif); font-size: 1.5em; }
.zi-sum-pts.good { color: var(--zi); }
.zi-sum-pts.bad { color: #f27e63; }
.zi-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 4px 0; }
.zi-gallery figure { margin: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zi-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #000; }
.zi-gallery figcaption { font-size: .75em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zi-target { margin-top: 4px; }
/* Past rounds sheet */
.zi-rounds { display: flex; flex-direction: column; gap: 10px; }
.zi-round { border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.zi-round-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.zi-rpts { font-size: .85em; color: var(--gold-2); }
.zi-rpts i { color: var(--muted); font-style: normal; }
.zi-rbody { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zi-rbody > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zi-rbody small { color: var(--muted); font-size: .75em; }
.zi-rbody b { color: var(--gold-2); overflow-wrap: anywhere; }
@media (max-width: 480px) { .zi-rbody { grid-template-columns: 1fr; } }
/* Taking a photo */
.zi-sheet .sheet-card.zi-edit { max-height: calc(100svh - 24px); overflow-y: auto; gap: 10px; }
.zi-tip { margin: 0; font-size: .9em; }
.zi-stage { position: relative; flex: none; width: 100%; margin: 0 auto; border-radius: 12px; overflow: hidden; touch-action: none; cursor: crosshair; background: #000; }
.zi-stage img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.zi-frame { position: absolute; border: 2px solid var(--zi); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; }
.zi-pickrow { display: flex; gap: 12px; align-items: center; }
.zi-loupe { position: fixed; z-index: 60; width: 120px; height: 120px; border-radius: 16px; border: 3px solid var(--zi); background: #000; box-shadow: 0 12px 30px rgba(0,0,0,.6); pointer-events: none; }
.zi-preview { width: 92px; height: 92px; border-radius: 12px; flex: none; background: #000; border: 1px solid color-mix(in srgb, var(--zi) 50%, transparent); }
.zi-pickrow > div { display: flex; flex-direction: column; gap: 6px; }
.zi-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.zi-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0,0,0,.3); color: var(--text); font: inherit; font-size: .9em; cursor: pointer; }
.zi-chip small { color: var(--gold-2); }
.zi-chip.on { border-color: var(--zi); background: color-mix(in srgb, var(--zi) 22%, transparent); color: #fff; }
.zi-editbtns { display: flex; gap: 8px; }
.zi-editbtns .btn { flex: 1; }

/* ---- Wordsworth (remote crossword tile game) ---- */
.ww-screen { --ww: #e3a857; gap: 8px; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.ww-screen.waiting { height: auto; min-height: 100svh; overflow: visible; }
.ww-scores { display: flex; gap: 8px; flex: none; align-items: stretch; }
.ww-scores:empty, .ww-last:empty, .ww-rack:empty, .ww-bar:empty { display: none; }
.ww-sc { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); min-width: 0; transition: border-color .25s, box-shadow .25s; }
.ww-sc small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ww-sc .rm-dot { position: static; flex: none; }
.ww-sc b { font-family: var(--serif); font-size: 1.4em; color: var(--gold-2); }
.ww-sc.turn { border-color: var(--ww); box-shadow: 0 0 0 1px var(--ww), 0 0 18px -6px var(--ww); }
.ww-sc.turn small { color: var(--text); font-weight: 600; }
.ww-bag { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--muted); cursor: pointer; font: inherit; line-height: 1.1; }
.ww-bag b { color: var(--text); font-size: 1.05em; }
.ww-bag small { font-size: .68em; }
.ww-last { flex: none; text-align: center; font-size: .88em; color: var(--muted); min-height: 1.3em; }
.ww-last b { color: var(--text); letter-spacing: .04em; }
.ww-last em { color: var(--ww); font-style: normal; font-weight: 700; }
.ww-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.ww-stage[hidden] { display: none; }
.ww-wrap { flex: 1; min-height: 0; container-type: size; overflow: hidden; display: grid; place-items: start center; border-radius: 14px; }
.ww-board { --side: min(100cqw, 100cqh); width: var(--side); height: var(--side); display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); gap: 2px; padding: 3px; box-sizing: border-box; border-radius: 12px; background: #15141c; border: 1px solid var(--line-2); container-type: inline-size; user-select: none; -webkit-user-select: none; }
.ww-stage.zoomed .ww-wrap { overflow: auto; place-items: start; overscroll-behavior: contain; }
.ww-stage.zoomed .ww-board { --side: calc(min(100cqw, 100cqh) * 1.85); flex: none; }
.ww-cell { position: relative; display: grid; place-items: center; border-radius: 3px; background: #1f1e28; color: rgba(255,255,255,.55); overflow: hidden; min-width: 0; min-height: 0; cursor: pointer; }
.ww-cell small { font-size: 1.55cqw; line-height: 1.05; text-align: center; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; opacity: .9; }
.ww-cell.tw { background: #7a2e2b; color: #ffd2c8; }
.ww-cell.dw { background: #6b3b52; color: #ffd6e8; }
.ww-cell.tl { background: #20506e; color: #cdeaff; }
.ww-cell.dl { background: #2d4f5c; color: #cfeef5; }
.ww-cell.star { background: #6b3b52; color: #ffd6e8; }
.ww-cell.star .icon { width: 70%; height: 70%; }
.ww-cell.hover { outline: 2px solid var(--ww); outline-offset: -2px; }
.ww-tile { position: relative; display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: 1; box-sizing: border-box; border-radius: 4px; background: linear-gradient(180deg, #f6e7c4, #e7cf9b); color: #2a1d0b; box-shadow: inset 0 -2px 0 rgba(120,80,20,.35), 0 1px 2px rgba(0,0,0,.4); touch-action: none; cursor: grab; }
.ww-tile b { font-family: var(--serif); font-weight: 800; font-size: 4.4cqw; line-height: 1; }
.ww-tile i { position: absolute; right: 8%; bottom: 4%; font-style: normal; font-weight: 700; font-size: 1.7cqw; line-height: 1; opacity: .75; }
.ww-tile.blank b { color: #8a5a12; }
.ww-tile.new { background: linear-gradient(180deg, #fff3d6, #f2d9a0); box-shadow: 0 0 0 2px var(--ww), 0 2px 6px rgba(0,0,0,.5); }
.ww-tile.last { background: linear-gradient(180deg, #fbe9b9, #eccd86); box-shadow: inset 0 0 0 2px rgba(227,168,87,.9); }
.ww-tile.sel { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--ww), 0 8px 16px rgba(0,0,0,.5); }
.ww-tile.lifted { opacity: .3; }
.ww-ghost { position: fixed; left: 0; top: 0; z-index: 90; width: 54px; height: 54px; pointer-events: none; container-type: normal; box-shadow: 0 12px 26px rgba(0,0,0,.55); }
.ww-ghost b { font-size: 28px; }
.ww-ghost i { font-size: 11px; }
.ww-zoom { position: absolute; right: 6px; bottom: 6px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(13,13,20,.82); backdrop-filter: blur(6px); color: var(--muted); cursor: pointer; }
.ww-zoom .icon { width: 18px; height: 18px; }
.ww-rack { flex: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; container-type: inline-size; padding: 8px; border-radius: 14px; background: linear-gradient(180deg, #2a2016, #1b150f); border: 1px solid rgba(227,168,87,.25); }
.ww-rack .ww-tile b { font-size: 7.2cqw; }
.ww-rack .ww-tile i { font-size: 2.8cqw; }
.ww-slot { aspect-ratio: 1; border-radius: 6px; border: 1px dashed rgba(227,168,87,.25); }
.ww-slot.empty { border-style: solid; border-color: transparent; }
.ww-rack .ww-tile.sel { transform: translateY(-6px); }
.ww-bar { flex: none; display: flex; gap: 8px; align-items: center; }
.ww-bar .btn { flex: 1; padding: .8em 1em; min-width: 0; }
.ww-bar .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-bar .icon-btn { flex: none; width: 2.9em; height: 2.9em; }
.ww-bar .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.ww-pts { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: rgba(26,20,10,.85); color: var(--gold-2); font-size: .95em; }
.ww-letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; container-type: inline-size; margin-top: 10px; }
.ww-letters .ww-tile { border: 0; cursor: pointer; }
.ww-letters .ww-tile b { font-size: 7cqw; color: #2a1d0b; }
.ww-swaprack { margin: 10px 0; }
.ww-swaprack .ww-tile { cursor: pointer; }
.ww-or { margin: 12px 0 6px; }
.ww-tracker { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; margin-top: 8px; }
.ww-tracker span { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.ww-tracker b { font-size: .9em; }
.ww-tracker i { font-style: normal; color: var(--gold-2); font-weight: 700; }
.ww-tracker .gone { opacity: .3; }
.ww-final { display: flex; gap: 8px; margin: 12px 0 4px; }
/* Table games: chat + reactions live in the top bar (.tc-dock, in place of the table code); the wheel fans downward. */
.tc-dock { display: flex; gap: 8px; flex: none; }
.tc-dock:empty { display: none; }
.tc-dock .tc-tab, .tc-dock .tc-react { position: relative; top: auto; right: auto; width: 2.6em; height: 2.6em; padding: 0; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); box-shadow: none; font-size: 1em; color: var(--gold-2); backdrop-filter: none; }
.tc-dock .tc-tab > span:not(.icon):not(.tc-badge) { display: none; }
.tc-dock .tc-tab .icon, .tc-dock .tc-react .icon { width: 1.3em; height: 1.3em; }
.tc-dock .tc-badge { top: -6px; left: auto; right: -6px; }
.tc-dock .tc-react.on { background: var(--gold); color: #1a1408; }
body[data-role="table"] .tc-wheel { left: 50%; right: auto; top: calc(env(safe-area-inset-top, 0px) + 70px); }
body[data-role="table"] .tc-emo { --r: 112px; --a: calc(198deg + var(--i) * 18deg); }
body[data-role="table"] .tc-emo.edit { --r: 40px; --a: 270deg; }
/* Narrow phones: the hand/round label gives way first so the top bar never overflows. */
.rm-top > .rm-hand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .rm-top { gap: 6px; } .rm-top .tc-dock { gap: 6px; } .rm-top .rm-title { font-size: 1.12em; } }

/* ---- Name Your Price ---- */
.rm-age { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(242,126,99,.4); background: rgba(242,126,99,.08); font-weight: 700; cursor: pointer; }
.rm-age[hidden] { display: none; }
.rm-age input { width: 20px; height: 20px; accent-color: var(--gold); }
.nyp-screen { --np: #7ed957; gap: 10px; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.nyp-screen.waiting { height: auto; min-height: 100svh; overflow: visible; }
.nyp-tile { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 22px; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--np) 12%, transparent), transparent 70%), var(--panel); border: 1px solid color-mix(in srgb, var(--np) 30%, var(--line-2)); }
.nyp-tile > * { flex: none; }
.nyp-card { padding: 16px 16px 18px; border-radius: 18px; background: rgba(0,0,0,.28); border: 1px solid var(--line); }
.nyp-card.adult { border-color: rgba(242,126,99,.45); background: linear-gradient(180deg, rgba(242,126,99,.09), rgba(0,0,0,.28)); }
.nyp-cardtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nyp-18 { display: inline-grid; place-items: center; padding: 2px 7px; margin-left: 6px; border-radius: 6px; background: #c2412d; color: #fff; font-size: .72em; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.nyp-18.big { font-size: 1.1em; padding: 6px 12px; margin: 0 auto 6px; }
.nyp-lead { margin: 10px 0 2px; color: var(--muted); font-size: .95em; }
.nyp-text { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(1.35em, 6.2vw, 1.9em); line-height: 1.15; }
.nyp-step { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.nyp-step > b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--np); color: #0c1606; font-size: .85em; }
.nyp-back { margin-left: auto; border: 1px solid var(--line-2); background: none; color: var(--muted); border-radius: 99px; padding: 4px 10px; font: inherit; font-size: .82em; cursor: pointer; }
.nyp-picker { display: flex; flex-direction: column; gap: 10px; }
.nyp-amount { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border: 0; background: none; color: var(--text); cursor: text; font: inherit; }
.nyp-amount b { font-family: var(--serif); font-size: 3em; line-height: 1; color: var(--np); border-bottom: 2px dashed color-mix(in srgb, var(--np) 40%, transparent); padding: 0 6px 4px; }
.nyp-amount.never b { color: var(--bad); border-color: rgba(242,126,99,.4); }
.nyp-amount.free b { color: var(--gold-2); }
.nyp-amount small { color: var(--muted); }
.nyp-type { text-align: center; font-size: 1.6em; }
.nyp-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: none; margin: 0; touch-action: pan-y; }
.nyp-slider::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--np) var(--p, 0%), rgba(255,255,255,.12) var(--p, 0%)); }
.nyp-slider::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--np) var(--p, 0%), rgba(255,255,255,.12) var(--p, 0%)); }
.nyp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: #f3efe6; border: 3px solid var(--np); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.nyp-slider::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #f3efe6; border: 3px solid var(--np); }
.nyp-scale { position: relative; height: 1.2em; margin: -8px 15px 0; color: var(--dim); font-size: .78em; }
.nyp-scale small { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.nyp-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.nyp-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 6px; text-align: center; }
.nyp-mine, .nyp-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nyp-mine > div, .nyp-side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); text-align: center; }
.nyp-mine small, .nyp-side > small { color: var(--muted); font-size: .8em; }
.nyp-mine b { font-family: var(--serif); font-size: 1.5em; color: var(--np); }
.nyp-price { font-family: var(--serif); font-size: 2.1em; line-height: 1.1; color: var(--np); }
.nyp-price.never { color: var(--bad); }
.nyp-guess { display: flex; flex-direction: column; gap: 4px; font-size: .82em; color: var(--muted); }
.nyp-pts { font-style: normal; font-weight: 800; color: var(--text); }
.nyp-pts.p10, .nyp-pts.p7 { color: var(--np); }
.nyp-pts.p0 { color: var(--dim); }
.nyp-verdict { margin: 0; text-align: center; font-family: var(--serif); font-size: 1.35em; }
.nyp-final { margin: 0; font-family: var(--serif); text-align: center; }
.nyp-tile > .kicker { text-align: center; }
.nyp-list { display: flex; flex-direction: column; gap: 6px; }
.nyp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.22); font-size: .9em; }
.nyp-row-p { display: flex; flex-direction: column; align-items: flex-end; min-width: 52px; }
.nyp-row-p small { color: var(--dim); font-size: .72em; }
.nyp-row-p b { color: var(--np); }
.nyp-banner { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(242,126,99,.45); background: rgba(242,126,99,.1); font-size: .9em; }
.nyp-banner-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Hidden Army: WebGL battlefield (scene3d.js) + portrait cards ---- */
.ha-screen { --ha: #d0563f; gap: 8px; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.ha-screen.waiting { height: auto; min-height: 100svh; overflow: visible; }
.ha-bar { flex: none; display: flex; align-items: center; gap: 8px; }
.ha-status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); }
.ha-status b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-status .rm-dot { position: static; flex: none; }
.ha-status.go { border-color: #e6cf9f; box-shadow: 0 0 0 1px rgba(230,207,159,.5), 0 0 22px -6px rgba(230,207,159,.8); animation: haGo 2.4s ease-in-out infinite; }
@keyframes haGo { 50% { box-shadow: 0 0 0 1px rgba(230,207,159,.25), 0 0 10px -6px rgba(230,207,159,.5); } }
.ha-tally { flex: none; display: flex; gap: 12px; padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--text); font: inherit; cursor: pointer; }
.ha-tally span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ha-tally small { font-size: .66em; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ha-tally b { font-family: var(--serif); font-size: 1.15em; }
.ha-stage { position: relative; flex: 1; min-height: 0; border-radius: 20px; overflow: hidden; background: #0b0a08; border: 1px solid var(--line); }
.ha-stage[hidden] { display: none; }
.ha-3d { position: absolute; inset: 0; }
.ha-3d canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.ha-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 20px; transition: opacity .5s; }
.ha-stage.ready .ha-loading { opacity: 0; pointer-events: none; }
.ha-info { position: absolute; left: 10px; top: 10px; z-index: 3; max-width: min(72%, 320px); pointer-events: none; }
.ha-info-card { display: flex; flex-direction: column; gap: 2px; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: rgba(14,11,7,.82); border: 1px solid rgba(230,207,159,.28); box-shadow: 0 10px 28px rgba(0,0,0,.5); backdrop-filter: blur(8px); font-size: .88em; line-height: 1.3; animation: haIn .25s ease-out; }
.ha-info-card b { color: var(--gold-2); }
.ha-info-card span { color: var(--muted); }
@keyframes haIn { from { opacity: 0; transform: translateY(6px); } }
.ha-foot { flex: none; display: flex; align-items: center; gap: 8px; }
.ha-foot .btn { padding: .8em 1.1em; }
.ha-foot .ha-go { flex: 1; }
.ha-hint { flex: 1; text-align: center; color: var(--muted); font-size: .9em; }
/* Portrait card: the painting in a gold frame, rank disc top left, name ribbon at the bottom. */
.ha-card { --edge: #1c3a86; position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: #120d08;
  border: 5px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 2px #d6aa5a, 0 0 0 5px var(--edge), 0 18px 34px rgba(0,0,0,.55); }
.ha-card.foe { --edge: #8e1d16; }
.ha-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.ha-card::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px rgba(255,236,180,.55), inset 0 0 40px rgba(0,0,0,.55); pointer-events: none; }
.ha-card-rank { position: absolute; left: 6%; top: 5%; width: 26%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, "Times New Roman", serif; font-weight: 800; font-size: clamp(.8em, 5vw, 1.6em); color: #1d1206;
  background: linear-gradient(135deg, #fff0bf, #d8b064 40%, #8d6526 70%, #e9cc85); box-shadow: 0 2px 6px rgba(0,0,0,.6), inset 0 0 0 2px rgba(40,20,0,.6); }
.ha-card-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 8px; text-align: center; font-family: Georgia, "Times New Roman", serif; letter-spacing: .16em; text-transform: uppercase; font-size: .82em; color: #f0d898;
  background: linear-gradient(transparent, rgba(20,12,4,.92) 55%); }
.ha-card.small { border-width: 2px; border-radius: 7px; box-shadow: 0 0 0 1.5px #d6aa5a, 0 0 0 3px var(--edge); }
.ha-card.small .ha-card-rank { width: 34%; font-size: .62em; }
.ha-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 45%, rgba(40,20,14,.84), rgba(4,3,2,.95)); backdrop-filter: blur(3px); }
.ha-overlay[hidden] { display: none; }
.ha-clash { position: relative; width: min(94vw, 460px); height: min(74vh, 480px); }
.ha-clash .ha-card { position: absolute; top: 6%; width: 47%; }
.ha-clash .ha-card.l { left: 1%; } .ha-clash .ha-card.r { right: 1%; }
.ha-flash { position: absolute; left: 50%; top: 34%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; opacity: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(circle, #fff 0 8%, rgba(255,220,150,.9) 18%, rgba(255,120,60,.5) 38%, transparent 68%); mix-blend-mode: screen; }
.ha-cl-text { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; opacity: 0; display: flex; flex-direction: column; gap: 4px; }
.ha-cl-text small { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .72em; }
.ha-cl-text b { font-family: var(--serif); font-size: 1.5em; line-height: 1.2; }
.ha-end { width: min(92vw, 380px); text-align: center; display: flex; flex-direction: column; gap: 10px; padding: 24px 20px 20px; border-radius: 24px; background: linear-gradient(180deg, #1d1912, #0f0d09); border: 1px solid rgba(230,207,159,.3); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: haIn .45s ease-out; }
.ha-end .ha-card { width: 46%; margin: 0 auto 6px; }
.ha-end.lose { border-color: rgba(208,86,63,.4); }
.ha-end h2 { margin: 0; font-family: var(--serif); font-size: 2.4em; letter-spacing: .04em; }
.ha-end.win h2 { color: #f3dfa9; text-shadow: 0 0 24px rgba(243,223,169,.45); }
.ha-end.lose h2 { color: #ff8d74; }
.ha-end p { margin: 0; }
.ha-report { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.ha-rep { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ha-rep .ha-card { width: 44px; }
.ha-rep.gone { opacity: .3; filter: grayscale(1); }
.ha-rep small { font-size: .62em; color: var(--muted); }
.ha-rep b { font-size: .95em; }
/* Checkers - reuses the Hidden Army stage, bar and end card. */
.ck-tally { align-items: center; }
.ck-count { flex-direction: row !important; gap: 6px; }
.ck-count b { font-size: 1.1em; }
.ck-count small { font-size: .7em !important; color: var(--gold-2) !important; letter-spacing: 0 !important; }
.ck-chip { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c8352c, #6e120d 70%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.6); }
.ck-chip.mine { background: radial-gradient(circle at 35% 30%, #fff6e2, #cbb68c 75%); }
.ck-end-piece { position: relative; width: 96px; height: 70px; margin: 0 auto 4px; }
.ck-end-piece i { position: absolute; left: 0; right: 0; height: 40px; border-radius: 50%; background: radial-gradient(ellipse at 40% 30%, #c8352c, #6e120d 70%); box-shadow: inset 0 -6px 0 rgba(0,0,0,.35), inset 0 0 0 3px rgba(0,0,0,.2), 0 6px 14px rgba(0,0,0,.6); }
.ck-end-piece i:first-child { bottom: 0; } .ck-end-piece i:last-child { bottom: 18px; }
.ck-end-piece.mine i { background: radial-gradient(ellipse at 40% 30%, #fff6e2, #cbb68c 75%); }
.ck-end-piece i:last-child::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 18px; margin: -11px 0 0 -15px; background: linear-gradient(180deg, #fff0bf, #d8b064 50%, #8d6526);
  clip-path: polygon(0 100%, 0 20%, 20% 60%, 35% 0, 50% 55%, 65% 0, 80% 60%, 100% 20%, 100% 100%); }
/* Mastermind Duel - reuses the Hidden Army stage/bar/end card. */
.mm-marble { --mc: #888; display: inline-block; width: 1em; height: 1em; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.85) 0, rgba(255,255,255,0) 26%), radial-gradient(circle at 50% 60%, var(--mc) 45%, color-mix(in srgb, var(--mc) 55%, #000) 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,.55), inset 0 -2px 4px rgba(0,0,0,.25); }
.mm-tabs { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm-tabs[hidden] { display: none; }
.mm-tab { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; padding: 7px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.mm-tab small { font-size: .72em; text-transform: uppercase; letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-tab b { grid-row: span 2; font-family: var(--serif); font-size: 1.35em; color: var(--text); }
.mm-tab b span { font-size: .6em; color: var(--muted); }
.mm-tab em { font-style: normal; font-size: .78em; }
.mm-tab.on { border-color: rgba(230,207,159,.6); background: rgba(230,207,159,.08); color: var(--gold-2); }
.mm-tab.new::after { content: ''; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 8px var(--gold-2); }
.mm-tray { flex: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 16px; background: linear-gradient(180deg, #2a1810, #1a0f09); border: 1px solid rgba(230,207,159,.18); box-shadow: inset 0 2px 8px rgba(0,0,0,.6); }
.mm-tray[hidden] { display: none; }
.mm-pick { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.35); box-shadow: inset 0 2px 6px rgba(0,0,0,.8); cursor: pointer; padding: 0; }
.mm-pick .mm-marble { font-size: 32px; transition: transform .12s; }
.mm-pick:active .mm-marble { transform: scale(.88); }
.mm-end-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.3); }
.mm-end-row small { color: var(--muted); }
.mm-end-row span { display: flex; gap: 6px; font-size: 24px; }
.mm-modes { display: flex; gap: 6px; margin-top: 6px; }
.mm-poss { margin-left: auto; flex: none; color: var(--muted); font-size: .78em; text-align: right; }
@media (max-width: 380px) { .mm-pick { width: 38px; height: 38px; } .mm-pick .mm-marble { font-size: 27px; } }

/* Rummikub - full-height screen: players, ticker, the table (scrolls), hint, rack, buttons. */
.rk-screen { --rk: #e08a3c; gap: 7px; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.rk-screen.waiting { height: auto; min-height: 100svh; overflow: visible; }
.rk-screen [hidden] { display: none !important; }
.rk-players { flex: none; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 6px; }
.rk-pl { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 9px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .25s, box-shadow .25s; }
.rk-pl.turn { border-color: #e6cf9f; box-shadow: 0 0 0 1px rgba(230,207,159,.45), 0 0 18px -6px rgba(230,207,159,.8); }
.rk-pl > b { font-size: .86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-pl.me > b { color: var(--gold-2); }
.rk-pl > span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rk-pl em { font-style: normal; font-weight: 800; font-size: .9em; }
.rk-pl small { margin-left: auto; font-size: .64em; color: var(--muted); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-mini { flex: none; width: 9px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, #fbf4e4, #d9cdb2); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.rk-ticker { flex: none; display: flex; gap: 10px; overflow-x: auto; white-space: nowrap; font-size: .8em; color: var(--muted); min-height: 1.3em; scrollbar-width: none; }
.rk-tk b { color: var(--text); font-weight: 700; }
.rk-tk.play b { color: #f0c48f; }
.rk-table { --tw: 30px; --cols: 2; position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px;
  background: radial-gradient(ellipse at 50% 0%, rgba(60,110,70,.35), transparent 70%), linear-gradient(180deg, #16301f, #0f2016); border: 1px solid rgba(120,170,120,.18); box-shadow: inset 0 2px 18px rgba(0,0,0,.6); }
.rk-empty { grid-column: 1 / -1; margin: 30px auto; color: rgba(255,255,255,.45); text-align: center; font-size: .9em; max-width: 26ch; }
.rk-row { flex: none; display: flex; align-items: stretch; gap: 8px; }
.rk-row > * { flex: 0 0 calc((100% - (var(--cols) - 1) * 8px) / var(--cols)); }
.rk-set { position: relative; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px 2px; min-width: 0; min-height: calc(var(--tw) * 1.38 + 8px); padding: 4px; border-radius: 7px; background: rgba(0,0,0,.22); border: 1px solid transparent; transition: border-color .15s, background .15s; }
.rk-set.bad { border-color: #ff6a52; border-style: dashed; background: rgba(255,90,60,.12); }
.rk-set.mine:not(.bad) { border-color: rgba(230,207,159,.45); }
.rk-set.over, .rk-newset.over { background: rgba(230,207,159,.18); border-color: #e6cf9f; border-style: solid; }
.rk-add { position: absolute; z-index: 3; top: -9px; right: -7px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #e6cf9f; background: #2a3d2c; box-shadow: 0 2px 8px rgba(0,0,0,.6); color: #f3dfa9; cursor: pointer; padding: 0; animation: haIn .2s ease-out; }
.rk-add .icon { width: 60%; height: 60%; }
.rk-newset { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: calc(var(--tw) * 1.38 + 8px); padding: 0 12px; border-radius: 7px; border: 1px dashed rgba(230,207,159,.35); background: transparent; color: rgba(230,207,159,.6); font: inherit; font-size: .8em; cursor: pointer; }
.rk-newset .icon { width: 14px; height: 14px; }
.rk-newset.on { border-style: solid; border-color: #e6cf9f; color: #f3dfa9; background: rgba(230,207,159,.12); }
.rk-tile { --w: var(--tw); position: relative; flex: none; width: var(--w); height: calc(var(--w) * 1.38); border-radius: calc(var(--w) * .16); display: flex; flex-direction: column; align-items: center; justify-content: center; font-style: normal; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: linear-gradient(180deg, #fffaf0 0%, #f2e9d6 70%, #ddd0b4 100%); box-shadow: 0 1px 0 #fff inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 2px 4px rgba(0,0,0,.45); transition: transform .12s, box-shadow .12s; }
.rk-tile b { font-family: Georgia, "Times New Roman", serif; font-weight: 800; font-size: calc(var(--w) * .58); line-height: 1; letter-spacing: -.03em; }
.rk-tile u { width: calc(var(--w) * .2); height: calc(var(--w) * .2); margin-top: calc(var(--w) * .08); border-radius: 50%; background: currentColor; opacity: .55; text-decoration: none; }
.rk-tile.red { color: #c0142b; } .rk-tile.blue { color: #2459c8; } .rk-tile.black { color: #1b1b1b; }
/* Orange sits well apart from red: a golden amber, with a thin dark edge so it still reads on the ivory tile. */
.rk-tile.orange { color: #eaa007; } .rk-tile.orange b { -webkit-text-stroke: .6px rgba(90,50,0,.55); }
.rk-tile.joker { color: #b88a2a; } .rk-tile.joker svg { width: 70%; height: 70%; filter: drop-shadow(0 1px 0 rgba(255,255,255,.6)); }
.rk-tile.sel { z-index: 2; transform: translateY(calc(var(--w) * -.22)) scale(1.04); background: linear-gradient(180deg, #fff6d6 0%, #f6dc9a 65%, #e2bb63 100%);
  box-shadow: 0 0 0 3px #f3c74f, 0 0 0 5px rgba(20,14,4,.85), 0 0 22px 4px rgba(243,199,79,.75), 0 8px 14px rgba(0,0,0,.55); animation: rkBob .9s ease-in-out infinite, rkSel 1.4s ease-in-out infinite; }
.rk-tile.sel:nth-child(even) { animation-delay: -.45s, -.7s; }
.rk-tile.sel:nth-child(3n) { animation-duration: 1.05s, 1.4s; }
.rk-tile.sel::before { content: ''; position: absolute; top: max(calc(var(--w) * -.38), -16px); left: 50%; transform: translateX(-50%) translateY(-25%); width: calc(var(--w) * .46); height: calc(var(--w) * .46); min-width: 11px; min-height: 11px; border-radius: 50%;
  background: #f3c74f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23140e04' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; box-shadow: 0 0 0 2px rgba(20,14,4,.85); }
/* Selected tiles bob up and down with a little wiggle (transform only - never changes the layout). */
@keyframes rkBob {
  0%, 100% { transform: translateY(calc(var(--w) * -.2)) scale(1.04) rotate(0deg); }
  25% { transform: translateY(calc(var(--w) * -.32)) scale(1.05) rotate(-4deg); }
  50% { transform: translateY(calc(var(--w) * -.22)) scale(1.04) rotate(0deg); }
  75% { transform: translateY(calc(var(--w) * -.32)) scale(1.05) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) { .rk-tile.sel { animation: none; } }
@keyframes rkSel { 0%, 100% { box-shadow: 0 0 0 3px #f3c74f, 0 0 0 5px rgba(20,14,4,.85), 0 0 22px 4px rgba(243,199,79,.75), 0 8px 14px rgba(0,0,0,.55); } 50% { box-shadow: 0 0 0 3px #ffe08a, 0 0 0 5px rgba(20,14,4,.85), 0 0 30px 8px rgba(243,199,79,.95), 0 8px 14px rgba(0,0,0,.55); } }
.rk-tile.lit { box-shadow: 0 0 0 2px rgba(240,196,143,.95), 0 2px 4px rgba(0,0,0,.45); }
.rk-tile.played::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #e6cf9f; }
.rk-tile.fresh { box-shadow: 0 0 0 2px #7fd18b, 0 0 12px rgba(127,209,139,.6), 0 2px 4px rgba(0,0,0,.45); }
.rk-hint { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; height: 1.9em; font-size: .82em; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rk-hint > span { overflow: hidden; text-overflow: ellipsis; }
.rk-hint.warn .rk-warn { color: #ff9c86; font-weight: 700; }
.rk-rack { --rw: 36px; flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 5px 4px; padding: 18px 8px 12px; min-height: calc(var(--rw) * 1.38 + 30px); border-radius: 16px; touch-action: none;
  background: linear-gradient(180deg, #5a3a20, #3b2414); border: 1px solid rgba(230,207,159,.22); box-shadow: inset 0 2px 0 rgba(255,255,255,.08), inset 0 -10px 18px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.4); }
.rk-rack .rk-tile { --w: var(--rw); }
.rk-rack.over { border-color: #e6cf9f; }
.rk-back { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 1.9em; padding: 0 10px; border-radius: 99px; border: 1px dashed rgba(230,207,159,.5); background: rgba(0,0,0,.25); color: #f3dfa9; font: inherit; font-size: .78em; cursor: pointer; }
.rk-back .icon { width: 14px; height: 14px; }
.rk-ghost { position: fixed; left: 0; top: 0; z-index: 60; display: flex; gap: 2px; pointer-events: none; --tw: 38px; filter: drop-shadow(0 10px 16px rgba(0,0,0,.6)); }
.rk-foot { gap: 6px; }
.rk-sort { width: 44px; font-weight: 800; font-size: .72em; letter-spacing: -.02em; color: var(--gold-2); }
.rk-wait .rk-seats { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; text-align: left; }
.rk-seat { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); }
.rk-seat.in { border-style: solid; color: var(--text); }
.rk-seat small { color: var(--muted); }
.rk-scores { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 6px 0; }
.rk-end { width: min(94vw, 440px); }
.rk-res { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rk-res-row { display: grid; grid-template-columns: minmax(0, 6ch) 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; align-items: center; padding: 7px 10px; border-radius: 12px; background: rgba(0,0,0,.3); }
.rk-res-row.win { box-shadow: inset 0 0 0 1px rgba(230,207,159,.45); }
.rk-res-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-res-tiles { display: flex; flex-wrap: wrap; gap: 2px; --tw: 17px; grid-row: span 2; }
.rk-res-tiles small { color: var(--gold-2); }
.rk-res-row > b { font-family: var(--serif); font-size: 1.1em; text-align: right; }
.rk-res-row > small { grid-column: 3; color: var(--muted); font-size: .72em; text-align: right; }
.rm-bot-rows { display: flex; flex-direction: column; gap: 8px; }

/* ---- Tangle: themed word hunt ---- */
.tg-screen { --tg: #7fc8a9; --tgm: #e6cf9f; --tgt: #7fc8a9; gap: 8px; }
.tg-bar { display: flex; gap: 8px; align-items: stretch; }
.tg-score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 4px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); line-height: 1.1; }
.tg-score small { font-size: .7em; color: var(--muted); max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-score b { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.tg-score.mine b { color: var(--tgm); }
.tg-score.theirs b { color: var(--tgt); }
.tg-clue { text-align: center; line-height: 1.15; }
.tg-clue small { display: block; font-size: .7em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.tg-clue b { font-family: var(--serif); font-size: 1.45em; color: var(--gold-2); }
.tg-word { min-height: 1.9em; display: grid; place-items: center; text-align: center; }
.tg-word b { font-size: 1.35em; letter-spacing: .14em; color: #f3efe6; }
.tg-word small { color: var(--muted); }
.tg-word small.good { color: var(--tg); }
.tg-word.bad b { color: var(--bad); animation: tgShake .35s; }
@keyframes tgShake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.tg-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.tg-board { position: relative; flex: none; width: min(100%, calc((100dvh - 380px) * var(--cols) / var(--rows)), 460px); aspect-ratio: var(--cols) / var(--rows); touch-action: none; user-select: none; -webkit-user-select: none; }
.tg-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); }
.tg-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tg-lines path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: .2; }
.tg-lines path.trail { stroke: rgba(243,239,230,.55); }
.tg-lines path.mine { stroke: rgba(230,207,159,.55); }
.tg-lines path.theirs { stroke: rgba(127,200,169,.55); }
.tg-cell { display: grid; place-items: center; position: relative; z-index: 1; }
.tg-cell span { width: 78%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: clamp(16px, 5.2vw, 24px); color: #e9e3d6; transition: background .15s, color .15s, transform .15s; }
.tg-cell.on span { background: #f3efe6; color: #17130d; transform: scale(1.08); }
.tg-cell.mine span { background: var(--tgm); color: #1d170c; }
.tg-cell.theirs span { background: var(--tgt); color: #0d1a14; }
.tg-cell.hint span { box-shadow: 0 0 0 2px var(--gold-2), 0 0 16px -2px var(--gold); animation: tgHint 1.6s ease-in-out infinite; animation-delay: calc(var(--hk) * .12s); }
@keyframes tgHint { 50% { box-shadow: 0 0 0 2px var(--gold-2), 0 0 24px 2px var(--gold); } }
.tg-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tg-slot { padding: 4px 10px; border-radius: 99px; font-size: .78em; font-weight: 800; letter-spacing: .08em; border: 1px solid var(--line-2); }
.tg-slot.mine { background: rgba(230,207,159,.16); color: var(--tgm); border-color: rgba(230,207,159,.45); }
.tg-slot.theirs { background: rgba(127,200,169,.14); color: var(--tgt); border-color: rgba(127,200,169,.45); }
.tg-slot.blank { color: var(--muted); border-style: dashed; min-width: 44px; text-align: center; }
.tg-slot.blank i { font-style: normal; font-weight: 600; }
.tg-slot.missed { color: var(--bad); border-style: dashed; }
.tg-extra { width: 100%; text-align: center; color: var(--muted); font-size: .75em; }
.tg-foot .ha-hint { font-size: .85em; }
