/* 4smarts hero prototype v4 — GeoGuessr-style structure, ink-navy + gold.
   Type: Oswald VF (display, from visualistka) · Geist (body) · Geist Mono (data). */

@font-face {
  font-family: "Oswald";
  src: url("../fonts/OswaldVF.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/GeistVF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMonoVF.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg:        #0A0E1E;
  --bg-2:      #0F1530;
  --panel:     rgba(19, 26, 54, 0.78);
  --panel-hi:  rgba(255, 255, 255, 0.055);
  --ink:       #F4F0E4;
  --muted:     #96A0BE;
  --gold:      #E9B84E;
  --gold-2:    #FFD37A;
  --line:      rgba(233, 184, 78, 0.16);
  --line-dim:  rgba(150, 160, 190, 0.16);
  --ok:        #57D9A3;
  --fail:      #F27D72;
  --warn:      #FFB347;
  --shadow:    0 30px 90px rgba(3, 6, 18, 0.6), 0 6px 24px rgba(3, 6, 18, 0.45);
  --radius:    22px;
  --ease:      cubic-bezier(0.2, 0.7, 0.2, 1);
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body:    "Geist", system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 420;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100svh;
}
body.modal-open { overflow: hidden; }

::selection { background: rgba(233, 184, 78, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(6, 9, 20, 0.75), rgba(6, 9, 20, 0.35) 70%, transparent);
  transition: background 0.3s;
}
.site-header.scrolled {
  background: rgba(10, 14, 30, 0.7);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(233, 184, 78, 0.12);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark-4 { color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 26px; margin-right: auto; }
.site-nav a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--gold-2); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.lang-switch button.is-active { background: rgba(233, 184, 78, 0.16); color: var(--gold-2); }

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 460;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  flex: none;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(270deg, var(--gold), transparent);
  flex: none;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.9vw, 50px);
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  margin-bottom: 16px;
}
.h2-center { text-align: center; margin-bottom: 44px; }
.section-lead { color: var(--muted); max-width: 56ch; margin-bottom: 42px; }
.footnote { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 30px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 15px 32px;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.2s;
  will-change: transform;
}
.btn--primary {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 72%);
  color: #131a33;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.18);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 44px rgba(233, 184, 78, 0.38);
}
.btn--ghost {
  background: rgba(6, 9, 20, 0.35);
  color: var(--ink);
  border: 1px solid var(--line-dim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn--ghost:hover { border-color: rgba(233, 184, 78, 0.55); transform: translateY(-1px); }
.btn--big { padding: 18px 44px; font-size: 16px; }
.btn--small { padding: 9px 18px; font-size: 12.5px; border-radius: 10px; }
.btn--card { width: 100%; margin-top: 2px; }
.casual-session-actions { width: 100%; display: flex; gap: 8px; }
.casual-session-actions > .btn { flex: 1 1 0; min-width: 0; }
.casual-session-actions--card { margin-top: 2px; }
.casual-session-actions--card .btn--card { margin-top: 0; padding-inline: 14px; }
.casual-session-actions--band { width: min(100%, 520px); margin-inline: auto; }
.casual-session-new { border-color: rgba(233, 184, 78, 0.36); color: var(--gold-2); }
@media (max-width: 420px) {
  .casual-session-actions { flex-direction: column; }
}

/* ---------- HERO (full-bleed video) ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
#shader-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  display: none;               /* fallback when video is missing */
}
body.no-video #shader-glow { display: block; }
body.no-video .hero-video { display: none; }
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 90% 70% at 50% 42%, rgba(6, 9, 20, 0.18), rgba(6, 9, 20, 0.62) 78%),
    linear-gradient(180deg, rgba(10, 14, 30, 0.42), rgba(10, 14, 30, 0.28) 45%, rgba(10, 14, 30, 0.7) 85%, var(--bg));
  pointer-events: none;
}
.hero-fade {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 140px;
  z-index: 2;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  width: min(100%, 900px);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 680;
  font-size: clamp(52px, 8.2vw, 128px);
  line-height: 0.99;
  text-transform: uppercase;
  letter-spacing: 0.012em;
  margin-bottom: 30px;
  text-shadow: 0 4px 60px rgba(3, 6, 18, 0.75);
}
.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero-title .line { display: block; }
.hero-title .dot { color: var(--gold); }
.hero-sub {
  color: rgba(244, 240, 228, 0.86);
  font-size: 18px;
  max-width: 58ch;
  margin: 0 auto 30px;
  text-shadow: 0 2px 24px rgba(3, 6, 18, 0.8);
}
.hero-actions {
  width: min(100%, 540px);
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-action { width: 100%; }
.hero-action .btn { width: 100%; }
.hero-action--primary .btn {
  min-height: 64px;
  padding-inline: 32px;
  font-size: 18px;
}
.hero-action--secondary .btn {
  min-height: 54px;
  color: rgba(244, 240, 228, 0.74);
  border-color: rgba(244, 240, 228, 0.26);
  background: rgba(6, 9, 20, 0.2);
}
.hero-action--secondary .cta-sub { color: rgba(244, 240, 228, 0.86); }
.hero-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-mode-wrap { position: relative; min-width: 0; }
.hero-mode-card {
  width: 100%;
  min-width: 0;
  min-height: 112px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(150, 160, 190, 0.2);
  border-radius: 12px;
  background: rgba(6, 9, 20, 0.24);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.hero-mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 184, 78, 0.42);
  background: rgba(15, 21, 48, 0.5);
}
.hero-mode-icon { color: var(--gold); font: 500 25px/1 var(--font-display); margin-bottom: 6px; }
.hero-mode-name {
  overflow-wrap: anywhere;
  font: 560 14px/1.25 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-mode-copy { margin-top: 5px; color: rgba(244, 240, 228, 0.5); font: 450 11.5px/1.3 var(--font-mono); }
.mode-chip-row { position: relative; display: flex; justify-content: center; margin: -16px 0 22px; }
.mode-entry-chip,
.poster-suggestion,
.account-mode-btn {
  border: 1px solid rgba(233, 184, 78, 0.34);
  border-radius: 999px;
  background: rgba(233, 184, 78, 0.07);
  color: var(--gold-2);
  font: 550 11.5px/1.2 var(--font-mono);
  padding: 7px 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mode-entry-chip:hover,
.poster-suggestion:hover,
.account-mode-btn:hover { border-color: var(--gold); background: rgba(233, 184, 78, 0.13); }
.micro-stats { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal-line { display: block; transform: translateY(110%); transition: transform 0.9s var(--ease); }
.reveal-line.is-in { transform: translateY(0); }

/* ---------- TRY section / question card ---------- */

.section--try { position: relative; overflow: visible; }
#glyph-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.try-inner { position: relative; z-index: 1; }

.hero-stage { position: relative; max-width: 620px; margin: 0 auto; }

.qcard { position: relative; z-index: 2; perspective: 1100px; }
.qcard-tilt {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  transform-style: preserve-3d;
  will-change: transform;
}
.qcard-tilt::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-hi) 30%, rgba(255, 255, 255, 0.16) 50%, var(--panel-hi) 70%, transparent);
  pointer-events: none;
}

.qcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 480;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  white-space: nowrap;
}
.chip--tempo { color: var(--muted); border-color: var(--line-dim); }
.difficulty-badge { color: var(--ink); border-color: rgba(233, 184, 78, 0.52); }
.difficulty-badge[data-difficulty="novice"] { color: #8ed6aa; border-color: rgba(142, 214, 170, 0.45); }
.difficulty-badge[data-difficulty="expert"] { color: #f29a8f; border-color: rgba(242, 154, 143, 0.48); }
.difficulty-badge--appear { animation: difficulty-badge-in 400ms var(--ease) both; }
@keyframes difficulty-badge-in {
  from { opacity: 0; transform: scale(0.72); }
  65% { opacity: 1; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
.q-progress { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.q-text {
  font-weight: 480;
  font-size: 18.5px;
  line-height: 1.55;
  margin-bottom: 20px;
  min-height: 116px;
}
#preview-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#preview-text.is-masked, .q-text.is-masked {
  filter: blur(7px);
  opacity: 0.4;
  user-select: none;
  letter-spacing: -0.06em;
}
.gm-question .q-text { min-height: 0; transition: filter 0.45s var(--ease), opacity 0.45s; }
.q-media { margin-bottom: 18px; }
.q-handout {
  white-space: pre-wrap;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.92em;
  line-height: 1.5;
  padding: 12px 16px;
  border: 1px dashed var(--line-dim);
  border-radius: 14px;
  background: rgba(4, 7, 18, 0.5);
  margin-bottom: 12px;
}
.q-media img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(4, 7, 18, 0.5);
  border: 1px solid var(--line-dim);
  cursor: zoom-in;
}
.q-gallery {
  outline: none;
}
.q-gallery:focus-visible {
  border-radius: 16px;
  box-shadow: 0 0 0 2px var(--gold);
}
.q-gallery__viewport {
  position: relative;
  min-height: 180px;
}
.q-gallery__card[hidden] { display: none; }
.q-gallery__card:not([hidden]) { animation: gallery-card-in 220ms var(--ease); }
@keyframes gallery-card-in {
  from { opacity: 0; transform: rotateY(-5deg) translateX(10px); }
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}
.q-gallery__controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.q-gallery__arrow {
  min-height: 40px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 19px;
}
.q-gallery__arrow:disabled { opacity: 0.3; }
.q-gallery__counter {
  color: var(--muted);
  font: 600 12px/1 var(--font-mono);
  text-align: center;
}
.q-media video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(52svh, 420px);
  margin: 0 auto;
  border: 1px solid var(--line-dim);
  border-radius: 14px;
  background: #050814;
  object-fit: contain;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 5, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: overlay-in 0.25s var(--ease);
}
.lightbox img {
  max-width: 96vw;
  max-height: 94vh;
  border-radius: 10px;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.8);
}
.lightbox__close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(5, 8, 20, 0.82);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.q-media audio { display: none; }  /* engine kept hidden; custom player drives it */

/* ---------- custom audio player ---------- */
.ap {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-dim);
  background: linear-gradient(180deg, rgba(15, 21, 48, 0.72), rgba(10, 14, 30, 0.72));
  overflow: hidden;
}
.ap-state { display: none; }
.ap-state--loading {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  background: rgba(10, 14, 30, 0.78);
  color: var(--muted);
  font: 500 12px/1.3 var(--font-mono);
}
.ap.is-loading .ap-state--loading { display: flex; }
.ap.is-loading .ap-ctrl { pointer-events: none; }
.ap-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(233, 184, 78, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ap-spin 0.85s linear infinite;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }
.ap-state--error {
  position: absolute;
  z-index: 3;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(160deg, rgba(19, 26, 54, 0.99), rgba(8, 12, 29, 0.99));
}
.ap.is-error .ap-state--error { display: flex; }
.ap.is-error .ap-viz,
.ap.is-error .ap-ctrl { visibility: hidden; }
.ap-error-glyph {
  flex: 0 0 auto;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(233, 184, 78, 0.5);
}
.ap-error-text {
  min-width: 0;
  color: var(--ink);
  font: 520 13px/1.35 var(--font-body);
}
.ap-retry {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(233, 184, 78, 0.1);
  color: var(--gold-2);
  font: 600 11px/1 var(--font-mono);
  cursor: pointer;
}
.ap-viz {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0 0 10px;
}
.ap-ctrl { display: flex; align-items: center; gap: 12px; }
.ap-play {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  padding: 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  cursor: pointer;
  color: #131a33;
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 20px rgba(233, 184, 78, 0.28);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ap-play:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 28px rgba(233, 184, 78, 0.4); }
.ap-play:active { transform: translateY(0) scale(0.95); }
.ap-play:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ap-play.is-loading { opacity: 0.55; }
.ap-play svg { width: 20px; height: 20px; display: block; }

.ap-seek {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 22px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
  border-radius: 6px;
}
.ap-seek-track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(150, 160, 190, 0.22);
}
.ap-seek-fill {
  position: absolute; left: 0; top: 50%;
  height: 4px; width: 0%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.ap-seek-thumb {
  position: absolute; top: 50%; left: 0%;
  width: 12px; height: 12px; margin-left: -6px;
  transform: translateY(-50%) scale(0);
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(233, 184, 78, 0.18);
  transition: transform 0.16s var(--ease);
}
.ap-seek:hover .ap-seek-thumb,
.ap-seek:focus-visible .ap-seek-thumb,
.ap.is-seeking .ap-seek-thumb { transform: translateY(-50%) scale(1); }
.ap-seek:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.ap-time {
  flex: 0 0 auto;
  min-width: 76px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* loading skeleton shimmer until canplay */
.ap.is-loading .ap-seek-track {
  background-image: linear-gradient(90deg, rgba(150, 160, 190, 0.16) 0%, rgba(233, 184, 78, 0.5) 50%, rgba(150, 160, 190, 0.16) 100%);
  background-size: 200% 100%;
  animation: ap-shimmer 1.3s linear infinite;
}
@keyframes ap-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (max-width: 360px) {
  .ap-viz { height: 46px; }
  .ap-play { width: 40px; height: 40px; }
  .ap-play svg { width: 18px; height: 18px; }
  .ap-time { min-width: 68px; font-size: 11px; }
  .ap-ctrl { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .difficulty-badge--appear { animation: none; }
  .q-gallery__card:not([hidden]),
  .lightbox { animation: none; }
  .ap.is-loading .ap-seek-track,
  .ap-spinner { animation: none; }
}
.preview-qwrap { position: relative; }
.preview-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--gold-2);
  text-shadow: 0 2px 18px rgba(10, 14, 30, 0.9);
  padding: 0 24px;
  pointer-events: none;
}

/* ---------- timer ring ---------- */

.ring-wrap { position: relative; width: 132px; height: 132px; margin: 0 auto 20px; }
.ring { display: block; transform: rotate(-90deg); }
.ring-ticks { fill: none; stroke: rgba(244, 240, 228, 0.1); stroke-width: 5; stroke-dasharray: 1 5.594; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 7; }
.ring-progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 351.86;
  stroke-dashoffset: 0;
  transition: stroke 0.5s;
  filter: drop-shadow(0 0 6px rgba(233, 184, 78, 0.35));
}
.ring-wrap.is-idle { animation: breathe 4s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.ring-wrap.is-warn .ring-progress { stroke: var(--warn) !important; }
.ring-wrap.is-danger .ring-progress { stroke: var(--fail) !important; }
.ring-wrap.is-warn .ring-secs, .ring-wrap.is-danger .ring-secs { animation: tick-pulse 1s infinite; }
.ring-wrap.is-warn { filter: drop-shadow(0 0 16px rgba(255, 179, 71, 0.35)); }
.ring-wrap.is-danger { filter: drop-shadow(0 0 16px rgba(242, 125, 114, 0.4)); }
@keyframes tick-pulse { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.07); } }
.ring-wrap.flash-ok .ring-progress { stroke: var(--ok) !important; }

/* SPEC 85 soft blitz: the ring badge during the opening window. */
.ring-blitz {
  display: none;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFD37A, #E9B84E);
  color: #1B1610;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ring-wrap.is-blitz .ring-blitz { display: inline-block; animation: blitz-pulse 0.9s var(--ease) infinite; }
.ring-wrap.is-blitz { filter: drop-shadow(0 0 14px rgba(255, 211, 122, 0.45)); }
@keyframes blitz-pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); } }

/* SPEC 85: the blitz verdict banner ("Впізнав з перших нот"). */
.blitz-banner {
  display: none;
  margin: -4px 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-soft, #FFD37A);
  letter-spacing: 0.02em;
}
.blitz-banner.is-on { display: block; animation: blitz-in 0.45s var(--ease); }
@keyframes blitz-in { from { transform: scale(0.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ring-wrap.is-blitz .ring-blitz, .blitz-banner.is-on { animation: none; }
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ring-secs {
  font-family: var(--font-mono);
  font-weight: 640;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ring-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
}

.qcard-foot {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(150, 160, 190, 0.12);
}
.demo-disclaimer {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 16px;
  text-align: center;
}

/* ---------- sections ---------- */

.section {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 100px 24px;
}
main > .section:nth-of-type(even)::before {
  content: "";
  position: absolute;
  inset: -120px -30vw;
  z-index: -1;
  background: radial-gradient(ellipse 46% 52% at 18% 40%, rgba(51, 70, 184, 0.11), transparent 68%);
  pointer-events: none;
}
main > .section:nth-of-type(odd):not(.section--try)::before {
  content: "";
  position: absolute;
  inset: -120px -30vw;
  z-index: -1;
  background: radial-gradient(ellipse 46% 52% at 84% 45%, rgba(233, 184, 78, 0.07), transparent 68%);
  pointer-events: none;
}
main > .section:not(.section--try)::after {
  content: "";
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 184, 78, 0.18), transparent);
  pointer-events: none;
}

/* scroll reveals (visualistka motion language: rise-up, 80-90ms stagger) */
[data-sr] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0s);
}
[data-sr].in { opacity: 1; transform: translateY(0); }

/* fair icons draw themselves in */
.fair-icon path, .fair-icon circle {
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  transition: stroke-dashoffset 1.1s var(--ease) 0.25s;
}
.fair-card.in .fair-icon path, .fair-card.in .fair-icon circle { stroke-dashoffset: 0; }

/* ladder badge ignition on reveal */
.ladder-card.in .ladder-badge { animation: badge-ignite 0.9s var(--ease) both; }
@keyframes badge-ignite {
  0% { transform: scale(0.8); filter: brightness(0.6); }
  55% { transform: scale(1.08); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* rotating ring behind the final CTA */
.cta-band { overflow: hidden; }
.band-ring {
  position: absolute;
  width: 560px;
  height: 560px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.09;
  z-index: -1;
  animation: band-spin 70s linear infinite;
  pointer-events: none;
}
@keyframes band-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.ladder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ladder-card {
  position: relative;
  background: rgba(19, 26, 54, 0.5);
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s;
  overflow: hidden;
}
.ladder-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}
.ladder-card:hover { transform: translateY(-4px); border-color: var(--line); }
.ladder-badge {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--gold);
  border: calc(1px + var(--lvl) * 1px) solid rgba(233, 184, 78, calc(0.22 + var(--lvl) * 0.17));
  box-shadow: 0 0 calc(var(--lvl) * 10px) rgba(233, 184, 78, calc(var(--lvl) * 0.09)),
              inset 0 0 calc(var(--lvl) * 6px) rgba(233, 184, 78, calc(var(--lvl) * 0.05));
}
.ladder-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.ladder-range { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.topics-cloud { display: flex; flex-wrap: wrap; gap: 12px; max-width: 780px; }
.topic-chip {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 20px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--ink);
  transition: border-color 0.25s, transform 0.25s var(--ease), color 0.25s;
  cursor: default;
}
.topic-chip:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }

.fair-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fair-card {
  position: relative;
  background: rgba(19, 26, 54, 0.5);
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  padding: 32px 28px;
  overflow: hidden;
}
.fair-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}
.fair-icon { width: 34px; height: 34px; color: var(--gold); margin-bottom: 18px; }
.fair-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.fair-card p { color: var(--muted); font-size: 15.5px; }

.cta-band { text-align: center; padding-top: 40px; padding-bottom: 130px; }
.cta-band h2 { margin-bottom: 30px; }

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(150, 160, 190, 0.12);
  padding: 26px 24px 36px;
  text-align: center;
}
.site-footer p { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ---------- overlays / modals ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 8, 19, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  animation: overlay-in 0.3s var(--ease);
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.game-modal {
  position: relative;
  background: linear-gradient(180deg, rgba(23, 31, 62, 0.97), rgba(15, 21, 44, 0.97));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow), 0 0 90px rgba(233, 184, 78, 0.07);
  /* entry animation lives on .entering only: keeping it on the base class made
     the browser REPLAY modal-in whenever a modifier class (shake/panic) was
     removed — the owner saw the window "load twice" after answering */
  width: min(680px, 100%);
  max-height: min(92vh, 880px);
  max-height: min(92dvh, 880px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 30px 18px;
}
.game-modal.entering { animation: modal-in 0.4s var(--ease); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.game-modal::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}
.game-modal.shake { animation: shake 0.45s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-9px); }
  35% { transform: translateX(8px); }
  55% { transform: translateX(-5px); }
  75% { transform: translateX(3px); }
}
.game-modal.flash-fail { box-shadow: var(--shadow), 0 0 70px rgba(242, 125, 114, 0.28); }
.game-modal.flash-ok   { box-shadow: var(--shadow), 0 0 70px rgba(87, 217, 163, 0.22); }

/* game modal internals */
.gm-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(150, 160, 190, 0.12);
}
.gm-progress { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.gm-diff button { padding: 4px 8px; font-size: 10px; }
@media (max-width: 560px) { .gm-diff { display: none; } }
.history-strip { display: flex; gap: 6px; flex: 1; }
.history-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 640;
  animation: dot-in 0.3s var(--ease);
}
@keyframes dot-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.history-dot.ok { color: var(--ok); border: 1px solid rgba(87, 217, 163, 0.45); background: rgba(87, 217, 163, 0.08); }
.history-dot.fail { color: var(--fail); border: 1px solid rgba(242, 125, 114, 0.45); background: rgba(242, 125, 114, 0.08); }
.gm-close, .gm-sound {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gm-close:hover { color: var(--fail); border-color: rgba(242, 125, 114, 0.5); transform: rotate(90deg); }
.gm-sound:hover { color: var(--gold-2); border-color: var(--line); }
.gm-sound.is-muted { color: var(--fail); }

.answer-zone { position: relative; padding-top: 10px; }
.answer-row { display: flex; gap: 10px; }
.answer-input {
  flex: 1;
  min-width: 0;
  background: rgba(6, 9, 20, 0.65);
  border: 1px solid rgba(150, 160, 190, 0.22);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 460;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.answer-input::placeholder { color: rgba(150, 160, 190, 0.55); }
.answer-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 184, 78, 0.16);
}
.answer-input:disabled { opacity: 0.45; }
.btn--answer { padding: 13px 24px; border-radius: 12px; }
.btn--answer:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.answer-hint { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 10px; }

.start-pill {
  display: block;
  margin: -4px auto 16px;
  background: rgba(10, 14, 30, 0.7);
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 11px 26px;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.3s;
}
.start-pill:hover { box-shadow: 0 0 30px rgba(233, 184, 78, 0.35); transform: scale(1.04); }

.result-zone { padding-top: 4px; }   /* no container animation: verdict pops once, no double-appearance */
.final-zone { animation: rise-in 0.32s var(--ease); text-align: center; padding: 10px 0 4px; }

.diff-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.diff-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}
.diff-switch button {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.diff-switch button:hover { color: var(--ink); border-color: var(--line); }
.diff-switch button.is-active {
  background: rgba(233, 184, 78, 0.16);
  border-color: var(--gold);
  color: var(--gold-2);
}

/* spec-20: content-type segmented control — same visual language as the
   difficulty pills; a secondary chip row appears for music themes */
.content-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.content-switch button {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.content-switch button:hover { color: var(--ink); border-color: var(--line); }
.content-switch button.is-active {
  background: rgba(233, 184, 78, 0.16);
  border-color: var(--gold);
  color: var(--gold-2);
}
.content-themes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -6px 0 14px;
}
.ct-chip {
  font: 500 11.5px/1 var(--font-mono);
  letter-spacing: 0.03em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ct-chip:hover { color: var(--ink); border-color: var(--line); }
.ct-chip.is-active {
  background: rgba(233, 184, 78, 0.16);
  border-color: var(--gold);
  color: var(--gold-2);
}
/* header variant: compact, one line, mirrors diff-hdr */
.content-hdr button { padding: 6px 10px; font-size: 10px; }
@media (max-width: 760px) { .content-hdr { display: none; } }   /* modal ready-phase picker still available */
@media (max-width: 560px) {
  /* squarish/foldable width: pills wrap onto two rows, never overflow */
  .content-switch { gap: 6px; }
  .content-switch button { padding: 7px 11px; font-size: 11.5px; }
  .content-themes { gap: 5px; margin: -4px 0 12px; }
  .ct-chip { padding: 6px 10px; font-size: 10.5px; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.verdict {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  animation: verdict-pop 0.45s var(--ease);
}
@keyframes verdict-pop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.verdict.ok { color: var(--ok); }
.verdict.fail { color: var(--fail); }
.grey-note { font-size: 14px; color: var(--warn); margin-bottom: 10px; }
.correct-answer { margin-bottom: 4px; }
.player-answer { color: var(--muted); font-size: 14.5px; margin-bottom: 4px; }
.accepted-line { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.q-comment {
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin-bottom: 12px;
}
.attribution { position: relative; width: max-content; max-width: 100%; margin-bottom: 8px; }
.attribution-chip {
  padding: 5px 11px; border: 1px solid var(--line-dim); border-radius: 999px;
  background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer;
  font: 600 11.5px/1.2 var(--font-mono); letter-spacing: .02em;
}
.attribution-chip:hover, .attribution-chip:focus-visible {
  color: var(--gold-2); border-color: rgba(233,184,78,.5); outline: none;
}
.attribution-popover { bottom: calc(100% + 7px); min-width: min(290px, 78vw); }
.attribution-popover__copy { display: block; }
/* v160: base + author pack as two compact labelled rows */
.attribution-popover__row { display: flex; gap: 10px; align-items: baseline; }
.attribution-popover__row + .attribution-popover__row { margin-top: 4px; }
.attribution-popover__label {
  flex: 0 0 auto;
  min-width: 42px;
  font: 600 9px/1.7 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.attribution-popover__value { font-size: 12.5px; }
.attribution-popover a {
  display: inline-block; margin-top: 8px; color: var(--gold-2);
  font: 650 12px/1.3 var(--font-mono); text-underline-offset: 3px;
}
.rating-line { font-family: var(--font-mono); font-size: 15px; margin-bottom: 16px; }
.rating-line .delta-pos { color: var(--gold); font-weight: 640; }
.rating-line .delta-neg { color: var(--fail); font-weight: 640; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.final-zone .result-actions { justify-content: center; }

.final-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 10px; }
.final-score {
  font-family: var(--font-display);
  font-weight: 680;
  font-size: 64px;
  background: linear-gradient(115deg, var(--gold-2) 20%, var(--gold) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.05;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 34px rgba(233, 184, 78, 0.3));
}
.final-rating { font-family: var(--font-mono); font-size: 16px; margin-bottom: 6px; }
.final-level { margin-bottom: 18px; }
.final-level strong { color: var(--gold); }

.final-history {
  text-align: left;
  margin: 0 0 20px;
  border: 1px solid rgba(150, 160, 190, 0.14);
  border-radius: 14px;
  overflow: hidden;
}
.fh-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(150, 160, 190, 0.09);
}
.fh-row:last-child { border-bottom: none; }
.fh-row:nth-child(odd) { background: rgba(255, 255, 255, 0.018); }
.fh-icon { font-family: var(--font-mono); font-weight: 640; flex: none; }
.fh-icon.ok { color: var(--ok); }
.fh-icon.fail { color: var(--fail); }
.fh-q { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-a { font-family: var(--font-mono); font-size: 12px; color: var(--ink); flex: none; max-width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gm-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(150, 160, 190, 0.1);
}

.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 26px;
  z-index: 5;
}
.confetti {
  position: absolute;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: confetti-fly 1.15s var(--ease) forwards;
}
@keyframes confetti-fly {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--cx)), calc(-50% + var(--cy))) rotate(var(--cr)) scale(0.6); }
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: rgba(15, 21, 44, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 22px;
  font-size: 14px;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  z-index: 100;
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .popup { display: none; }
  .site-nav { display: none; }
}
@media (max-width: 960px) {
  .hero { padding-top: 100px; }
  .ladder-grid { grid-template-columns: repeat(2, 1fr); }
  .fair-grid { grid-template-columns: 1fr; }
  .game-modal { padding: 18px 20px 14px; }
  .fh-a { display: none; }
  .btn--small { padding: 9px 12px; font-size: 11.5px; }
}
@media (max-width: 760px) {
  .diff-hdr { display: none; }   /* modal ready-phase picker still available */
}
@media (max-width: 560px) {
  .header-inner { gap: 12px; }
  .wordmark { font-size: 19px; }
  .section { padding: 64px 16px; }
  .hero {
    align-items: flex-start;
    padding: 88px 16px 64px;
  }
  .eyebrow { margin-bottom: 10px; font-size: 10px; }
  .hero-title { font-size: clamp(39px, 12.5vw, 58px); margin-bottom: 16px; }
  .hero-sub { font-size: 14px; line-height: 1.42; margin-bottom: 18px; }
  .hero-actions { gap: 9px; }
  .hero-action--primary .btn { min-height: 56px; padding: 13px 16px; font-size: 15px; }
  .hero-action--secondary .btn { min-height: 50px; padding: 12px 16px; font-size: 14px; }
  .hero-action .cta-sub { margin-top: 4px; font-size: 10.5px; }
  .hero-mode-grid { gap: 9px; }
  .hero-mode-card { min-height: 104px; padding-inline: 8px; }
  .hero-mode-name { font-size: 12px; }
  .hero-mode-copy { font-size: 10px; }
  .micro-stats { font-size: 10.5px; line-height: 1.4; }
  .qcard-tilt { padding: 20px 18px; }
  .answer-row { flex-direction: column; }
  .ladder-grid { grid-template-columns: 1fr; }
  .overlay { padding: 10px; }
  #btn-login { display: none; }
}

/* ---------- unfolded foldables / squarish & short-landscape screens ----------
   e.g. Oppo Find N5 inner display in Chrome: desktop-wide viewport but short
   visible height (address bar + system dock). Scale hero type from height so
   the CTA row stays inside the first screen. */
@media (min-width: 561px) and (max-height: 900px) {
  .hero {
    padding: 88px 24px calc(48px + env(safe-area-inset-bottom, 0px));
  }
  .hero-title {
    font-size: clamp(44px, 8.5svh, 96px);
    margin-bottom: 22px;
  }
  .hero-sub {
    font-size: 16px;
    margin-bottom: 28px;
  }
  .section {
    padding-block: 64px;
  }
  .game-modal {
    max-height: min(94dvh, 880px);
    border-radius: 18px;
  }
  .overlay {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

/* SPEC 23a: premium casual screens, title card, and shared empty states */

/* A11 — casual and tournament verdicts use the deliberate gold-on-ink card.
   Ranked and daily keep their existing compact result treatment. */
#result-zone.verdict-card,
#tr-result-zone.verdict-card {
  padding: 22px;
  border: 1px solid rgba(233, 184, 78, 0.42);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 4%, rgba(233, 184, 78, 0.12), transparent 32%),
    linear-gradient(160deg, rgba(19, 26, 54, 0.98), rgba(8, 12, 29, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 46px rgba(3, 6, 18, 0.3);
}
#result-zone.verdict-card {
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
#result-zone.verdict-card::before,
#tr-result-zone.verdict-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
#result-zone.verdict-card > .verdict,
#tr-result-zone.verdict-card > .verdict {
  min-height: 28px;
  margin: 0 0 14px;
}
#result-zone.verdict-card.has-verdict-stamp > .verdict,
#tr-result-zone.verdict-card.has-verdict-stamp > .verdict { padding-right: 116px; }
#result-zone.verdict-card .verdict-stamp,
#tr-result-zone.verdict-card .verdict-stamp { top: 17px; right: 18px; }
#result-zone .verdict-flags {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
#result-zone .verdict-flags .rule-chip,
#result-zone .verdict-flags .grey-note { margin-bottom: 0; }
#result-zone .verdict-answer-block {
  margin: 0 0 16px;
  padding: 16px 17px 14px;
  border: 1px solid rgba(233, 184, 78, 0.3);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  background: rgba(5, 8, 20, 0.55);
}
#result-zone .correct-answer {
  margin: 0;
  color: var(--gold-2);
}
#result-zone .correct-answer__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#result-zone #correct-answer {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(25px, 5vw, 34px);
  font-weight: 640;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
#result-zone .player-answer {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-dim);
  color: var(--ink);
  font-size: 13.5px;
}
#result-zone .accepted-line {
  margin: 9px 0 0;
  color: var(--muted);
}
#result-zone .q-comment {
  margin: 0 0 14px;
  padding: 14px 15px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 15px;
  font-style: normal;
  line-height: 1.65;
}
#result-zone .reveal-media {
  margin: 0 0 14px;
  animation: rise-in 0.32s var(--ease);
}
#result-zone .reveal-media__caption {
  margin: 0 0 7px;
  color: var(--muted);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#result-zone .reveal-media img,
#result-zone .reveal-media video {
  display: block;
  max-width: 100%;
  max-height: min(48vh, 440px);
  border: 1px solid var(--line-dim);
  border-radius: 12px;
  background: rgba(5, 8, 20, 0.55);
}
#result-zone .reveal-media img { width: auto; }
#result-zone .reveal-media img[role="button"] { cursor: zoom-in; }
#result-zone .reveal-media video,
#result-zone .reveal-media audio { width: 100%; }
#result-zone .explain-zone { margin: 0 0 14px; }
#result-zone .verdict-progress {
  padding: 11px 0 4px;
  border-top: 1px solid var(--line-dim);
}
#result-zone .rating-line { margin-bottom: 10px; }
#result-zone .rank-progress { margin-bottom: 10px; }
#result-zone .attribution {
  margin: 0 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-dim);
  color: var(--muted);
  /* v161: opacity on the container flattened the popover subtree (broke its
     backdrop and washed the panel out over the Магістр block) - the muted
     look lives on the chip alone, the container out-stacks its neighbours */
  z-index: 12;
}
#result-zone .attribution .attribution-chip { opacity: 0.78; }
#result-zone .attribution .attribution-chip:hover,
#result-zone .attribution .attribution-chip:focus-visible { opacity: 1; }
#result-zone .verdict-actions {
  position: sticky;
  z-index: 5;
  bottom: -18px;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 7px;
  margin: 16px -22px calc(-64px - env(safe-area-inset-bottom));
  padding: 10px 22px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-dim);
  background: rgba(8, 12, 29, 0.97);
  box-shadow: 0 -14px 30px rgba(3, 6, 18, 0.3);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
#result-zone .verdict-actions .btn {
  min-width: 0;
  padding: 10px 13px;
  font-size: 11.5px;
  white-space: nowrap;
}
#result-zone .verdict-actions #btn-next { flex: 1 1 auto; }
#result-zone .verdict-actions #btn-summary,
#result-zone .verdict-actions #btn-appeal { flex: 0 1 auto; }

/* A12 — casual summary poster. */
#final-zone.series-poster {
  position: relative;
  padding: 28px 24px 24px;
  border: 1px solid rgba(233, 184, 78, 0.4);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(233, 184, 78, 0.15), transparent 38%),
    linear-gradient(165deg, rgba(20, 28, 56, 0.98), rgba(7, 11, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px rgba(3, 6, 18, 0.34);
  animation: none;
}
#final-zone.series-poster::before {
  content: "◆";
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 14px;
  text-shadow: 0 0 18px rgba(233, 184, 78, 0.55);
}
#final-zone.series-poster > .poster-stage {
  animation: rise-in 180ms var(--ease) both;
  animation-delay: var(--poster-delay, 0ms);
}
#final-zone .final-title { --poster-delay: 0ms; margin-bottom: 6px; }
#final-zone .final-score { --poster-delay: 18ms; font-size: clamp(68px, 14vw, 92px); margin-bottom: 8px; }
#final-zone .final-rating { --poster-delay: 36ms; margin: 0 auto 10px; color: var(--ink); }
#final-zone .final-streak { --poster-delay: 48ms; margin-bottom: 12px; }
#final-zone .final-category-block { --poster-delay: 60ms; margin: 14px 0; }
#final-zone .final-category-label {
  margin-bottom: 8px;
  color: var(--muted);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#final-zone .final-categories {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}
#final-zone .final-category-chip {
  padding: 6px 11px;
  border: 1px solid rgba(233, 184, 78, 0.34);
  border-radius: 999px;
  background: rgba(233, 184, 78, 0.08);
  color: var(--gold-2);
  font: 500 11px/1.2 var(--font-mono);
}
#final-zone .final-level { --poster-delay: 70ms; margin: 12px 0 16px; }
#final-zone .final-keys { --poster-delay: 78ms; gap: 10px; margin-bottom: 18px; }
#final-zone .final-keys .skey { width: 36px; height: 36px; }
#final-zone .final-history {
  --poster-delay: 84ms;
  max-height: 220px;
  overflow-y: auto;
  border-color: var(--line-dim);
  background: rgba(5, 8, 20, 0.3);
}
#final-zone .poster-suggestion {
  --poster-delay: 88ms;
  display: block;
  margin: 0 auto 14px;
}
#final-zone .series-poster-actions {
  --poster-delay: 90ms;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#final-zone .series-poster-actions #btn-continue {
  grid-column: 1 / -1;
  min-height: 50px;
  font-size: 15px;
}
#final-zone .series-poster-actions .btn--ghost { color: var(--muted); }
#final-zone .series-poster-actions .btn--ghost:hover { color: var(--ink); }
#final-zone.is-survival-new {
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 54px rgba(233, 184, 78, 0.18);
}

/* A20 — transient brand card inside the casual modal. */
.game-modal > .game-title-card {
  position: absolute;
  z-index: 12;
  inset: 0;
  min-height: 100%;
  padding: 32px;
  border-radius: 25px;
  background:
    radial-gradient(circle at 50% 42%, rgba(233, 184, 78, 0.16), transparent 37%),
    linear-gradient(155deg, rgba(19, 26, 54, 0.995), rgba(5, 8, 20, 0.995));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  touch-action: manipulation;
}
.game-modal > .game-title-card.is-visible {
  pointer-events: auto;
  animation: modal-in 220ms var(--ease) both;
}
.game-title-card__glyph {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 24px;
  text-shadow: 0 0 22px rgba(233, 184, 78, 0.6);
}
.game-title-card__brand {
  margin-bottom: 8px;
  color: var(--muted);
  font: 650 12px/1 var(--font-mono);
  letter-spacing: 0.28em;
}
.game-title-card__mode {
  margin-bottom: 16px;
  color: var(--gold-2);
  font: 650 clamp(34px, 8vw, 58px)/1 var(--font-display);
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.game-title-card__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font: 500 12px/1.4 var(--font-mono);
}
.game-title-card__meta span[aria-hidden] { color: var(--gold); font-size: 8px; }
.game-title-card__skip {
  margin-top: 24px;
  color: var(--muted);
  font: 500 10.5px/1.4 var(--font-mono);
}

/* A19 — lightweight branded zero-data treatment shared by all three surfaces. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(19, 26, 54, 0.42);
  text-align: center;
}
.empty-state__glyph {
  color: var(--gold);
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(233, 184, 78, 0.45);
}
.empty-state__text {
  max-width: 34ch;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.empty-state__action { margin-top: 2px; }
.empty-state--compact { padding: 18px 12px; gap: 8px; }
.empty-state--compact .empty-state__glyph { font-size: 27px; }
.empty-state--compact .empty-state__text { font-size: 12px; }
.casual-empty { margin: 20px 0 8px; }
.lb-list > .empty-state { margin: 8px 0 2px; }

/* A9 — empty submission feedback; JS omits the class for reduced motion. */
.answer-row.is-empty-submit { animation: nm-wobble 360ms var(--ease); }
.answer-row.is-empty-submit .answer-input { border-color: var(--fail); }

@media (max-width: 560px) {
  #result-zone.verdict-card,
  #tr-result-zone.verdict-card { padding: 17px 15px 15px; }
  #result-zone.verdict-card.has-verdict-stamp > .verdict,
  #tr-result-zone.verdict-card.has-verdict-stamp > .verdict { padding-right: 94px; }
  #result-zone.verdict-card .verdict-stamp,
  #tr-result-zone.verdict-card .verdict-stamp { top: 13px; right: 12px; }
  #result-zone .verdict-answer-block { padding: 14px 13px 12px; }
  #result-zone #correct-answer { font-size: 25px; }
  #result-zone .verdict-actions { gap: 5px; }
  #result-zone .verdict-actions .btn { padding: 9px 6px; font-size: 9.5px; letter-spacing: 0.01em; }

  #final-zone.series-poster { padding: 22px 14px 16px; border-radius: 18px; }
  #final-zone .final-score { font-size: 66px; }
  #final-zone .final-keys { gap: 7px; }
  #final-zone .final-keys .skey { width: 32px; height: 32px; }
  #final-zone .final-history { max-height: 180px; }

  .game-modal > .game-title-card { padding: 24px 18px; border-radius: 18px; }
  .game-title-card__mode { font-size: 34px; }
  .game-title-card__meta { gap: 7px; font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  #final-zone.series-poster > .poster-stage,
  .game-modal > .game-title-card.is-visible,
  .answer-row.is-empty-submit,
  #result-zone .reveal-media {
    animation: none;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring-wrap.is-idle,
  .popup.is-in.float-a, .popup.is-in.float-b, .popup.is-in.float-c,
  .ring-wrap.is-warn .ring-secs, .ring-wrap.is-danger .ring-secs,
  .game-modal.shake, .confetti, .verdict {
    animation: none;
  }
  .reveal, .popup, [data-sr] { transition-duration: 0.01s; transform: none; opacity: 1; }
  .band-ring, .ladder-card.in .ladder-badge { animation: none; }
  .fair-icon path, .fair-icon circle { stroke-dashoffset: 0; transition: none; }
  .reveal-line { transition-duration: 0.01s; transform: none; }
  .btn, .ladder-card, .topic-chip { transition: none; }
  .overlay, .game-modal, .auth-modal { animation: none; }
  .hero-video { display: none; }
  body:not(.no-video) .hero { background: url("../media/hero-still.jpg") center/cover; }
}

/* ---------- board-features: streak, hint, pass, panic, rank progress, exit confirm ---------- */
.streak-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--warn);
  border: 1px solid rgba(255, 179, 71, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  animation: dot-in 0.3s var(--ease);
}
.streak-chip b { font-weight: 700; }
.streak-chip.s3 { color: var(--gold-2); border-color: var(--gold); box-shadow: 0 0 12px rgba(233, 184, 78, 0.35); }
.streak-chip.s5 { color: #FF9D5C; border-color: #FF9D5C; box-shadow: 0 0 16px rgba(255, 157, 92, 0.45); }
.streak-chip.s10 { color: var(--fail); border-color: var(--fail); box-shadow: 0 0 20px rgba(242, 125, 114, 0.55); }

.mask-line {
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--gold-2);
  text-align: center;
  margin-bottom: 10px;
  animation: rise-in 0.3s var(--ease);
}
.hint-step-line { display: block; }
.hint-step-line--semantic { color: var(--ink); }
.assist-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.assist-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.assist-btn:hover:not(:disabled) { color: var(--gold-2); border-color: var(--line); }
.assist-btn:disabled { opacity: 0.4; cursor: default; }
.assist-row .answer-hint { margin: 0 0 0 auto; }
.assist-confirm-wrap { position: relative; }
.assist-popover {
  position: absolute; z-index: 8; bottom: calc(100% + 8px); left: 0;
  width: min(310px, 78vw); padding: 10px; border: 1px solid rgba(233,184,78,.35);
  /* v161: near-opaque panel - .88 let underlying text bleed through wherever
     an ancestor context killed the backdrop blur */
  border-radius: 10px; background: rgba(13,18,38,.97); color: var(--ink);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 12px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.assist-popover button {
  display: block; margin-top: 8px; padding: 6px 12px; cursor: pointer;
  border: 1px solid rgba(233,184,78,.5); border-radius: 999px;
  background: rgba(233,184,78,.12); color: var(--gold-2);
  font: 650 12px/1 var(--font-mono); letter-spacing: .02em;
}
.assist-popover button:hover { background: rgba(233,184,78,.22); border-color: var(--gold-2); }
/* v162: invisible hover bridge across the 7-8px gap between the trigger and
   the panel - crossing that gap dropped :hover/mouse containment and closed
   the panel before the cursor could reach a link inside it */
.assist-popover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}
.assist-confirm-wrap:focus-within .assist-popover[hidden],
.assist-confirm-wrap:hover .assist-popover[hidden] { display: block; }

.panic-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: 26px;
  background: radial-gradient(ellipse 75% 65% at 50% 50%, transparent 55%, rgba(242, 125, 114, 0.28));
  opacity: 0;
  transition: opacity 0.6s;
}
.game-modal.panic .panic-vignette { opacity: 1; animation: panic-pulse 1s ease-in-out infinite; }
@keyframes panic-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.85; } }

.verdict.pass { color: var(--warn); }
.rule-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ok);
  border: 1px solid rgba(87, 217, 163, 0.35);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

.rank-progress { margin-bottom: 16px; }
.rp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 6px;
}
.rp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  transition: width 0.8s var(--ease);
}
.rp-label { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.rank-progress.near .rp-label { color: var(--gold-2); animation: tick-pulse 1.2s infinite; }

.final-streak { font-family: var(--font-mono); font-size: 13px; color: var(--warn); margin-bottom: 14px; }

.exit-confirm {
  border: 1px solid rgba(242, 125, 114, 0.4);
  border-radius: 14px;
  background: rgba(242, 125, 114, 0.07);
  padding: 16px 18px;
  margin-top: 14px;
  animation: rise-in 0.25s var(--ease);
}
.exit-confirm p { font-size: 14.5px; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  .game-modal.panic .panic-vignette { animation: none; opacity: 0.4; }
  .rank-progress.near .rp-label { animation: none; }
  .streak-chip, .mask-line, .exit-confirm { animation: none; }
}

/* ---------- auth modal (live) ---------- */

.auth-modal {
  position: relative;
  background: linear-gradient(180deg, rgba(23, 31, 62, 0.97), rgba(15, 21, 44, 0.97));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow), 0 0 90px rgba(233, 184, 78, 0.07);
  animation: modal-in 0.4s var(--ease);
  width: min(420px, 100%);
  padding: 30px 32px 26px;
}
.auth-modal::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
}
.auth-modal .gm-close { position: absolute; top: 18px; right: 18px; }
.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #fff;
  color: #1f2430;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.auth-google:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-dim); }
.auth-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.auth-label .answer-input { width: 100%; margin-top: 6px; font-family: var(--font-body); }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-msg {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ok);
  margin: 2px 0 10px;
  text-align: center;
}
.auth-msg.is-error { color: var(--fail); }
.auth-forgot, .auth-switch {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}
.auth-forgot { margin-top: 16px; color: var(--muted); }
.auth-forgot:hover, .auth-switch:hover { color: var(--gold-2); text-decoration: underline; }

/* ---------- five keys mode ---------- */
.cta-main { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cta-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.keys-strip, .final-keys { display: flex; gap: 8px; align-items: center; }
.final-keys { justify-content: center; margin-bottom: 18px; }
.skey { width: 26px; height: 26px; flex: none; position: relative; }
.final-keys .skey { width: 40px; height: 40px; }
.skey svg { width: 100%; height: 100%; display: block; }
.skey .k-outline { stroke: rgba(150, 160, 190, 0.5); fill: none; stroke-width: 1.6; }
.skey.done .k-outline { stroke: var(--gold); fill: rgba(233, 184, 78, 0.85); }
.skey.fail .k-outline { stroke: rgba(242, 125, 114, 0.7); fill: rgba(242, 125, 114, 0.12); }
.skey.cur .k-outline { stroke: var(--gold-2); }
.skey.cur { animation: key-pulse 1.6s var(--ease) infinite; }
@keyframes key-pulse { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.12); opacity: 1; } }
.skey.done { filter: drop-shadow(0 0 6px rgba(233, 184, 78, 0.5)); }
@media (prefers-reduced-motion: reduce) { .skey.cur { animation: none; } }

/* ---------- wave2: near-miss, pass reveal, onboarding, mobile dock ---------- */
.answer-input.near-miss {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(233, 184, 78, 0.25), 0 0 22px rgba(233, 184, 78, 0.35) !important;
  animation: nm-wobble 0.5s var(--ease);
}
@keyframes nm-wobble { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

.result-zone.pass-reveal .correct-answer { font-size: 21px; }
.result-zone.pass-reveal .correct-answer strong {
  color: var(--gold-2);
  font-size: 24px;
  display: inline-block;
  animation: rise-in 0.35s var(--ease);
}

.ob-tip {
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(233, 184, 78, 0.1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  animation: rise-in 0.3s var(--ease);
}

@media (max-width: 760px) {
  .game-modal { max-height: min(96dvh, 880px); }
  #game-overlay > .game-modal { max-height: min(calc(var(--vvh, 100dvh) - 16px), 880px); }
  .answer-zone {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(15, 21, 44, 0.97) 22%);
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 6;
  }
  .assist-btn, .btn--answer { min-height: 44px; }
}

/* A13 — compact casual action dock bound to the real visual viewport. */
@media (max-width: 560px) {
  #game-overlay {
    top: var(--vvtop, 0px);
    bottom: auto;
    height: var(--vvh, 100dvh);
    padding: 8px 8px 0;
    align-items: flex-end;
  }
  #game-overlay > .game-modal {
    display: flex;
    flex-direction: column;
    height: calc(var(--vvh, 100dvh) - 8px);
    max-height: calc(var(--vvh, 100dvh) - 8px);
    overflow-anchor: none;
    scroll-padding-bottom: 132px;
  }
  #game-modal > #gm-question {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
  }
  #game-modal.has-action-dock > .gm-foot { display: none; }
  /* pre-start keeps the base ≤760px sticky answer-zone so #btn-start stays
     on the first screen (review fix: the relative override pushed it below
     the fold on phones) */
  #game-modal #answer-zone.is-action-docked {
    order: 10;
    bottom: -14px;
    margin: 12px -20px -14px;
    margin-top: auto;
    padding: 12px 20px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(15, 21, 44, 0.97);
    box-shadow: 0 -18px 34px rgba(5, 8, 20, 0.34);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
  }
  #game-modal #answer-zone > .answer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  #game-modal #answer-zone .answer-input,
  #game-modal #btn-answer {
    min-height: 48px;
  }
  #game-modal #btn-answer {
    min-width: 104px;
    padding: 10px 14px;
  }
  #game-modal #answer-zone > .assist-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }
  #game-modal #answer-zone > .assist-row .assist-btn {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
  }
  #game-modal #answer-zone > .assist-row .answer-hint { display: none; }
  #game-modal #result-zone .verdict-actions {
    bottom: -15px;
    margin-inline: -15px;
    padding-inline: 15px;
  }
  #game-modal #result-zone .verdict-actions .btn { min-height: 44px; }
}
/* ---------- enhancements ---------- */
.q-media.solviq-enh-media,
.q-media.solviq-enh-zoom-host {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}
.q-media.solviq-enh-media-loading {
  min-height: var(--solviq-enh-skeleton-height, 168px);
}
.solviq-enh-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgb(from var(--gold) r g b / 8%) 20%,
    rgb(from var(--gold) r g b / 16%) 50%,
    rgb(from var(--gold) r g b / 8%) 80%
  );
  background-size: 200% 100%;
  animation: solviq-enh-shimmer 1.4s linear infinite;
}
@keyframes solviq-enh-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.solviq-enh-zoomable {
  -webkit-user-drag: none;
  user-select: none;
  touch-action: pan-y;
  will-change: transform;
}
.solviq-enh-zoomable.solviq-enh-zoom-animate {
  transition: transform 0.22s var(--ease);
}
.solviq-enh-zoomable.is-zoomed {
  touch-action: none;
  cursor: grab;
}
.solviq-enh-zoomable.is-zoomed.is-panning { cursor: grabbing; }

@media (prefers-reduced-motion: reduce) {
  .solviq-enh-skeleton {
    background: rgb(from var(--gold) r g b / 8%);
    animation: none;
  }
  .solviq-enh-zoomable.solviq-enh-zoom-animate { transition: none; }
}

/* pre-start setup row: language + theme (owner 2026-08-11) */
.game-setup { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 2px; }
.setup-group { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.setup-group button {
  font: 500 12px/1 "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
}
.setup-group button.is-active { border-color: var(--gold); color: var(--gold); opacity: 1; }
/* background video must never own the pointer: right-click = normal page menu */
.hero-video { pointer-events: none; }

/* v29: modal header fit with 10 keys — keys shrink, controls never do */
.keys-strip .skey { width: 18px; height: 18px; }
.gm-diff, .gm-lang { flex: none; }
.gm-head { flex-wrap: wrap; row-gap: 6px; }
.gm-lang button { padding: 4px 8px; font-size: 10px; }

/* v29: theme dropdown (pre-start) */
.theme-btn {
  font: 500 13px/1 var(--font-mono);
  letter-spacing: 0.04em;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 20, 0.35);
  color: var(--ink);
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--gold); }
.theme-btn:disabled { opacity: 0.62; cursor: default; }
.game-setup { position: relative; display: flex; justify-content: center; margin: 10px 0 2px; }
.theme-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 6px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(23, 31, 62, 0.98), rgba(15, 21, 44, 0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: min(430px, 92vw);
}
.theme-pop button {
  font: 500 12px/1.2 var(--font-mono);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.theme-pop button:hover { border-color: var(--line); }
.theme-pop button.is-active { border-color: var(--gold); color: var(--gold); }
.theme-pop .theme-n { color: var(--muted); font-size: 10px; }
@media (max-width: 560px) { .theme-pop { grid-template-columns: repeat(2, 1fr); } }

/* spec 76: during a locked casual session the content pills stay clickable
   (a click offers a filtered restart) but read as subtly locked */
.theme-pop button.is-locked { opacity: 0.62; }

/* spec 76: mid-session filter confirm — anchored beside the content dropdown,
   reuses the .theme-pop surface; static show/hide only, so it is inherently
   reduced-motion safe */
.theme-pop.cfilter-confirm {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  max-width: 320px;
}
.cfilter-confirm__text {
  margin: 0;
  font: 500 12.5px/1.5 var(--font-mono);
  color: var(--ink);
}
.cfilter-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cfilter-confirm__actions button {
  display: inline-flex;
  white-space: nowrap;
}
#cfilter-restart-go {
  border-color: var(--gold);
  color: var(--gold-2);
}

/* spec 77: question-base filter — a labeled wrap-grid row inside both content
   dropdowns (owner hard rule: wrapped buttons, never a scroll lane) */
.base-filter {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line-dim);
}
.base-filter__label {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.base-filter button {
  display: inline-flex;
  justify-content: center;
  font: 500 11px/1 var(--font-mono);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}
.base-filter button:hover { color: var(--ink); border-color: var(--line); }
.base-filter button.is-active {
  background: rgba(233, 184, 78, 0.16);
  border-color: var(--gold);
  color: var(--gold-2);
}
.base-filter button.is-locked { opacity: 0.62; }

/* spec 77: ranked CTAs read disabled while a base filter is active; clicks
   show the explanation instead of starting ranked (never pointer-events:
   none — a disabled CTA must never be a silent no-op) */
.btn.is-base-locked { opacity: 0.62; }
.base-ranked-note { color: var(--gold-2); }

/* v29: floating glyphs inside the game modal (same vibe as the hero field) */
.gm-glyphs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.game-modal > *:not(.gm-glyphs) { position: relative; z-index: 1; }

/* v31: theme picker in the site header (opens downward) */
.theme-hdr { position: relative; }
.theme-btn--hdr { font-size: 11px; padding: 6px 12px; background: transparent; color: var(--muted); }
.theme-btn--hdr:hover { color: var(--gold-2); }
.theme-pop--hdr { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; }
/* owner 2026-09-02: the in-game language switch (.gm-dd) must stay usable
   on phones - only the page-header copies collapse. */
@media (max-width: 700px) { .theme-hdr:not(.gm-dd) { display: none; } }
.gm-dd .theme-pop { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; z-index: 90; }
/* v159: the head must out-stack its siblings - the .game-modal>* rule makes
   every child an equal z-index:1 context, so the later-DOM question block
   painted over head popovers and swallowed their clicks */
.game-modal > .gm-head { z-index: 5; }
/* v159: in-game language switch is a one-tap segmented control */
.lang-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.lang-seg button { font: 500 10px/1 var(--font-mono); padding: 5px 9px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.lang-seg button.is-active { background: rgba(233, 184, 78, 0.14); color: var(--gold); }
.lang-seg button:hover { color: var(--gold-2); }

/* v34: pre-start controls must not overlap the start pill */
.game-setup { margin: 12px 0 16px; }
.answer-zone .start-pill { margin-top: 4px; }

/* v35: style gate for music questions */
.style-gate { text-align: center; margin: 6px 0 10px; }
.style-gate-title { font: 500 14px/1.4 var(--font-mono); color: var(--muted); margin-bottom: 10px; }
.style-gate-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.style-gate-row button {
  font: 560 14px/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 20, 0.35);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.style-gate-row button:hover { border-color: var(--gold); transform: translateY(-1px); }

/* v35: time switch + accepted spoiler */
.time-switch button.is-active { border-color: var(--gold); color: var(--gold); opacity: 1; }
.accepted-toggle {
  font: 500 12px/1 var(--font-mono);
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline dotted;
  cursor: pointer;
  padding: 0;
}
.accepted-toggle.is-open { color: var(--gold); }
.accepted-list { display: block; margin-top: 6px; font-size: 13px; color: var(--ink); }

/* v51: one-button filter dropdowns (owner 2026-08-18) */
.gm-dd { position: relative; }
.gm-dd .theme-btn { font-size: 10px; padding: 4px 10px; background: transparent; color: var(--muted); }
.gm-dd .theme-btn:hover { color: var(--gold-2); }
.gm-dd .theme-pop { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; grid-template-columns: 1fr; min-width: 140px; }
#hdr-diff, #content-switch-hdr, #lang-pop-hdr, #lang-pop-gm, #gm-diff, #diff-switch, #content-switch { grid-template-columns: 1fr; min-width: 150px; max-width: 220px; }
.game-setup .theme-hdr { position: relative; display: inline-block; margin-right: 10px; }

/* v53: account chip + popup (logged-in header identity, owner 2026-08-20) */
.account-hdr { position: relative; }
.account-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--gold);
  font: 600 14px/1 var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.account-chip:hover { border-color: var(--gold); }
.account-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-pop { display: block; min-width: 220px; padding: 14px; text-align: left; }
.account-name {
  font: 600 13px/1.3 var(--font-mono);
  color: var(--ink);
  margin: 0 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-pop .account-logout { width: 100%; justify-content: center; color: var(--muted); }
.account-pop .account-logout:hover { color: var(--fail); border-color: var(--fail); }

/* v53: profile stats panel inside the account popup */
.account-pop { max-height: min(70vh, 560px); overflow-y: auto; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.acct-card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-dim); border-radius: 10px; padding: 8px 10px; }
.acct-card-v { font: 600 18px/1.2 var(--font-mono); color: var(--gold-2); }
.acct-card-l { font: 500 10px/1.3 var(--font-mono); color: var(--muted); margin-top: 2px; }
.acct-section { margin-top: 10px; }
.acct-h { font: 600 10px/1.2 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.acct-row { font: 500 12px/1.5 var(--font-mono); color: var(--ink); margin: 0; }
.acct-top { color: var(--ok); }
.acct-low { color: var(--warn); }
.acct-cal-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.acct-cal-cell { width: 11px; height: 11px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.acct-cal-cell.l1 { background: rgba(233, 184, 78, 0.35); }
.acct-cal-cell.l2 { background: rgba(233, 184, 78, 0.65); }
.acct-cal-cell.l3 { background: var(--gold); }
.acct-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.acct-badge { font: 500 10px/1.2 var(--font-mono); color: var(--muted); border: 1px solid var(--line-dim); border-radius: 999px; padding: 4px 8px; opacity: 0.45; }
.acct-badge.is-got { color: var(--gold); border-color: var(--gold); opacity: 1; }
.acct-empty { font: 500 12px/1.5 var(--font-mono); color: var(--muted); margin: 0; }
.acct-note { font: 500 10px/1.4 var(--font-mono); color: var(--muted); margin: 10px 0 0; opacity: 0.8; }
.account-mode-actions { display: grid; gap: 6px; margin: 0 0 10px; }
.account-mode-btn { width: 100%; text-align: left; }
.acct-section > .account-mode-btn { margin-top: 6px; }
.account-pop .account-logout { margin-top: 12px; }

/* v55: answer explainer (interrogate the answer, owner 2026-08-20) */
.explain-zone { margin: 12px 0 4px; }
.explain-host {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
}
.explain-host__avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.explain-host__avatar .host-avatar__initials { font-size: 13px; }
.explain-host__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.host-panel__voice.explain-voice {
  font-size: 14px;
}
.explain-btn {
  font: 500 12px/1.2 var(--font-mono);
  color: var(--gold);
  background: transparent;
  border: 1px dashed var(--gold);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.explain-btn:hover { background: rgba(233, 184, 78, 0.08); }
.explain-btn:disabled { opacity: 0.5; cursor: wait; }
.explain-body {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 10px 10px 0;
}
.explain-p { font: 400 13px/1.6 var(--font-body, inherit); color: var(--ink); margin: 0 0 8px; white-space: pre-wrap; }
.explain-p:last-child { margin-bottom: 0; }
.explain-loading { color: var(--muted); font-style: italic; }
.explain-error { color: var(--warn); }
.explain-followup-q { color: var(--gold-2); font-style: italic; }
.explain-form { display: flex; gap: 8px; margin-top: 10px; }
.explain-input { flex: 1; min-width: 0; }

/* v56: ranked mode — hero CTA (board consensus 2026-08-20) */
.btn--ranked { position: relative; gap: 6px; }
.btn--ranked:not(.is-locked) { animation: ranked-pulse 2.6s ease-in-out infinite; }
@keyframes ranked-pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.18), 0 0 0 rgba(233, 184, 78, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.18), 0 0 26px rgba(233, 184, 78, 0.55); }
}
.btn--ranked.is-locked {
  background: rgba(19, 26, 54, 0.55);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line-dim);
}
.btn--ranked.is-locked:hover { transform: none; box-shadow: none; border-color: rgba(233, 184, 78, 0.4); }
.hero-action--primary .btn--ranked.is-locked {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 72%);
  color: #131a33;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.18);
}
.hero-action--primary .btn--ranked.is-locked:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 44px rgba(233, 184, 78, 0.38);
}
.cta-ranked-lock { font-size: 13px; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn--ranked:not(.is-locked) { animation: none; }
}

/* v56: ranked series overlay */
.ranked-modal .gm-head { flex-wrap: wrap; }
.rk-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}
.rk-head-spacer { flex: 1; }
.rk-calib-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-2);
  border: 1px solid rgba(233, 184, 78, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.rk-loading { text-align: center; padding: 40px 10px; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.rk-notice { font-family: var(--font-mono); font-size: 12.5px; color: var(--warn); margin-top: 10px; }
.rk-context-line {
  min-height: 1.5em;
  margin: -6px 0 10px;
  color: var(--muted);
  font: 500 12px/1.5 var(--font-mono);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms var(--ease);
}
.rk-context-line.is-visible { opacity: 1; visibility: visible; }
.rk-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--gold-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-decoration: underline dotted;
  cursor: pointer;
}
.rk-calib-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gold-2);
  border: 1px solid rgba(233, 184, 78, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
}
.rk-error { text-align: center; padding: 30px 10px 10px; }
.rk-error .result-actions, .rk-error p { justify-content: center; }
.rk-error p { color: var(--warn); font-size: 14px; margin-bottom: 14px; }
.rk-empty { text-align: center; padding: 40px 10px 10px; }
.rk-empty-title { font-size: 16px; color: var(--ink); margin-bottom: 18px; line-height: 1.5; }
.rk-levelup {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gold-2);
  text-shadow: 0 0 24px rgba(233, 184, 78, 0.5);
  margin: 4px 0 18px;
  animation: rk-levelup-in 0.6s var(--ease);
}
@keyframes rk-levelup-in {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .rk-levelup { animation: none; }
}

/* v56: leaderboard overlay */
.lb-tabs { display: flex; gap: 8px; }
.lb-tab {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lb-tab:hover { color: var(--ink); border-color: var(--line); }
.lb-tab.is-active { background: rgba(233, 184, 78, 0.16); border-color: var(--gold); color: var(--gold-2); }
.lb-h2 { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 2px 0 14px; }
.lb-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; scrollbar-gutter: stable; margin-bottom: 4px; }
.lb-list, .lb-me { transition: opacity 120ms var(--ease); }
.lb-modal.is-refreshing #lb-list,
.lb-modal.is-refreshing #lb-me { opacity: 0.58; }
.lb-list.lb-swapping,
.lb-me.lb-swapping {
  overflow: hidden;
  transition: opacity 80ms var(--ease), transform 80ms var(--ease), height 140ms var(--ease);
}
.lb-swap-out { opacity: 0; transform: translateY(-6px); }
.lb-swap-in { opacity: 0; transform: translateY(8px); }
.lb-swap-in.is-visible { opacity: 1; transform: translateY(0); }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
}
.lb-row-enter {
  animation: lb-row-enter 140ms var(--ease) both;
}
@keyframes lb-row-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.lb-row.is-me { border-color: var(--gold); background: rgba(233, 184, 78, 0.08); }
.lb-row.lb-own-pulse {
  animation: lb-own-pulse 720ms var(--ease) 170ms both;
}
@keyframes lb-own-pulse {
  0%, 100% { background: rgba(233, 184, 78, 0.08); box-shadow: 0 0 0 rgba(233, 184, 78, 0); }
  45% { background: rgba(233, 184, 78, 0.17); box-shadow: 0 0 24px rgba(233, 184, 78, 0.24); }
}
.lb-rank {
  flex: 0 0 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.lb-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--gold);
  font: 600 12px/1 var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-name-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lb-name {
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-you-chip {
  display: inline-block;
  font: 600 9.5px/1 var(--font-mono);
  color: #131a33;
  background: var(--gold);
  border-radius: 4px;
  padding: 2px 5px;
  margin-right: 6px;
  vertical-align: 1px;
}
.lb-level { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lb-metric {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
}
.lb-metric.delta-pos { color: var(--gold); }
.lb-metric.delta-neg { color: var(--fail); }
.lb-me { margin-top: 6px; }
.lb-empty-note, .lb-loading-note, .lb-locked-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 18px 10px;
}
.lb-locked-note { border: 1px dashed var(--line); border-radius: 12px; }

/* v56: profile popup ranked block */
.rk-acct-cta { margin-bottom: 12px; text-align: center; }
.rk-acct-cta .btn { width: 100%; }
.rk-acct-block { margin-bottom: 12px; }
.rk-acct-level { font: 600 13px/1.4 var(--font-mono); color: var(--gold-2); margin-bottom: 8px; }
.rk-acct-block .rp-bar { margin-bottom: 6px; }
.rk-acct-lb-btn { width: 100%; margin-top: 8px; }

@media (max-width: 560px) {
  .lb-name { max-width: 34vw; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-context-line,
  .lb-list,
  .lb-me,
  .lb-list.lb-swapping,
  .lb-me.lb-swapping { transition: none; }
  .lb-row-enter,
  .lb-row.lb-own-pulse { animation: none; }
}

/* v56: tournament appeal (ranked moved into the host in v71) */
.rk-appeal { margin: 8px 0 0; }
.rk-appeal-form { display: flex; gap: 8px; margin-top: 8px; }
.rk-appeal-input { flex: 1; min-width: 0; }
.rk-appeal-done { font: 500 12px/1.5 var(--font-mono); color: var(--ok); margin: 8px 0 0; }

/* v71: post-answer AI host */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.host-panel {
  margin: 14px 0 4px;
  border: 1px solid rgba(233, 184, 78, 0.28);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(25, 34, 67, 0.9), rgba(12, 18, 39, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.host-panel__lead {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
}
.host-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #10162f;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 18px rgba(233, 184, 78, 0.18);
}
.host-avatar__initials {
  font: 650 18px/1 var(--font-display);
}
.host-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.host-avatar.is-fallback img { display: none; }
.host-panel__identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.host-panel__name {
  color: var(--gold-2);
  font: 600 12px/1.3 var(--font-display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.host-panel__reaction { color: var(--ink); font: 500 13.5px/1.45 var(--font-body); }
.host-panel__actions { display: flex; align-items: center; gap: 7px; }
.host-panel__skip {
  min-height: 32px;
  border: 0;
  padding: 4px 2px;
  color: var(--muted);
  background: transparent;
  font: 600 10px/1 var(--font-mono);
  text-decoration: underline;
  text-decoration-color: rgba(233, 184, 78, 0.34);
  text-underline-offset: 3px;
  cursor: pointer;
}
.host-panel__skip:hover,
.host-panel__skip:focus-visible { color: var(--gold-2); text-decoration-color: currentColor; }
.host-panel__voice {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold-2);
  background: rgba(233, 184, 78, 0.07);
  font-size: 17px;
  cursor: pointer;
}
.host-panel__voice:hover { border-color: rgba(233, 184, 78, 0.55); }
.host-panel__toggle {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--gold-2);
  background: rgba(233, 184, 78, 0.07);
  font: 600 10.5px/1 var(--font-mono);
  cursor: pointer;
}
.host-panel__toggle:hover { border-color: rgba(233, 184, 78, 0.55); }
.host-drawer { padding: 0 12px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.host-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 180px;
  overflow-y: auto;
  padding: 11px 2px 5px;
  scrollbar-gutter: stable;
}
.host-log:empty { display: none; }
.host-message {
  max-width: 88%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 11px;
  color: var(--ink);
  font: 500 12.5px/1.45 var(--font-body);
  overflow-wrap: anywhere;
}
.host-message--user { align-self: flex-end; background: rgba(233, 184, 78, 0.13); }
.host-message--host {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.host-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 0 12px 11px; }
.host-quick button {
  min-height: 44px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font: 500 10.5px/1.25 var(--font-mono);
  cursor: pointer;
}
.host-quick .host-panel__toggle { width: 100%; }
.host-quick button:hover { color: var(--ink); border-color: var(--line); }
.host-quick button:disabled,
.host-form :disabled,
.host-confirm:disabled { opacity: 0.48; cursor: not-allowed; }
.host-form { display: flex; gap: 7px; margin-top: 8px; }
.host-form .answer-input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 11px; }
.host-form .btn { flex: 0 0 auto; }
.host-confirm { margin-top: 8px; width: 100%; }
.host-turns { margin: 7px 2px 0; color: var(--muted); font: 500 10.5px/1.3 var(--font-mono); }
.host-error { margin: 8px 2px 0; color: var(--warn); font: 500 11px/1.4 var(--font-mono); }
.host-typing { display: flex; align-items: center; gap: 4px; min-height: 18px; padding: 7px 4px 0; }
.host-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: host-typing 850ms ease-in-out infinite;
}
.host-typing span:nth-child(2) { animation-delay: 120ms; }
.host-typing span:nth-child(3) { animation-delay: 240ms; }
@keyframes host-typing {
  0%, 70%, 100% { opacity: 0.28; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}
@media (max-width: 520px) {
  .host-panel__lead { grid-template-columns: 42px minmax(0, 1fr); }
  .host-avatar { width: 42px; height: 42px; }
  .host-panel__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .host-form { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .host-typing span { animation: none; opacity: 0.72; transform: none; }
}

/* v57: daily challenge */
.section--daily { padding-top: 0; padding-bottom: 64px; }
.daily-card {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(23, 31, 62, 0.72), rgba(15, 21, 44, 0.72));
  border: 1px solid var(--line-dim);
  border-radius: 26px;
  padding: 38px 40px 34px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 70px rgba(233, 184, 78, 0.05);
}

/* v70 landing motion pass */
.section--daily { position: relative; overflow: hidden; }
.daily-card { isolation: isolate; }
.daily-emblem {
  width: 180px; height: 116px; margin: -9px auto 4px; overflow: visible;
  filter: drop-shadow(0 0 18px rgba(233,184,78,.2));
}
.daily-card:not(.in) .daily-emblem__reveal { opacity: 0; transform: translateY(16px); }
.daily-card.in .daily-emblem__reveal { animation: emblem-reveal 600ms var(--ease) both; }
.daily-emblem__flame {
  transform-box: fill-box; transform-origin: center bottom;
  animation: candle-live 3.8s ease-in-out infinite;
}
.daily-emblem__motes { transform-origin: center; animation: emblem-motes 7s linear infinite; }
@keyframes emblem-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes candle-live { 0%,100% { transform: scale(1) rotate(-1deg); opacity: .88; } 50% { transform: scale(.92,1.08) rotate(2deg); opacity: 1; } }
@keyframes emblem-motes { 0% { transform: translateY(8px); opacity: .25; } 50% { opacity: .8; } 100% { transform: translateY(-13px); opacity: .2; } }
.daily-card::after {
  content: ""; position: absolute; z-index: -1; inset: 22% 8% -24%;
  background: radial-gradient(ellipse, rgba(233,184,78,.22), transparent 68%);
  opacity: .8; pointer-events: none;
}
.daily-dust { position: absolute; z-index: -1; inset: 0; pointer-events: none; overflow: hidden; }
.daily-dust::before, .daily-dust::after {
  content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #ffd37a; opacity: 0;
  box-shadow: 32px 90px #e9b84e, 96px 35px #ffd37a, 168px 112px #e9b84e,
    245px 48px #ffd37a, 326px 128px #e9b84e, 410px 68px #ffd37a,
    498px 142px #e9b84e, 570px 44px #ffd37a, 650px 106px #e9b84e;
  animation: dust-drift 7s linear infinite;
}
.daily-dust::after { left: 12%; animation-delay: -3.5s; animation-duration: 9s; }
@keyframes dust-drift {
  0% { transform: translate3d(0, 28px, 0); opacity: 0; }
  18%, 76% { opacity: .42; }
  100% { transform: translate3d(18px, -52px, 0); opacity: 0; }
}
.daily-card.in .daily-dot { animation: daily-dot-pulse 520ms var(--ease) both; animation-delay: calc(var(--dot-index) * 90ms + 180ms); }
.daily-dot:nth-child(1) { --dot-index: 0; }.daily-dot:nth-child(2) { --dot-index: 1; }
.daily-dot:nth-child(3) { --dot-index: 2; }.daily-dot:nth-child(4) { --dot-index: 3; }.daily-dot:nth-child(5) { --dot-index: 4; }
@keyframes daily-dot-pulse { 50% { transform: scale(1.65); opacity: 1; } }

.preview-qwrap { --spot-x: 50%; --spot-y: 50%; }
.preview-qwrap .q-text.is-masked {
  color: transparent; text-shadow: 0 0 8px rgba(244,240,228,.35); opacity: .12;
  filter: blur(3px);
}
.preview-qwrap::after {
  content: attr(data-spotlight-text); position: absolute; inset: 0; padding: inherit;
  color: var(--ink); pointer-events: none; white-space: pre-wrap;
  /* Owner 2026-08-25: hidden until the cursor first crosses the zone, then a
     translucent roaming spotlight, never bright static text. */
  opacity: 0; transition: opacity .45s ease;
  -webkit-mask-image: radial-gradient(circle 105px at var(--spot-x) var(--spot-y), #000 5%, transparent 72%);
  mask-image: radial-gradient(circle 105px at var(--spot-x) var(--spot-y), #000 5%, transparent 72%);
}
.preview-qwrap.is-live::after { opacity: .55; }
.preview-qwrap.is-decoded .q-text { color: var(--ink); text-shadow: none; opacity: 1; filter: none; }
.preview-qwrap.is-decoded::after, .preview-qwrap.is-decoded .preview-hint { opacity: 0; }
.q-text.is-scrambling { font-family: var(--font-mono); }
@media (hover: none) { .preview-qwrap::after { opacity: .55; animation: spotlight-sweep 8s ease-in-out infinite alternate; } }
@keyframes spotlight-sweep { from { transform: translateX(-28%); } to { transform: translateX(28%); } }

.ladder-track { position: relative; }
.ladder-line { position: absolute; z-index: 0; inset: -30px 0 auto; width: 100%; height: 180px; overflow: visible; pointer-events: none; }
.ladder-line path { fill: none; stroke: rgba(233,184,78,.55); stroke-width: 2; stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 650ms var(--ease); }
.ladder-track.in .ladder-line path { stroke-dashoffset: 0; }
.ladder-grid { position: relative; z-index: 1; }
.ladder-art { width: 100%; height: 124px; object-fit: contain; margin-bottom: 14px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.45)); }
.ladder-card::after { content: ""; position: absolute; inset: -60% auto -60% -45%; width: 28%; background: linear-gradient(90deg, transparent, rgba(255,211,122,.34), transparent); transform: translateX(-250%) rotate(18deg); opacity: 0; }
.ladder-card:hover::after { transform: translateX(650%) rotate(18deg); opacity: 1; transition: transform 650ms var(--ease), opacity 120ms; }

#fair, .cta-band { position: relative; isolation: isolate; overflow: hidden; }
.section-video, .section-video-veil { position: absolute; z-index: -2; inset: -12px 0; width: 100%; height: calc(100% + 24px); }
.section-video { object-fit: cover; }
.section-video-veil { z-index: -1; background: rgba(10,17,40,.7); }
.section-motion-content { position: relative; z-index: 1; }

/* SPEC 53 follow-up: ambient loop videos inside the daily/tournament cards.
   Negative z-index children paint above the card background but below its
   content inside the isolated stacking context. */
.card--motion { position: relative; isolation: isolate; overflow: hidden; }
.card-video, .card-video-veil { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; border-radius: inherit; pointer-events: none; }
.card-video { object-fit: cover; }
.card-video-veil { z-index: -1; background: rgba(10, 17, 40, .72); }

@media (hover:hover) and (pointer:fine) {
  .topic-chip { position: relative; isolation: isolate; overflow: hidden; --topic-x: 50%; --topic-y: 50%; border-color: transparent; }
  .topic-chip::before { content: ""; position: absolute; z-index: -2; inset: -35%; background: conic-gradient(transparent, #e9b84e, #ffd37a, transparent 38%); transform: rotate(0); opacity: 0; }
  .topic-chip::after { content: ""; position: absolute; z-index: -1; inset: 1px; border-radius: inherit; background: radial-gradient(circle 90px at var(--topic-x) var(--topic-y), rgba(233,184,78,.19), rgba(19,26,54,.94) 72%); }
  .topic-chip:hover::before { opacity: 1; transform: rotate(180deg); transition: transform 550ms var(--ease), opacity 150ms; }
}

@media (max-width: 768px) { .ladder-line { display: none; } .ladder-art { height: 150px; } }
@media (prefers-reduced-motion: reduce) {
  .daily-dust::before, .daily-dust::after, .daily-card.in .daily-dot, .preview-qwrap::after,
  .daily-card.in .daily-emblem__reveal, .daily-emblem__flame, .daily-emblem__motes { animation: none; }
  .daily-card:not(.in) .daily-emblem__reveal { opacity: 1; transform: none; }
  .daily-dust { display: none; }
  .ladder-line path { stroke-dashoffset: 0; transition: none; }
  .ladder-card:hover::after, .topic-chip:hover::before { transition: none; }
}
.daily-h2 { margin-bottom: 6px; }
.daily-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.daily-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; }
.daily-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.daily-dot.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 184, 78, 0.14); }
.daily-dot.is-correct { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(233, 184, 78, 0.45); }
.daily-dot.is-incorrect { background: var(--fail); border-color: var(--fail); box-shadow: 0 0 14px rgba(242, 125, 114, 0.35); }
.btn--daily { position: relative; gap: 6px; }
.btn--daily.is-locked {
  background: rgba(19, 26, 54, 0.55);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line-dim);
}
.btn--daily.is-locked:hover { transform: none; box-shadow: none; border-color: rgba(233, 184, 78, 0.4); }
.daily-cta-lock { font-size: 13px; line-height: 1; }

/* v57: daily overlay — slot list phase */
.daily-slots { padding-top: 4px; }
.daily-slot-list { display: flex; flex-direction: column; gap: 8px; }
.daily-slot-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-dim);
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.daily-slot-row:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.05); }
.daily-slot-num {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 640;
  font-size: 13px;
  border: 1px solid var(--line-dim);
  color: var(--muted);
}
.daily-slot-row.is-correct .daily-slot-num { border-color: var(--gold); color: var(--gold-2); background: rgba(233, 184, 78, 0.1); }
.daily-slot-row.is-incorrect .daily-slot-num { border-color: var(--fail); color: var(--fail); background: rgba(242, 125, 114, 0.1); }
.daily-slot-row.is-active .daily-slot-num { border-color: var(--gold); color: var(--gold-2); }
.daily-slot-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.daily-slot-diff { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.daily-slot-label { font-size: 13.5px; color: var(--ink); }
.daily-slot-mark { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.daily-slot-row.is-correct .daily-slot-mark { color: var(--gold); }
.daily-slot-row.is-incorrect .daily-slot-mark { color: var(--fail); }
.daily-slots-actions { margin-top: 16px; justify-content: center; }

/* v57: daily overlay — summary share grid */
.daily-share-grid { font-size: 24px; letter-spacing: 4px; margin: 4px 0 18px; }

/* SPEC 22: landing game-feel pack */

/* question swap: 55ms out + 200ms skeleton + 90ms in = 345ms */
.game-feel-card-transitioning > .ring-wrap,
.game-feel-card-transitioning > .answer-zone,
.game-feel-card-transitioning > .result-zone,
.game-feel-card-transitioning > .question-toggle {
  display: none;
}
.game-feel-card-sizing { overflow: hidden; transition: height 90ms var(--ease); }
.game-feel-card-out > .qcard-head,
.game-feel-card-out > .q-text,
.game-feel-card-out > .q-media {
  animation: game-feel-card-out 55ms var(--ease) both;
}
.game-feel-card-enter > .qcard-head,
.game-feel-card-enter > .q-text,
.game-feel-card-enter > .q-media {
  animation: game-feel-card-in 90ms var(--ease) both;
}
@keyframes game-feel-card-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-7px); }
}
@keyframes game-feel-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.game-feel-skeleton-chip,
.game-feel-skeleton-line,
.game-feel-skeleton-media {
  background: linear-gradient(
    100deg,
    rgb(from var(--gold) r g b / 7%) 20%,
    rgb(from var(--gold) r g b / 17%) 50%,
    rgb(from var(--gold) r g b / 7%) 80%
  );
  background-size: 200% 100%;
  animation: solviq-enh-shimmer 1.2s linear infinite;
}
.game-feel-skeleton-chip {
  display: inline-block;
  width: 88px;
  min-height: 27px;
  border-color: var(--line-dim);
}
.game-feel-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 66px !important;
}
.game-feel-skeleton-line {
  display: block;
  height: 14px;
  border-radius: 999px;
}
.game-feel-skeleton-media {
  min-height: 150px;
  border: 1px solid var(--line-dim);
  border-radius: 14px;
}

/* streak track: ten segments with milestone posts at 3 / 5 / 10 */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.streak-track {
  display: grid;
  grid-template-columns: repeat(10, 6px);
  align-items: center;
  gap: 2px;
  min-width: 78px;
  padding: 7px 0 8px;
  margin-left: 2px;
}
.streak-segment {
  position: relative;
  display: block;
  width: 6px;
  height: 3px;
  border-radius: 999px;
  background: var(--line-dim);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
  transition-delay: var(--streak-delay, 0ms);
}
.streak-segment.is-filled {
  background: currentColor;
  transform: scaleY(1.45);
}
.streak-segment.is-milestone { height: 6px; }
.streak-milestone-label {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font: 600 7px/1 var(--font-mono);
}
.streak-segment.is-reached .streak-milestone-label { color: currentColor; }
.streak-segment.is-igniting { animation: badge-ignite 0.9s var(--ease) both; }
.streak-chip.is-draining { border-color: var(--fail); color: var(--fail); }

/* per-digit rating roll */
.odometer-number {
  display: inline-flex;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.odometer-digit {
  display: inline-block;
  width: 0.64em;
  height: 1.12em;
  overflow: hidden;
  text-align: center;
  line-height: 1.12;
  vertical-align: -0.18em;
}
.odometer-reel {
  display: flex;
  flex-direction: column;
  line-height: 1.12em;
  transition: transform 0.5s var(--ease);
  transition-delay: var(--odometer-delay, 0ms);
  will-change: transform;
}
.odometer-digit.roll-down .odometer-reel { transform: translateY(-50%); }
.odometer-number.is-rolling .odometer-digit.roll-up .odometer-reel { transform: translateY(-50%); }
.odometer-number.is-rolling .odometer-digit.roll-down .odometer-reel { transform: translateY(0); }

/* verdict rubber stamp lives in the result corner, clear of the explanation */
.result-zone { position: relative; }
.result-zone.has-verdict-stamp > .verdict { padding-right: 108px; }
.verdict-stamp {
  --stamp-rotate: -7deg;
  position: absolute;
  z-index: 4;
  top: 0;
  right: 2px;
  max-width: 104px;
  padding: 4px 9px 3px;
  border: 3px double currentColor;
  border-radius: 7px;
  color: var(--fail);
  font: 650 17px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0.9;
  pointer-events: none;
  transform: rotate(var(--stamp-rotate));
  filter: drop-shadow(0 3px 8px rgba(3, 6, 18, 0.35));
  animation: verdict-stamp-in 0.34s var(--ease) both;
}
.verdict-stamp--ok { color: var(--ok); }
.verdict-stamp--fail { --stamp-rotate: 6deg; color: var(--fail); }
.verdict-stamp--pass { --stamp-rotate: -3deg; color: var(--warn); }
@keyframes verdict-stamp-in {
  0% { opacity: 0; transform: rotate(calc(var(--stamp-rotate) - 9deg)) scale(2.1); }
  58% { opacity: 1; transform: rotate(var(--stamp-rotate)) scale(0.86); }
  78% { transform: rotate(var(--stamp-rotate)) scale(1.08); }
  100% { opacity: 0.9; transform: rotate(var(--stamp-rotate)) scale(1); }
}

/* long questions collapse only after verdict; the module removes these classes on show */
.question-accordion {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  transition: max-height 0.28s var(--ease);
}
.question-accordion.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(2.5em, var(--question-collapsed-height));
  background: linear-gradient(transparent, var(--bg-2));
  pointer-events: none;
}
.question-toggle {
  display: block;
  margin: 0 0 16px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: 500 12px/1.4 var(--font-mono);
  cursor: pointer;
}
.question-toggle:hover { color: var(--gold-2); }
.question-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }

.explain-p.is-typewriting { cursor: pointer; touch-action: manipulation; }
/* while the voice synthesizes, the panel shows a breathing ellipsis
   instead of sitting blank (owner 2026-09-01) */
.explain-p.is-typewriting:empty::after {
  content: "···";
  letter-spacing: 3px;
  opacity: 0.55;
  animation: voice-wait-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-wait-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.75; }
}
@media (prefers-reduced-motion: reduce) {
  .explain-p.is-typewriting:empty::after { animation: none; }
}

@media (max-width: 560px) {
  .streak-track { grid-template-columns: repeat(10, 5px); gap: 1px; min-width: 59px; }
  .streak-segment { width: 5px; }
  .verdict-stamp { max-width: 92px; font-size: 14px; right: 0; }
  .result-zone.has-verdict-stamp > .verdict { padding-right: 94px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-feel-card-out > .qcard-head,
  .game-feel-card-out > .q-text,
  .game-feel-card-out > .q-media,
  .game-feel-card-enter > .qcard-head,
  .game-feel-card-enter > .q-text,
  .game-feel-card-enter > .q-media,
  .game-feel-skeleton-chip,
  .game-feel-skeleton-line,
  .game-feel-skeleton-media,
  .streak-segment.is-igniting,
  .verdict-stamp {
    animation: none;
  }
  .streak-segment,
  .odometer-reel,
  .question-accordion,
  .game-feel-card-sizing {
    transition: none;
  }
  .mode-entry-chip,
  .poster-suggestion,
  .account-mode-btn { transition: none; }
}

/* The legacy modal-child stacking rule precedes this override. */
.game-modal > .game-title-card { position: absolute; z-index: 12; }

/* SPEC 27: compact thematic/editor-set shelves below the primary CTA. */
.pack-browser {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  margin: 22px auto 0;
  display: grid;
  gap: 9px;
  text-align: left;
}
.pack-shelf { min-width: 0; }
.pack-shelf__label {
  margin: 0 0 5px 3px;
  color: var(--muted);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pack-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 7px;
  min-width: 0;
  padding: 2px 3px 7px;
}
.pack-chip-item { min-width: 0; }
.pack-chip {
  display: block; width: 100%;
  padding: 8px 13px;
  overflow: hidden;
  border: 1px solid rgba(233, 184, 78, 0.32);
  border-radius: 999px;
  background: rgba(8, 12, 27, 0.62);
  color: var(--gold-2);
  font: 550 11.5px/1.15 var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(9px);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.pack-chip:hover { border-color: var(--gold); background: rgba(233, 184, 78, 0.13); }
.pack-shelf--quiet .pack-chip {
  border-color: var(--line-dim);
  color: rgba(244, 240, 228, 0.72);
  background: rgba(8, 12, 27, 0.42);
}
.pack-shelf--quiet .pack-chip:hover { border-color: var(--line); color: var(--ink); }
.pack-expand {
  margin: 3px auto 0; padding: 7px 12px; border: 1px solid var(--line-dim);
  border-radius: 999px; background: rgba(8,12,27,.72); color: var(--muted);
  font: 550 10.5px/1 var(--font-mono); cursor: pointer;
}

/* Tag facets stay visible on desktop and collapse behind one quiet control on mobile. */
.tag-filters {
  flex: 1 0 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 1px;
}
.tag-filters__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 10.5px/1 var(--font-mono);
  cursor: pointer;
}
.tag-filters__panel { display: grid; gap: 7px; }
.tag-filter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.tag-filter-row__label {
  flex: 0 0 76px;
  color: var(--muted);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}
.tag-filter-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.tag-filter-chip {
  padding: 6px 9px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: 500 10px/1 var(--font-mono);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tag-filter-chip:hover { color: var(--ink); border-color: var(--line); }
.tag-filter-chip.is-active {
  border-color: var(--gold);
  background: rgba(233, 184, 78, 0.13);
  color: var(--gold-2);
}
.tag-filters.is-locked { opacity: 0.62; }
.tag-filters.is-locked .tag-filter-chip,
.tag-filters.is-locked .tag-filters__toggle { cursor: default; }

/* Local collectible patches live beside the existing profile achievements. */
.account-patches { margin: 0 0 10px; }
.acct-patches { display: flex; flex-wrap: wrap; gap: 5px; }
.acct-patch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(233, 184, 78, 0.5);
  border-radius: 8px;
  background: rgba(233, 184, 78, 0.08);
  color: var(--gold-2);
  font: 550 10px/1.15 var(--font-mono);
}
.acct-patch__count {
  min-width: 16px;
  padding: 2px 4px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--bg);
  font-size: 9px;
  text-align: center;
}

@media (max-width: 560px) {
  .pack-browser { width: calc(100vw - 20px); gap: 6px; margin-top: 16px; }
  .pack-chip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-inline: -2px; padding-bottom: 5px; }
  .pack-chip-row.is-collapsed .pack-chip-item:nth-child(n + 7) { display: none; }
  .pack-chip { padding: 7px 11px; font-size: 10.5px; }
  .tag-filters__toggle { display: inline-flex; }
  .tag-filters__panel { margin-top: 8px; }
  .tag-filter-row { display: block; }
  .tag-filter-row__label { display: block; margin: 0 0 5px; text-align: center; }
  .tag-filter-row__chips { justify-content: center; gap: 4px; }
  .tag-filter-chip { padding: 6px 8px; font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pack-chip,
  .tag-filter-chip { transition: none; }
}

/* SPEC 30: weekend tournament landing card */
.section--tournament { padding-top: 0; padding-bottom: 64px; }
.tournament-card {
  position: relative;
  isolation: isolate;
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
  padding: 38px 40px 34px;
  border: 1px solid rgba(233, 184, 78, 0.42);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% -15%, rgba(255, 211, 122, 0.2), transparent 48%),
    linear-gradient(155deg, rgba(25, 33, 66, 0.96), rgba(9, 14, 33, 0.94));
  box-shadow: var(--shadow), 0 0 76px rgba(233, 184, 78, 0.11);
  text-align: center;
  transition: border-color 180ms var(--ease), opacity 180ms var(--ease);
}
.tournament-card::before {
  content: ""; position: absolute; z-index: 0; inset: -70%; pointer-events: none;
  background: conic-gradient(transparent 0 37%, rgba(255,211,122,.8) 45%, transparent 53% 100%);
  opacity: 0; transform: rotate(0deg);
}
.tournament-card.is-open::before { opacity: .58; animation: tournament-perimeter 7s linear infinite; }
.tournament-card.is-open { border-color: transparent; }
.tournament-emblem { position: relative; z-index: 1; display: block; width: 180px; height: 112px; margin: -8px auto 3px; overflow: visible; filter: drop-shadow(0 0 18px rgba(233,184,78,.22)); }
.tournament-card.is-open .tournament-emblem__art {
  transform-box: fill-box; transform-origin: center;
  animation: tournament-emblem-live 3.8s ease-in-out infinite;
}
.tournament-card.is-open .tournament-emblem__glint { animation: tournament-glint 4.8s ease-in-out infinite; }
.tournament-card.is-upcoming .tournament-emblem { opacity: .46; }
.tournament-card.is-upcoming .tournament-emblem__art { animation: tournament-shimmer 5.5s ease-in-out infinite; }
.tournament-card.is-closed .tournament-emblem, .tournament-card.is-finished .tournament-emblem { opacity: .38; filter: none; }
@keyframes tournament-perimeter { to { transform: rotate(360deg); } }
@keyframes tournament-emblem-live { 50% { transform: scale(1.025); opacity: 1; } }
@keyframes tournament-glint { 0%,58%,100% { opacity: 0; transform: translateX(-24px); } 68% { opacity: .75; } 78% { opacity: 0; transform: translateX(38px); } }
@keyframes tournament-shimmer { 0%,100% { opacity: .62; } 50% { opacity: .9; } }
.tournament-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 1px;
  border-radius: 24px;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.045) 49%, transparent 72%),
    radial-gradient(circle at 50% -15%, rgba(255, 211, 122, 0.2), transparent 48%),
    linear-gradient(155deg, rgba(25, 33, 66, 0.98), rgba(9, 14, 33, 0.98));
}
.tournament-card__glyph {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 20px;
  text-shadow: 0 0 20px rgba(233, 184, 78, 0.58);
}
.tournament-card > * { position: relative; z-index: 2; }
.tournament-h2 { margin-bottom: 6px; }
.tournament-dates {
  min-height: 1.5em;
  margin-bottom: 22px;
  color: var(--muted);
  font: 500 12px/1.5 var(--font-mono);
}
.tournament-card__actions { align-items: center; }
.tournament-card__lb { margin-top: 10px; }
.btn--tournament { position: relative; gap: 6px; }
.btn--tournament.is-live:not(.is-locked) { animation: tournament-pulse 2.25s ease-in-out infinite; }
.btn--tournament.is-locked,
.btn--tournament.is-upcoming,
.btn--tournament.is-result {
  background: rgba(19, 26, 54, 0.58);
  color: var(--muted);
  border: 1px solid var(--line-dim);
  box-shadow: none;
}
.btn--tournament.is-result { color: var(--gold-2); border-color: rgba(233, 184, 78, 0.38); }
.btn--tournament.is-upcoming { cursor: default; opacity: 0.72; }
.btn--tournament.is-locked:hover,
.btn--tournament.is-upcoming:hover,
.btn--tournament.is-result:hover { transform: none; box-shadow: none; }
.tournament-cta-lock { font-size: 13px; line-height: 1; }
.tournament-card.is-upcoming { border-color: var(--line-dim); opacity: 0.76; }
@keyframes tournament-pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.18), 0 0 0 rgba(233, 184, 78, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 18px rgba(233, 184, 78, 0.22), 0 0 34px rgba(233, 184, 78, 0.48); }
}

/* Shared game-mode help: anchored desktop popover and mobile bottom sheet. */
.cta-main, .hero-mode-wrap { position: relative; }
.mode-info-trigger {
  position: absolute; z-index: 8; top: 10px; right: 10px; width: 24px; height: 24px;
  display: inline-grid; place-items: center; padding: 0; border: 1px solid rgba(233,184,78,.5);
  border-radius: 50%; background: rgba(10,14,30,.82); color: var(--gold-2);
  font: 650 13px/1 var(--font-mono); cursor: help;
  opacity: .42; transition: opacity .18s ease;
}
.mode-info-trigger:hover, .mode-info-trigger:focus-visible { opacity: 1; border-color: var(--gold-2); background: rgba(233,184,78,.16); outline: 2px solid rgba(255,211,122,.3); outline-offset: 2px; }
.mode-entry-wrap { position: relative; display: inline-flex; }
.mode-entry-wrap .mode-info-trigger { top: -8px; right: -10px; }
.mode-info-trigger--packs { top: -4px; right: 3px; }
.account-mode-wrap { position: relative; }
.account-mode-wrap .account-mode-btn { width: 100%; padding-right: 38px; }
.account-mode-wrap .mode-info-trigger { top: 6px; right: 7px; }
.acct-section--mode { position: relative; }
.acct-section--mode > .mode-info-trigger { top: auto; right: 7px; bottom: 7px; }
.acct-section--mode > .account-mode-btn { padding-right: 38px; }
.mode-info-popover {
  position: fixed; z-index: 1200; left: var(--popover-left, 12px); top: var(--popover-top, 12px);
  width: min(320px, calc(100vw - 24px)); padding: 16px 42px 16px 17px;
  border: 1px solid rgba(233,184,78,.52); border-radius: 14px;
  background: linear-gradient(150deg, rgba(24,32,64,.98), rgba(8,12,28,.99));
  box-shadow: 0 18px 55px rgba(0,0,0,.5), 0 0 28px rgba(233,184,78,.1); color: var(--ink);
}
.mode-info-popover__copy { margin: 0; font: 450 13px/1.5 var(--font-body); }
.mode-info-popover__close { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
@media (max-width: 640px) {
  .mode-info-popover { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; padding: 20px 46px 22px 20px; border-radius: 20px; }
  .has-mode-info::after { content: ""; position: fixed; z-index: 1199; inset: 0; background: rgba(3,6,16,.45); }
}
@media (prefers-reduced-motion: reduce) {
  .tournament-card::before, .tournament-emblem__art,
  .tournament-emblem__glint { animation: none !important; }
}

/* SPEC 30: tournament player, poster and leaderboard */
.tournament-modal .gm-head { flex-wrap: wrap; }
.tournament-unrated { color: var(--muted); border-color: var(--line-dim); }
.tournament-rating-note { color: var(--muted); }
.tournament-handout {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: rgba(233, 184, 78, 0.06);
  color: var(--ink);
  font: 500 13px/1.55 var(--font-body);
}
.tournament-media audio {
  display: block;
  width: 100%;
  color-scheme: dark;
}
#tr-summary.tournament-summary {
  position: relative;
  overflow: hidden;
  padding: 30px 24px 24px;
  border: 1px solid rgba(233, 184, 78, 0.46);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(233, 184, 78, 0.18), transparent 40%),
    linear-gradient(165deg, rgba(20, 28, 56, 0.98), rgba(7, 11, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px rgba(3, 6, 18, 0.34);
  animation: none;
}
#tr-summary.tournament-summary::before {
  content: "◆";
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(233, 184, 78, 0.55);
}
#tr-summary .final-score { margin-bottom: 8px; font-size: clamp(62px, 13vw, 88px); }
#tr-summary .final-rating { margin: 0 auto 18px; color: var(--ink); }
#tr-summary .series-poster-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#tr-summary .series-poster-actions #tr-summary-lb {
  grid-column: 1 / -1;
  min-height: 50px;
}
.tournament-ribbon {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: -34px;
  width: 146px;
  padding: 7px 0 6px;
  transform: rotate(36deg);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(90deg, #d39a31, #ffd37a, #d39a31);
  color: #11172c;
  box-shadow: 0 7px 22px rgba(3, 6, 18, 0.38);
  font: 750 12px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-align: center;
}
.tournament-lb-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.tournament-lb-score { color: var(--gold-2); }
.tournament-lb-duration { color: var(--muted); font-size: 10px; font-weight: 500; }
.tournament-lb-status.is-finished { color: var(--ok); }
.tournament-lb-status.is-progress { color: var(--warn); }
.tournament-lb-modal.is-refreshing .lb-list,
.tournament-lb-modal.is-refreshing .lb-me { opacity: 0.58; }
.tr-acct-block {
  position: relative;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(233, 184, 78, 0.28);
  border-radius: 12px;
  background: rgba(233, 184, 78, 0.055);
}
.tr-acct-title { margin: 0 0 4px; color: var(--muted); font: 600 10px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; }
.tr-acct-result { margin: 0; color: var(--gold-2); font: 650 13px/1.4 var(--font-mono); }
.tr-acct-ribbon {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
}
.tr-acct-lb { width: 100%; margin-top: 8px; }
.mode-table-link {
  width: 100%; margin-top: 6px; border: 0; background: none; color: var(--gold);
  font: 600 10px/1.4 var(--font-mono); text-decoration: underline; cursor: pointer;
}
.tournament-history { max-width: 760px; margin: 24px auto 0; }
.tournament-history h3 { margin: 0 0 10px; color: var(--ink); text-align: center; }
#tournament-history-list { display: grid; gap: 8px; }
.tournament-history-week {
  display: grid; gap: 4px; width: 100%; padding: 14px 16px; border: 1px solid var(--line-dim);
  border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer;
}
.tournament-history-week:hover { border-color: rgba(233,184,78,.48); }
.tournament-history-key { color: var(--gold-2); font: 650 13px/1.4 var(--font-mono); }
.tournament-history-count, .tournament-history-podium { color: var(--muted); font: 500 11px/1.4 var(--font-mono); }
.casual-weekly-summary { margin: 14px 0; padding: 12px; border: 1px solid var(--line-dim); border-radius: 14px; }
.casual-weekly-title { margin: 0 0 4px; color: var(--gold-2); font: 650 13px/1.3 var(--font-mono); }
.casual-weekly-note { margin: 0 0 8px; color: var(--muted); font: 500 10px/1.4 var(--font-mono); }
.casual-weekly-list .lb-row { min-height: 38px; padding: 5px 7px; }

@media (max-width: 560px) {
  .section--tournament { padding-left: 14px; padding-right: 14px; }
  .tournament-card { padding: 28px 16px 26px; border-radius: 20px; }
  .tournament-card::after { border-radius: 18px; }
  #tr-summary.tournament-summary { padding: 26px 14px 18px; }
  .tournament-ribbon { top: 14px; right: -40px; }
  .tournament-lb-duration { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .tournament-card,
  .btn--tournament.is-live:not(.is-locked) { transition: none; animation: none; }
}

/* SPEC 64: focused MVP landing. The legacy presentation remains intact when
   every feature flag is enabled by the legacy Chromium harnesses. */
.mvp-active .site-header {
  background: linear-gradient(180deg, rgba(5, 8, 18, .62), rgba(5, 8, 18, .18) 74%, transparent);
  border-bottom: 1px solid transparent;
}
.mvp-active .site-header.scrolled {
  background: rgba(8, 12, 27, .88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom-color: rgba(233, 184, 78, .12);
}
.mvp-active .header-inner { max-width: 1168px; }
.mvp-active .wordmark { margin-right: auto; }
.mvp-active main { display: flex; flex-direction: column; }
.mvp-active #try { order: 1; }
.mvp-active #game-choices { order: 2; }
.mvp-active #ranked-leaderboard { order: 3; }
.mvp-active #mvp-fair-rating { order: 4; }
.mvp-active #daily { order: 5; }
.mvp-active #tournament { order: 6; }
.mvp-active #try.section {
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(78px, 9svh, 104px) 24px clamp(28px, 4svh, 44px);
  background: #070b18;
}
.mvp-active #try .try-inner {
  width: min(1168px, 100%);
  margin: auto;
}
.mvp-hero-video,
.mvp-hero-video-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mvp-hero-video {
  z-index: -2;
  inset: -14px 0;
  height: calc(100% + 28px);
  object-fit: cover;
  opacity: .52;
}
.mvp-active #try .mvp-hero-video {
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  opacity: .92;
}
.mvp-hero-video-veil {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 24%, rgba(13, 20, 47, .36), rgba(7, 10, 24, .78) 68%),
    linear-gradient(180deg, rgba(10, 14, 30, .22), var(--bg));
}
.mvp-active #try .mvp-hero-video-veil {
  background:
    linear-gradient(180deg, rgba(5, 8, 18, .42) 0%, rgba(5, 8, 18, .06) 25%, rgba(5, 8, 18, .08) 68%, rgba(5, 8, 18, .68) 100%),
    radial-gradient(ellipse 58% 50% at 22% 44%, rgba(4, 7, 17, .28), transparent 78%);
}
.mvp-hero-fade {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: clamp(24px, 5svh, 54px);
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--bg));
}
.mvp-hero-intro {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto clamp(12px, 2svh, 22px);
  text-align: center;
  text-shadow: 0 3px 24px rgba(2, 4, 12, .95);
}
.mvp-hero-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -42% -16%;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(3, 6, 15, .58), transparent 72%);
}
.mvp-hero-title {
  margin: 0;
  color: #fffaf0;
  font: 620 clamp(32px, 4.2vw, 58px)/1.02 var(--font-display);
  letter-spacing: -.015em;
  text-transform: uppercase;
}
.mvp-hero-sub {
  margin: 10px auto 0;
  max-width: 640px;
  color: rgba(235, 238, 249, .9);
  font: 460 clamp(14px, 1.25vw, 16.5px)/1.5 var(--font-body, inherit);
  text-shadow: 0 2px 18px rgba(2, 4, 12, .95);
}
.mvp-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .82fr);
  gap: clamp(18px, 2.4vw, 30px);
  align-items: center;
}
.mvp-active #try .hero-stage { max-width: none; }
/* spec 81: single-game hero — with every mode tile off (ranked + extraModes
   down) the two-column grid collapses to one centered stage column. */
.mvp-active.single-game-hero #try .mvp-hero-layout {
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
}
.hero-game-setup-slot:empty,
#modal-game-setup-slot:empty { display: none; }
/* SPEC 89: the bar carries EVERY filter (difficulty, time mode, content,
   base, theme, language, tag chips); the legacy theme-hdr-only crop is
   gone and a wrap layout packs the pills, never a scroll lane. */
/* Owner 2026-09-01: ALL filters live in the TOP BAR - a second right-
   aligned row inside the fixed glass header. The header's own duplicate
   content/language pills are gone; the bar is the single filter home. */
.mvp-active .site-header .header-content { display: none; }
/* Owner 2026-09-01 v2: the five filters (difficulty, time, base, theme +
   the header's own language pill) sit INLINE in the header-actions row,
   small type, next to the sound button. Content filter and the
   era/thinking panel are parked; the bar's own language pill is hidden -
   the header already has one. */
.mvp-active .site-header .hero-game-setup-slot { display: contents; }
.mvp-active .site-header .game-setup--hero { display: contents; }
.mvp-active .site-header .game-setup--hero > .theme-hdr:has(#cfilter-btn),
.mvp-active .site-header .game-setup--hero > .theme-hdr:has(#lang-btn-setup),
.mvp-active .site-header .game-setup--hero > .content-themes,
.mvp-active .site-header .game-setup--hero > .tag-filters {
  display: none !important;
}
.mvp-active .site-header .game-setup--hero .theme-btn {
  font-size: 11px;
  padding: 7px 12px;
  letter-spacing: 0.03em;
}
.theme-btn .dd-current {
  display: block;
  font-size: 9px;
  line-height: 1;
  margin-top: 3px;
  opacity: 0.65;
}
@media (max-width: 760px) {
  .mvp-active .site-header .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
  }
  .mvp-active .site-header .game-setup--hero .theme-btn {
    font-size: 10px;
    padding: 6px 9px;
  }
}
.mvp-active .site-header .game-setup--hero > .theme-hdr {
  display: block;
  min-width: 0;
  margin: 0;
}
.mvp-active .site-header .game-setup--hero > .theme-hdr > .theme-btn {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mvp-active .site-header .game-setup--hero > .theme-btn {
  justify-self: stretch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* full-row members: the music style chips and the era/thinking panel
   ride their own right-aligned line inside the flex bar */
.mvp-active .site-header .game-setup--hero > .content-themes,
.mvp-active .site-header .game-setup--hero > .tag-filters {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.mvp-active .site-header .game-setup--hero .theme-pop {
  top: calc(100% + 8px);
  bottom: auto;
}
/* SPEC 89: the «Фільтри» toggle is a bar control like the pills around it */
.mvp-active .site-header .game-setup--hero .tag-filters__toggle {
  display: inline-flex;
  justify-self: stretch;
  margin: 0;
  padding: 9px 16px;
  font: 500 13px/1 var(--font-mono);
  color: var(--ink);
}
.mvp-active .site-header .game-setup--hero .tag-filters__panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(23, 31, 62, 0.96), rgba(15, 21, 44, 0.96));
}
.mvp-active .site-header .game-setup--hero .tag-filter-row__label { flex-basis: 64px; }
.mvp-active #try .qcard-tilt {
  padding-block: 20px;
  background: rgba(10, 15, 34, .76);
  box-shadow: 0 26px 78px rgba(2, 4, 13, .58);
}
.mvp-active #try .q-text { min-height: 92px; }
.mvp-hero-modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.mvp-hero-modes__label {
  margin: 0 0 -2px;
  color: rgba(255, 244, 215, .82);
  text-shadow: 0 2px 16px rgba(2, 4, 12, .92);
  font: 650 11px/1.2 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.mvp-active #try .mvp-hero-mode-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 15px;
  padding: 17px 18px;
}
.mvp-active #try .mvp-hero-mode-card .mvp-game-emblem {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  width: 112px;
  height: 78px;
  margin: 0;
}
.mvp-active #try .mvp-hero-mode-card h3,
.mvp-active #try .mvp-hero-mode-card p,
.mvp-active #try .mvp-hero-mode-card .mvp-game-card__action { grid-column: 2; }
.mvp-active #try .mvp-hero-mode-card h3 { align-self: end; margin-top: 8px; font-size: 21px; }
.mvp-active #try .mvp-hero-mode-card p {
  align-self: start;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.35;
}
.mvp-active #try .mvp-hero-mode-card .mvp-game-card__action { min-height: 44px; padding: 9px 12px; }
.mvp-active #try .mvp-hero-mode-card .mvp-game-card__media video { opacity: .82; }
.mvp-active #try .mvp-hero-mode-card .mvp-unrated-badge { top: 13px; right: 15px; }
.mvp-active #try .mvp-hero-mode-card .mvp-ranked-ribbon { top: 16px; right: -43px; transform: rotate(34deg) scale(.86); }
.mvp-active #try .eyebrow { margin-bottom: 6px; }
.mvp-active #try .demo-disclaimer {
  color: rgba(225, 228, 241, .72);
  text-shadow: 0 2px 14px rgba(2, 4, 12, .94);
}
.mvp-hero-meta {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 6px auto 0;
  color: rgba(225, 228, 241, .76);
  font: 520 11px/1.4 var(--font-mono);
}
.mvp-warmup-badge { color: var(--muted); border-color: rgba(150, 160, 190, 0.3); }

.mvp-games { width: 100%; padding-top: 96px; padding-bottom: 96px; }
.mvp-games .h2-center { margin-bottom: 28px; }
.mvp-game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mvp-games .mvp-game-grid { width: min(620px, 100%); margin-inline: auto; grid-template-columns: 1fr; }
.mvp-game-card {
  position: relative;
  isolation: isolate;
  min-height: 356px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 25px 24px;
  overflow: hidden;
  border: 1px solid var(--line-dim);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(84, 102, 210, 0.12), transparent 43%),
    linear-gradient(155deg, rgba(22, 30, 61, 0.92), rgba(11, 16, 35, 0.94));
  box-shadow: 0 20px 58px rgba(3, 6, 18, 0.36);
  transition: transform 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease);
}
.mvp-game-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -80% auto -80% -52%;
  width: 34%;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-240%) rotate(16deg);
  background: linear-gradient(90deg, transparent, rgba(255, 226, 157, .2), transparent);
}
.mvp-game-card:hover {
  transform: translateY(-7px) scale(1.008);
  border-color: rgba(233, 184, 78, 0.52);
  box-shadow: 0 28px 72px rgba(3, 6, 18, .48), 0 0 38px rgba(84, 102, 210, .1);
}
.mvp-game-card:hover::before {
  opacity: 1;
  transform: translateX(650%) rotate(16deg);
  transition: transform 720ms var(--ease), opacity 140ms ease;
}
.mvp-game-card__media,
.mvp-game-card__media video,
.mvp-game-card__veil { position: absolute; inset: 0; width: 100%; height: 100%; }
.mvp-game-card__media { z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.mvp-game-card__media video {
  inset: -14px;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  object-fit: cover;
  opacity: .72;
  scale: 1.015;
  transition: scale 650ms var(--ease), opacity 240ms ease;
}
.mvp-game-card:hover .mvp-game-card__media video { scale: 1.075; opacity: .9; }
.mvp-game-card__veil {
  background:
    linear-gradient(180deg, rgba(7, 11, 26, .2) 0%, rgba(8, 12, 28, .72) 54%, rgba(8, 12, 28, .97) 100%),
    radial-gradient(circle at 78% 8%, transparent, rgba(8, 12, 28, .38) 62%);
}
.mvp-game-card--ranked {
  border-color: rgba(233, 184, 78, 0.54);
  background:
    radial-gradient(circle at 90% -10%, rgba(255, 211, 122, 0.23), transparent 48%),
    linear-gradient(150deg, rgba(35, 36, 58, 0.96), rgba(13, 18, 38, 0.96));
  box-shadow: 0 22px 68px rgba(233, 184, 78, 0.14), 0 20px 58px rgba(3, 6, 18, 0.4);
}
.mvp-game-card--ranked .mvp-game-card__veil {
  background:
    linear-gradient(180deg, rgba(26, 20, 12, .08), rgba(11, 13, 27, .78) 58%, rgba(9, 12, 26, .98)),
    radial-gradient(circle at 72% 0, rgba(233, 184, 78, .1), rgba(8, 12, 28, .46) 62%);
}
.mvp-game-card--media .mvp-game-card__veil {
  background:
    linear-gradient(180deg, rgba(7, 11, 26, .18), rgba(12, 13, 35, .74) 55%, rgba(8, 11, 27, .98)),
    radial-gradient(circle at 30% 10%, rgba(84, 102, 210, .08), rgba(8, 12, 28, .48) 65%);
}
.mvp-ranked-ribbon {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: -39px;
  width: 148px;
  padding: 7px 0 6px;
  transform: rotate(36deg);
  border-block: 1px solid rgba(255, 255, 255, .42);
  color: #11172c;
  background: linear-gradient(90deg, #b87a20, #ffd982 48%, #c9902e);
  box-shadow: 0 7px 22px rgba(3, 6, 18, .42);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: .17em;
  text-align: center;
}
.mvp-game-emblem {
  position: relative;
  z-index: 3;
  display: block;
  width: 148px;
  height: 98px;
  margin: -2px 0 10px -10px;
  overflow: visible;
  color: var(--gold);
  filter: drop-shadow(0 0 18px rgba(233, 184, 78, .28));
}
.mvp-game-emblem--music { color: #aab5ff; filter: drop-shadow(0 0 18px rgba(84, 102, 210, .34)); }
.mvp-game-card:not(.in) .mvp-emblem-reveal { opacity: 0; transform: translateY(13px) scale(.97); }
.mvp-game-card.in .mvp-emblem-reveal { animation: mvp-emblem-reveal 660ms var(--ease) 100ms both; }
.mvp-game-card.in .mvp-endless-flame {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: candle-live 3.8s ease-in-out infinite;
}
.mvp-game-card.in .mvp-emblem-motes { transform-origin: center; animation: emblem-motes 7s linear infinite; }
.mvp-game-card:hover .mvp-emblem-glint { animation: mvp-emblem-glint 640ms var(--ease) both; }
.mvp-music-bars rect { transform-box: fill-box; transform-origin: center; animation: mvp-music-bar 1.6s ease-in-out infinite; }
.mvp-music-bars rect:nth-child(2) { animation-delay: -1.1s; }
.mvp-music-bars rect:nth-child(3) { animation-delay: -.55s; }
.mvp-music-bars rect:nth-child(4) { animation-delay: -1.35s; }
@keyframes mvp-emblem-reveal { from { opacity: 0; transform: translateY(13px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes mvp-emblem-glint { 0% { opacity: 0; transform: translate(-14px, 12px); } 45% { opacity: .74; } 100% { opacity: 0; transform: translate(16px, -12px); } }
@keyframes mvp-music-bar { 0%, 100% { transform: scaleY(.58); opacity: .56; } 50% { transform: scaleY(1.12); opacity: 1; } }
.mvp-game-card h3,
.mvp-game-card p,
.mvp-game-card__action { position: relative; z-index: 3; }
.mvp-game-card h3 {
  margin: 0 0 8px;
  color: #fff9e9;
  text-shadow: 0 2px 18px rgba(3, 6, 18, .72);
  font: 620 25px/1.12 var(--font-display);
  text-transform: uppercase;
}
.mvp-game-card p { margin: 0 0 22px; color: rgba(232, 233, 244, .76); font-size: 14.5px; line-height: 1.48; }
.mvp-game-card__action {
  width: 100%;
  min-height: 49px;
  margin-top: auto;
  padding: 12px 16px;
  border-color: rgba(255, 255, 255, .2);
  background-color: rgba(10, 14, 30, .7);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  font-size: 12.5px;
}
.mvp-game-card--ranked .mvp-game-card__action { animation: ranked-pulse 2.6s ease-in-out infinite; }
.mvp-game-card__glyph, .mvp-fair-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(233, 184, 78, 0.36);
  border-radius: 50%;
  color: var(--gold-2);
  background: rgba(233, 184, 78, 0.075);
  font: 650 18px/1 var(--font-mono);
}
.mvp-unrated-badge {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 22px;
  padding: 6px 9px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(10, 14, 30, 0.62);
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mvp-unrated-caption { margin: 14px 0 0; color: var(--muted); text-align: center; font: 500 11px/1.4 var(--font-mono); }

.mvp-ranked-board {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(360px, 1.2fr);
  gap: 54px;
  align-items: center;
}
.mvp-ranked-board__copy .section-lead { margin-bottom: 24px; }
.mvp-ranked-board__list {
  position: relative;
  overflow: hidden;
  min-height: 172px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(19, 26, 54, 0.58);
  box-shadow: var(--shadow);
}
.mvp-ranked-board__list::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(233, 184, 78, .055) 46%, transparent 74%);
  animation: mvp-board-sheen 7s ease-in-out infinite;
}
@keyframes mvp-board-sheen { 0%, 20% { transform: translateX(-90%); } 72%, 100% { transform: translateX(90%); } }
.mvp-ranked-board__list .lb-row { min-height: 44px; }
.mvp-fair { width: 100%; isolation: isolate; overflow: hidden; border-radius: 28px; }
.mvp-fair .section-video { opacity: .54; }
.mvp-fair .section-video-veil {
  background: linear-gradient(100deg, rgba(9, 14, 33, .96), rgba(10, 17, 40, .7) 54%, rgba(9, 14, 33, .88));
}
.mvp-fair .fair-card {
  border-color: rgba(233, 184, 78, .18);
  background: rgba(12, 18, 39, .68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mvp-fair .mvp-fair-icon { margin-bottom: 14px; border-radius: 12px; }

.account-archive {
  margin: 8px 0 12px;
  border: 1px solid rgba(233, 184, 78, 0.28);
  border-radius: 12px;
  background: rgba(233, 184, 78, 0.045);
}
.account-archive summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  color: var(--gold-2);
  cursor: pointer;
  list-style: none;
  font: 650 11px/1.3 var(--font-mono);
}
.account-archive summary::-webkit-details-marker { display: none; }
.account-archive summary::after { content: "⌄"; color: var(--muted); transition: transform 160ms ease; }
.account-archive[open] summary::after { transform: rotate(180deg); }
.account-archive__count { margin-left: auto; color: var(--muted); font-size: 10px; }
.account-archive__body { display: grid; gap: 7px; padding: 0 10px 11px; }
.account-archive__row { padding: 7px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.035); color: var(--ink); font: 520 10.5px/1.35 var(--font-mono); }
.account-archive__patches { display: flex; flex-wrap: wrap; gap: 5px; }

.paused-mode-overlay { z-index: 1300; }
.paused-mode-card {
  width: min(620px, 100%);
  padding: 42px 38px 36px;
  border: 1px solid rgba(233, 184, 78, 0.46);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% -10%, rgba(233, 184, 78, 0.18), transparent 46%),
    linear-gradient(165deg, rgba(23, 31, 62, 0.99), rgba(9, 13, 31, 0.99));
  box-shadow: var(--shadow);
  text-align: center;
}
.paused-mode-card__glyph { display: block; margin-bottom: 14px; color: var(--gold); font: 700 26px/1 var(--font-mono); }
.paused-mode-card h2 { max-width: 14ch; margin: 0 auto 15px; }
.paused-mode-card > p { max-width: 46ch; margin: 0 auto 25px; color: var(--muted); }
.paused-mode-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }

@media (max-width: 820px) {
  .mvp-game-grid { grid-template-columns: 1fr; }
  .mvp-game-card { min-height: 324px; }
  .mvp-hero-layout { grid-template-columns: 1fr; gap: 14px; }
  .mvp-hero-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mvp-hero-modes__label { grid-column: 1 / -1; }
  .mvp-active #try .mvp-hero-mode-card {
    min-height: 190px;
    grid-template-columns: 82px minmax(0, 1fr);
    column-gap: 10px;
    padding: 15px;
  }
  .mvp-active #try .mvp-hero-mode-card .mvp-game-emblem { width: 82px; height: 62px; }
  .mvp-active #try .mvp-hero-mode-card h3 { font-size: 19px; }
  .mvp-active #try .mvp-hero-mode-card p { font-size: 11.5px; }
  .mvp-ranked-board { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 700px) {
  .mvp-active .header-actions { gap: 5px; }
  .mvp-active .header-language,
  .mvp-active .header-content { display: block; }
  .mvp-active .header-difficulty { display: none; }
  .mvp-active .theme-btn--hdr { padding-inline: 8px; }
}
@media (max-width: 560px) {
  .mvp-active #btn-login { display: inline-flex; padding-inline: 10px; }
  .mvp-active #try.section {
    min-height: 100vh;
    min-height: 100svh;
    padding: 70px 12px 22px;
  }
  .mvp-hero-intro { margin-bottom: 9px; }
  .mvp-hero-title { font-size: clamp(27px, 8.2vw, 34px); line-height: 1.08; }
  .mvp-hero-meta { margin-top: 8px; font-size: 9.5px; }
  .mvp-hero-layout { gap: 10px; }
  .mvp-active #try .qcard-tilt { padding: 14px 13px; }
  .mvp-active #try .qcard-head { margin-bottom: 10px; }
  .mvp-active #try .chip { padding: 4px 8px; font-size: 9.5px; }
  .mvp-active #try .q-text { min-height: 70px; margin-bottom: 10px; font-size: 15px; }
  .mvp-active #try .ring-wrap { width: 104px; height: 104px; margin-bottom: 12px; }
  .mvp-active #try .ring { width: 104px; height: 104px; }
  .mvp-active #try .ring-secs { font-size: 25px; }
  .mvp-active #try .demo-disclaimer { margin-top: 8px; font-size: 9.5px; }
  .mvp-hero-modes { gap: 8px; }
  .mvp-hero-modes__label { font-size: 9px; }
  .mvp-active #try .mvp-hero-mode-card {
    min-height: 176px;
    display: flex;
    padding: 12px 10px 10px;
  }
  .mvp-active #try .mvp-hero-mode-card .mvp-game-emblem {
    align-self: flex-start;
    width: 66px;
    height: 48px;
    margin: 0 0 3px -5px;
  }
  .mvp-active #try .mvp-hero-mode-card h3 { margin: 0 0 7px; font-size: 16px; }
  .mvp-active #try .mvp-hero-mode-card p { display: none; }
  .mvp-active #try .mvp-hero-mode-card .mvp-game-card__action {
    min-height: 42px;
    margin-top: auto;
    padding: 8px;
    font-size: 10px;
    line-height: 1.15;
  }
  .mvp-active #try .mvp-hero-mode-card .mvp-unrated-badge { top: 10px; right: 9px; padding: 4px 6px; font-size: 7.5px; }
  .mvp-active #try .mvp-hero-mode-card .mvp-ranked-ribbon { top: 12px; right: -48px; transform: rotate(34deg) scale(.72); }
  .mvp-games { padding-top: 72px; padding-bottom: 72px; }
  .mvp-game-card { padding: 23px 20px 20px; }
  .mvp-active #try .mvp-hero-mode-card { padding: 12px 10px 10px; }
  .mvp-game-emblem { width: 132px; height: 88px; }
  .mvp-active #try .mvp-hero-mode-card .mvp-game-emblem { width: 66px; height: 48px; }
  .paused-mode-card { padding: 32px 18px 24px; border-radius: 20px; }
}
@media (max-width: 430px) {
  .mvp-active .header-content { display: none; }
  .mvp-active .header-inner { padding-inline: 12px; }
  .mvp-active .wordmark { font-size: 17px; }
  .mvp-active .gm-sound { width: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .mvp-game-card,
  .mvp-game-card::before,
  .mvp-game-card__media video,
  .account-archive summary::after { transition: none; }
  .mvp-game-card:hover { transform: none; }
  .mvp-game-card:hover::before { opacity: 0; }
  .mvp-game-card:hover .mvp-game-card__media video { scale: 1.015; }
  .mvp-game-card:not(.in) .mvp-emblem-reveal { opacity: 1; transform: none; }
  .mvp-game-card.in .mvp-emblem-reveal,
  .mvp-game-card.in .mvp-endless-flame,
  .mvp-game-card.in .mvp-emblem-motes,
  .mvp-game-card:hover .mvp-emblem-glint,
  .mvp-music-bars rect,
  .mvp-game-card--ranked .mvp-game-card__action,
  .mvp-ranked-board__list::before { animation: none; }
}
