/* ═══════════════════════════════════════════════════════════════════════════
   games.css — the /games pages only. Every class is gm- / stw- prefixed:
   site.css and themes.css style many bare names (.card, .stat, …) with
   !important, so nothing here borrows one.
   Light theme = NO data-theme attribute; the --theme-* vars exist only on the
   other themes, so every var below carries its light fallback.
   ═══════════════════════════════════════════════════════════════════════════ */
.gm-page {
  --gm-surface: var(--theme-surface, #fff);
  --gm-ink: var(--theme-surface-text, var(--theme-text, #1f2937));
  --gm-head: var(--heading-color, #343f52);
  --gm-muted: var(--theme-muted, #5b6472);
  --gm-line: var(--theme-border, #e3e8ef);
  --gm-accent: var(--theme-accent, #3a6fd4);
  --gm-accent-ink: var(--theme-accent-ink, #295bba);
  --gm-soft: var(--bs-soft-primary, #e0e9fa);
  --gm-tile: #f0f3f8;
  --gm-shadow: 0 1px 3px rgba(15,23,42,.08), 0 6px 18px rgba(15,23,42,.06);
  --gm-gold: #ffcc33; --gm-gold-deep: #e0a800;
  --gm-arena-1: #26348a; --gm-arena-2: #121a45; --gm-arena-edge: #0b1030; --gm-arena-ink: #eef1ff; --gm-arena-muted: #aab4e8;
}
body[data-theme] .gm-page { --gm-tile: rgba(255,255,255,.06); --gm-shadow: 0 1px 3px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.3); --gm-soft: rgba(var(--theme-accent-rgb, 99,102,241), .18); }
body[data-theme="dark"] .gm-page { --gm-arena-1: #1b2252; --gm-arena-2: #0b0f24; --gm-arena-edge: #05070f; }
body[data-theme="high-contrast"] .gm-page {
  --gm-ink: #000; --gm-muted: #1f2937; --gm-line: #000; --gm-tile: #fff; --gm-shadow: none; --gm-soft: #000;
  --gm-gold: #ffff00; --gm-gold-deep: #ffff00;
  --gm-arena-1: #000; --gm-arena-2: #000; --gm-arena-edge: #fff; --gm-arena-ink: #fff; --gm-arena-muted: #fff;
}

.gm-crumb { font-size: 14px; color: var(--gm-muted); margin: 0; }
body[data-theme="high-contrast"] .gm-crumb { color: #fff; }
.gm-crumb a { color: var(--gm-accent-ink); text-decoration: none; font-weight: 600; }
.gm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 4px 0 12px; flex-wrap: wrap; }
.gm-head h1 { margin: 0; font-size: 1.9rem; line-height: 1.1; font-weight: 700; }
.gm-head .gm-sub { margin: 4px 0 0; color: var(--gm-muted); font-size: 1rem; }
body[data-theme="high-contrast"] .gm-head .gm-sub { color: #fff; }
.gm-tools { display: flex; gap: 8px; align-items: center; }
.gm-seg { display: inline-flex; background: var(--gm-surface); border: 1px solid var(--gm-line); border-radius: 12px; padding: 4px; gap: 4px; box-shadow: var(--gm-shadow); }
.gm-seg button { white-space: nowrap; border: 0; background: none; height: 38px; padding: 0 16px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--gm-muted); display: inline-flex; align-items: center; gap: 8px; }
.gm-seg button.active { background: var(--gm-accent); color: #fff; }
body[data-theme="high-contrast"] .gm-seg { background: #000; border: 2px solid #fff; }
body[data-theme="high-contrast"] .gm-seg button { color: #fff; }
body[data-theme="high-contrast"] .gm-seg button.active { color: #000; }
.gm-seg .gm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gm-gold); box-shadow: 0 0 0 2px rgba(255,204,51,.35); }
.gm-iconbtn { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid var(--gm-line); background: var(--gm-surface); display: inline-grid; place-items: center; box-shadow: var(--gm-shadow); color: var(--gm-ink); }
body[data-theme="high-contrast"] .gm-iconbtn { background: #000; border: 2px solid #fff; color: #fff; }
.gm-iconbtn .gm-off { display: none; }
.gm-iconbtn.is-muted .gm-on { display: none; } .gm-iconbtn.is-muted .gm-off { display: inline; }

.gm-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 991px) { .gm-layout { grid-template-columns: minmax(0, 1fr); } }
.gm-side { display: grid; gap: 16px; }
.gm-card { background: var(--gm-surface); color: var(--gm-ink); border-radius: 14px; box-shadow: var(--gm-shadow); padding: 18px; }
body[data-theme="high-contrast"] .gm-card { border: 2px solid #fff; }
.gm-card h2 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 700; color: inherit; }
.gm-card p { margin: 0; color: var(--gm-muted); font-size: 15px; }
.gm-howto { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.gm-howto li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.gm-howto .gm-n { width: 24px; height: 24px; border-radius: 50%; background: var(--gm-soft); color: var(--gm-accent-ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
body[data-theme="high-contrast"] .gm-howto .gm-n { color: #fff; }
.gm-fair { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--gm-muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gm-line); }
.gm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gm-stat { background: var(--gm-tile); border-radius: 10px; padding: 10px 6px; text-align: center; }
body[data-theme="high-contrast"] .gm-stat { border: 2px solid #000; }
.gm-stat b { display: block; font-size: 1.5rem; line-height: 1.1; font-weight: 700; }
.gm-stat span { font-size: 11.5px; color: var(--gm-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.gm-note { font-size: 13.5px !important; margin-top: 10px !important; }
.gm-about { margin-top: 22px; }
.gm-about p { max-width: 760px; }
.gm-kbd, .stw-kbd { display: inline-block; font: 700 12px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .85; vertical-align: 1px; }

/* ── the arena ── */
.gm-arena { position: relative; border-radius: 20px; overflow: hidden; color: var(--gm-arena-ink); user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; outline: none;
  background: radial-gradient(120% 80% at 50% 0%, var(--gm-arena-1) 0%, var(--gm-arena-2) 70%), var(--gm-arena-2);
  box-shadow: inset 0 0 0 3px var(--gm-arena-edge), 0 10px 30px rgba(18,26,69,.25); }
.gm-arena:focus-visible { box-shadow: inset 0 0 0 3px var(--gm-arena-edge), 0 0 0 3px rgba(var(--theme-accent-rgb, 58,111,212), .45); }
body[data-theme="high-contrast"] .gm-arena { box-shadow: inset 0 0 0 3px #fff; }
.gm-arena::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px), radial-gradient(rgba(255,255,255,.3) 1px, transparent 1.4px);
  background-size: 120px 120px, 70px 70px; background-position: 13px 21px, 40px 5px; }
body[data-theme="high-contrast"] .gm-arena::before { display: none; }
.gm-arena:fullscreen { border-radius: 0; width: 100vw; height: 100vh; }

/* ── Stop the Wheel ── */
.stw-arena { display: grid; grid-template-rows: auto 1fr auto; padding: 18px 20px 20px; cursor: pointer; }
.stw-arena:fullscreen { padding: 24px; }
.stw-hud { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "l s r"; align-items: start; gap: 8px; pointer-events: none; }
.stw-hud .stw-l { grid-area: l; justify-self: start; display: grid; gap: 8px; justify-items: start; }
.stw-hud .stw-r { grid-area: r; justify-self: end; }
.stw-hud .stw-score { grid-area: s; }
/* wide arenas: the HUD lives in the top corners (a circle leaves them empty) */
.stw-arena.stw-hud-over { grid-template-rows: 1fr auto; }   /* ⛔ the HUD is out of the flow here: without this the STAGE took the 'auto' row and sat at the top (owner's phone, fullscreen) */
.stw-arena.stw-hud-over .stw-stage { align-self: center; }
.stw-hud-over .stw-hud { position: absolute; top: 18px; left: 20px; right: 20px; grid-template-columns: auto 1fr auto; grid-template-areas: "l . r" "s . ."; row-gap: 10px; }
.stw-hud-over .stw-score { justify-self: start; text-align: left; }
.stw-hud-over .stw-score b { font-size: 56px; }
.stw-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-weight: 700; font-size: 14px; }
.stw-chip small { font-size: 11px; color: var(--gm-arena-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
body[data-theme="high-contrast"] .stw-chip { background: #000; border: 2px solid #fff; }
.stw-score { text-align: center; line-height: 1; }
.stw-score b { display: block; font-size: 64px; font-weight: 700; letter-spacing: -.02em; text-shadow: 0 3px 0 rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.stw-score small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gm-arena-muted); font-weight: 700; margin-top: 4px; }
.stw-combo { display: inline-flex; height: 28px; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--gm-gold); color: #2b2100; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 var(--gm-gold-deep); }
.stw-stage { position: relative; display: grid; place-items: center; }
.stw-stage canvas { display: block; }
.stw-shake { animation: stw-shake .32s ease-out; }
@keyframes stw-shake { 0%,100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.stw-pop { position: absolute; left: 50%; transform: translateX(-50%) rotate(-2deg); font-weight: 700; font-size: 24px; letter-spacing: .05em; white-space: nowrap; pointer-events: none;
  padding: 6px 16px; border-radius: 12px; animation: stw-pop .22s cubic-bezier(.2,1.6,.4,1); }
@keyframes stw-pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.stw-pop.perfect { background: var(--gm-gold); color: #2b2100; box-shadow: 0 4px 0 var(--gm-gold-deep), 0 8px 22px rgba(255,204,51,.45); }
.stw-pop.hit { background: #fff; color: #142060; box-shadow: 0 4px 0 #b9c2ee; }
.stw-pop.miss { background: #dc2626; color: #fff; box-shadow: 0 4px 0 #7f1414; transform: translateX(-50%); }
body[data-theme="high-contrast"] .stw-pop { border: 3px solid #000; box-shadow: none; }
.stw-foot { position: relative; z-index: 2; text-align: center; min-height: 48px; display: grid; place-items: center; gap: 8px; }
.stw-hint { font-size: 16px; color: var(--gm-arena-muted); font-weight: 600; }
.stw-hint b { color: var(--gm-arena-ink); }
.stw-prog { display: flex; gap: 6px; justify-content: center; }
.stw-prog i { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
body[data-theme="high-contrast"] .stw-prog i { border: 2px solid #fff; }
.stw-prog i.now { outline: 2px solid var(--gm-arena-ink); outline-offset: 2px; }
.stw-prog i.g, .stw-tiles i.g, .stw-legend i.g { background: #22c55e; border-color: #16a34a; }
.stw-prog i.y, .stw-tiles i.y, .stw-legend i.y { background: #facc15; border-color: #ca8a04; }
.stw-prog i.r, .stw-tiles i.r, .stw-legend i.r { background: #ef4444; border-color: #b91c1c; }
.stw-panel { position: absolute; z-index: 3; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(460px, calc(100% - 28px)); cursor: default;
  background: rgba(9,13,40,.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px; padding: 18px 18px 16px; text-align: center; box-shadow: 0 18px 40px rgba(0,0,0,.4); animation: stw-up .25s ease-out; }
@keyframes stw-up { from { transform: translate(-50%, 16px); opacity: 0; } }
body[data-theme="high-contrast"] .stw-panel { background: #000; border: 3px solid #fff; }
.stw-k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gm-arena-muted); font-weight: 700; }
.stw-big { font-size: 54px; font-weight: 700; line-height: 1.05; margin: 2px 0; }
.stw-big small { font-size: 22px; color: var(--gm-arena-muted); }
.stw-newbest { display: inline-block; margin-top: 6px; background: var(--gm-gold); color: #2b2100; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; transform: rotate(-3deg); }
.stw-meta { display: flex; justify-content: center; gap: 16px; font-size: 14px; color: var(--gm-arena-muted); font-weight: 600; margin-top: 4px; flex-wrap: wrap; }
.stw-meta b { color: var(--gm-arena-ink); }
.stw-row { display: flex; gap: 10px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.stw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 10px; border: 0; font-weight: 700; font-size: 16px; cursor: pointer; }
.stw-btn-gold { background: var(--gm-gold); color: #2b2100; box-shadow: 0 3px 0 var(--gm-gold-deep); }
.stw-btn-gold:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gm-gold-deep); }
.stw-btn-ghost { background: transparent; color: var(--gm-arena-ink); border: 2px solid currentColor; }
body[data-theme="high-contrast"] .stw-btn-gold { box-shadow: none; border: 2px solid #000; }
.stw-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.stw-tiles { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.stw-tiles i { width: 30px; height: 30px; border-radius: 7px; }
.stw-legend { display: flex; gap: 12px; justify-content: center; font-size: 12.5px; color: var(--gm-arena-muted); flex-wrap: wrap; }
.stw-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.stw-shared { min-height: 20px; font-size: 14px; font-weight: 700; color: #86efac; }
.stw-daily-done { font-weight: 700; color: var(--gm-ink) !important; }
.stw-daily-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.stw-streak { font-weight: 700; }
.stw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* prototype tuning panel (?tune=1 only) */
.stw-tune { position: fixed; z-index: 9999; right: 12px; bottom: 12px; width: 300px; background: #111; color: #eee; font: 12px/1.4 system-ui, sans-serif; padding: 10px 12px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.4); display: grid; gap: 4px; }
.stw-tune label { display: grid; grid-template-columns: 1fr 110px 40px; gap: 6px; align-items: center; }
.stw-tune #stwTuneNow { color: #fde68a; margin-top: 4px; }

@media (max-width: 575px) {
  .gm-head h1 { font-size: 1.75rem; }
  .gm-tools { width: 100%; }
  .gm-tools .gm-seg { flex: 1; min-width: 0; }
  .gm-tools .gm-seg button { flex: 1; justify-content: center; padding: 0 6px; font-size: 14px; }
  .stw-arena { min-height: 0; padding: 12px 12px 14px; border-radius: 16px; }
  .stw-score b { font-size: 48px; }
  .stw-chip { height: 28px; padding: 0 10px; font-size: 13px; }
  .stw-panel { bottom: 12px; padding: 14px 12px 12px; }
  .stw-big { font-size: 44px; }
  .stw-prog i { width: 18px; height: 18px; }
  .stw-pop { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .stw-pop, .stw-panel { animation: none; } }

/* ── the share sheet (WspGame.shareSheet) — a modal <dialog> ── */
.gm-share { border: 0; padding: 0; border-radius: 20px; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: var(--theme-surface, #fff); color: var(--theme-surface-text, var(--theme-text, #1f2937)); box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: auto; }
.gm-share::backdrop { background: rgba(8,12,36,.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
body[data-theme="high-contrast"] .gm-share { border: 3px solid #fff; color: #000; }
.gm-share-in { position: relative; padding: 20px 20px 16px; }
.gm-share h2 { margin: 0 40px 12px 0; font-size: 1.2rem; font-weight: 700; color: inherit; }
.gm-share-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(127,127,127,.14); color: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.gm-share-img { border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: #141c4e; display: grid; place-items: center; }
.gm-share-img img { width: 100%; height: 100%; display: block; }
.gm-share-ph { color: #aab4e8; font-weight: 600; }
.gm-share-text { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: rgba(127,127,127,.1); font: 600 13.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: inherit; }
.gm-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gm-share-b { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 12px; border: 1px solid var(--theme-border, #e3e8ef); background: none; color: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.gm-share-b:hover, .gm-share-b:focus-visible { background: rgba(127,127,127,.1); color: inherit; }
body[data-theme="high-contrast"] .gm-share-b { border: 2px solid #000; color: #000; }
.gm-share-main { grid-column: span 4; grid-auto-flow: column; justify-content: center; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; padding: 12px; background: var(--theme-accent, #3a6fd4); border-color: transparent; color: #fff; }
.gm-share-main:hover, .gm-share-main:focus-visible { background: var(--theme-accent, #3a6fd4); color: #fff; filter: brightness(1.08); }
body[data-theme="high-contrast"] .gm-share-main { color: #000; }
.gm-share-whatsapp svg { color: #16a34a; } .gm-share-facebook svg { color: #1877f2; } .gm-share-telegram svg { color: #229ed9; }
body[data-theme="high-contrast"] .gm-share-b svg { color: #000; }
.gm-share-msg { min-height: 22px; margin-top: 10px; text-align: center; font-weight: 700; font-size: 14px; color: #16a34a; }
@media (max-width: 420px) { .gm-share-in { padding: 16px 14px 12px; } .gm-share-grid { gap: 6px; } .gm-share-b { font-size: 11.5px; } }

/* ── /games hub ── */
.gm-back { display: inline-flex; gap: 6px; font-weight: 700; font-size: 14.5px; text-decoration: none; color: var(--gm-accent-ink); }
.gm-hubhead h1 { margin: 6px 0 4px; font-size: 2.4rem; font-weight: 700; }
.gm-hubhead p { margin: 0 0 20px; color: var(--gm-muted); font-size: 1.05rem; max-width: 640px; }
body[data-theme="high-contrast"] .gm-hubhead p { color: #fff; }
.gm-games { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .gm-games { grid-template-columns: 1fr; } }
.gm-game { background: var(--gm-surface); color: var(--gm-ink); border-radius: 20px; box-shadow: var(--gm-shadow); overflow: hidden; display: grid; grid-template-rows: auto 1fr; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.gm-game:hover { transform: translateY(-3px); color: var(--gm-ink); }
body[data-theme="high-contrast"] .gm-game { border: 3px solid #fff; }
.gm-game-art { height: 250px; display: grid; place-items: center; border-radius: 0; box-shadow: none; }
.gm-game-art canvas { position: relative; z-index: 1; }
.gm-game-body { padding: 18px 20px 20px; display: grid; gap: 10px; align-content: start; }
.gm-game h2 { margin: 0; font-size: 1.6rem; font-weight: 700; color: inherit; }
.gm-game p { margin: 0; color: var(--gm-muted); font-size: 1rem; }
.gm-game-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.gm-play { margin-left: auto; padding: 8px 22px; }
.gm-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; background: var(--gm-tile); color: var(--gm-ink); }
body[data-theme="high-contrast"] .gm-pill { border: 2px solid #000; }
.gm-pill-done { background: #dcfce7; color: #166534; }
.gm-pill-todo { background: #fff4cc; color: #7a5a00; }
body[data-theme="dark"] .gm-pill-done { background: #12301f; color: #86efac; }
body[data-theme="dark"] .gm-pill-todo { background: #3a3000; color: #fcd34d; }
body[data-theme="high-contrast"] .gm-pill-done, body[data-theme="high-contrast"] .gm-pill-todo { background: #fff; color: #000; }
.gm-badge { position: absolute; z-index: 2; left: 16px; top: 16px; background: var(--gm-gold); color: #2b2100; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 8px; }
.gm-soon .gm-game-art { filter: saturate(.75); }
.gm-fan { position: relative; z-index: 1; width: 320px; height: 190px; }
.gm-fan img { position: absolute; width: 150px; height: 100px; object-fit: contain; background: #fff; padding: 6px; border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.gm-fan img:nth-child(1) { left: 6px; top: 46px; transform: rotate(-12deg); }
.gm-fan img:nth-child(2) { left: 162px; top: 40px; transform: rotate(10deg); }
.gm-fan img:nth-child(3) { left: 84px; top: 22px; transform: rotate(-2deg); width: 168px; height: 112px; z-index: 2; }
.gm-q { position: absolute; z-index: 3; right: 10px; bottom: 2px; background: var(--gm-gold); color: #2b2100; font-weight: 700; font-size: 22px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 0 var(--gm-gold-deep); }
.gm-promise { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .gm-promise { grid-template-columns: 1fr; } }
.gm-promise .gm-card { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.gm-promise h2 { font-size: 1rem; margin: 0 0 2px; }
.gm-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--gm-soft); display: grid; place-items: center; font-size: 20px; }
@media (max-width: 575px) { .gm-hubhead h1 { font-size: 2rem; } .gm-game-art { height: 210px; } .gm-fan { transform: scale(.85); } }

/* ── the Daily leaderboard card (game-board.js) ── */
.gm-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gm-board-head h2 { margin: 0; }
.gm-board-tabs { display: inline-flex; background: var(--gm-tile); border-radius: 9px; padding: 3px; gap: 2px; }
.gm-board-tabs button { border: 0; background: none; border-radius: 7px; padding: 4px 10px; font-size: 13px; font-weight: 700; color: var(--gm-muted); }
.gm-board-tabs button.active { background: var(--gm-surface); color: var(--gm-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
body[data-theme="high-contrast"] .gm-board-tabs { border: 2px solid #000; }
body[data-theme="high-contrast"] .gm-board-tabs button.active { background: #000; color: #fff; }
.gm-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gm-board-list li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; font-size: 15px; }
.gm-board-list li:nth-child(odd) { background: var(--gm-tile); }
.gm-board-list li.is-me { background: var(--gm-soft); outline: 2px solid var(--gm-accent); outline-offset: -2px; }
.gm-board-list em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gm-accent-ink); margin-left: 4px; }
body[data-theme="high-contrast"] .gm-board-list em { color: #000; }
.gm-board-rank { font-weight: 700; text-align: center; color: var(--gm-muted); }
.gm-board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gm-board-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.gm-board-score small { font-weight: 600; color: var(--gm-muted); }
.gm-board-empty { margin: 4px 0 0 !important; }
.gm-board-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gm-line); }
.gm-board-note { font-size: 14px !important; margin: 0 0 8px !important; }
.gm-board-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gm-board-small { font-size: 13.5px; color: var(--gm-muted); gap: 2px; }

.gm-board-form { display: grid; gap: 6px; }
.gm-board-form input { height: 40px; border-radius: 9px; border: 1px solid var(--gm-line); padding: 0 12px; font-size: 15px; background: var(--gm-surface); color: var(--gm-ink); }
body[data-theme="high-contrast"] .gm-board-form input { border: 2px solid #000; }
.gm-board-msg { min-height: 18px; font-size: 13.5px; font-weight: 700; color: #dc2626; }
.gm-linkbtn { border: 0; background: none; padding: 0 2px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--gm-accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
body[data-theme="high-contrast"] .gm-linkbtn { color: #000; }

/* ── round 3 (2026-12-01): stats first, folded how-to, FAQ ── */
.gm-stats-5 { grid-template-columns: repeat(6, 1fr); }
.gm-stats-5 .gm-stat { grid-column: span 2; }
.gm-stats-5 .gm-stat-big { grid-column: span 3; }
.gm-stats-5 .gm-stat-big b { font-size: 1.9rem; }
.gm-howto-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.gm-howto-card > summary::-webkit-details-marker { display: none; }
.gm-howto-card > summary h2 { margin: 0; }
.gm-howto-card > summary::after { content: "▾"; color: var(--gm-muted); font-size: 14px; transition: transform .2s; }
.gm-howto-card[open] > summary::after { transform: rotate(180deg); }
.gm-howto-card[open] > summary { margin-bottom: 8px; }
.gm-modes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gm-line); display: grid; gap: 6px; }
.gm-modes p { font-size: 14px !important; }
.gm-faq { margin-top: 16px; }
.gm-faq details { border-top: 1px solid var(--gm-line); padding: 10px 0; }
.gm-faq details:first-of-type { border-top: 0; }
.gm-faq summary { cursor: pointer; font-weight: 700; font-size: 1rem; color: var(--gm-ink); }
.gm-faq details p { margin-top: 6px !important; max-width: 820px; }
.stw-mode-note { font-size: 13px; color: var(--gm-arena-muted); font-weight: 600; max-width: 560px; line-height: 1.35; }
.stw-foot { gap: 4px; }
.stw-mode-note b { color: var(--gm-arena-ink); }
/* the "you beat your best" moment */
.stw-cele { position: absolute; inset: 0; z-index: 4; pointer-events: none; display: grid; place-items: center; }
.stw-cele span { font-weight: 800; font-size: clamp(30px, 6vw, 54px); color: var(--gm-gold); letter-spacing: .02em; text-shadow: 0 4px 0 #7a5a00, 0 0 30px rgba(255,204,51,.6); animation: stw-cele 1.6s cubic-bezier(.2,1.4,.4,1) both; }
body[data-theme="high-contrast"] .stw-cele span { color: #ffff00; text-shadow: 0 0 0 #000, 3px 3px 0 #000; }
@keyframes stw-cele { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 18% { transform: scale(1.12) rotate(2deg); opacity: 1; } 30% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stw-cele span { animation-duration: .01s; animation-fill-mode: none; } }
/* leaderboard round 3: what each tab means, streaks, a Daily's squares */
.gm-board-what { font-size: 13px !important; margin: -4px 0 8px !important; }
.gm-board-tabs button { padding: 4px 8px; }
.gm-board-streak { font-size: 12px; font-weight: 700; margin-left: 4px; white-space: nowrap; }
.gm-board-marks { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: 1px; }
.gm-board-marks i { width: 6px; height: 6px; border-radius: 2px; background: #ef4444; }
.gm-board-marks i.g { background: #22c55e; } .gm-board-marks i.y { background: #facc15; }
.gm-board-usedn { justify-self: start; font-size: 13px; }
@media (max-width: 400px) { .gm-board-marks { display: none; } }

/* How to play: under the game, above About (owner 2026-12-01) */
.gm-howto-sec { margin-top: 22px; }
.gm-howto-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 767px) { .gm-howto-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.gm-howto-sec .gm-modes { margin-top: 0; padding: 14px 16px; border-top: 0; border-radius: 12px; background: var(--gm-tile); }
body[data-theme="high-contrast"] .gm-howto-sec .gm-modes { border: 2px solid #000; }
.gm-howto-sec .gm-modes h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: inherit; }
.gm-about { margin-top: 16px; }
