/* 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; }

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;
}
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; }

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

.hero {
  position: relative;
  min-height: 100vh;
  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;
  max-width: 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 38px;
  text-shadow: 0 2px 24px rgba(3, 6, 18, 0.8);
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.cta-row--center { justify-content: center; }
.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); }
.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-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;
}
.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);
}
.q-media audio { width: 100%; display: block; }
.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; }
.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;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  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;
  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);
  animation: modal-in 0.4s var(--ease);
  width: min(680px, 100%);
  max-height: min(92vh, 880px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 30px 18px;
}
@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);
}
@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 { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.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-title { font-size: clamp(42px, 13vw, 64px); }
  .qcard-tilt { padding: 20px 18px; }
  .answer-row { flex-direction: column; }
  .ladder-grid { grid-template-columns: 1fr; }
  .overlay { padding: 10px; }
  #btn-login { display: 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 {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.22em;
  color: var(--gold-2);
  text-align: center;
  margin-bottom: 10px;
  animation: rise-in 0.3s var(--ease);
}
.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; }

.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); }
  .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; }
}
/* ---------- 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; }
}
