/* RMUV — palette sampled from the splash */
:root {
  --purple: #A24BE0;
  --teal:   #1FD8E0;
  --orange: #FF6A2B;
  --gold:   #FFD23F;
  --violet: #664794;
  --bg:     #0C0B0E;
  --pink:   #FF4D9D;
  --text:   #F3EDEE;
  --line:   rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }
html { height: 100%; overscroll-behavior: none; }

/* App-shell lockdown: the page itself never scrolls or rubber-bands (that "floating
 * layer" drag on iOS). Body is pinned to the viewport; the .app inside is the only
 * scroll container, and overscroll-behavior keeps its scroll from chaining out. */
body {
  margin: 0;
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 80% at 50% -10%, #16101f 0%, var(--bg) 55%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
}
input, textarea { -webkit-user-select: text; user-select: text; }
.app::-webkit-scrollbar { width: 4px; }
.app::-webkit-scrollbar-track { background: transparent; }
.app::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
.app::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

.app {
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* slim themed scrollbar — the OS default clashes with the dark UI on desktop */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  /* reserve the scrollbar gutter so content doesn't jump when it appears
     (e.g. when a game's action buttons grow the page past the viewport) */
  scrollbar-gutter: stable;
  padding:
    calc(20px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* brand — logo-center header: hero lockup flanked by utility (sound) + profile pill */
.brand { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; margin: 0 auto; box-sizing: border-box; padding: 0 12px; }
.brand-lockup { flex: 1 1 auto; min-width: 0; text-align: center; }
.util-btn {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.util-btn:hover { background: rgba(255, 255, 255, 0.1); }
.util-btn.off { opacity: 0.45; }
.brand h1 {
  margin: 0;
  font-size: clamp(40px, 12vw, 72px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 4px;
}
.brand h1 .v { color: var(--purple); text-shadow: 0 0 18px rgba(162, 75, 224, 0.6); }
.tag {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.8;
}
.tag .accent { color: var(--teal); }

/* controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group .label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
  text-align: center;
}
.segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.segmented button {
  background: transparent;
  color: var(--text);
  border: 0;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.segmented button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.segmented button.active { background: var(--purple); color: #fff; }
.segmented button:disabled { opacity: 0.3; cursor: not-allowed; }

.newgame {
  background: linear-gradient(135deg, var(--teal), var(--purple));
  color: #06121a;
  font-weight: 800;
  letter-spacing: 1px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}
.newgame:hover { filter: brightness(1.1); }
/* 👻 Neon Dash "race your best" toggle: muted when OFF, lit purple when ON */
.ghost-toggle { display: block; margin: 10px auto 0; background: #2a2440; color: #C77DFF; box-shadow: inset 0 0 0 1.5px #4a3a6e; }
.ghost-toggle.on { background: linear-gradient(135deg, #C77DFF, #7C4DFF); color: #1a0b2e; box-shadow: 0 0 14px rgba(199,125,255,0.55); }

/* status */
.status {
  text-align: center;
  font-size: 18px;
  letter-spacing: 1px;
  min-height: 24px;
}
.status.over.win { font-size: 24px; font-weight: 800; }

/* board */
.board-wrap { display: flex; justify-content: center; }
.board {
  display: grid;
  grid-template-columns: repeat(var(--size, 7), 1fr);
  gap: 4px;
  width: 100%;
  /* never taller than the viewport now that the hint line is gone */
  max-width: min(480px, 68vh);
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  /* scale the mark to the CELL, not the viewport: a 3×3 has big cells (big X/O), a 7×7
     has small ones. min(...) tracks the actual board width; ÷ --size ≈ one cell. */
  font-size: clamp(22px, calc(min(480px, 68vh, 92vw) / var(--size, 7) * 0.55), 96px);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  aspect-ratio: 1 / 1;
  transition: background 0.12s, transform 0.05s;
}
.cell:hover:not(.filled) { background: rgba(162, 75, 224, 0.18); }
.cell.filled { cursor: default; }
.sym-x { color: var(--teal);   text-shadow: 0 0 10px rgba(31, 216, 224, 0.5); }
.sym-o { color: var(--purple); text-shadow: 0 0 10px rgba(162, 75, 224, 0.5); }
.sym-t { color: var(--orange); text-shadow: 0 0 10px rgba(255, 106, 43, 0.5); }
.cell.just-placed { animation: pop 0.18s ease; }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }
.cell.win-cell {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* a germinating seed: faint, pulsing, in the owner's color, showing its countdown */
.cell.seed {
  cursor: pointer;
  font-size: clamp(10px, 3vw, 16px);
  font-weight: 700;
  opacity: 0.9;
  animation: germinate 1.1s ease-in-out infinite;
}
.cell.seed.sym-x { background: rgba(31, 216, 224, 0.10);  box-shadow: inset 0 0 0 1px rgba(31, 216, 224, 0.5); }
.cell.seed.sym-o { background: rgba(162, 75, 224, 0.10);  box-shadow: inset 0 0 0 1px rgba(162, 75, 224, 0.5); }
.cell.seed.sym-t { background: rgba(255, 106, 43, 0.10);  box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.5); }
@keyframes germinate {
  0%, 100% { transform: scale(0.88); opacity: 0.55; }
  50%      { transform: scale(1.0);  opacity: 1; }
}
/* a freshly sprouted tile flashes brighter than a normal placement */
.cell.sprouted { animation: sprout 0.45s ease; }
@keyframes sprout {
  0%   { transform: scale(0.3); filter: brightness(2.4); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* hint (legacy one-liner — superseded by the How-to-play modal on most games) */
.hint {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.6;
}

/* How-to-play modal + the persistent "?" chip that reopens it */
.howto-chip {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 900; font-size: 15px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, transform 0.05s;
}
.howto-chip:hover { background: rgba(162, 75, 224, 0.25); }
.howto-chip:active { transform: scale(0.92); }

.howto-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(6, 5, 9, 0.72);
  backdrop-filter: blur(3px);
  animation: howto-fade 0.16s ease;
}
@keyframes howto-fade { from { opacity: 0; } to { opacity: 1; } }
.howto-card {
  width: 100%; max-width: 420px;
  max-height: 84vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)), var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent, var(--teal));
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  animation: howto-rise 0.18s ease;
}
@keyframes howto-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.howto-title {
  font-weight: 900; font-size: 17px;
  color: var(--accent, var(--teal));
  margin-bottom: 12px;
}
.howto-body { font-size: 14px; line-height: 1.5; opacity: 0.92; }
.howto-body p { margin: 0 0 10px; }
.howto-body b { color: var(--text); }
.howto-body .howto-mode { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.howto-dontshow {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; opacity: 0.7;
  margin: 16px 0 14px;
  cursor: pointer;
}
.howto-dontshow input { accent-color: var(--purple); width: 16px; height: 16px; }
.howto-ok {
  width: 100%;
  border: none; border-radius: 10px;
  padding: 12px;
  font-weight: 800; font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  cursor: pointer;
}
.howto-ok:active { transform: scale(0.99); }

/* ===== splash intro ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.35s ease;
}
.splash img { width: 100%; height: 100%; object-fit: contain; }
.splash-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
  opacity: 0.9;
  animation: splashPulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes splashPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ===== screens / shell ===== */
[hidden] { display: none !important; }
.screen { display: flex; flex-direction: column; gap: 18px; }
/* the active game screen fills the viewport so a game can spread into the height
 * (discard centred, hand at the bottom) instead of stacking at the top with dead
 * space below. Games whose root isn't flex:1 just top-align as before. */
#game-screen { flex: 1; min-height: 0; }
/* unified header bar: [← Menu]   ·   centered game title   ·   [?] — one row,
   reclaiming the vertical space the per-game title block used to take. */
.game-header { position: relative; display: flex; align-items: center; min-height: 34px; }
.game-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; max-width: 60%;
  font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.howto-slot { margin-left: auto; flex: 0 0 auto; }
/* the per-game centered title blocks now live in the header bar instead */
.ttt-head, .bubble-head, .c8-head, .ck-head, .ht-head, .mb-head, .rv-head { display: none; }
/* center the game body in the height below the header (safe = degrade to top-scroll
   when content is taller than the box). Games whose child is flex:1 fill the height
   and are unaffected; content-height games stop leaving dead space below. */
#game-root { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: safe center; }

/* ===== fit-to-frame (RMUV_FIT): a panel game scales to the box it's given. The
   outer reserves the SCALED size (set in JS) so the panel centers without overflow;
   the inner is the game at its design width, scaled from top-left to fill the outer. */
.rmuv-fit { align-self: center; flex: 0 0 auto; }
.rmuv-fit-inner { transform: scale(var(--rmuv-scale, 1)); transform-origin: top left; }

/* tablets: let an ACTIVE game breathe past the 560px menu column so the fitter can
   scale up and claim space. Menus and non-game screens keep the 560px column. */
.app:has(#game-screen:not([hidden])) { width: min(720px, 100%); }

/* ===== menu ===== */
.menu { align-items: center; padding-top: 6px; gap: 12px; }   /* tighter than the 18px .screen rhythm so games sit higher */
.game-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}
.game-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.game-card .ic { font-size: 30px; line-height: 1; }
.game-card .name { flex: 1; font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.game-card .meta { font-size: 11px; letter-spacing: 2px; opacity: 0.6; }
.game-card .badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.7;
}
.game-card .pop-chip {
  position: absolute;
  top: -7px;
  right: 12px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #1a1206;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  box-shadow: 0 2px 10px rgba(255, 106, 43, 0.4);
}
.game-card:not(.soon):hover {
  transform: translateY(-2px);
  border-color: var(--purple);
  background: rgba(162, 75, 224, 0.1);
  box-shadow: 0 6px 24px rgba(162, 75, 224, 0.25);
}
.game-card:not(.soon):active { transform: translateY(0); }
.game-card.soon { opacity: 0.45; cursor: not-allowed; }

/* ===== genre filter chips + flat game grid ===== */
/* Desktop: wrap to rows (vertical room is plentiful, all chips reachable, no
 * scroll needed). Mobile: a single horizontal scroll strip (see the max-width:480
 * block) so the chips stop eating half the iPhone before any game shows. */
.filter-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  width: 100%; max-width: 420px; padding: 1px 2px 3px;
}
.filter-chips button {
  flex: 0 0 auto;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-chips button:hover { background: rgba(255, 255, 255, 0.08); }
.filter-chips button.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.game-grid { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.game-card.filtered-out { display: none; }

/* ===== Global Tourney (cup badge · submit prompt · leaderboard · toast) ===== */
.card-badge { position: absolute; top: 8px; right: 10px; font-size: 18px; line-height: 1; z-index: 2; }
.card-badge.cup { cursor: pointer; filter: drop-shadow(0 0 6px rgba(255, 210, 63, 0.6)); animation: tqpulse 2s ease-in-out infinite; }
@keyframes tqpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===================== Global Tourney submit prompt — the high-score moment ===================== */
.tq-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 0 6px; }
.tq-avchip { position: relative; margin-bottom: -4px; }
.tq-disc { position: relative; width: 130px; height: 130px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.04), 0 14px 38px -10px rgba(0,0,0,0.7); }
.tq-disc::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; z-index: -1; filter: blur(12px); opacity: 0.55; }
.tq-plabel { font-size: 10px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: rgba(0,0,0,0.5); margin-bottom: -2px; }
.tq-rank { font-size: 54px; font-weight: 900; line-height: 1; color: #2a1500; font-variant-numeric: tabular-nums; }
.tq-medalemo { position: absolute; top: -4px; right: 2px; font-size: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
.tq-disc.r1 { background: radial-gradient(circle at 50% 32%, #fff2b0, var(--gold) 55%, #b8860b); } .tq-disc.r1::before { background: var(--gold); }
.tq-disc.r2 { background: radial-gradient(circle at 50% 32%, #fff, #D7E1EA 55%, #8d9aa6); }       .tq-disc.r2::before { background: #D7E1EA; }
.tq-disc.r3 { background: radial-gradient(circle at 50% 32%, #ffd9b0, #E08C46 55%, #8a4f1f); }    .tq-disc.r3::before { background: #E08C46; }
.tq-disc.rN { background: radial-gradient(circle at 50% 32%, #d7c4ff, var(--purple) 55%, #5a2d86); } .tq-disc.rN::before { background: var(--purple); }
.tq-disc.rN .tq-rank, .tq-disc.rN .tq-plabel { color: #fff; }
.tq-msg { font-size: 16px; text-align: center; line-height: 1.5; margin-top: 8px; }
.tq-msg b { color: var(--gold); font-variant-numeric: tabular-nums; }
.tq-on { display: block; opacity: 0.6; font-size: 12.5px; margin-top: 2px; }
.tq-actions { display: flex; flex-direction: column; gap: 9px; width: 100%; margin-top: 16px; }
.tq-submit { padding: 13px; border-radius: 12px; border: 0; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; color: #2a1500;
  background: linear-gradient(135deg, var(--gold), var(--orange)); box-shadow: 0 8px 22px -8px rgba(255,170,40,0.6); }
.tq-ghost { padding: 11px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tq-mute2 { background: none; border: 0; color: var(--text); opacity: 0.45; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; margin-top: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .tourney-prompt .tq-avchip { animation: tlrise 0.5s both 0.15s; }
  .tourney-prompt .tq-disc   { animation: tqpop 0.6s both 0.3s; }
  .tourney-prompt .tq-msg    { animation: tlrise 0.45s both 0.5s; }
  .tourney-prompt .tq-actions { animation: tlrise 0.45s both 0.62s; }
}
@keyframes tqpop { 0% { opacity: 0; transform: scale(0.5) rotate(-12deg); } 65% { transform: scale(1.08) rotate(3deg); } 100% { opacity: 1; transform: none; } }

/* ===================== Global Tourney leaderboard — the championship podium ===================== */
/* the overlay wraps the card in 16px padding each side; size the card to fit INSIDE that
   (calc(100vw - 36px) leaves a hair of slack so a sub-pixel rounding never spills into a
   horizontal scrollbar), and clip any horizontal overflow on the tourney overlay containers. */
.tourney-board .rmv-ov-card, .tourney-prompt .rmv-ov-card { overflow-x: hidden; max-width: 100%; }
/* ============================ THE RMUV PANEL — one reusable premium surface ============================
   `.rmv-panel` is the look: layered radial glow + faint grain + neon border + deep shadow. Drop it on any
   overlay's inner card to make it match. Default glow is purple/teal (profile, results, info); add `.gold`
   for the championship variant (tourney, achievements). Pair with `.rmv-kicker` (eyebrow) + `.rmv-paneltitle`
   (display title); add `.gold` to the kicker for the trophy accent. ONE source of truth — the tourney cards
   (.tl-card/.tq-card) and the arcade game-over card (.arcade-card) share the structure below via the
   selector lists, so they can never drift. Full guide: docs/THE-RMUV-LOOK.md. */
.rmv-panel, .tl-card, .tq-card, .arcade-card, .bm-card, .av-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: 20px; border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 70px -20px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.06);
}
.rmv-panel::before, .tl-card::before, .tq-card::before, .arcade-card::before, .bm-card::before, .av-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5; mix-blend-mode: screen;
  background-image: radial-gradient(rgba(255,255,255,0.04) 0.5px, transparent 0.6px); background-size: 3px 3px;
}
/* neutral glow (default) — profile / results / info surfaces */
.rmv-panel, .arcade-card, .bm-card, .av-card, .pm-card {
  background:
    radial-gradient(95% 60% at 50% -6%, rgba(162,75,224,0.20), transparent 58%),
    radial-gradient(85% 52% at 50% 4%, rgba(31,216,224,0.09), transparent 62%),
    linear-gradient(180deg, #15121c 0%, #0d0b11 72%);
}
.rmv-panel, .arcade-card { padding: 18px 16px 14px; }
/* gold (championship) glow — tourney + achievements */
.rmv-panel.gold, .tl-card, .tq-card {
  padding: 18px 16px 14px;
  background:
    radial-gradient(120% 75% at 50% -8%, rgba(255,210,63,0.16), transparent 52%),
    radial-gradient(90% 60% at 50% 0%, rgba(162,75,224,0.18), transparent 60%),
    linear-gradient(180deg, #15121c 0%, #0d0b11 72%);
}
.tl-card, .tq-card { width: min(calc(100vw - 34px), 440px); }

/* kicker (eyebrow) + display title — reusable; add .gold to the kicker for the trophy accent */
.rmv-kicker, .tl-kicker { font-size: 11px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase;
  background: linear-gradient(90deg, var(--teal), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rmv-kicker.gold, .tl-kicker { background: linear-gradient(90deg, var(--gold), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(255,210,63,0.35)); }
.rmv-paneltitle, .tl-game { font-size: 22px; font-weight: 900; letter-spacing: 0.3px; margin-top: 2px;
  background: linear-gradient(180deg, #fff, #cbb8e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* tourney header layout */
.tl-h { position: relative; text-align: center; margin-bottom: 4px; }
.tl-cup { -webkit-text-fill-color: initial; filter: none; margin-right: 4px; }
.tl-h hr { width: 64px; height: 2px; border: 0; margin: 8px auto 0; opacity: 0.7;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* styled confirm/prompt dialog (RMUV_OVERLAY.confirm / .prompt) — a .rmv-panel with title + buttons */
.rmv-dlg { width: min(calc(100vw - 34px), 380px); gap: 12px; align-items: center; text-align: center; }
.rmv-dlg-h { font-size: 18px; font-weight: 800; letter-spacing: 0.2px; }
.rmv-dlg-msg { font-size: 14px; opacity: 0.8; line-height: 1.5; }
.rmv-dlg-input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: var(--text); font: inherit; font-size: 15px; text-align: center; }
.rmv-dlg-btns { display: flex; gap: 10px; width: 100%; margin-top: 2px; }
.rmv-dlg-ok, .rmv-dlg-cancel { flex: 1; padding: 12px; border-radius: 11px; font: inherit; font-weight: 800; cursor: pointer; }
.rmv-dlg-ok { border: 0; background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06121a; }
.rmv-dlg-ok.danger { background: linear-gradient(135deg, var(--orange), var(--pink)); color: #fff; }
.rmv-dlg-cancel { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--text); }
.rmv-dlg-cancel:hover { background: rgba(255,255,255,0.12); }
/* "What's New" announcement card (RMUV_WHATSNEW) — a left-aligned .rmv-panel + bullet list */
.wn-card { width: min(calc(100vw - 34px), 400px); gap: 12px; text-align: left; align-items: stretch; }
.wn-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.wn-item { display: flex; gap: 11px; align-items: flex-start; }
.wn-ico { font-size: 20px; line-height: 1.3; flex: 0 0 auto; }
.wn-text { font-size: 14px; line-height: 1.5; opacity: 0.9; }
.wn-note { font-size: 13px; opacity: 0.7; text-align: center; margin-top: 2px; }
.wn-ok { margin-top: 4px; padding: 12px; border: 0; border-radius: 11px; font: inherit; font-weight: 800;
  cursor: pointer; background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06121a; }
/* podium */
.tl-podium { position: relative; display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: 6px; margin: 18px 2px 6px; padding-top: 30px; }
.tl-podium::before { content: ""; position: absolute; left: 50%; top: -6px; width: 180px; height: 180px; transform: translateX(-50%); pointer-events: none; filter: blur(2px);
  background: radial-gradient(circle, rgba(255,210,63,0.28), rgba(255,106,43,0.08) 45%, transparent 70%); }
.tl-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tl-seat-empty { opacity: 0; }
.tl-avwrap { position: relative; }
.tl-medal { position: absolute; bottom: -4px; right: -6px; font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.tl-pts { font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; line-height: 1; }
.tl-place { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; opacity: 0.6; text-transform: uppercase; }
.tl-ped { width: 100%; border-radius: 10px 10px 4px 4px; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; font-size: 26px; font-weight: 900; color: rgba(0,0,0,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 24px -12px rgba(0,0,0,0.7); }
.tl-seat-1 .tl-ped { height: 76px; background: linear-gradient(180deg, var(--gold), #b8860b); }
.tl-seat-2 .tl-ped { height: 54px; background: linear-gradient(180deg, #D7E1EA, #8d9aa6); }
.tl-seat-3 .tl-ped { height: 40px; background: linear-gradient(180deg, #E08C46, #8a4f1f); }
.tl-seat-1 { z-index: 2; }
.tl-seat-1 .tl-pts { font-size: 26px; background: linear-gradient(180deg, #fff7d6, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255,210,63,0.55)); }
.tl-seat-1 .tl-place { color: var(--gold); opacity: 0.95; }
.tl-seat-2 .tl-pts { font-size: 17px; color: #e8eef4; }
.tl-seat-3 .tl-pts { font-size: 17px; color: #f2c79b; }
.tl-seat-2 .tl-place, .tl-seat-3 .tl-place { opacity: 0.5; }
.tl-crown { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 26px; filter: drop-shadow(0 0 8px rgba(255,210,63,0.7)); }
/* the field (4–9) */
.tl-fieldh { display: flex; align-items: center; gap: 10px; margin: 16px 2px 8px; font-size: 10px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; opacity: 0.4; }
.tl-fieldh::before, .tl-fieldh::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tl-field { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.tl-frow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255,255,255,0.035); border: 1px solid var(--line); border-radius: 11px; }
.tl-rk { font-size: 12px; font-weight: 800; opacity: 0.45; width: 14px; text-align: center; }
.tl-fsc { margin-left: auto; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; opacity: 0.85; }
/* footer + empty */
.tl-empty { text-align: center; opacity: 0.8; font-size: 15px; padding: 26px 12px; line-height: 1.6; }
.tl-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.5px; }
.tl-left b { color: var(--gold); font-variant-numeric: tabular-nums; }
.tl-next { opacity: 0.7; }
.tl-next b { color: var(--teal); opacity: 1; }
/* reveal choreography (scoped to the tourney overlay; fires once on open) */
@media (prefers-reduced-motion: no-preference) {
  .tourney-board .tl-h     { animation: tlrise 0.5s both; }
  .tourney-board .tl-seat-2 { animation: tlrise 0.55s both 0.12s; }
  .tourney-board .tl-seat-3 { animation: tlrise 0.55s both 0.22s; }
  .tourney-board .tl-seat-1 { animation: tlpop 0.6s both 0.36s; }
  .tourney-board .tl-crown  { animation: tldrop 0.5s both 0.7s, tlbob 2.6s ease-in-out infinite 1.2s; }
  .tourney-board .tl-fieldh { animation: tlrise 0.4s both 0.55s; }
  .tourney-board .tl-frow   { animation: tlrise 0.45s both 0.62s; }
  .tourney-board .tl-foot   { animation: tlrise 0.4s both 0.9s; }
}
@keyframes tlrise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tlpop  { 0% { opacity: 0; transform: translateY(20px) scale(0.8);} 70%{ transform: translateY(0) scale(1.06);} 100%{ opacity: 1; transform: none;} }
@keyframes tldrop { from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.5);} to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1);} }
@keyframes tlbob  { 0%,100%{ transform: translateX(-50%) translateY(0);} 50%{ transform: translateX(-50%) translateY(-4px);} }

.rmuv-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: #161419; border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; font-weight: 700; opacity: 0; transition: opacity 0.3s, transform 0.3s; z-index: 99; pointer-events: none; }
.rmuv-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== pre-game setup card + slide-to-board (RMUV_UI.setup) ===== */
.gsetup-shell { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* breathing room at the top so the first row (player chips + their turn-ring glow)
   isn't shaved by the shell's overflow:hidden. Absorbed by the game's flex spacer,
   so it never pushes bottom content into the clip. */
.gsetup-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 6px; }
.gsetup-panel {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: var(--bg);
  transition: transform 0.46s cubic-bezier(0.45, 0, 0.2, 1);
}
.gsetup-shell.go .gsetup-panel { transform: translateX(-100%); }
.gsetup-card {
  width: 100%; max-width: 360px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
}
.gsetup-title { font-size: 25px; font-weight: 800; letter-spacing: 1px; text-align: center; color: var(--accent); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.gsetup-field { display: flex; flex-direction: column; gap: 8px; }
.gsetup-label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; opacity: 0.55; }
.gsetup-start {
  margin-top: 4px; padding: 16px; border-radius: 15px; border: none; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #0C0B0E;
  background: linear-gradient(90deg, var(--accent), var(--purple)); box-shadow: 0 8px 26px rgba(162, 75, 224, 0.4);
  transition: transform 0.12s, box-shadow 0.18s;
}
.gsetup-start:hover { box-shadow: 0 10px 32px rgba(162, 75, 224, 0.55); }
.gsetup-start:active { transform: translateY(2px); }
.gsetup-resume {
  padding: 14px; border-radius: 14px; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 800; letter-spacing: 0.5px; color: #0C0B0E;
  background: linear-gradient(90deg, var(--teal), var(--gold)); box-shadow: 0 6px 22px rgba(31, 216, 224, 0.35);
  transition: transform 0.12s, box-shadow 0.18s;
}
.gsetup-resume:active { transform: translateY(2px); }
.gsetup-or { text-align: center; font-size: 11px; letter-spacing: 1px; opacity: 0.4; margin: -4px 0; }
.gsetup-stage { align-items: stretch; }
.game-foot { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 6px 0 2px; }
.ghost-btn {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--text); font-family: inherit;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--accent); }

/* ===== genre accordion (legacy — unused since the filter-chip menu) ===== */
.genre-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.genre { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.025); }
.genre-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: transparent; border: 0; color: var(--text);
  cursor: pointer; font-family: inherit;
}
.genre-head:hover { background: rgba(255, 255, 255, 0.045); }
.genre-name { flex: 1; text-align: left; font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.genre-meta { font-size: 11px; opacity: 0.5; letter-spacing: 1px; }
.genre-chev { opacity: 0.7; font-size: 13px; transition: transform 0.2s; }
.genre.open .genre-chev { transform: rotate(180deg); }
.genre-body { display: none; flex-direction: column; gap: 10px; padding: 0 12px 14px; }
.genre.open .genre-body { display: flex; }

.tap {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
  opacity: 0.85;
  margin: 4px 0 0;
}
.ana-note {
  font-size: 11px; line-height: 1.4; text-align: center;
  color: var(--text); opacity: 0.34; margin: 18px 0 4px;
}

/* ===== multiplayer bar (menu) ===== */
.mp-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.mp-join { display: flex; gap: 6px; }
.mp-join input {
  width: 92px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  padding: 8px 10px;
}
.mp-join button {
  background: var(--teal);
  color: #06121a;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

/* ===== lobby ===== */
.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding-top: 8px;
}
.lobby-title { margin: 0; font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.room-code { font-size: 16px; letter-spacing: 3px; opacity: 0.8; }
.room-code b {
  font-size: 34px;
  letter-spacing: 8px;
  color: var(--teal);
  text-shadow: 0 0 18px rgba(31, 216, 224, 0.5);
  margin-left: 6px;
}
.qr {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  line-height: 0;
}
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.lobby-sub { margin: 0; font-size: 12px; opacity: 0.6; letter-spacing: 1px; }
.lobby-sub b { color: var(--text); opacity: 0.9; }
.players { display: flex; flex-direction: column; gap: 8px; width: min(280px, 80%); }
.pl {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: 1px;
}
.pl.me { background: linear-gradient(135deg, rgba(31,216,224,0.18), rgba(162,75,224,0.18)); border-color: rgba(255,255,255,0.2); }
.pl.bot { border-style: dashed; opacity: 0.9; }
.pl-x {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06);
  color: var(--text); font-size: 11px; line-height: 1; cursor: pointer;
}
.pl-x:hover { background: rgba(255, 77, 157, 0.3); }
.lobby-addcpu { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lobby-wait { margin: 0; font-size: 13px; opacity: 0.7; letter-spacing: 1px; min-height: 18px; }
.lobby-mode { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* ---- The Table: around-the-table seat ring (lobby presentation) ---- */
.players.table-ring {
  position: relative; width: min(330px, 94%); height: 290px;
  display: block; flex: none; margin: 2px auto 4px;
}
.tr-felt {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: radial-gradient(circle at 50% 38%, rgba(31,216,224,0.14), rgba(162,75,224,0.10) 70%, rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4), 0 0 24px rgba(31,216,224,0.12);
}
.tr-felt b { font-size: 14px; font-weight: 800; letter-spacing: 1px; max-width: 130px; text-align: center; line-height: 1.15; }
.tr-felt span { font-size: 11px; opacity: 0.6; letter-spacing: 1px; }
.tr-seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 74px; padding: 4px 2px; border-radius: 12px;
}
.tr-seat.me { background: linear-gradient(135deg, rgba(31,216,224,0.18), rgba(162,75,224,0.18)); box-shadow: 0 0 0 1px rgba(255,255,255,0.18); }
.tr-seat .rmv-av { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.tr-seat.bot { opacity: 0.92; }
.tr-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; max-width: 74px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.tr-dot { position: absolute; top: 2px; right: 12px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--bg, #16141b); z-index: 2; }
.tr-dot.here { background: #3ddc84; box-shadow: 0 0 6px rgba(61,220,132,0.8); }
.tr-dot.gone { background: #ffb648; animation: tr-pulse 1s ease-in-out infinite; }
.tr-dot.bot { background: #8a8594; }
@keyframes tr-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.tr-crown { position: absolute; top: -4px; left: 14px; font-size: 13px; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.tr-seat .pl-x { position: absolute; top: 0; right: 0; }
.tr-seat.open { opacity: 0.5; }
.tr-chair {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--line); font-size: 16px; color: var(--text);
}

/* ---- The Table: host's between-rounds game switcher ---- */
.lobby-switch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(330px, 94%); }
.lsw-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lsw {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.lsw:hover:not(:disabled) { border-color: rgba(255,255,255,0.3); }
.lsw.cur { background: linear-gradient(135deg, var(--teal), var(--purple, #a24be0)); color: #0d0c10; border-color: transparent; }
.lsw:disabled { opacity: 0.32; cursor: default; }

/* ===== game screen chrome ===== */
.back {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.back:hover { background: rgba(255, 255, 255, 0.1); }
/* long list screens (profile / tourney / lobby) — keep the back button reachable without scrolling
   all the way up. It floats as a sticky chip; opaque bg + blur so scrolling content reads cleanly
   behind it. The in-game back (#back-btn) stays static to avoid overlapping a game's HUD. */
#profile-back, #tourney-back, #lobby-back {
  position: sticky; top: 4px; z-index: 10;
  background: rgba(18, 16, 22, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
#profile-back:hover, #tourney-back:hover, #lobby-back:hover { background: rgba(30, 27, 36, 0.95); }

/* ===== RMUV_TABLE harness chrome (shared by every turn-based game) ===== */
.rt-game { display: flex; flex-direction: column; gap: 16px; }
.rt-stage { display: flex; flex-direction: column; gap: 16px; }

.ttt { display: flex; flex-direction: column; gap: 16px; }
.ttt-head, .bubble-head { text-align: center; }
.ttt-title, .bubble-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 2px;
}

/* ===== reversi ===== */
.reversi { display: flex; flex-direction: column; gap: 12px; }
.rv-head { text-align: center; }
.rv-title { margin: 0; font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.rv-score { display: flex; justify-content: center; gap: 22px; font-size: 14px; letter-spacing: 1px; }
.rv-tally b { font-size: 22px; font-weight: 800; }
.rv-tally.p0 b { color: var(--teal); }
.rv-tally.p1 b { color: var(--pink); }
.rv-tally.p2 b { color: #FFD23F; }
.rv-wrap { display: flex; justify-content: center; }
.rv-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  padding: 6px;
  background: rgba(102, 71, 148, 0.16);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.rv-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
}
.rv-cell.lastmove { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22); }
.rv-cell.target::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(124, 255, 90, 0.7);
  box-shadow: 0 0 8px rgba(124, 255, 90, 0.6);
}
.rv-cell .disc {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}
.disc.p0 { background: radial-gradient(circle at 35% 30%, #d6fbfd, #1FD8E0 58%, #128f95); }
.disc.p1 { background: radial-gradient(circle at 35% 30%, #ffd6e8, #FF4D9D 58%, #c12c71); }
.disc.p2 { background: radial-gradient(circle at 35% 30%, #fff3c4, #FFD23F 58%, #c79a17); }
.disc.just-placed { animation: pop 0.18s ease; }
.disc.flipped { animation: rvFlip 0.4s ease; }
@keyframes rvFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(90deg) scale(0.75); }
  100% { transform: rotateY(0deg) scale(1); }
}

/* ===== mille bornes ===== */
.mb { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.mb-head { text-align: center; }
.mb-title { margin: 0; font-size: 20px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.mb-teal-tx { color: var(--teal); } .mb-pink-tx { color: var(--pink); }
.mb-gold-tx { color: #FFD23F; } .mb-lime-tx { color: #7CFF5A; }

.mb-table { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; justify-content: center; }
.mb .mb-hand { margin-top: auto; }   /* template: hand to the bottom */
.mb-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 11px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.mb-row.turn { border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.mb-who { width: 74px; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.mb-row.mb-teal .mb-who { color: var(--teal); } .mb-row.mb-pink .mb-who { color: var(--pink); }
.mb-row.mb-gold .mb-who { color: #FFD23F; } .mb-row.mb-lime .mb-who { color: #7CFF5A; }
.mb-mid { flex: 1; min-width: 0; }
.mb-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mb-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--purple)); }
.mb-row.mb-pink .mb-bar span { background: linear-gradient(90deg, var(--pink), #ff9ec8); }
.mb-row.mb-gold .mb-bar span { background: linear-gradient(90deg, #FFD23F, #fff0b0); }
.mb-row.mb-lime .mb-bar span { background: linear-gradient(90deg, #7CFF5A, #c9ffb8); }
.mb-sub { font-size: 11px; opacity: 0.8; margin-top: 4px; letter-spacing: .3px; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mb-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); white-space: nowrap; }
.mb-chip.haz { color: #ff8f8f; border-color: rgba(255, 90, 90, 0.4); background: rgba(255, 90, 90, 0.1); }
.mb-chip.saf { color: #FFD23F; border-color: rgba(255, 210, 63, 0.4); background: rgba(255, 210, 63, 0.12); }
.mb-chip.ok { color: #7CFF5A; border-color: rgba(124, 255, 90, 0.35); }
.mb-chip.warn { color: #cfcad6; }
.mb-last { font-size: 12px; opacity: 0.85; }

.mb-hand { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mb-card {
  width: 58px; height: 78px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; padding: 4px 2px; color: #0c0b0e; font-weight: 800;
  transition: transform 0.1s;
}
.mb-card .mb-ic { font-size: 18px; }
.mb-card .mb-tx { font-size: 10px; line-height: 1.05; text-align: center; }
.mb-card.c-dist { background: radial-gradient(circle at 50% 25%, #d6fbfd, #1FD8E0); }
.mb-card.c-dist .mb-tx { font-size: 18px; }
.mb-card.c-haz { background: radial-gradient(circle at 50% 25%, #ffd3d3, #ff5a5a); }
.mb-card.c-rem { background: radial-gradient(circle at 50% 25%, #d6ffce, #7CFF5A); }
.mb-card.c-saf { background: radial-gradient(circle at 50% 25%, #fff3c4, #FFD23F); }
.mb-card.sel { transform: translateY(-6px); box-shadow: 0 0 0 2px #fff, 0 6px 14px rgba(0,0,0,.4); }
.mb-card.dim { opacity: 0.45; }

.mb-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 0; }
.mb-act {
  border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 800; cursor: pointer;
  background: rgba(255, 255, 255, 0.1); color: var(--text);
}
.mb-act.go { background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06121a; }
.mb-act.atk { background: linear-gradient(135deg, #ff5a5a, var(--orange)); color: #1a0a06; }
.mb-act.reno { background: rgba(255, 210, 63, 0.16); color: #FFD23F; font-size: 12px; padding: 7px 11px; }
.mb-act.big { font-size: 17px; padding: 11px 26px; }

/* ===== profile pill + screen ===== */
.profile-pill {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px 5px 6px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); color: var(--text); font-weight: 700; font-size: 13px;
  transition: background 0.15s;
}
.profile-pill:hover { background: rgba(255, 255, 255, 0.08); }
.pp-ic { font-size: 15px; }
.pp-lvl { color: #FFD23F; }
.pp-bar { width: 70px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--purple)); }
.pp-cp { opacity: 0.8; font-size: 12px; }

.profile { display: flex; flex-direction: column; gap: 12px; max-width: 460px; margin: 0 auto; padding: 8px 0 24px; }
.pf-head { display: flex; gap: 14px; align-items: center; }
.pf-ring {
  width: 72px; height: 72px; flex: 0 0 auto; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(162, 75, 224, 0.5), rgba(31, 216, 224, 0.18));
  border: 2px solid var(--teal);
}
.pf-ring b { font-size: 28px; font-weight: 800; line-height: 1; }
.pf-ring span { font-size: 9px; letter-spacing: 2px; opacity: 0.7; }
.pf-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pf-name { align-self: flex-start; border: 0; background: none; color: var(--text); font-size: 18px; font-weight: 800; cursor: pointer; padding: 0; }
.pf-name i { font-size: 12px; opacity: 0.5; font-style: normal; }
.pf-cp { font-size: 20px; font-weight: 800; color: #FFD23F; }
.pf-cp span { font-size: 11px; font-weight: 600; color: var(--text); opacity: 0.6; margin-left: 6px; }
.pf-bar { height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pf-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--purple)); }
.pf-next { font-size: 11px; opacity: 0.65; }
.pf-streak { font-size: 14px; font-weight: 700; }
.pf-sec {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  opacity: 0.85; margin-top: 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.pf-sec span { font-size: 12px; opacity: 0.7; }
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pf-badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
  padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  font: inherit; color: inherit; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pf-badge:active { transform: scale(0.96); }
.pf-age { font-size: 11px; opacity: 0.6; margin-top: 4px; }
/* badge detail card — big, readable (the wall text is tiny on a phone) */
.badge-modal { /* layout now owned by .rmv-ov[data-mode=fixed]; style hook only */ }
/* badge detail: panel skin from the shared rules above; keeps its centered layout + the tier
   border/glow rules below (.bm-card.t-epic.on etc. override the neutral border). */
.bm-card { padding: 26px 22px; max-width: 340px; width: 100%; text-align: center; align-items: center; }
.bm-card.off { opacity: 0.92; }
.bm-card.t-common.on    { border-color: rgba(31, 216, 224, 0.55); }
.bm-card.t-special.on   { border-color: rgba(63, 167, 255, 0.6); }
.bm-card.t-epic.on      { border-color: rgba(162, 75, 224, 0.7); box-shadow: 0 0 22px rgba(162, 75, 224, 0.3); }
.bm-card.t-legendary.on { border-color: rgba(255, 210, 63, 0.8); box-shadow: 0 0 26px rgba(255, 210, 63, 0.4); }
.bm-ic { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.bm-name { font-size: 1.45rem; font-weight: 900; letter-spacing: 0.3px; }
.bm-tier { display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; margin: 8px 0; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); opacity: 0.85; }
.bm-tier.t-common { color: #1FD8E0; } .bm-tier.t-special { color: #3FA7FF; } .bm-tier.t-epic { color: #C98BFF; } .bm-tier.t-legendary { color: #FFD23F; }
.bm-desc { font-size: 1rem; line-height: 1.45; opacity: 0.85; margin: 6px 0 14px; }
.bm-reward { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 700; opacity: 0.85; }
.bm-reward.got { color: #FFD23F; border-color: rgba(255, 210, 63, 0.4); opacity: 1; }
.bm-reward b { color: #C98BFF; letter-spacing: 3px; }
.bm-status { font-size: 0.95rem; font-weight: 700; opacity: 0.7; }
.bm-status.got { color: #7CFF9B; opacity: 1; }
.bm-close { margin-top: 18px; width: 100%; padding: 13px; border: none; border-radius: 13px; background: linear-gradient(135deg, #1FD8E0, #A24BE0); color: #06121a; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.pf-badge.off { opacity: 0.42; }
/* earned in a past prestige life: clearly dormant — icon stays recognizable but
   desaturated + dimmed so it never reads as "currently earned"; the mastery ★ keeps
   its metal colour so a bronze/silver/gold re-earn record still pops. */
.pf-badge.past { opacity: 0.6; }
.pf-badge.past .pf-bic { filter: grayscale(1); opacity: 0.8; }
/* end-match win banner — your avatar + gear + title get one big spotlight on a win */
.win-banner { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; background: radial-gradient(circle at center, rgba(10,8,16,0.5), rgba(10,8,16,0.82)); }
.win-banner.show { opacity: 1; pointer-events: auto; }
.wb-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 34px; transform: scale(0.8) translateY(8px); transition: transform 0.32s cubic-bezier(0.2, 1.5, 0.4, 1); }
.win-banner.show .wb-card { transform: scale(1) translateY(0); }
.wb-burst { font-size: 1.9rem; animation: rmv-pulse 1.6s ease-in-out infinite; }
.wb-name { font-size: 1.3rem; font-weight: 900; margin-top: 12px; }
.wb-title { font-size: 0.92rem; font-weight: 800; letter-spacing: 0.04em; }
.wb-title.t-common { color: #cfcad6; }
.wb-title.t-special { color: #FF4D9D; }
.wb-title.t-epic { color: #FF6A2B; }
.wb-title.t-legendary { color: #FFD23F; }
.wb-wins { font-size: 1.55rem; font-weight: 900; color: #FFD23F; letter-spacing: 0.06em; margin-top: 6px; text-shadow: 0 0 16px rgba(255, 210, 63, 0.55); }
.pf-badge.on { background: rgba(255, 255, 255, 0.05); }
.pf-badge.t-common.on    { border-color: rgba(31, 216, 224, 0.55); background: rgba(31, 216, 224, 0.07); }
.pf-badge.t-special.on   { border-color: rgba(63, 167, 255, 0.6);  background: rgba(63, 167, 255, 0.09); }
.pf-badge.t-epic.on      { border-color: rgba(162, 75, 224, 0.7);  background: rgba(162, 75, 224, 0.11); box-shadow: 0 0 10px rgba(162, 75, 224, 0.28); }
.pf-badge.t-legendary.on { border-color: rgba(255, 210, 63, 0.8);  background: rgba(255, 210, 63, 0.11); box-shadow: 0 0 14px rgba(255, 210, 63, 0.4); }
.pf-badge.mystery { border-style: dashed; }
.pf-bic { font-size: 24px; }
.pf-bname { font-size: 11px; font-weight: 800; }
.pf-bhint { font-size: 9px; opacity: 0.7; line-height: 1.2; }
.pf-btier { font-size: 7px; letter-spacing: 1px; text-transform: uppercase; font-weight: 800; opacity: 0; }
.pf-badge.t-epic.on .pf-btier { opacity: 0.75; color: #c79bff; }
.pf-badge.t-legendary.on .pf-btier { opacity: 0.9; color: #FFD23F; }
.pf-stats { display: flex; flex-direction: column; gap: 4px; }
.pf-stat { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 2px; }
.pf-game { font-weight: 700; }
.pf-bits { opacity: 0.7; font-size: 12px; text-align: right; }
.pf-empty { opacity: 0.6; font-size: 13px; text-align: center; padding: 10px; }
.pf-reset {
  margin: 10px auto 0; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text); opacity: 0.7; border-radius: 10px; padding: 8px 16px; font-weight: 700; cursor: pointer;
}

/* toast stack — one fixed bottom column so banners/toasts never cover each other */
#toast-stack {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2600;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 484px; margin: 0 auto; pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}
#toast-stack > * { pointer-events: auto; }
/* canonical toast chip — anything pushed via RMUV_TOAST.push() gets this look (tourney, fakeout,
   Neon Leap secrets/shortcuts, …). .ach-toast (tier gradients) + .people-toast are richer variants
   that ride the same stack. Add .gold / .purple for an accent border. */
.toast { width: auto; max-width: 360px; padding: 11px 16px; font-weight: 700; font-size: 14px; color: var(--text);
  background: linear-gradient(180deg, #17141f, #100d15); border: 1px solid rgba(255,255,255,0.10); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  transform: translateY(120%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.toast.in { transform: translateY(0); opacity: 1; }
.toast.gold { border-color: rgba(255,210,63,0.55); color: var(--gold); }
.toast.purple { border-color: rgba(162,75,224,0.6); color: #c79bff; }
/* In a landscape game, rotate the toast stack onto the same frame as the game and
   pin toasts to the landscape TOP — so they read correctly and never cover the
   bottom A button. pointer-events:none lets taps fall through to the game. */
body.lg-game #toast-stack {
  top: 50%; left: 50%; right: auto; bottom: auto; margin: 0;
  width: 100vh; height: 100vw; max-width: none;
  transform: translate(-50%, -50%) rotate(90deg); transform-origin: center center;
  justify-content: flex-start; align-items: center;
  padding: 56px 12px 0; z-index: 70; pointer-events: none;
}

/* achievement unlock toast */
.ach-toast {
  width: 100%; max-width: 360px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(162, 75, 224, 0.96), rgba(31, 216, 224, 0.93)); color: #06121a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(160%); opacity: 0; transition: transform 0.34s ease, opacity 0.34s ease;
}
.ach-toast.t-epic { background: linear-gradient(135deg, #A24BE0, #3FA7FF); }
.ach-toast.t-legendary { background: linear-gradient(135deg, #FFD23F, #FF6A2B); }
.ach-toast.in { transform: translateY(0); opacity: 1; }
.at-ic { font-size: 28px; }
.at-txt { display: flex; flex-direction: column; }
.at-txt b { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.at-txt span { font-size: 15px; font-weight: 800; }

/* people you've played with — profile list + table-intro greeting */
.pf-people { display: flex; flex-direction: column; gap: 2px; }
.pf-person {
  display: flex; align-items: baseline; gap: 8px; width: 100%; font-size: 13px; padding: 8px 6px;
  border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); border-radius: 8px;
  background: none; color: var(--text); cursor: pointer; text-align: left;
}
.pf-person:hover { background: rgba(255, 255, 255, 0.05); }
.pf-pname { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pmeta { opacity: 0.7; font-size: 12px; }
.pf-pago { opacity: 0.55; font-size: 11px; min-width: 54px; text-align: right; }
.people-toast {
  width: 100%; max-width: 360px; margin: 0 auto;
  background: linear-gradient(180deg, #17141f, #100d15); border: 1px solid rgba(255,255,255,0.10); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
  transform: translateY(160%); opacity: 0; transition: transform 0.34s ease, opacity 0.34s ease;
}
.people-toast.in { transform: translateY(0); opacity: 1; }
.pt-head { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: var(--teal); }
.pt-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; padding: 2px 0; }
.pt-name { font-weight: 800; }
.pt-meta { opacity: 0.7; font-size: 12px; }

/* person detail modal (browse someone you've played with) */
.person-modal { /* layout now owned by .rmv-ov[data-mode=fixed]; style hook only */ }
.pm-card {           /* neutral panel bg from the shared rule; scrolls internally so no overflow:hidden/grain */
  position: relative; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 18px; padding: 18px 16px;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 12px;
}
.pm-name { font-size: 20px; font-weight: 800; }

/* ===== PWA install banner ===== */
.pwa-banner {        /* the .rmv-panel skin, kept horizontal (so it can't use the flex-column .rmv-panel class) */
  width: 100%; max-width: 460px; margin: 0 auto; position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px;
  background:
    radial-gradient(95% 130% at 50% -25%, rgba(162,75,224,0.20), transparent 60%),
    radial-gradient(80% 110% at 100% 0%, rgba(31,216,224,0.09), transparent 62%),
    linear-gradient(180deg, #15121c 0%, #0d0b11 80%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
  transform: translateY(140%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease;
}
.pwa-banner::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5; mix-blend-mode: screen;
  background-image: radial-gradient(rgba(255,255,255,0.04) 0.5px, transparent 0.6px); background-size: 3px 3px; }
.pwa-banner > * { position: relative; }   /* keep content above the grain */
.pwa-banner.in { transform: translateY(0); opacity: 1; }
.pwa-ic { width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto; }
.pwa-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pwa-txt b { font-size: 14px; font-weight: 800; }
.pwa-txt span { font-size: 12px; opacity: 0.8; line-height: 1.3; }
.pwa-btns { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pwa-install {
  border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 800; cursor: pointer;
  background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06121a;
}
.pwa-banner.update .pwa-install { background: linear-gradient(135deg, #FFD23F, var(--orange)); }   /* "Restart" stands out */
.pwa-x {
  border: 0; border-radius: 10px; width: 34px; height: 34px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: var(--text); font-size: 14px;
}

/* ===== mall-opoly ===== */
.mall { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mall .controls, .mall .status, .mall .hint, .mall .mall-actions, .mall .mall-cash { width: 100%; }
/* compact status reclaims ~a line so the board top clears the header on a phone */
.mall .status { font-size: 14px; letter-spacing: 0.5px; min-height: 0; line-height: 1.3; }
.mall .status .mb-last { font-size: 12px; opacity: 0.75; }
.mall-cash { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mall-chip {
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--pc); background: rgba(255, 255, 255, 0.04);
  display: inline-flex; align-items: center; gap: 5px;
}
.mall-chip.turn { box-shadow: 0 0 0 2px var(--pc); background: rgba(255, 255, 255, 0.08); }
.mall-chip.out { opacity: 0.4; text-decoration: line-through; }
.mall-chip b { color: var(--text); font-size: 13px; }
.mall-chip i { font-style: normal; opacity: 0.7; font-size: 11px; }
.mall-wrap { display: flex; justify-content: center; width: 100%; }
/* portrait "mall" board — aspect-ratio is also set inline from COLS/ROWS in JS */
/* cap by viewport HEIGHT (via a vh max-width — the 5/9 aspect makes height = width×1.8),
   so the tall portrait board fits above the cash/status/action chrome on a phone. */
.mall-canvas { border-radius: 12px; touch-action: manipulation; width: 100%; max-width: min(360px, 26vh); aspect-ratio: 5 / 9; display: block; }
.mall-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* ===== slide racer ===== */
.sr { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sr .controls, .sr .status { width: 100%; }
.sr-wrap { display: flex; justify-content: center; width: 100%; }
.sr-canvas { border-radius: 12px; touch-action: manipulation; width: 100%; max-width: min(360px, 50vh); aspect-ratio: 1 / 1; display: block; }
.sr-rollrow { display: flex; gap: 10px; justify-content: center; align-items: center; width: 100%; }
.sr-boostbtn { border-color: rgba(124, 255, 90, 0.5); color: #7CFF5A; font-weight: 700; white-space: nowrap; }
.sr-roll { font-size: 18px; min-width: 160px; }

/* ===== track racer (pawn / card) ===== */
.tr { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.tr .controls, .tr .status { width: 100%; }
.tr-wrap { display: flex; justify-content: center; width: 100%; }
.tr-canvas { border-radius: 12px; touch-action: manipulation; width: 100%; max-width: min(340px, 46vh); aspect-ratio: 1 / 1; display: block; }
.tr-boostbtn { background: rgba(124, 255, 90, 0.1) !important; color: #7CFF5A !important; box-shadow: inset 0 0 0 1px rgba(124, 255, 90, 0.5) !important; font-size: 13px !important; }
.tr-nitro { color: #7CFF5A; font-weight: 700; }
.tr-score { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); font-size: 12px; }
.tr-chip.turn { box-shadow: 0 0 0 2px var(--pc); background: rgba(255,255,255,0.08); }
.tr-chip b { letter-spacing: 2px; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 8px; }
.tr-act { min-width: 140px; }
.tr-act[style*="--pc"] { box-shadow: inset 0 0 0 2px var(--pc); }

/* ===== crazy 8s (the card-game template: tight top, discard centred, hand low) ===== */
.c8 { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: 1; min-height: 0; width: 100%; }
.c8-head { text-align: center; }
.c8-title { margin: 0; font-size: 20px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.c8 .controls, .c8 .status, .c8 .hint, .c8 .mb-hand, .c8 .mb-actions { width: 100%; }
.c8 .hint { margin-top: 2px; }
.c8-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.c8-chip {
  font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--pc); background: rgba(255, 255, 255, 0.04);
}
.c8-chip b { color: #fff; font-size: 14px; margin-left: 1px; }   /* the card count, bold + white so it pops */
.c8-chip.turn { box-shadow: 0 0 0 2px var(--pc); background: rgba(255, 255, 255, 0.08); }
.c8-chip.low { border-color: #FF4D9D; }
.c8-chip.low b { color: #FF7DB8; }
.c8-dir { font-size: 13px; opacity: 0.8; letter-spacing: 1px; }
.c8-warn { text-align: center; font-size: 14px; font-weight: 700; color: #FFD23F;
  background: rgba(255, 210, 63, 0.1); border: 1px solid rgba(255, 210, 63, 0.4);
  border-radius: 999px; padding: 6px 14px; margin: 6px auto; max-width: max-content; animation: fkPop 0.3s ease; }
.c8-warn b { color: #fff; }

.c8-pile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 0; margin: 0; }
.c8-top { border-radius: 12px; }
.c8-top .mb-card { width: 88px; height: 118px; cursor: default; }
.c8-top .mb-card .mb-tx { font-size: 30px; }
.c8-active { font-size: 12px; letter-spacing: 1px; opacity: 0.85; text-transform: capitalize; }

.c8-card.c8-teal { background: radial-gradient(circle at 50% 25%, #d6fbfd, #1FD8E0); }
.c8-card.c8-pink { background: radial-gradient(circle at 50% 25%, #ffd6e8, #FF4D9D); }
.c8-card.c8-gold { background: radial-gradient(circle at 50% 25%, #fff3c4, #FFD23F); }
.c8-card.c8-lime { background: radial-gradient(circle at 50% 25%, #d6ffce, #7CFF5A); }
.c8-card.c8-wild {
  background: conic-gradient(from 0deg, #1FD8E0, #FF4D9D, #FFD23F, #7CFF5A, #1FD8E0);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.c8-card .mb-ic { font-size: 22px; }

/* ===== hearts ===== */
.hearts { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: 1; min-height: 0; }
.ht-head { text-align: center; }
.ht-title { margin: 0; font-size: 20px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.hearts .controls, .hearts .status, .hearts .hint { width: 100%; }
.hearts .pl-hand { margin-top: auto; }   /* template: hand drops to the bottom (thumb zone) */
.ht-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.ht-chip {
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--pc); background: rgba(255, 255, 255, 0.04);
}
.ht-chip.turn { box-shadow: 0 0 0 2px var(--pc); background: rgba(255, 255, 255, 0.08); }
.ht-chip b { color: var(--text); }
.ht-broken { font-size: 12px; color: #ff5a7a; letter-spacing: 1px; }

.ht-trick {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  min-height: 78px; width: 100%; padding: 8px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); border-radius: 12px;
}
.ht-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ht-pl { font-size: 11px; font-weight: 800; }
.ht-empty { opacity: 0.5; font-size: 13px; letter-spacing: 1px; }

.pl-card {
  display: inline-flex; align-items: center; gap: 1px;
  background: #f4f1ea; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.25);
  min-width: 38px; height: 54px; padding: 0 6px;
  font-weight: 800; font-size: 17px; justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.pl-card b { font-size: 19px; font-weight: 700; }
.pl-card.red { color: #d6263a; }
.pl-card.blk { color: #15131a; }
.ht-slot .pl-card { height: 70px; font-size: 23px; }

/* hand: bigger, readable cards (the wall was tiny on a phone), wrapping within
 * the viewport so a 13-card Hearts hand stays legible */
.pl-hand { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; width: 100%; padding-top: 4px; }
.pl-hand .pl-card { cursor: pointer; transition: transform 0.1s; min-width: 50px; height: 74px; font-size: 23px; }
.pl-hand .pl-card b { font-size: 25px; }
.pl-hand .pl-card.playable { box-shadow: 0 0 0 2px var(--teal), 0 2px 6px rgba(0, 0, 0, 0.5); position: relative; z-index: 2; }
.pl-hand .pl-card.playable:hover { transform: translateY(-8px); z-index: 3; }
.pl-hand .pl-card.dim { opacity: 0.4; cursor: default; }

/* ===== rummy ===== */
.rummy { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: 1; min-height: 0; }
.rummy .controls, .rummy .status, .rummy .hint, .rummy .pl-hand, .rummy .mb-actions { width: 100%; }
.rm-center { display: flex; gap: 26px; justify-content: center; align-items: center; padding: 6px 0; flex: 1; min-height: 0; }
.rm-pile { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rm-cap { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.55; }
.pl-card.back {
  background: linear-gradient(135deg, #2f2755, #664794); color: #d6d0ff;
  width: 66px; height: 92px; font-size: 32px; cursor: pointer; border-color: rgba(255,255,255,0.2);
}
.rm-top .pl-card, .pl-card.empty { width: 66px; height: 92px; font-size: 28px; }
.rm-top .pl-card b { font-size: 30px; }
.pl-card.empty { background: rgba(255,255,255,0.05); color: var(--text); cursor: default; box-shadow: none; }
.rm-pile .pl-card { cursor: pointer; }
.pl-card.goout { box-shadow: 0 0 0 2px #FFD23F, 0 0 14px rgba(255,210,63,0.7); }
.pl-card.jd { box-shadow: 0 0 0 2px #FF8A4B, 0 0 14px rgba(255,138,75,0.8); }
.pl-card.jd.playable { box-shadow: 0 0 0 2px #FF8A4B, 0 0 16px rgba(255,138,75,0.95); }

/* ===== bubble pop ===== */
.bubble { display: flex; flex-direction: column; gap: 14px; }
.hud {
  display: flex;
  justify-content: center;
  gap: 28px;
}
.hud-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.55; }
.hud-val { font-size: 22px; font-weight: 800; }
.hud-item.time .hud-val { color: var(--teal); }

.canvas-wrap {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(102, 71, 148, 0.18) 0%, rgba(255, 255, 255, 0.02) 55%);
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 60vh;
  max-height: 560px;
  min-height: 360px;
  touch-action: none;
  cursor: pointer;
}
/* over-title / over-score render INSIDE the .arcade-card now (every overlay goes through
   RMUV_OVERLAY). The old `.overlay` container rule + its touch-action floor are retired —
   the .rmv-ov contract owns positioning + touch-action by dismiss mode. */
.over-title {
  margin: 0;
  font-size: 40px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: var(--purple);
  text-shadow: 0 0 22px rgba(162, 75, 224, 0.6);
}
.over-score { margin: 0; font-size: 18px; letter-spacing: 1px; opacity: 0.9; line-height: 1.5; text-align: center; }
.over-score b { color: var(--teal); font-size: 22px; }

/* ---- orientation choice for sideways games (player picks; we CSS-rotate) ---- */
#orient-gate {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--bg); text-align: center; padding: 24px;
}
.og-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.5px; color: var(--text); }
.og-choices { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.og-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 142px;
  padding: 20px 14px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  color: var(--text); font-size: 16px; font-weight: 800;
}
.og-choice:hover { background: rgba(255, 255, 255, 0.08); }
.og-choice[data-mode="landscape"] { border-color: rgba(124, 255, 90, 0.6); box-shadow: 0 0 16px rgba(124, 255, 90, 0.14); }
.og-ic { font-size: 40px; }
.og-sub { font-size: 11px; font-weight: 600; opacity: 0.55; letter-spacing: 0.3px; }
.og-foot { margin: 0; font-size: 12px; opacity: 0.5; }

/* in-header flip toggle (shown only for sideways games) */
.flip-btn {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.flip-btn.on { color: #7CFF5A; border-color: rgba(124, 255, 90, 0.6); }

/* landscape: CSS-rotate the WHOLE game screen 90° to fill a portrait-locked phone.
   Header + game rotate together, so the header reads correctly at the landscape
   top and the gamepad sits at the landscape bottom — opposite ends, no overlap. */
#game-screen.landscape {
  position: fixed; top: 50%; left: 50%;
  width: 100vh; height: 100vw; box-sizing: border-box;
  transform: translate(-50%, -50%) rotate(90deg); transform-origin: center center;
  z-index: 60; background: var(--bg);
  display: flex; flex-direction: column;
  /* device is portrait-locked, content rotated 90°: device TOP (notch) → stage LEFT,
     device BOTTOM (home bar) → stage RIGHT. Pad both so controls clear the safe areas. */
  padding-left: max(env(safe-area-inset-top), 14px);
  padding-right: max(env(safe-area-inset-bottom), 8px);
}
#game-screen.landscape .game-header { flex: 0 0 auto; }       /* keep its height, never collapse */
#game-screen.landscape #game-root { flex: 1 1 0; min-height: 0; display: flex; }
#game-screen.landscape .bubble { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#game-screen.landscape .canvas-wrap { flex: 1; min-height: 0; }
#game-screen.landscape .canvas-wrap canvas { height: 100%; max-height: none; min-height: 0; }

/* ---- Controller shelf: Neon Leap landscape playfield + on-screen gamepad ---- */
.canvas-wrap.landscape canvas { height: 54vh; max-height: 460px; min-height: 300px; }

.gamepad { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gp-btn {
  position: absolute; bottom: 16px; pointer-events: auto;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #fff;
  background: rgba(20, 18, 29, 0.55); border: 2px solid rgba(31, 216, 224, 0.55);
  box-shadow: 0 0 14px rgba(31, 216, 224, 0.2); backdrop-filter: blur(2px);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform 0.05s, background 0.1s;
}
.gp-btn.held { transform: scale(0.92); background: rgba(31, 216, 224, 0.28); }
.gp-left { left: 16px; }
.gp-right { left: 84px; }
.gp-a {
  right: 18px; width: 72px; height: 72px; font-size: 26px;
  border-color: rgba(124, 255, 90, 0.7); color: #7CFF5A;
  box-shadow: 0 0 16px rgba(124, 255, 90, 0.28);
}
.gp-a.held { background: rgba(124, 255, 90, 0.26); }
/* Neon Strike adds a B (fire) button: B is the big primary on the right, A (jump) sits left of it */
.gp-a.gp-a2 { right: 102px; width: 58px; height: 58px; font-size: 22px; }
.gp-b {
  right: 20px; bottom: 16px; width: 74px; height: 74px; font-size: 26px;
  border-color: rgba(255, 77, 157, 0.75); color: #FF4D9D;
  box-shadow: 0 0 16px rgba(255, 77, 157, 0.3);
}
.gp-b.held { background: rgba(255, 77, 157, 0.26); }

/* Stripe (mower) — two-thumb lever INDICATORS (input is a whole-canvas split) + the in-game
   End button. Same canvas-wrap overlay idiom as the gamepad above, grass-green accent. */
.mow-levers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.mow-lever {
  position: absolute; bottom: 18px; width: 46px; height: 150px; border-radius: 24px;
  background: rgba(20, 18, 29, 0.55); border: 2px solid rgba(124, 255, 90, 0.4);
  box-shadow: 0 0 14px rgba(124, 255, 90, 0.14); backdrop-filter: blur(2px);
}
.mow-lever.l { left: 16px; }
.mow-lever.r { right: 16px; }
.mow-lever .neutral { position: absolute; left: 9px; right: 9px; top: 50%; height: 2px; background: rgba(255, 255, 255, 0.28); }
.mow-knob {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.55); color: #04161a;
  font: 900 13px system-ui; display: flex; align-items: center; justify-content: center;
  transition: background 0.08s;
}
.mow-lever .lbl { position: absolute; left: 0; right: 0; bottom: -16px; text-align: center;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.55; }
.mow-end {
  position: absolute; top: 10px; right: 10px; z-index: 5; pointer-events: auto; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--text);
  background: rgba(20, 18, 29, 0.6); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(3px);
}
.mow-end:active { transform: scale(0.94); }

/* dev feel-tuner panel (only present with ?tune=1; rotates with the landscape stage) */
.tune-fab {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  width: 34px; height: 34px; border-radius: 9px; font-size: 16px;
  background: rgba(12, 11, 14, 0.7); border: 1px solid var(--line); color: var(--text);
  pointer-events: auto; cursor: pointer;
}
.tune-box {
  position: absolute; top: 48px; left: 8px; z-index: 6; width: 236px; max-width: 72%;
  background: rgba(12, 11, 14, 0.93); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; pointer-events: auto; backdrop-filter: blur(3px);
}
.tune-h { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: var(--teal); margin-bottom: 6px; }
.tune-row { display: grid; grid-template-columns: 66px 1fr 36px; align-items: center; gap: 6px; margin: 6px 0; font-size: 11px; }
.tune-row input[type=range] { width: 100%; accent-color: var(--teal); }
.tune-row b { text-align: right; font-variant-numeric: tabular-nums; color: #FFD23F; }
.tune-out { font-size: 10px; font-family: monospace; opacity: 0.65; margin: 8px 0 6px; word-break: break-word; line-height: 1.5; }
.tune-reset { font-size: 11px; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text); cursor: pointer; }

.mode-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mode-chip {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.5px; border: 1px solid var(--line); color: var(--ink-dim, #b8b2c4);
}
.mode-chip.on { color: #0C0B0E; background: var(--teal); border-color: var(--teal); }
.mode-chip.soon { opacity: 0.5; }

/* Neon Leap level-select map */
.nl-world { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--teal); margin: 2px 0 -2px; }
.nl-levels { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.nl-lv {
  min-width: 58px; padding: 9px 12px; border-radius: 12px; font-size: 15px; font-weight: 800;
  color: #fff; background: rgba(20, 18, 29, 0.6); border: 2px solid rgba(31, 216, 224, 0.55);
  box-shadow: 0 0 12px rgba(31, 216, 224, 0.16); cursor: pointer; transition: transform 0.06s, background 0.1s;
}
.nl-lv:hover:not(:disabled) { background: rgba(31, 216, 224, 0.22); transform: translateY(-1px); }
.nl-lv:disabled { opacity: 0.42; border-color: var(--line); box-shadow: none; cursor: default; }
.nl-lv.done { border-color: rgba(124, 255, 90, 0.7); color: #7CFF5A; box-shadow: 0 0 12px rgba(124, 255, 90, 0.2); }
.nl-continue { margin-bottom: 2px; background: linear-gradient(90deg, #FFD23F, var(--orange)); color: #0C0B0E; }
.nl-endless { margin-top: 4px; background: linear-gradient(90deg, var(--purple), var(--pink)); }
.nl-mech { font-size: 10px; font-weight: 700; color: var(--orange); border: 1px solid rgba(255, 106, 43, 0.5); border-radius: 999px; padding: 1px 7px; margin-left: 6px; letter-spacing: 0.3px; vertical-align: middle; }
.canvas-wrap .overlay { overflow-y: auto; justify-content: safe center; }

.scoreboard { display: flex; flex-direction: column; gap: 8px; width: min(240px, 72%); }
.sb-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  letter-spacing: 1px;
}
.sb-row span { opacity: 0.8; }
.sb-row.win {
  background: linear-gradient(135deg, rgba(31, 216, 224, 0.25), rgba(162, 75, 224, 0.25));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.sb-row.win span { color: var(--teal); opacity: 1; }

/* ===== checkers ===== */
.checkers { display: flex; flex-direction: column; gap: 16px; }
.ck-head { text-align: center; }
.ck-title { margin: 0; font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: 2px; }
.p0-txt { color: var(--teal); }
.p1-txt { color: var(--pink); }
.p2-txt { color: #FFD23F; }
.p3-txt { color: var(--purple); }

.ck-wrap { position: relative; display: flex; justify-content: center; }
.ck-board {
  display: grid;
  grid-template-columns: repeat(var(--size, 8), 1fr);
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ck-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* squares need real contrast — the old 0.035/0.20 tints vanished on phones */
.ck-cell.light { background: rgba(255, 255, 255, 0.10); }
.ck-cell.dark { background: rgba(162, 75, 224, 0.32); }
.ck-cell.lastmove { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16); }
.ck-cell.sel { box-shadow: inset 0 0 0 3px var(--teal); }
.ck-cell.target::after {
  content: '';
  position: absolute;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  background: rgba(124, 255, 90, 0.85);
  box-shadow: 0 0 10px rgba(124, 255, 90, 0.7);
}

.piece {
  position: relative;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
}
.piece.p0 { background: radial-gradient(circle at 35% 30%, #d6fbfd, #1FD8E0 58%, #128f95); }
.piece.p1 { background: radial-gradient(circle at 35% 30%, #ffd6e8, #FF4D9D 58%, #c12c71); }
.piece.p2 { background: radial-gradient(circle at 35% 30%, #fff3c4, #FFD23F 58%, #c79a17); }
.piece.p3 { background: radial-gradient(circle at 35% 30%, #e7d2fb, #A24BE0 58%, #6a2da0); }
.piece.movable { cursor: pointer; box-shadow: 0 3px 6px rgba(0,0,0,0.45), 0 0 0 3px rgba(255,255,255,0.22); }
.piece.king::after {
  content: '♚';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60%;
  color: #FFD23F;
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.8);
}

.combo-pop {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(28px, 9vw, 48px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: var(--orange);
  text-shadow: 0 0 20px rgba(255, 106, 43, 0.8);
  pointer-events: none;
  animation: comboPop 1s ease forwards;
}
@keyframes comboPop {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  70% { transform: translate(-50%, -70%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -120%) scale(0.9); opacity: 0; }
}

/* ---------- Fakeout (Party shelf — bluffing trivia) ---------- */
.fakeout { display: flex; flex-direction: column; gap: 14px; padding: 8px 4px 28px; max-width: 520px; margin: 0 auto; width: 100%; }
.fo-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; letter-spacing: 0.04em; }
.fo-round { color: #1FD8E0; }
.fo-mult { color: #FFD23F; }
.fo-body { display: flex; flex-direction: column; gap: 14px; }
.fo-prompt { font-size: 1.35rem; line-height: 1.45; font-weight: 700; background: #16141b; border: 1px solid #2a2730; border-radius: 16px; padding: 22px 18px; text-align: center; }
.fo-prompt.small { font-size: 1.05rem; padding: 14px; }
.fo-blank { display: inline-block; min-width: 64px; border-bottom: 3px solid #FF4D9D; color: transparent; }
.fo-fill { color: #1FD8E0; border-bottom: 3px solid #1FD8E0; padding: 0 5px; }
.fo-hint { text-align: center; color: #9b96a3; margin: 0; }
.fo-inrow { display: flex; }
.fo-input { flex: 1; font-size: 1.1rem; padding: 14px 16px; border-radius: 14px; border: 1px solid #3a3640; background: #0f0e12; color: #fff; outline: none; }
.fo-input:focus { border-color: #FF4D9D; }
.fo-btn { font-size: 1.05rem; font-weight: 700; padding: 15px; border: none; border-radius: 14px; background: linear-gradient(135deg, #FF4D9D, #A24BE0); color: #fff; cursor: pointer; }
.fo-btn:active { transform: translateY(1px); }
.fo-reject { color: #FF6A2B; text-align: center; min-height: 1.2em; font-weight: 600; }
.fo-wait { text-align: center; color: #8a8593; }
.fo-count { color: #1FD8E0; font-weight: 700; }
.fo-locked { text-align: center; background: #16141b; border: 1px solid #2a2730; border-radius: 14px; padding: 18px; }
.fo-mylie { color: #FFD23F; font-size: 1.15rem; font-weight: 700; }
.fo-opts { display: flex; flex-direction: column; gap: 10px; }
.fo-opt { position: relative; font-size: 1.1rem; font-weight: 600; text-align: left; padding: 16px 18px; border: 1px solid #3a3640; border-radius: 14px; background: #16141b; color: #fff; cursor: pointer; }
.fo-opt:active { transform: translateY(1px); }
.fo-opt.is-mine { opacity: 0.5; cursor: default; }
.fo-tag { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 0.68rem; letter-spacing: 0.05em; color: #8a8593; text-transform: uppercase; }
.fo-reveals { display: flex; flex-direction: column; gap: 8px; }
.fo-rev { background: #16141b; border: 1px solid #2a2730; border-radius: 12px; padding: 12px 14px; }
.fo-rev.truth { border-color: #1FD8E0; background: #0f1a1c; }
.fo-rev.chain { border-color: #FF4D9D; background: #1c0f17; }
.fo-revtop { display: flex; align-items: center; gap: 8px; }
.fo-revtext { font-weight: 700; font-size: 1.05rem; flex: 1; }
.fo-who { font-size: 0.85rem; color: #9b96a3; }
.fo-voters { font-size: 0.8rem; color: #b9b4c0; margin-top: 2px; }
.fo-voters.dim, .dim { color: #6c6772; }
.fo-chainbadge { font-size: 0.7rem; font-weight: 800; color: #fff; background: #FF4D9D; border-radius: 999px; padding: 3px 9px; }
.fo-pts { font-weight: 800; color: #FFD23F; }
.fo-standings { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.fo-standings.final { width: 100%; }
.fo-rank { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: #16141b; }
.fo-rank.me { background: #221a2b; border: 1px solid #A24BE0; }
.fo-medal { width: 1.6em; text-align: center; }
.fo-rav { display: inline-flex; flex: 0 0 auto; }
/* winner spotlight at the final results — the icon + gear they actually built */
.fo-champ-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.fo-champ-av { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fo-champ-ttl { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; }
.fo-champ-ttl.t-common { color: #cfcad6; }
.fo-champ-ttl.t-special { color: #FF4D9D; }
.fo-champ-ttl.t-epic { color: #FF6A2B; }
.fo-champ-ttl.t-legendary { color: #FFD23F; }
.fo-rname { flex: 1; font-weight: 600; }
.fo-delta { color: #7CFF9B; font-weight: 700; font-size: 0.85rem; }
.fo-rscore { font-weight: 800; color: #FFD23F; }
.fo-chainflash { text-align: center; font-size: 1.35rem; font-weight: 900; color: #FF4D9D; text-shadow: 0 0 14px rgba(255,77,157,0.6); animation: foPulse 1.4s ease; }
@keyframes foPulse { 0% { transform: scale(0.7); opacity: 0; } 30% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
/* Hearts Reverse cascade + Rummy Chain-Meld chain flashes (inline, above the play area) */
.ht-flash { text-align: center; font-size: 1.3rem; font-weight: 900; color: #FF6A2B; text-shadow: 0 0 14px rgba(255,106,43,0.6); margin: 2px 0; animation: foPulse 1.3s ease; }
.rm-flash { text-align: center; font-size: 1.2rem; font-weight: 900; color: #FFD23F; text-shadow: 0 0 14px rgba(255,210,63,0.6); margin: 2px 0; animation: foPulse 1.3s ease; }
.rm-chaintag { color: #FFD23F; font-weight: 900; }
/* Dots & Boxes board */
.db { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.db-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.db-canvas { width: 100%; max-width: min(420px, 60vh); aspect-ratio: 1 / 1; display: block; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); border-radius: 14px; touch-action: manipulation; cursor: pointer; }
.db-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.6rem; font-weight: 900; color: #FFD23F; text-shadow: 0 0 16px rgba(255, 210, 63, 0.7); pointer-events: none; }
.db-flash.go { animation: fkPop 0.4s ease; }
/* Nim board */
.nim { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; min-height: 0; }
.nim-wrap { position: relative; width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.nim-board { display: flex; flex-direction: column; gap: 16px; padding: 10px; }
.nim-board.locked { pointer-events: none; }
.nim-heap { display: flex; gap: 9px; align-items: center; min-height: 34px; flex-wrap: wrap; justify-content: center; }
.nim-heap.empty { min-height: 18px; }
.nim-empty { font-size: 12px; letter-spacing: 1px; opacity: 0.4; text-transform: uppercase; }
.nim-token { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); padding: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #d6fbfd, #1FD8E0); box-shadow: 0 2px 4px rgba(0,0,0,0.4); transition: transform .08s, background .08s, box-shadow .08s; }
.nim-heap .nim-token:hover, .nim-heap .nim-token:hover ~ .nim-token { background: radial-gradient(circle at 35% 30%, #ffe1b0, #FF6A2B); transform: translateY(-3px); box-shadow: 0 0 10px rgba(255,106,43,0.6); }
.fo-done { text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; padding-top: 10px; }
.fo-crown { font-size: 3rem; animation: foPulse 1s ease; }
.fo-winner { font-size: 1.7rem; font-weight: 900; color: #FFD23F; }

/* ---- Overhead (party, key headsup) — reuses the .fo-* vocabulary; .hu-* is the forehead/remote layer */
.hu-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hu-deck { background: #16141b; border: 1px solid #2a2730; border-radius: 14px; padding: 14px 10px; color: #eee; font-weight: 700; font-size: 0.95rem; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.hu-deck:active { border-color: #FFA63F; }
.hu-deck-ic { font-size: 1.6rem; }
.hu-deck-group { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 2px 0; color: #8a8594; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hu-deck-group::before, .hu-deck-group::after { content: ''; flex: 1; height: 1px; background: #2a2730; }
.hu-count { display: flex; align-items: center; justify-content: center; min-height: 40vh; }
.hu-count span { font-size: 6rem; font-weight: 900; color: #FFA63F; animation: hu-pop 1s infinite; }
@keyframes hu-pop { 0% { transform: scale(0.6); opacity: 0.4; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.hu-stage { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.hu-word { font-size: clamp(2.2rem, 11vw, 4.2rem); font-weight: 900; text-align: center; line-height: 1.1; padding: 8vh 6px; word-break: break-word; }
.hu-stage.hold .hu-word { padding: 14vh 6px; }
.hu-word.small { font-size: clamp(1.5rem, 7vw, 2.4rem); padding: 14px 6px 0; }
.hu-fact { font-size: 0.95rem; color: #bbb; text-align: center; background: #16141b; border: 1px solid #2a2730; border-radius: 12px; padding: 10px 12px; }
.hu-notalk { font-weight: 800; color: #FFD23F; text-align: center; letter-spacing: 0.04em; }
.hu-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.hu-btn { border: none; border-radius: 16px; padding: 26px 10px; font-size: 1.25rem; font-weight: 900; cursor: pointer; color: #101010; }
.hu-btn.got { background: #46E08A; }
.hu-btn.pass, .hu-btn.skip { background: #FF6E6E; }
.hu-btn:active { transform: scale(0.97); }
.hu-meta { display: flex; gap: 18px; align-items: baseline; font-weight: 800; }
.hu-score { color: #46E08A; font-size: 1.5rem; }
.hu-clock { color: #FFA63F; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.hu-clock.low { color: #FF6E6E; animation: hu-pop 1s infinite; }
.hu-flame { color: #FFD23F; }
.hu-words { display: flex; flex-direction: column; gap: 6px; }
.hu-wrow { background: #16141b; border: 1px solid #2a2730; border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.hu-wrow.got { border-color: #2c5a40; }
.hu-wrow.pass { color: #999; }
.hu-ready { background: #FFA63F; }
/* role views (set-the-phone-down) */
.hu-fact.lead { font-size: clamp(1.25rem, 5.2vw, 1.9rem); line-height: 1.4; font-weight: 800; color: #fff; padding: 18px 16px; }   /* the read-aloud clue is the hero now */
.hu-answer { font-size: 0.95rem; color: #8a8593; letter-spacing: 0.02em; }
.hu-answer b { color: #FFD23F; font-weight: 800; }
.hu-stage.guesser { gap: 18px; padding: 6vh 6px 0; }
.hu-cat { font-size: clamp(1.6rem, 8vw, 2.6rem); font-weight: 900; color: #FFA63F; text-align: center; letter-spacing: 0.01em; }
.hu-guess-call { color: #9b96a3; font-weight: 700; }
.hu-score.big { font-size: 2.4rem; }
.hu-wait-tag { color: #9b96a3; font-weight: 700; font-size: 0.95rem; }
/* Tier 1: multiplier, chaos, boss */
.hu-mult { color: #FFD23F; font-size: 1.5rem; font-weight: 900; text-shadow: 0 0 12px rgba(255,210,63,0.5); }
.hu-chaos { background: linear-gradient(90deg,#7b2ff7,#f72f8e); color: #fff; font-weight: 900; text-align: center;
  border-radius: 12px; padding: 10px 12px; letter-spacing: 0.02em; box-shadow: 0 0 18px rgba(247,47,142,0.35); animation: hu-pop 1.2s infinite; }
.hu-chaos b { color: #FFD23F; }
.hu-boss-intro { font-size: clamp(1.5rem, 7vw, 2.2rem); font-weight: 900; text-align: center; letter-spacing: 0.03em;
  color: #fff; background: linear-gradient(90deg,#b3001b,#ff5e3a); border-radius: 14px; padding: 16px 12px; box-shadow: 0 0 22px rgba(255,94,58,0.4); }
.hu-stage.boss { gap: 14px; }
.hu-boss-head { display: flex; justify-content: space-between; align-items: center; width: 100%;
  font-weight: 900; color: #ff5e3a; letter-spacing: 0.02em; }
.hu-boss-score { color: #46E08A; font-size: 1.3rem; }
.hu-clock.boss { color: #ff5e3a; font-size: 2rem; }
/* boss = multiple-choice trivia with a hint ladder */
.hu-hints { display: flex; flex-direction: column; gap: 8px; width: 100%; min-height: 96px; }
.hu-hint { background: #16141b; border: 1px solid #2a2730; border-left: 3px solid #ff5e3a; border-radius: 10px;
  padding: 10px 12px; font-weight: 700; color: #eee; }
.hu-hint.fresh { animation: hu-pop 0.5s ease; border-left-color: #FFD23F; }
.hu-choices { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.hu-choices.reveal { margin-bottom: 4px; }
.hu-choice { border: 1px solid #2a2730; background: #1d1a24; color: #fff; border-radius: 14px; padding: 18px 12px;
  font-size: 1.15rem; font-weight: 800; cursor: pointer; text-align: center; }
.hu-choice:active { transform: scale(0.98); }
.hu-choice.mine { border-color: #FFA63F; background: #2a2230; }
.hu-choice.dim { opacity: 0.45; }
.hu-choice.right { background: #1d4a32; border-color: #46E08A; color: #cfeede; }
.hu-choice.wrong { background: #4a1d22; border-color: #FF6E6E; color: #ffd6d6; }
.hu-verdict { text-align: center; font-weight: 900; font-size: 1.1rem; padding: 6px 0; }
.hu-verdict.good { color: #46E08A; }
.hu-verdict.bad { color: #FF8a8a; }
.hu-verdict b { color: #FFD23F; }
/* host rounds picker on the deck-vote screen */
.hu-rounds { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.hu-rounds-lbl { color: #9b96a3; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em; }
.hu-rbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #2a2730; background: #16141b; color: #eee; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.hu-rbtn.on { background: #FFA63F; color: #101010; border-color: #FFA63F; }
.hu-rounds-note { text-align: center; color: #9b96a3; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }

/* ---------- Parlay (Party shelf — Liar's Dice) ---------- */
.parlay { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; padding-bottom: 24px; position: relative; }
.pl-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pl-chip { font-size: 0.86rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #16141b; border: 1px solid #2a2730; border-left: 3px solid var(--pc, #888); }
.pl-chip.turn { background: #221a2b; border-color: #A24BE0; box-shadow: 0 0 10px rgba(162,75,224,0.4); }
.pl-chip.out { opacity: 0.45; text-decoration: line-through; }
.pl-chip b { font-weight: 700; letter-spacing: -1px; }
.pl-total { font-size: 0.8rem; color: #8a8593; align-self: center; padding: 5px 8px; }
.pl-bid { text-align: center; background: #16141b; border: 1px solid #2a2730; border-radius: 14px; padding: 14px; min-height: 30px; }
.pl-bidlabel { color: #9b96a3; font-size: 0.95rem; }
.pl-bidval { font-size: 1.5rem; font-weight: 800; color: #FFD23F; }
.pl-bigdie { font-size: 1.5em; line-height: 1; vertical-align: -0.12em; }
.pl-cup { text-align: center; }
.pl-cuplabel { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #6c6772; margin-bottom: 2px; }
.pl-dice { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pl-die { font-size: 3rem; line-height: 1; color: #1FD8E0; text-shadow: 0 0 12px rgba(31,216,224,0.45); }
.pl-knocked { color: #FF6A2B; font-weight: 700; }
.pl-actions { display: flex; justify-content: center; }
.pl-builder { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.pl-qty { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 800; }
.pl-step { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #3a3640; background: #16141b; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.pl-step:active { transform: translateY(1px); }
.pl-qn { min-width: 1.3em; text-align: center; color: #FFD23F; }
.pl-qx { color: #6c6772; }
.pl-faces { display: flex; gap: 6px; }
.pl-face { width: 48px; height: 48px; border-radius: 12px; border: 1px solid #3a3640; background: #0f0e12; color: #cfcad6; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.pl-face.sel { border-color: #1FD8E0; color: #1FD8E0; background: #0f1a1c; box-shadow: 0 0 10px rgba(31,216,224,0.4); }
.pl-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pl-bidbtn { font-size: 1.05rem; font-weight: 700; padding: 13px 20px; border: none; border-radius: 13px; background: linear-gradient(135deg, #1FD8E0, #A24BE0); color: #06121a; cursor: pointer; }
.pl-bidbtn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }
.pl-liar { font-size: 1.05rem; font-weight: 800; padding: 13px 20px; border: none; border-radius: 13px; background: linear-gradient(135deg, #FF4D9D, #FF6A2B); color: #fff; cursor: pointer; }
.pl-liar:active, .pl-bidbtn:active { transform: translateY(1px); }
.pl-warn { font-size: 0.82rem; color: #FF6A2B; }
/* reveal overlay — the dramatic cup-lift */
.pl-reveal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,7,10,0.92); border-radius: 16px; z-index: 30; padding: 16px; animation: plFade 0.25s ease; }
@keyframes plFade { from { opacity: 0; } to { opacity: 1; } }
.pl-revcard { text-align: center; display: flex; flex-direction: column; gap: 10px; max-width: 420px; width: 100%; }
.pl-revh { font-size: 1.15rem; font-weight: 700; }
.pl-revbid { color: #FFD23F; font-size: 1.1rem; }
.pl-revcups { display: flex; flex-direction: column; gap: 6px; }
.pl-revrow { display: flex; align-items: center; gap: 10px; background: #16141b; border-radius: 10px; padding: 6px 12px; }
.pl-revname { flex: 0 0 5.5em; text-align: left; font-weight: 600; font-size: 0.9rem; color: #b9b4c0; }
.pl-revdice { font-size: 1.8rem; line-height: 1; letter-spacing: 2px; color: #6c6772; }
.pl-revdice .hit { color: #1FD8E0; text-shadow: 0 0 10px rgba(31,216,224,0.6); }
.pl-revres { font-size: 1.1rem; font-weight: 700; padding: 10px; border-radius: 12px; }
.pl-revres.lie { background: #1c0f17; border: 1px solid #FF4D9D; color: #FF89C0; }
.pl-revres.true { background: #0f1a1c; border: 1px solid #1FD8E0; color: #7FE9EE; }
.pl-revtap { font-size: 0.75rem; color: #6c6772; }

/* ---------- Farkle (Dice shelf — push your luck) ---------- */
.farkle { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; padding-bottom: 24px; position: relative; }
.fk-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fk-chip { font-size: 0.9rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: #16141b; border: 1px solid #2a2730; border-left: 3px solid var(--pc, #888); }
.fk-chip.turn { background: #221a2b; border-color: #A24BE0; box-shadow: 0 0 10px rgba(162,75,224,0.4); }
.fk-chip b { color: #FFD23F; }
.fk-target { font-size: 0.8rem; color: #8a8593; align-self: center; padding: 5px 6px; }
.fk-turn { display: flex; justify-content: space-between; align-items: center; background: #16141b; border: 1px solid #2a2730; border-radius: 12px; padding: 10px 16px; }
.fk-stash { font-size: 1.05rem; } .fk-stash b { color: #FF6A2B; font-size: 1.4rem; }
.fk-rem { font-size: 0.85rem; color: #9b96a3; }
.fk-dice { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 64px; align-items: center; }
.fk-die { font-size: 3.4rem; line-height: 1; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 14px; border: 2px solid #2a2730; background: #0f0e12; color: #cfcad6; cursor: pointer; padding: 0; }
.fk-die.sel { border-color: #FFD23F; color: #FFD23F; background: #1c1808; box-shadow: 0 0 14px rgba(255,210,63,0.5); transform: translateY(-4px); }
.fk-die:disabled { cursor: default; }
.fk-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fk-btn { font-size: 1.05rem; font-weight: 700; padding: 14px 20px; border: none; border-radius: 13px; cursor: pointer; color: #06121a; }
.fk-btn:active { transform: translateY(1px); }
.fk-btn.go { background: linear-gradient(135deg, #1FD8E0, #7CFF9B); }
.fk-btn.bank { background: linear-gradient(135deg, #FFD23F, #FF6A2B); }
.fk-btn.alt { background: #2a2730; color: #cfcad6; }
.fk-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.fk-flash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; z-index: 30; font-size: 2.2rem; font-weight: 900; text-align: center; animation: fkPop 0.3s ease; }
.fk-flash.hot { background: rgba(28,8,2,0.92); color: #FF6A2B; text-shadow: 0 0 18px rgba(255,106,43,0.7); }
.fk-flash.farkle { background: rgba(8,7,10,0.93); color: #FF4D9D; text-shadow: 0 0 16px rgba(255,77,157,0.6); }
.fk-flash.bank { background: rgba(4,14,10,0.92); color: #7CFF9B; text-shadow: 0 0 16px rgba(124,255,155,0.5); }
.fk-flash.streak { background: rgba(20,14,2,0.93); color: #FFD23F; text-shadow: 0 0 18px rgba(255,210,63,0.6); }
.fk-sub { font-size: 1rem; font-weight: 600; color: #cfcad6; }
.fk-streak { color: #FFD23F; font-weight: 800; font-size: 0.78rem; margin-left: 5px; }
@keyframes fkPop { 0% { transform: scale(0.6); opacity: 0; } 40% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Yahtzee (Dice shelf — scorecard) ---------- */
.yahtzee { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; padding-bottom: 24px; position: relative; }
.yz-roll { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.yz-dice { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.yz-die { font-size: 3rem; line-height: 1; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 13px; border: 2px solid #2a2730; background: #0f0e12; color: #cfcad6; cursor: pointer; padding: 0; }
.yz-die.held { border-color: #1FD8E0; color: #1FD8E0; background: #0f1a1c; box-shadow: 0 0 12px rgba(31,216,224,0.45); }
.yz-die:disabled { cursor: default; opacity: 0.9; }
.yz-hint { font-size: 0.78rem; color: #6c6772; }
.yz-cardwrap { overflow-x: auto; }
.yz-card { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.yz-card th, .yz-card td { border: 1px solid #221f28; padding: 7px 8px; text-align: center; }
.yz-card thead th { color: #cfcad6; font-size: 0.85rem; border-bottom: 2px solid #2a2730; }
.yz-card thead th.turn { color: #fff; border-bottom-color: var(--pc); box-shadow: inset 0 -3px 0 var(--pc); }
.yz-card th.cat { text-align: left; color: #b9b4c0; font-weight: 600; white-space: nowrap; }
.yz-card td.filled { color: #fff; font-weight: 700; background: #16141b; }
.yz-card td.empty { color: #3a3640; }
.yz-card td.open { color: #FFD23F; font-weight: 700; cursor: pointer; background: #1c1808; border-color: #FFD23F; }
.yz-card td.open:active { transform: scale(0.96); }
.yz-card td.open.hot { color: #FF8A4B; background: #2a1408; border-color: #FF6A2B; box-shadow: inset 0 0 0 2px rgba(255,106,43,0.55); }
.yz-card th.cat.hot { color: #FF8A4B; }
.yz-card tr.uplast td, .yz-card tr.uplast th { border-bottom: 2px solid #2a2730; }
.yz-card tr.sub th, .yz-card tr.sub td { color: #9b96a3; font-size: 0.82rem; background: #100f14; }
.yz-card tr.total th, .yz-card tr.total td { color: #FFD23F; font-weight: 800; font-size: 1.05rem; background: #16141b; border-top: 2px solid #2a2730; }
.yz-flash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 16px; z-index: 30; font-size: 1.9rem; font-weight: 900; text-align: center; padding: 16px; animation: fkPop 0.3s ease; }
.yz-flash.yz { background: rgba(15,8,28,0.93); color: #C98BFF; text-shadow: 0 0 16px rgba(162,75,224,0.7); }
.yz-flash.bonus { background: rgba(15,8,28,0.95); color: #FFD23F; text-shadow: 0 0 18px rgba(255,210,63,0.7); }
.yz-sub { display: block; font-size: 1rem; color: #cfcad6; margin-top: 4px; }
.fk-mult { color: #FFD23F; font-weight: 800; font-size: 0.95rem; }
/* Parlay — Cascade mode (Spot On + read streak) */
.pl-spot { font-size: 1.05rem; font-weight: 800; padding: 13px 18px; border: none; border-radius: 13px; background: linear-gradient(135deg, #FFD23F, #1FD8E0); color: #06121a; cursor: pointer; }
.pl-spot:active { transform: translateY(1px); }
.pl-spothint { font-size: 0.78rem; color: #9b96a3; text-align: center; }
.pl-streak { color: #FF6A2B; font-weight: 800; font-size: 0.82rem; }
.pl-revstreak { font-size: 1.1rem; font-weight: 800; color: #FF6A2B; text-shadow: 0 0 12px rgba(255,106,43,0.6); }
/* Crazy 8s — +2/+4 stacking */
.c8-stack { color: #FF6A2B; font-weight: 800; }
.mb-act.take { background: linear-gradient(135deg, #FF6A2B, #FF4D9D); color: #fff; }

/* ---------- Avatars (emoji-in-a-ring) ---------- */
.rmv-av { position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex: 0 0 auto; box-sizing: border-box; }
.rmv-ring { width: 100%; height: 100%; border-radius: 50%; padding: 3px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.rmv-av-in { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #16141b; line-height: 1; }
.rmv-av-epic { box-shadow: 0 0 9px rgba(255,77,157,0.5); }
.rmv-av-legendary { box-shadow: 0 0 12px rgba(255,210,63,0.65); }
.pf-avatar { position: relative; border: none; background: none; padding: 0; cursor: pointer; flex: 0 0 auto; }
.pf-av-lvl { position: absolute; bottom: -2px; right: -2px; background: #A24BE0; color: #fff; font-size: 0.7rem; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #0C0B0E; }
.pf-av-edit { position: absolute; top: -2px; right: -2px; background: #16141b; border: 1px solid #3a3640; border-radius: 50%; width: 18px; height: 18px; font-size: 0.62rem; display: flex; align-items: center; justify-content: center; font-style: normal; }
.pf-person { display: flex; align-items: center; gap: 10px; }
.pf-pinfo { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
.pf-pago { color: #6c6772; }
.pp-av { display: inline-flex; align-items: center; }
.pl .rmv-av { margin-right: 6px; }
/* avatar picker */
.av-modal { /* layout now owned by .rmv-ov[data-mode=fixed]; style hook only */ }
.av-card { padding: 16px 16px 12px; max-width: 420px; width: 100%; max-height: 84vh; }   /* panel skin from the shared rules above; capped (with headroom) so the grid scrolls under the pinned tabs AND the modal itself never needs a second scrollbar */
.av-card > .av-tabs { flex: 0 0 auto; }                 /* pinned header — Avatar / Wreath / Title + close stay put */
.av-modal .rmv-ov-close { display: none; }              /* the floating ✕ got lost on the backdrop — use the in-header close instead */
.av-close { flex: 0 0 auto; width: 40px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text); border-radius: 10px; font-size: 0.95rem; line-height: 1; cursor: pointer; }
.av-close:hover { background: rgba(255,255,255,0.12); }
.av-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* thin scrollbars across overlay scroll regions (was a chunky default) */
.av-scroll, .rmv-ov-card { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.28) transparent; }
.av-scroll::-webkit-scrollbar, .rmv-ov-card::-webkit-scrollbar { width: 6px; height: 6px; }
.av-scroll::-webkit-scrollbar-thumb, .rmv-ov-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.24); border-radius: 999px; }
.av-scroll::-webkit-scrollbar-track, .rmv-ov-card::-webkit-scrollbar-track { background: transparent; }
.av-h { font-size: 1.2rem; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.av-h span { color: #1FD8E0; font-size: 0.9rem; }
.av-sub { color: #9b96a3; font-size: 0.82rem; margin: 4px 0 14px; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.av-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #16141b; border: 1px solid #2a2730; border-radius: 14px; padding: 10px 6px; cursor: pointer; color: #cfcad6; }
.av-pick.cur { border-color: #1FD8E0; background: #0f1a1c; }
.av-pick.locked { opacity: 0.5; cursor: not-allowed; }
.av-lbl { font-size: 0.66rem; text-align: center; line-height: 1.2; color: #9b96a3; }
.av-pick.cur .av-lbl { color: #1FD8E0; font-weight: 700; }
/* composable-cosmetic ("wreath explosion") picker: a per-slot grid + a live preview */
.cos-preview { display: flex; justify-content: center; margin: 8px 0 16px; }
.cos-slot { margin-bottom: 16px; }
.cos-slot-h { font-size: 0.76rem; font-weight: 800; color: #9b96a3; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }
.cos-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.cos-gly { font-size: 26px; line-height: 1; height: 30px; display: flex; align-items: center; justify-content: center; }
.cos-none { color: #6b6673; }
.cos-ring { width: 26px; height: 26px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 3px #16141b; }
/* titles: a text flair under the name + its picker grid */
.pf-title { display: inline-block; margin: 1px 0 2px; background: none; border: none; padding: 0; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; cursor: pointer; }
.pf-title.t-common { color: #cfcad6; }
.pf-title.t-special { color: #FF4D9D; }
.pf-title.t-epic { color: #FF6A2B; }
.pf-title.t-legendary { color: #FFD23F; }
.pf-title-add { color: #6b6673; font-weight: 600; font-size: 0.74rem; }
/* player stat-card: their avatar (with gear) + worn title */
.pm-av { position: relative; flex: 0 0 auto; }
.pm-av-lvl { position: absolute; bottom: -2px; right: -2px; background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 900; font-size: 0.6rem; min-width: 1.5em; height: 1.5em; padding: 0 0.3em; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 999px; box-shadow: 0 0 0 0.12em #16141b; }
.pm-title { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; margin: 1px 0 3px; }
.pm-title.t-common { color: #cfcad6; }
.pm-title.t-special { color: #FF4D9D; }
.pm-title.t-epic { color: #FF6A2B; }
.pm-title.t-legendary { color: #FFD23F; }
.ttl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.ttl-pick { display: flex; flex-direction: column; align-items: center; gap: 3px; background: #16141b; border: 1px solid #2a2730; border-radius: 12px; padding: 12px 8px; cursor: pointer; color: #cfcad6; }
.ttl-pick.cur { border-color: #1FD8E0; background: #0f1a1c; }
.ttl-pick.locked { opacity: 0.5; cursor: not-allowed; }
.ttl-txt { font-weight: 800; font-size: 0.86rem; }
.ttl-sub { font-size: 0.64rem; color: #9b96a3; }
.ttl-pick.t-special .ttl-txt { color: #FF4D9D; }
.ttl-pick.t-epic .ttl-txt { color: #FF6A2B; }
.ttl-pick.t-legendary .ttl-txt { color: #FFD23F; }

/* ===================== TOURNEY ===================== */
/* menu entry banner */
.tourney-entry {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; margin: 0 auto; box-sizing: border-box;
  background: linear-gradient(120deg, rgba(255,210,63,0.14), rgba(162,75,224,0.16));
  border: 1px solid rgba(255,210,63,0.4); border-radius: 14px;
  padding: 12px 16px; cursor: pointer; color: var(--text); text-align: left;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tourney-entry:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(255,210,63,0.18); }
.tourney-entry .te-ic { font-size: 1.7rem; filter: drop-shadow(0 0 8px rgba(255,210,63,0.5)); }
.tourney-entry .te-txt { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.tourney-entry .te-txt b { font-size: 1.02rem; letter-spacing: 0.4px; color: var(--gold); }
.tourney-entry .te-txt span { font-size: 0.74rem; color: #b7b1c0; }
.tourney-entry .te-go { font-size: 1.3rem; color: var(--gold); opacity: 0.8; }

/* the tourney screen is a single scrollable column */
.tourney { width: 100%; max-width: 420px; margin: 0 auto; }
#tourney-screen { align-items: center; }
.trn-h { margin: 0; font-size: 1.5rem; letter-spacing: 0.5px; }
.trn-setup { display: flex; flex-direction: column; gap: 16px; }
.trn-hero { text-align: center; }
.trn-trophy { font-size: 2.6rem; display: block; filter: drop-shadow(0 0 14px rgba(255,210,63,0.5)); }
.trn-sub { color: #b7b1c0; font-size: 0.82rem; margin: 6px 0 0; }
.trn-field { display: flex; flex-direction: column; gap: 7px; }
.trn-field > label { font-size: 0.78rem; font-weight: 700; color: #d7d2de; letter-spacing: 0.3px; }
.trn-field .segmented { width: 100%; }
.trn-field .segmented button { flex: 1; }
.trn-poolcount { color: var(--gold); font-weight: 700; }
.trn-poolnote { font-size: 0.72rem; color: #948f9d; margin: 0; }
.trn-names { display: flex; flex-direction: column; gap: 8px; }
.trn-namerow { display: flex; align-items: center; gap: 8px; }
.trn-pnum { font-size: 0.72rem; font-weight: 800; color: var(--teal); width: 26px; }
.trn-name { flex: 1; background: #16141b; border: 1px solid #2a2730; border-radius: 9px; padding: 9px 11px; color: var(--text); font-size: 0.9rem; }
.trn-name[readonly] { opacity: 0.75; }
.trn-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.trn-game {
  display: flex; align-items: center; gap: 6px; background: #141219; border: 1px solid #2a2730;
  border-radius: 11px; padding: 8px 9px; cursor: pointer; color: #8d8896; opacity: 0.5; transition: all 0.12s;
}
.trn-game.on { opacity: 1; color: var(--text); border-color: rgba(31,216,224,0.5); background: #0f1a1c; }
.trn-gic { font-size: 1.1rem; }
.trn-glbl { font-size: 0.74rem; line-height: 1.1; }
.trn-start, .trn-go, .trn-again {
  background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 800;
  letter-spacing: 0.6px; border: 0; border-radius: 13px; padding: 14px; font-size: 1.05rem; cursor: pointer;
}
.trn-start:disabled { opacity: 0.4; cursor: not-allowed; }

/* ready (pass-the-phone) */
.trn-ready { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding-top: 8px; }
.trn-roundtag { font-size: 0.82rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); }
.trn-roundtag span { color: #8d8896; font-weight: 600; }
.trn-gametile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 26px; background: linear-gradient(160deg, rgba(162,75,224,0.16), rgba(31,216,224,0.08)); border: 1px solid var(--line); border-radius: 18px; }
.trn-gametile .trn-bic { font-size: 3rem; }
.trn-gametile .trn-bname { font-size: 1.25rem; font-weight: 800; }
.trn-upnext { font-size: 1rem; color: #d7d2de; }
.trn-upnext b { color: var(--gold); }
.trn-avatar { font-size: 1.2rem; }
.trn-go { width: 100%; max-width: 280px; }
.trn-quit { background: none; border: 0; color: #6f6a78; font-size: 0.78rem; cursor: pointer; text-decoration: underline; margin-top: 4px; }

/* mini standings (between rounds) */
.trn-mini { width: 100%; max-width: 300px; }
.trn-stand { display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.trn-srow { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; padding: 3px 0; }
.trn-srow.me .trn-sname { color: var(--teal); font-weight: 700; }
.trn-spos { width: 18px; color: #8d8896; font-weight: 700; }
.trn-sname { flex: 1; text-align: left; }
.trn-spts { font-weight: 800; color: var(--gold); }

/* over-game result bar */
#trn-bar {
  position: fixed; left: 50%; bottom: max(env(safe-area-inset-bottom), 14px); transform: translateX(-50%);
  z-index: 2700; width: min(440px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px;
  background: rgba(20,18,25,0.97); border: 1px solid rgba(255,210,63,0.4); border-radius: 14px;
  padding: 10px 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); backdrop-filter: blur(6px);
}
#trn-bar[hidden] { display: none; }
.trn-barinfo { display: flex; flex-direction: column; flex: 1; line-height: 1.25; min-width: 0; }
.trn-barwho { font-size: 0.74rem; color: #b7b1c0; }
.trn-barres { font-size: 0.95rem; font-weight: 700; }
.trn-barres.win { color: var(--gold); }
.trn-barres.draw { color: var(--teal); }
.trn-barres.played { color: #d7d2de; }
.trn-barres b { color: #fff; }
.trn-bonus { font-size: 0.72rem; color: var(--pink); font-weight: 600; }
.trn-next { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 800; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; white-space: nowrap; }

/* champion */
.trn-champ { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 6px; }
.trn-crown { font-size: 3.4rem; filter: drop-shadow(0 0 18px rgba(255,210,63,0.6)); animation: trn-pop 0.5s ease; }
@keyframes trn-pop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
.trn-headline { font-size: 1.05rem; color: #d7d2de; margin: 0; }
.trn-headline b { color: var(--gold); }
.trn-pb { color: var(--pink); font-weight: 700; }
.trn-pbprev { color: #8d8896; font-size: 0.85rem; }
.trn-podium { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
.trn-prow { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.trn-prow.first { background: linear-gradient(120deg, rgba(255,210,63,0.18), rgba(255,106,43,0.08)); border-color: rgba(255,210,63,0.45); }
.trn-prow.me .trn-pname { color: var(--teal); }
.trn-pmedal { font-size: 1.2rem; width: 28px; }
.trn-pav { display: inline-flex; flex: 0 0 auto; }
.trn-pname { flex: 1; text-align: left; font-weight: 700; }
.trn-champ-av { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trn-champ-ttl { font-size: 0.86rem; font-weight: 800; letter-spacing: 0.03em; }
.trn-champ-ttl.t-common { color: #cfcad6; }
.trn-champ-ttl.t-special { color: #FF4D9D; }
.trn-champ-ttl.t-epic { color: #FF6A2B; }
.trn-champ-ttl.t-legendary { color: #FFD23F; }
.trn-ppts { font-weight: 800; color: var(--gold); }
.trn-ppts small { color: #8d8896; font-weight: 600; }
.trn-champ-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 280px; }
.trn-tomenu { background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px; font-size: 0.9rem; cursor: pointer; }

/* ===== mobile menu density: get game cards above the fold on a phone ===== */
@media (max-width: 480px) {
  .menu { gap: 10px; }
  .tag { letter-spacing: 2px; font-size: 11px; margin-top: 2px; }          /* one line, not two */
  .tourney-entry { padding: 10px 14px; }
  .tourney-entry .te-txt span { display: none; }                          /* drop the subtitle → one-line banner */
  .tourney-entry .te-txt b { font-size: 1rem; }
  /* phones have no vertical room to spare → one horizontal scroll strip
     (swipe sideways; the partial last chip is the affordance) */
  .filter-chips {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
}

/* ===================== PRESTIGE ===================== */
/* menu pill marker */
.pp-pr { font-size: 11px; font-weight: 800; color: var(--gold); margin-left: 5px; text-shadow: 0 0 8px rgba(255,210,63,0.5); }
/* profile head line */
.pf-prestige { margin-top: 4px; font-size: 0.78rem; font-weight: 700; color: var(--gold); letter-spacing: 0.3px; }
/* prestige button on the profile */
.pf-prestige-btn {
  width: 100%; border: 1px solid rgba(255,210,63,0.5); border-radius: 13px; padding: 13px;
  background: linear-gradient(120deg, rgba(255,210,63,0.16), rgba(162,75,224,0.18));
  color: var(--gold); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.4px; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.pf-prestige-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(255,210,63,0.2); }
/* not-yet-eligible: an informational "tap to learn" affordance, not a gold CTA */
.pf-prestige-btn.locked { background: rgba(255,255,255,0.04); border-color: var(--line); color: var(--text); font-weight: 700; opacity: 0.82; }
.pf-prestige-btn.locked:hover { transform: none; box-shadow: none; opacity: 1; }

/* mastery stars on a badge card (corner chip) */
.pf-badge { position: relative; }
.pf-bstar { position: absolute; top: 3px; right: 3px; font-size: 12px; line-height: 1; letter-spacing: -1px; padding: 2px 4px; border-radius: 7px; background: rgba(0,0,0,0.6); font-weight: 800; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.pf-bstar.m-bronze { color: #f0a058; }
.pf-bstar.m-silver { color: #e8e8f0; }
.pf-bstar.m-gold   { color: var(--gold); text-shadow: 0 0 7px rgba(255,210,63,0.7); }
.pf-bstar.m-master { background: linear-gradient(135deg, var(--gold), var(--orange)); box-shadow: 0 0 8px rgba(255,210,63,0.7); padding: 1px 3px; }
/* mastered = the badge is "full": a gold shield + a gold frame/glow on the whole card */
.pf-badge.mastered { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255,210,63,0.35); }
/* star on the unlock toast icon — makes a re-earn visibly level the badge up */
.at-ic { position: relative; }
.at-star { position: absolute; bottom: -3px; right: -7px; font-size: 11px; font-weight: 800; letter-spacing: -1px; text-shadow: 0 0 4px rgba(0,0,0,0.85); }
.at-star.m-bronze { color: #f0a058; } .at-star.m-silver { color: #e8e8f0; }
.at-star.m-gold { color: var(--gold); } .at-star.m-master { color: #7fe9ff; }
/* badge modal mastery line */
.bm-mastery { margin: 6px 0 2px; font-size: 1.1rem; letter-spacing: 1px; }
.bm-mastery span { display: block; font-size: 0.7rem; letter-spacing: 0.3px; opacity: 0.8; margin-top: 2px; text-transform: capitalize; }
.bm-mastery.m-bronze { color: #d98a4a; } .bm-mastery.m-silver { color: #d8d8e0; }
.bm-mastery.m-gold { color: var(--gold); } .bm-mastery.m-master { color: #7fe9ff; }

/* prestige confirm modal */
.prestige-modal { /* layout now owned by .rmv-ov[data-mode=fixed]; style hook only */ }
.pm2-card { width: 100%; max-width: 360px; background: linear-gradient(180deg, #1a1622, #141019); border: 1px solid rgba(255,210,63,0.4); border-radius: 20px; padding: 22px 20px; text-align: center; box-shadow: 0 18px 60px rgba(0,0,0,0.6); }
.pm2-ic { font-size: 2.6rem; filter: drop-shadow(0 0 14px rgba(255,210,63,0.6)); }
.pm2-h { font-size: 1.4rem; font-weight: 800; margin-top: 4px; }
.pm2-sub { font-size: 0.82rem; color: #b7b1c0; margin: 6px 0 14px; }
.pm2-rows { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 16px; }
.pm2-row { display: flex; gap: 8px; align-items: baseline; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 0.82rem; }
.pm2-row span { flex: 0 0 64px; font-weight: 800; font-size: 0.74rem; }
.pm2-row b { flex: 1; font-weight: 600; color: #e7e2ee; }
.pm2-row.good span { color: #5fe39a; } .pm2-row.warn span { color: var(--orange); }
.pm2-btns { display: flex; flex-direction: column; gap: 8px; }
.pm2-go { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 800; border: 0; border-radius: 12px; padding: 13px; font-size: 1rem; cursor: pointer; }
.pm2-no { background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px; font-size: 0.88rem; cursor: pointer; }

/* prestige celebration splash */
.prestige-cel { position: fixed; inset: 0; z-index: 3100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: radial-gradient(circle at 50% 40%, rgba(162,75,224,0.35), rgba(5,4,8,0.92)); opacity: 0; transition: opacity 0.3s; cursor: pointer; }
.prestige-cel.in { opacity: 1; }
.pc-burst { font-size: 4.5rem; filter: drop-shadow(0 0 24px rgba(255,210,63,0.7)); animation: trn-pop 0.5s ease; }
.pc-h { font-size: 2rem; font-weight: 900; letter-spacing: 3px; color: var(--gold); text-shadow: 0 0 20px rgba(255,210,63,0.6); }
.pc-sub { font-size: 0.9rem; color: #e7e2ee; }
.pc-tap { font-size: 0.72rem; color: #8d8896; margin-top: 12px; }

/* ---- prestige skill tree ---- */
.pf-skilltree-btn {
  width: 100%; border: 1px solid rgba(31,216,224,0.4); border-radius: 13px; padding: 12px;
  background: linear-gradient(120deg, rgba(31,216,224,0.12), rgba(162,75,224,0.14));
  color: var(--teal); font-weight: 800; font-size: 0.9rem; cursor: pointer; transition: transform 0.12s;
}
.pf-skilltree-btn b { color: var(--gold); }
.pf-skilltree-btn.has { border-color: rgba(255,210,63,0.55); box-shadow: 0 0 0 1px rgba(255,210,63,0.25); }
.pf-skilltree-btn:hover { transform: translateY(-1px); }

.skilltree-modal { /* layout now owned by .rmv-ov[data-mode=fixed]; style hook only */ }
.st-card { width: 100%; max-width: 380px; background: linear-gradient(180deg, #161a22, #11141b); border: 1px solid rgba(31,216,224,0.35); border-radius: 20px; padding: 20px 18px; box-shadow: 0 18px 60px rgba(0,0,0,0.6); }
.st-h { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.st-pts { font-size: 0.95rem; color: var(--gold); background: rgba(255,210,63,0.12); border: 1px solid rgba(255,210,63,0.4); border-radius: 999px; padding: 3px 11px; }
.st-sub { font-size: 0.76rem; color: #9b96a3; margin: 6px 0 14px; }
.st-rows { display: flex; flex-direction: column; gap: 8px; }
.st-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.st-row.gl { border-color: rgba(31,216,224,0.35); background: rgba(31,216,224,0.06); }
.st-ic { font-size: 1.4rem; flex: 0 0 auto; }
.st-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-info b { font-size: 0.9rem; }
.st-eff { font-size: 0.72rem; color: #b7b1c0; text-transform: capitalize; }
.st-pips { display: flex; gap: 2px; margin-top: 3px; }
.st-pips i { width: 8px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.st-pips i.on { background: var(--teal); }
.st-buy { flex: 0 0 auto; background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 800; border: 0; border-radius: 10px; padding: 9px 11px; font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.st-buy.off { background: rgba(255,255,255,0.06); color: #6f6a78; cursor: not-allowed; }
.st-max { flex: 0 0 auto; font-size: 0.72rem; font-weight: 800; color: var(--gold); padding: 6px 9px; }
.st-close { margin-top: 16px; width: 100%; padding: 13px; border: none; border-radius: 13px; background: linear-gradient(135deg, #1FD8E0, #A24BE0); color: #06121a; font-weight: 800; font-size: 1rem; cursor: pointer; }

/* ---- prestige avatar cosmetics (wreath/wings/animation + prestige numeral) ---- */
.rmv-frame { overflow: visible; }
.rmv-wl, .rmv-wr, .rmv-wt, .rmv-wb, .rmv-vest { position: absolute; line-height: 1; pointer-events: none; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5)); }
/* side decos flank the lower sides (a laurel droop); right is mirrored */
.rmv-wl, .rmv-wr { font-size: 0.46em; bottom: -0.04em; }
.rmv-wl { left: -0.15em; transform: rotate(20deg); }
.rmv-wr { right: -0.15em; transform: scaleX(-1) rotate(20deg); }
/* top deco sits centred above the ring (moon, crown, halo) */
.rmv-wt { font-size: 0.5em; top: -0.42em; left: 50%; transform: translateX(-50%); }
/* bottom deco mirrors the top, centred below the ring (laurel base, embers) */
.rmv-wb { font-size: 0.46em; bottom: -0.44em; left: 50%; transform: translateX(-50%); }
/* vest sits below the ring as a small body piece (coat, gi, hi-vis) */
.rmv-vest { font-size: 0.4em; bottom: -0.2em; left: 50%; transform: translateX(-50%); z-index: 1; }
/* glyph wrapper — motion animates the character, leaving the ring + disc still */
.rmv-face { display: inline-block; line-height: 1; transform-origin: 50% 80%; will-change: transform; }
/* wings need their own orientation (the side slot's laurel droop points them backwards).
   Orientation B = mirror swapped. Static here so wings are correct even w/ reduced motion. */
.rmv-side-wing .rmv-wl { transform-origin: 50% 90%; transform: scaleX(-1) rotate(20deg); }
.rmv-side-wing .rmv-wr { transform-origin: 50% 90%; transform: rotate(20deg); }
/* prestige numeral badge (top-right) */
.rmv-pr { position: absolute; top: -0.08em; right: -0.08em; font-size: 0.32em; min-width: 1.5em; height: 1.5em; padding: 0 0.2em; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: linear-gradient(135deg, var(--gold), var(--orange)); color: #2a1500; font-weight: 900; box-shadow: 0 0 0 0.12em #16141b; }
/* animated ring (P3+): a gentle glow pulse */
/* ---- avatar motion (worn "Motion" cosmetic + auto wing-flap). All animation is
   gated behind prefers-reduced-motion; keyframes are inert until referenced. ---- */
@keyframes rmv-pulse   { 0%,100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255,210,63,0)); } 50% { filter: brightness(1.18) drop-shadow(0 0 5px rgba(255,210,63,0.6)); } }
@keyframes rmv-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes rmv-bob     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10%); } }
@keyframes rmv-alive   { 0%,100% { transform: translateY(0) scale(1) rotate(0); } 25% { transform: translateY(-8%) scale(1.05) rotate(-3deg); } 50% { transform: translateY(-3%) scale(1.08) rotate(0); } 75% { transform: translateY(-8%) scale(1.05) rotate(3deg); } }
@keyframes rmv-heart   { 0%,40%,100% { transform: scale(1); } 12% { transform: scale(1.16); } 24% { transform: scale(1); } 30% { transform: scale(1.12); } }
@keyframes rmv-flapL   { 0%,100% { transform: scaleX(-1) rotate(20deg); } 50% { transform: scaleX(-1) rotate(40deg) scaleY(0.82); } }
@keyframes rmv-flapR   { 0%,100% { transform: rotate(20deg); } 50% { transform: rotate(40deg) scaleY(0.82); } }
@media (prefers-reduced-motion: no-preference) {
  .rmv-anim-glow .rmv-ring     { animation: rmv-pulse 2.4s ease-in-out infinite; }
  .rmv-anim-breathe .rmv-face  { animation: rmv-breathe 2.8s ease-in-out infinite; }
  .rmv-anim-bob .rmv-face      { animation: rmv-bob 2.4s ease-in-out infinite; }
  .rmv-anim-alive .rmv-face    { animation: rmv-alive 3.2s ease-in-out infinite; }
  .rmv-anim-heart .rmv-face    { animation: rmv-heart 2.2s ease-in-out infinite; }
  .rmv-side-wing .rmv-wl       { animation: rmv-flapL 0.85s ease-in-out infinite; }
  .rmv-side-wing .rmv-wr       { animation: rmv-flapR 0.85s ease-in-out infinite; }
}

/* in-game sound toggle (reuses .flip-btn shape; .sound-btn gets it auto-wired + synced) */
.gh-sound { font-size: 16px; }
.gh-sound.off { opacity: 0.5; }

/* Wormz mode picker (on the start/game-over overlay) */
.wz-modes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.wz-mode { background: rgba(255,255,255,0.08); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.wz-mode.on { background: var(--purple); border-color: var(--purple); color: #fff; }

/* avatar/wreath picker tabs + room for wreath deco in the grid previews */
.av-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.av-tab { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: #cfcad6; border-radius: 10px; padding: 9px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.av-tab.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.av-grid .av-pick { overflow: visible; padding-top: 16px; }

/* ===== Spillway (water sort) ===== */
.spill { display: flex; flex-direction: column; gap: 12px; }
.spill-wrap { position: relative; }
.spill-board {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: 12px 16px; padding: 22px 8px 16px; min-height: 220px;
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(31, 216, 224, 0.12) 0%, rgba(255, 255, 255, 0.02) 55%);
}
.spill-tube {
  display: flex; flex-direction: column; gap: 3px; width: 40px; padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.16); border-top: none;
  border-radius: 4px 4px 16px 16px; cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.spill-tube .seg {
  display: block; width: 100%; height: 30px; border-radius: 4px; background: var(--c, #888);   /* explicit width vs the tube's definite 40px — flex cross-axis stretch collapses to 0 inside transform:scale on iOS<26 WebKit (colours vanished on iPadOS 18.5) */
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.28), inset 0 2px 5px rgba(255, 255, 255, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.spill-tube .seg.empty { background: rgba(255, 255, 255, 0.035); box-shadow: none; }
.spill-tube .seg.lifted { transform: translateY(-5px); filter: brightness(1.25) saturate(1.2); }
.spill-tube.sel { transform: translateY(-8px); border-color: var(--teal); box-shadow: 0 0 16px rgba(31, 216, 224, 0.55); }
.spill-tube.done { border-color: #7CFF5A; box-shadow: 0 0 14px rgba(124, 255, 90, 0.45); }
.spill-tube.hint { border-color: var(--gold, #FFD23F); box-shadow: 0 0 16px rgba(255, 210, 63, 0.6); }
.spill-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.spill-foot .ghost-btn[disabled] { opacity: 0.35; pointer-events: none; }
.db-flash.big { font-size: 2rem; color: #7CFFE0; text-shadow: 0 0 18px rgba(124, 255, 224, 0.7); }

/* Tilefall — SameGame tap-a-group clearer. Columns are bottom-packed (column-reverse)
   so the engine's index-0 cell sits at the bottom and gravity reads naturally. */
.tf { display: flex; flex-direction: column; gap: 12px; }
.tf-wrap { position: relative; }
.tf-board {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 4px; padding: 14px 8px; min-height: 380px;
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 106, 43, 0.13) 0%, rgba(255, 255, 255, 0.02) 55%);
}
.tf-col { display: flex; flex-direction: column-reverse; gap: 4px; }
.tf-cell {
  display: block; width: 36px; height: 36px; padding: 0; border: none; border-radius: 8px;
  background: var(--c, #888); cursor: pointer;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.28);
  transition: transform 0.1s ease, filter 0.1s ease, opacity 0.12s ease;
}
.tf-cell.sel { transform: scale(1.12); filter: brightness(1.35) saturate(1.25); box-shadow: 0 0 12px var(--c, #fff), inset 0 0 0 2px rgba(255, 255, 255, 0.85); z-index: 1; }
.tf-cell.hint { filter: brightness(1.2); box-shadow: 0 0 10px var(--gold, #FFD23F), inset 0 0 0 2px rgba(255, 210, 63, 0.9); }
.tf-cell.hole { background: rgba(255, 255, 255, 0.03); box-shadow: none; opacity: 0.35; cursor: default; }
.tf-cell.bomb {
  background: radial-gradient(circle at 38% 34%, #6b6b72 0 30%, #2a2a30 62%, #16161a 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 90, 90, 0.35); cursor: default;
  position: relative;
}
.tf-cell.bomb::after { content: '💣'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tf-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.tf-foot .ghost-btn[disabled] { opacity: 0.35; pointer-events: none; }
@media (max-width: 360px) { .tf-cell { width: 32px; height: 32px; } }

/* ===== Minefall (minesweeper — flood-reveal cascade) ===== */
.mf { display: flex; flex-direction: column; gap: 12px; }
.mf-wrap { position: relative; display: flex; justify-content: center; }
.mf-board {
  display: grid; grid-template-columns: repeat(var(--cols, 9), 1fr);
  gap: 3px; width: min(94vw, 420px); padding: 8px;
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 197, 61, 0.12) 0%, rgba(255, 255, 255, 0.02) 55%);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.mf-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: clamp(13px, 3.4vw, 20px); font-weight: 800; line-height: 1;
  border: none; border-radius: 5px; cursor: pointer; padding: 0; color: #fff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  transition: background 0.1s ease, transform 0.08s ease;
}
.mf-cell:active { transform: scale(0.9); }
.mf-cell.flag { background: linear-gradient(145deg, rgba(255, 197, 61, 0.3), rgba(255, 120, 40, 0.14)); }
.mf-cell.open {
  background: rgba(255, 255, 255, 0.045); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: default; animation: mfReveal 0.18s ease;
}
.mf-cell.open:active { transform: none; }
.mf-cell.mine { background: rgba(255, 90, 90, 0.22); }
.mf-cell.boom { background: rgba(255, 90, 90, 0.55); animation: mfBoom 0.4s ease; }
.mf-cell.wrongflag { background: rgba(255, 90, 90, 0.18); opacity: 0.7; text-decoration: line-through; }
.mf-cell.hint { box-shadow: 0 0 0 2px var(--gold, #FFD23F), 0 0 12px rgba(255, 210, 63, 0.6); }
.mf-cell.n1 { color: #3FA7FF; } .mf-cell.n2 { color: #7CFF5A; } .mf-cell.n3 { color: #FF5A5A; }
.mf-cell.n4 { color: #C58BFF; } .mf-cell.n5 { color: #FFD23F; } .mf-cell.n6 { color: #1FD8E0; }
.mf-cell.n7 { color: #FF8A3F; } .mf-cell.n8 { color: #E0E0E0; }
.mf-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.mf-flag.on { border-color: var(--accent, #FFC53D); background: rgba(255, 197, 61, 0.18); color: #FFE08A; }
@keyframes mfReveal { from { transform: scale(0.6); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
@keyframes mfBoom { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ===== Blockwave (8×8 block puzzle) ===== */
.bw { display: flex; flex-direction: column; gap: 12px; }
.bw-wrap { position: relative; display: flex; justify-content: center; }
.bw-board {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  width: min(92vw, 380px); aspect-ratio: 1; padding: 8px;
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(138, 108, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 55%);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.bw-cell {
  border-radius: 5px; background: rgba(255, 255, 255, 0.045);
  display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
.bw-cell.on { background: var(--c, #888); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.28), inset 0 2px 5px rgba(255, 255, 255, 0.25); }
.bw-cell.bomb { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.3); }
.bw-cell.ghost { background: rgba(138, 108, 255, 0.5); box-shadow: inset 0 0 0 2px #8A6CFF; }
.bw-cell.ghost.bad { background: rgba(255, 90, 90, 0.4); box-shadow: inset 0 0 0 2px #FF5A5A; }
.bw-cell.willclear { box-shadow: inset 0 0 0 2px #FFD23F, 0 0 10px rgba(255, 210, 63, 0.55); }

.bw-tray { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 84px; touch-action: none; }
.bw-slot {
  flex: 1; max-width: 33%; min-height: 80px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: grab;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.bw-slot.sel { border-color: #8A6CFF; box-shadow: 0 0 14px rgba(138, 108, 255, 0.5); transform: translateY(-3px); }
.bw-slot.dead { opacity: 0.4; }
.bw-slot.dragging { opacity: 0.22; }
.bw-slot.empty { opacity: 0.25; cursor: default; }

.bw-piece { display: inline-grid; gap: 3px; }
.bw-piece .pc { width: var(--bw-cell, 18px); height: var(--bw-cell, 18px); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: calc(var(--bw-cell, 18px) * 0.6); line-height: 1; }
.bw-piece .pc.on { background: var(--c, #888); box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.25); }
.bw-piece .pc.bomb { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }

.bw-drag { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 30; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); opacity: 0.92; }
.bw-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }

/* ===== Pipstorm — dice roguelite. Solid pip-faces (zero art), a charm tray, and
   the chips × mult readout that detonates link-by-link when you Play. ===== */
.ps { display: flex; flex-direction: column; gap: 10px; --ps: #9D5BFF; position: relative; }
/* the overlay now spans the whole game (not just the dice wrap) so the tall shop
   screen covers the board + footer instead of spilling past them; scroll if needed. */
.ps > .overlay { overflow-y: auto; justify-content: safe center; padding: 16px 10px; gap: 8px; border-radius: 14px; }
.ps > .overlay .over-title { font-size: 26px; }
.ps-blind {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(157, 91, 255, 0.14) 0%, rgba(255, 255, 255, 0.02) 60%);
}
.ps-blind-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; opacity: 0.9; margin-bottom: 6px; }
.ps-bar { height: 9px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ps-bar-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #9D5BFF, #FF4D9D); transition: width 0.3s ease; }
.ps-bar-fill.ps-bar-done { background: linear-gradient(90deg, #7CFF5A, #3FA7FF); }

.ps-charms { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.ps-charm-empty { font-size: 12px; opacity: 0.5; padding: 4px 2px; }
.ps-charm {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 6px;
  border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer;
}
.ps-charm-ic { font-size: 15px; }
.ps-charm.ps-r-uncommon { border-color: rgba(63, 167, 255, 0.55); }
.ps-charm.ps-r-rare { border-color: rgba(255, 77, 157, 0.6); box-shadow: 0 0 10px rgba(255, 77, 157, 0.25); }

.ps-wrap { position: relative; display: flex; flex-direction: column; gap: 12px; }
.ps-readout {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(130% 100% at 50% 0%, rgba(157, 91, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 60%);
}
.ps-cat { font-size: 15px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: 0.92; }
.ps-mathline { display: flex; align-items: baseline; gap: 8px; font-size: 30px; font-weight: 900; }
.ps-chips { color: #3FA7FF; text-shadow: 0 0 14px rgba(63, 167, 255, 0.45); }
.ps-mult { color: #FF4D9D; text-shadow: 0 0 14px rgba(255, 77, 157, 0.5); }
.ps-x, .ps-eq { opacity: 0.5; font-size: 20px; font-weight: 600; }
.ps-total { color: #FFD23F; text-shadow: 0 0 16px rgba(255, 210, 63, 0.55); }
.ps-pulse { animation: psPulse 0.34s ease; }
@keyframes psPulse { 0% { transform: scale(1); } 45% { transform: scale(1.32); } 100% { transform: scale(1); } }

.ps-dice { display: flex; justify-content: center; flex-wrap: nowrap; gap: 10px; padding: 4px 0; }
.ps-die {
  position: relative; display: grid; grid-template-columns: repeat(3, 12px); grid-template-rows: repeat(3, 12px); gap: 2px;   /* definite tracks (12·3 + 2·2 gap + 8·2 pad = 56px): 1fr collapses to 0 inside the fitter's transform:scale on iOS<26 WebKit → pips vanish on iPadOS 18.5 */
  width: 56px; height: 56px; padding: 8px; cursor: pointer;
  background: #f4f1ea; border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 12px;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.22), 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.ps-cell { display: block; width: 100%; height: 100%; border-radius: 50%; }   /* fill the definite track explicitly — don't rely on grid stretch (collapses under transform:scale on old WebKit) */
.ps-cell.on { background: #20202a; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4); }
.ps-die.kept { transform: translateY(-8px); border-color: var(--ps); box-shadow: 0 0 16px rgba(157, 91, 255, 0.6), inset 0 -4px 8px rgba(0, 0, 0, 0.22); }
.ps-die.scoring { background: #fff6dc; }
.ps-die.scoring .ps-cell.on { background: #6a3d00; }
.ps-die.hinted { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 210, 63, 0.7); }
.ps-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.ps-foot .ghost-btn[disabled], .ps-foot .newgame[disabled] { opacity: 0.35; pointer-events: none; }
.ps-foot .newgame { padding: 9px 22px; }

.ps-draft { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.ps-draft-card {
  display: flex; flex-direction: column; gap: 3px; width: 120px; padding: 10px 8px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); color: var(--text); text-align: center;
}
.ps-draft-card[disabled] { opacity: 0.4; pointer-events: none; }
.ps-draft-card.ps-r-uncommon { border-color: rgba(63, 167, 255, 0.55); }
.ps-draft-card.ps-r-rare { border-color: rgba(255, 77, 157, 0.6); box-shadow: 0 0 12px rgba(255, 77, 157, 0.25); }
.ps-draft-card:hover { border-color: var(--ps); }
.ps-draft-ic { font-size: 26px; }
.ps-draft-nm { font-size: 13px; font-weight: 800; }
.ps-draft-rar { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.55; }
.ps-draft-desc { font-size: 11px; opacity: 0.78; line-height: 1.25; }

/* ===== Pipstorm Pass 2 — the shop economy (money, buy/sell/reroll). ===== */
.ps-money { color: #FFD23F; text-shadow: 0 0 10px rgba(255, 210, 63, 0.4); }
/* legendary rarity treatment (gold glow), for the tray chips + shop/draft cards */
.ps-charm.ps-r-legendary { border-color: rgba(255, 210, 63, 0.7); box-shadow: 0 0 12px rgba(255, 210, 63, 0.35); }
.ps-draft-card.ps-r-legendary { border-color: rgba(255, 210, 63, 0.7); box-shadow: 0 0 14px rgba(255, 210, 63, 0.3); }
.ps-draft-card { position: relative; }
.ps-price {
  position: absolute; top: -8px; right: -6px; font-size: 12px; font-weight: 900;
  color: #20202a; background: #FFD23F; padding: 1px 7px; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.ps-reward-line { font-size: 11px; opacity: 0.7; margin: 2px 0 6px; text-align: center; }
.ps-shoprow { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.ps-shoprow .ghost-btn[disabled], .ps-shoprow .newgame[disabled] { opacity: 0.35; pointer-events: none; }
.ps-sellrow { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 12px; }
.ps-sell-lbl { font-size: 11px; opacity: 0.5; }
.ps-sell {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; font-size: 12px; font-weight: 700;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer;
}
.ps-sell:hover { border-color: var(--gold); }
.ps-sell s { color: var(--gold); text-decoration: none; }

/* ===== Pipstorm DUNGEON (experimental Phase-A sandbox — dungeon.html only). The
   3×3 room map + the zoom/wipe transitions. Combat reuses the .ps* styles above. ===== */
.pd { display: flex; flex-direction: column; gap: 12px; --pd: #9D5BFF; --ps: #9D5BFF; --mint: #7CFFE0; }
.pd.pd-shake, .pd-shake { animation: pdShake 0.3s ease; }
@keyframes pdShake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 1px); } }

/* the fight CIRCUIT — gear as a firing machine in the former dead space */
.pd-circuit { position: relative; height: 232px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 0%, rgba(157,91,255,.07), rgba(0,0,0,.22)); }
.pd-csvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pd-cwire { stroke: rgba(255,255,255,.10); stroke-width: 2; }
.pd-clive { stroke: var(--mint); stroke-width: 3; opacity: 0; filter: drop-shadow(0 0 7px var(--mint)); transition: opacity .12s; }
.pd-clive.on { opacity: .95; }
.pd-cdot { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; opacity: 0;
  box-shadow: 0 0 16px 5px var(--mint); transform: translate(-50%, -50%); pointer-events: none;
  transition: left .15s linear, top .15s linear, opacity .15s; }
.pd-cnode { position: absolute; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(12,11,14,.9); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; font-size: 8.5px; font-weight: 800; text-align: center;
  pointer-events: none; transition: box-shadow .18s, transform .18s; }
.pd-cnode .ci { font-size: 19px; line-height: 1; }
.pd-cnode.core { border-color: var(--pd); box-shadow: 0 0 14px rgba(157,91,255,.4); }
.pd-cnode.fire { transform: translate(-50%, -50%) scale(1.16); }
.pd-cnode.r-rare { border-color: rgba(255,77,157,.5); }
.pd-cnode.r-legendary { border-color: rgba(255,210,63,.6); }
.pd-cdot, .pd-cnode { z-index: 2; }
/* co-firing synergy strands (2026-06-10): links drawn BETWEEN pieces that fired for the
   same reason this roll — gold = loadout synergy, purple-dashed = Chain Talisman fan-out,
   mint = a shared roll-condition cluster (evens / 3-kind / etc.). Non-fired nodes dim so a
   piece lighting up next roll reads as "a new one jumped in". */
.pd-cstrand { stroke: var(--mint); stroke-width: 2.5; opacity: .82; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(124,255,224,.55)); }
.pd-cstrand.r-synergy { stroke: #ffd23f; stroke-width: 3.2; filter: drop-shadow(0 0 8px rgba(255,210,63,.8)); }
.pd-cstrand.r-chain { stroke: var(--pd); stroke-dasharray: 5 4; filter: drop-shadow(0 0 8px rgba(157,91,255,.8)); }
.pd-cnode.pd-cdim { opacity: .3; filter: grayscale(.6); transition: opacity .25s ease, filter .25s ease; }
/* OVERCHARGE (2026-06-10 juice): meter redline payoff — overflow-glow + "⚡ OVERCHARGE" flash. */
.pd-cmeter .mt-fill.over { background: #ffd23f; box-shadow: 0 0 12px 2px rgba(255,210,63,.9); animation: pdOver .5s ease; }
@keyframes pdOver { 0% { filter: brightness(2.2); } 100% { filter: brightness(1); } }
.pd-overcharge { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap;
  font-weight: 900; font-size: 14px; letter-spacing: .04em; color: #ffd23f; text-shadow: 0 0 10px rgba(255,210,63,.9);
  pointer-events: none; opacity: 0; z-index: 4; }
.pd-overcharge.go { animation: pdOverText .95s ease forwards; }
@keyframes pdOverText { 0% { opacity: 0; transform: translateX(-50%) scale(.6); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-14px) scale(1.1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(1); } }
/* the banked Engine Reroll button — gold to read as the overcharge resource */
.pd-engreroll { color: #ffd23f !important; border-color: rgba(255,210,63,.5) !important; }
.pd-engreroll:not(:disabled) { box-shadow: 0 0 9px rgba(255,210,63,.35); }
/* dice weight: freshly-rolled dice tumble/pop in (kept dice sit still); per-die stagger via inline delay */
.ps-die.roll-in { animation: pdDieIn .34s cubic-bezier(.34,1.56,.64,1) backwards; }
@keyframes pdDieIn { 0% { transform: translateY(-15px) rotate(-18deg) scale(.7); opacity: 0; }
  60% { transform: translateY(2px) rotate(4deg) scale(1.06); opacity: 1; } 100% { transform: none; opacity: 1; } }
/* score-burn: the running total snaps bigger (gold) then settles on each multiplicative jump + final slam */
.ps-total.pd-punch { animation: pdPunch .28s ease; }
@keyframes pdPunch { 0% { transform: scale(1); } 35% { transform: scale(1.28); color: #ffd23f; } 100% { transform: scale(1); } }
.pd-haptic-toggle { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .ps-die.roll-in, .ps-total.pd-punch, .pd-overcharge.go, .pd-cmeter .mt-fill.over { animation: none !important; }
}
.pd-cmtext { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 15px; color: var(--mint);
  text-shadow: 0 0 12px currentColor; pointer-events: none; white-space: nowrap; opacity: 0; z-index: 3; }
.pd-cmtext.go { animation: pdMtext 0.7s ease forwards; }
@keyframes pdMtext { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -150%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.pd-cempty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; opacity: .4; text-align: center; padding: 0 26px; }
.pd-cmeter { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 62%; text-align: center; z-index: 1; }
.pd-cmeter .mt-lab { font-size: 8.5px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .45; }
.pd-cmeter .mt-track { height: 6px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 3px; }
.pd-cmeter .mt-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pd), var(--mint)); transition: width .22s ease; }
.pd-hud { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; opacity: 0.92; padding: 2px 4px; }
.pd-money { color: #FFD23F; text-shadow: 0 0 10px rgba(255,210,63,.4); }
.pd-run b { color: #3FA7FF; }
.pd-stage { position: relative; }
.pd-map { position: relative; }

.pd-floor { text-align: center; font-size: 12px; opacity: 0.6; margin: 4px 0 10px; }
.pd-hint { text-align: center; font-size: 12px; opacity: 0.55; margin: 12px 0 0; }
.pd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.pd-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.03); color: var(--text);
  cursor: pointer; transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.pd-cell .pd-ic { font-size: 26px; line-height: 1; }
.pd-cell .pd-lbl { font-size: 10px; letter-spacing: .5px; opacity: 0.7; text-transform: uppercase; }
.pd-cell.pd-locked { opacity: 0.38; cursor: default; }
.pd-cell.pd-clear { border-color: rgba(124,255,90,.5); background: rgba(124,255,90,.08); }
.pd-cell.pd-clear .pd-ic { color: #7CFF5A; }
.pd-cell.pd-active { border-color: var(--pd); box-shadow: 0 0 18px rgba(157,91,255,.5); background: radial-gradient(120% 120% at 50% 0%, rgba(157,91,255,.22), rgba(255,255,255,.02)); animation: pdPulse 1.4s ease-in-out infinite; }
.pd-cell.pd-exit.pd-open { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,210,63,.6); background: radial-gradient(120% 120% at 50% 0%, rgba(255,210,63,.25), rgba(255,255,255,.02)); animation: pdPulse 1.2s ease-in-out infinite; }
.pd-cell.pd-diving { transform: scale(1.35); box-shadow: 0 0 40px rgba(157,91,255,.8); z-index: 3; }
@keyframes pdPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
/* fog of war + branching map states */
.pd-cell.pd-fog { opacity: 0.28; cursor: default; }
.pd-cell.pd-fog .pd-ic { opacity: 0.5; }
.pd-cell.pd-seen { opacity: 0.5; cursor: default; }       /* revealed but not reachable from where you stand */
.pd-cell.pd-here { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 210, 63, 0.5); }
.pd-cell.pd-exit.pd-seen { opacity: 0.55; }
.pd-mapbuy { margin-top: 8px; display: inline-flex; flex-direction: column; line-height: 1.2; }
.pd-mapsub { opacity: 0.5; font-size: 10px; }

.pd-room { position: relative; }
/* shop / bust overlay covers the whole ROOM (not just the dice strip) + scrolls,
   so the tall shop screen doesn't spill over the combat behind it. */
.pd-room > .overlay { overflow-y: auto; justify-content: safe center; padding: 16px 10px; gap: 8px; border-radius: 14px; }
.pd-room > .overlay .over-title { font-size: 24px; }
.pd-roomtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pd-roomlbl { font-size: 13px; font-weight: 800; opacity: 0.9; }
.pd-back { font-size: 12px; padding: 5px 10px; }
.pd-money2 { color: #FFD23F; }
.pd-room.pd-zoom { animation: pdZoom .34s cubic-bezier(.2,.8,.3,1); }
@keyframes pdZoom { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pd-end { text-align: center; padding: 30px 10px; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* the themed wipe between map and room */
.pd-wipe { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(12,11,20,.94); pointer-events: none; }
.pd-wipe span { font-size: 64px; }
.pd-wipe.go { animation: pdWipe .43s ease; }
@keyframes pdWipe { 0% { clip-path: circle(0% at 50% 50%); } 55% { clip-path: circle(75% at 50% 50%); } 100% { clip-path: circle(0% at 50% 50%); opacity: 0; } }

/* room-type rooms (vault / treasure / shop) + the cursed-fight banner */
.pd-curse { text-align: center; font-size: 11px; font-weight: 700; color: #FF4D9D; opacity: 0.9; margin: 2px 0 8px; }
.pd-room-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 6px; text-align: center; }
.pd-room-body .over-title { font-size: 26px; }
.pd-room-body .ps-draft { margin: 8px 0; }
.ps-price.pd-free { background: #7CFF5A; color: #0c0b14; }
.pd-rewardcharms { justify-content: center; max-width: 340px; margin: 0 auto; }
.pd-gearstrip { justify-content: center; }
.pd-maprow { display: flex; justify-content: center; margin: 8px 0 2px; }

/* the paperdoll / loadout window */
.pd-doll { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 380px; margin: 6px auto; }
.pd-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; background: rgba(255, 255, 255, 0.04);
}
.pd-slot.pd-empty { opacity: 0.45; }
.pd-slot.ps-r-uncommon { border-color: rgba(63, 167, 255, 0.5); }
.pd-slot.ps-r-rare { border-color: rgba(255, 77, 157, 0.55); box-shadow: 0 0 10px rgba(255, 77, 157, 0.2); }
.pd-slot.ps-r-legendary { border-color: rgba(255, 210, 63, 0.65); box-shadow: 0 0 12px rgba(255, 210, 63, 0.3); }
.pd-slot-ic { font-size: 22px; line-height: 1; }
.pd-slot-nm { font-size: 12px; font-weight: 800; }
.pd-slot-sub { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.6; }
.pd-slot-desc { font-size: 10px; opacity: 0.78; line-height: 1.2; margin-top: 2px; }
.pd-mapov { overflow-y: auto; justify-content: safe center; padding: 16px 12px; gap: 8px; }
.pd-help { text-align: left; font-size: 13px; line-height: 1.45; max-width: 360px; margin: 0 auto; }
.pd-help p { margin: 0 0 9px; opacity: 0.9; }
.pd-hands { text-align: center; font-size: 13px; letter-spacing: 3px; color: #FFD23F; margin-top: 7px; }
.pd-hands-lbl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.55; color: var(--text); margin-right: 6px; }
.pd-hands-used { opacity: 0.28; }
.pd-hands-n { font-size: 11px; opacity: 0.65; color: var(--text); letter-spacing: 0; }

/* ---- RMUV_OVERLAY contract -------------------------------------------------
   A declared dismiss mode drives touch-action; the card scrolls and the ✕ is
   sticky, so "Close below the fold" is structurally impossible. */
.rmv-ov { display: flex; align-items: center; justify-content: safe center; gap: 14px; }
.rmv-ov[data-mode="fixed"] { position: fixed; inset: 0; z-index: 3000; padding: 16px; background: rgba(8,7,10,0.82); backdrop-filter: blur(3px); }
.rmv-ov[data-mode="panel"] { position: absolute; inset: 0; background: rgba(12,11,14,0.82); backdrop-filter: blur(2px); }
.rmv-ov[data-dismiss="tap-to-start"] { touch-action: none; }
.rmv-ov:not([data-dismiss="tap-to-start"]) { touch-action: pan-y; overflow-y: auto; }
/* A landscape game's stage is CSS-rotated 90° (#game-screen.landscape). touch-action panning
   axes are evaluated in SCREEN space, NOT the rotated element's local space — so a scrollable
   overlay's vertical scroll is driven by a physically HORIZONTAL swipe. `pan-y` blocks exactly
   that gesture, stranding players on Neon Leap's level-select map (can't scroll → can't reach
   Play). Permit both axes inside the rotated stage so the perpendicular scroll gesture lands.
   (touch-action intersects down the ancestor chain, so the parent .rmv-ov must allow it too.) */
#game-screen.landscape .rmv-ov:not([data-dismiss="tap-to-start"]),
#game-screen.landscape .rmv-ov-card { touch-action: pan-x pan-y; }
.rmv-ov-card { position: relative; max-height: min(86vh, 100%); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
/* center the card content (game splash / game-over / win screens) — opt-in via open({center:true}) */
.rmv-ov-center .rmv-ov-card { align-items: center; text-align: center; }
/* the standard arcade game-overlay card: a readable panel over a busy canvas + a soft entrance pop */
/* the game-over card: structure + neutral glow come from the shared .rmv-panel rules above; here it
   only adds its centered layout + a touch more horizontal padding for the score/buttons. */
.arcade-card { align-items: center; gap: 12px; padding: 22px 22px; }
.arcade-card .newgame { margin-top: 8px; padding: 12px 30px; font-size: 1.05rem; }
/* def.modes rung picker on the splash (lowest rung first) */
.arcade-modes { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; width: 100%; }
.arcade-modes .newgame { margin-top: 0; }
@media (prefers-reduced-motion: no-preference) { .arcade-card { animation: arcadePop 0.22s ease-out; } }
@keyframes arcadePop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rmv-ov-close { position: sticky; top: 0; align-self: flex-end; margin: -2px -2px 0 auto; background: rgba(255,255,255,0.08); color: var(--t, #e7e3ee); border: 1px solid rgba(255,255,255,0.15); border-radius: 999px; width: 30px; height: 30px; font-size: 16px; line-height: 1; cursor: pointer; }

/* declarative form of the touch-scroll floor for in-panel .overlay (Phase 2 will tag
   each game; until then the container floor selector above stays as the safety net) */
.overlay[data-dismiss="tap-to-start"] { touch-action: none; }
.overlay[data-dismiss]:not([data-dismiss="tap-to-start"]) { touch-action: pan-y; }

/* itch build: online MP unavailable in-frame — hide the mode toggle + join code */
.mp-bar{display:none!important}
