/* ============================================================
   Русский язык · 10 класс — квест-тренажёр
   Учительская · подготовка к ЕГЭ  ·  commercial / animated build
   ============================================================ */

:root {
  --bg: #0a0616;
  --bg-2: #150a2e;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --text: #ece9fb;
  --text-strong: #ffffff;
  --muted: #a9a4cc;
  --faint: #756f9a;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* vibrant, youthful neon palette */
  --accent: #a855f7;     /* electric violet  */
  --accent-2: #ec4899;   /* hot pink         */
  --accent-3: #d946ef;   /* fuchsia          */
  --accent-soft: rgba(168, 85, 247, 0.2);

  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --pink: #f472b6;

  --good: #2ee6a6;
  --good-bg: rgba(46, 230, 166, 0.15);
  --bad: #ff5d7a;
  --bad-bg: rgba(255, 93, 122, 0.15);

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 16px 36px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgba(168, 85, 247, 0.45), 0 18px 54px -14px rgba(236, 72, 153, 0.55);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Manrope", var(--font-body);
  --font-display: "Lora", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f2ff;
    --bg-2: #ece6ff;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-2: rgba(255, 255, 255, 0.95);
    --surface-3: #ffffff;
    --text: #221d38;
    --text-strong: #140f29;
    --muted: #6a6388;
    --faint: #9a93b8;
    --line: rgba(60, 30, 110, 0.12);
    --line-strong: rgba(60, 30, 110, 0.22);

    --accent: #7c3aed;
    --accent-2: #db2777;
    --accent-3: #c026d3;
    --accent-soft: rgba(124, 58, 237, 0.13);

    --violet: #7c3aed;
    --cyan: #0891b2;
    --lime: #65a30d;
    --pink: #db2777;

    --good: #0fae74;
    --good-bg: rgba(15, 174, 116, 0.12);
    --bad: #e23d57;
    --bad-bg: rgba(226, 61, 87, 0.1);

    --shadow: 0 30px 64px -32px rgba(80, 40, 140, 0.4);
    --shadow-sm: 0 16px 32px -22px rgba(80, 40, 140, 0.35);
    --glow: 0 0 0 1px rgba(124, 58, 237, 0.3), 0 18px 44px -16px rgba(219, 39, 119, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- animated aurora background ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(900px 640px at 82% -12%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(820px 560px at 8% 108%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;
  will-change: transform;
  mix-blend-mode: screen;
}
.b1 { width: 48vw; height: 48vw; left: -10vw; top: -12vw; background: radial-gradient(circle, var(--accent), transparent 70%); animation: drift1 22s ease-in-out infinite; }
.b2 { width: 42vw; height: 42vw; right: -10vw; top: 14vh; background: radial-gradient(circle, var(--accent-2), transparent 70%); opacity: 0.5; animation: drift2 28s ease-in-out infinite; }
.b3 { width: 40vw; height: 40vw; left: 16vw; bottom: -18vw; background: radial-gradient(circle, var(--cyan), transparent 70%); opacity: 0.42; animation: drift3 26s ease-in-out infinite; }
.b4 { width: 32vw; height: 32vw; right: 12vw; bottom: -10vw; background: radial-gradient(circle, var(--lime), transparent 70%); opacity: 0.3; animation: drift1 30s ease-in-out infinite reverse; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(9vw, 7vh) scale(1.18); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-8vw, 9vh) scale(1.12); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(7vw, -8vh) scale(1.2); } }
@media (prefers-color-scheme: light) { .blob { opacity: 0.3; mix-blend-mode: multiply; } .b2 { opacity: 0.26; } .b3,.b4 { opacity: 0.22; } }

.page {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(18px, 3.5vw, 44px) clamp(16px, 4vw, 40px) 56px;
  text-align: center;
}

em { font-style: italic; }
b { font-weight: 600; color: var(--text-strong); }
.muted { color: var(--muted); }

/* view transition */
.view { animation: viewIn 0.45s ease; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- BRAND BAR ---------- */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(18px, 3vw, 32px);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-ui); font-weight: 800; font-size: 1.02rem;
  letter-spacing: 0.01em; color: var(--text-strong);
}
.brand-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 8px transparent; } }
.brand-pill {
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 100px;
  background: var(--surface);
}

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  margin-bottom: clamp(26px, 5vw, 46px);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.05rem, 5.4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.015em;
  margin: 14px 0 14px;
  color: var(--text-strong);
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 45%, var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 6s linear infinite;
  font-style: italic;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero-dot { color: var(--accent); }
.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.13rem);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 18px;
}
.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: 54ch;
  margin: 0 auto 14px;
  padding: 12px 18px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 16px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 34px -22px var(--accent);
}
.hero-note b { color: var(--accent); }
.hero-note-ico {
  flex-shrink: 0;
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 6px var(--accent-soft));
  animation: noteBob 2.8s ease-in-out infinite;
}
@keyframes noteBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.hero-reward {
  max-width: 52ch;
  margin: 0 auto 22px;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--muted);
}
.hero-reward-ico { font-size: 1.08rem; }
.hero-reward b {
  font-weight: 700;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; justify-content: center; }
.chip {
  font-family: var(--font-ui); font-size: 0.86rem; font-weight: 500;
  color: var(--text);
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--surface); backdrop-filter: blur(8px);
}
.chip b { color: var(--accent); font-weight: 800; }
.hero-cta { animation: viewIn 0.6s 0.1s both, glowPulse 2.6s 1s ease-in-out infinite; }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(168,85,247,0.45), 0 14px 40px -16px rgba(236,72,153,0.5); }
  50% { box-shadow: 0 0 0 1px rgba(236,72,153,0.6), 0 20px 60px -10px rgba(168,85,247,0.7); }
}

/* progress orb */
.progress-orb {
  position: relative;
  width: clamp(124px, 22vw, 168px);
  height: clamp(124px, 22vw, 168px);
  flex-shrink: 0; justify-self: end;
}
.orb-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.orb-track { fill: none; stroke: var(--line); stroke-width: 8; }
.orb-fill {
  fill: none; stroke: url(#orbgrad); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.3, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 8px var(--accent-soft));
}
.orb-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.orb-num { font-family: var(--font-display); font-size: clamp(1.5rem, 3.6vw, 2rem); font-weight: 600; color: var(--text-strong); letter-spacing: -0.02em; }
.orb-slash { color: var(--faint); margin: 0 1px; }
.orb-label { font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* ---------- RANK BANNER ---------- */
.rank-banner {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 22px; margin-bottom: 26px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface); backdrop-filter: blur(8px);
  animation: viewIn 0.5s both;
}
.rb-label { font-family: var(--font-ui); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rb-title { font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; color: var(--accent); }
.rb-note { font-size: 0.92rem; color: var(--muted); }

/* ---------- MAP GRID ---------- */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: clamp(14px, 2vw, 20px);
}
.station-card {
  --hue: 40;
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  text-align: center;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  color: inherit; font: inherit;
  cursor: pointer; overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2,0.7,0.2,1), border-color 0.25s, box-shadow 0.3s, background 0.25s;
  animation: cardIn 0.55s cubic-bezier(0.2,0.7,0.2,1) both;
  animation-delay: var(--d, 0s);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(0.97); } to { opacity: 1; transform: none; } }
.station-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, hsl(var(--hue) 80% 62%), transparent 85%);
}
.station-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 50% -40%, hsl(var(--hue) 80% 60% / 0.18), transparent 70%);
  opacity: 0; transition: opacity 0.35s; pointer-events: none;
}
.station-card:not(.is-locked):hover {
  transform: translateY(-6px);
  border-color: hsl(var(--hue) 70% 60% / 0.5);
  box-shadow: 0 26px 60px -28px hsl(var(--hue) 70% 40% / 0.55);
  background: var(--surface-2);
}
.station-card:not(.is-locked):hover::after { opacity: 1; }
.station-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.station-card.is-locked { cursor: not-allowed; opacity: 0.5; filter: saturate(0.35); }
.sc-top { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; }
.sc-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  color: hsl(var(--hue) 78% 74%);
  background: hsl(var(--hue) 62% 55% / 0.16);
  border: 1px solid hsl(var(--hue) 62% 60% / 0.32);
  flex-shrink: 0;
  transition: transform 0.3s;
}
.station-card:not(.is-locked):hover .sc-tag { transform: scale(1.08) rotate(-4deg); }
@media (prefers-color-scheme: light) { .sc-tag { color: hsl(var(--hue) 70% 30%); } }
.sc-num { font-family: var(--font-ui); color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.sc-status { margin-left: auto; color: var(--good); font-weight: 700; font-size: 0.74rem; }
.sc-status.retry { color: var(--accent); }
.station-card.is-locked .sc-status { color: var(--faint); }
.sc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.24rem; line-height: 1.2; margin: 4px 0 0; color: var(--text-strong); }
.sc-sub { font-size: 0.88rem; color: var(--muted); margin: 0; flex-grow: 1; }
.sc-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.sc-bar { flex: 1; height: 7px; border-radius: 100px; background: var(--line); overflow: hidden; }
.sc-bar span { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, hsl(var(--hue) 65% 52%), hsl(var(--hue) 80% 66%)); transition: width 0.7s cubic-bezier(0.3,0.8,0.2,1); }
.sc-stars { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.sc-lock-note { font-size: 0.78rem; color: var(--faint); margin: 4px 0 0; }
.station-card.is-done { border-color: hsl(var(--hue) 55% 50% / 0.35); }

/* ---------- MAP FOOTER ---------- */
.map-footer { margin-top: 38px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.map-note { font-size: 0.82rem; color: var(--faint); margin: 0; }

/* ============================================================
   STATION PLAY
   ============================================================ */
.station-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--surface); color: var(--text);
  font: inherit; font-family: var(--font-ui); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.back-btn:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateX(-2px); }
.station-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; margin-right: auto; min-width: 0; }
.station-tag {
  --hue: 40;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 600;
  color: hsl(var(--hue) 78% 74%);
  background: hsl(var(--hue) 62% 55% / 0.16);
  border: 1px solid hsl(var(--hue) 62% 60% / 0.32);
  flex-shrink: 0;
}
@media (prefers-color-scheme: light) { .station-tag { color: hsl(var(--hue) 70% 30%); } }
.station-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud { display: flex; align-items: center; gap: 10px; }
.streak {
  font-family: var(--font-ui); font-weight: 800; font-size: 0.92rem;
  padding: 6px 12px; border-radius: 100px;
  color: #ff8a3d; background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.35);
  white-space: nowrap;
}
.streak.bump { animation: bump 0.45s cubic-bezier(0.3, 1.4, 0.4, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.station-score { font-family: var(--font-ui); font-size: 0.95rem; font-weight: 700; white-space: nowrap; }

/* track */
.track { height: 7px; border-radius: 100px; background: var(--line); overflow: hidden; margin-bottom: 24px; }
.track-fill { height: 100%; width: 0; border-radius: 100px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width 0.55s cubic-bezier(0.3,0.8,0.2,1); box-shadow: 0 0 12px var(--accent-soft); }

/* ---------- CARD ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
.question.swap { animation: qSwap 0.4s cubic-bezier(0.2,0.7,0.2,1); }
@keyframes qSwap { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
.question-head { margin-bottom: 14px; }
.qnum { font-family: var(--font-ui); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.qtext { font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.55rem); font-weight: 500; line-height: 1.34; color: var(--text-strong); margin: 0 0 6px; }
.qpassage {
  margin: 16px 0 4px; padding: 16px 20px;
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft); font-size: 1.06rem; font-style: italic; color: var(--text);
}

/* ---------- OPTIONS ---------- */
.board { display: grid; gap: 12px; margin-top: 22px; }
.board-compact { grid-template-columns: 1fr 1fr; }
@media (max-width: 460px) { .board-compact { grid-template-columns: 1fr; } }
.option {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: center;
  padding: 16px 20px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 1.05rem; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.18s, background 0.18s, box-shadow 0.18s;
  animation: optIn 0.4s cubic-bezier(0.2,0.7,0.2,1) both;
  animation-delay: var(--d, 0s);
}
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.board-compact .option { justify-content: center; font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; padding: 22px; }
.option .opt-text { flex: 1; }
.option:not(.locked):hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.option:not(.locked):active { transform: scale(0.985); }
.option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.option.locked { cursor: default; }
.option.locked:not(.correct):not(.wrong) { opacity: 0.45; }
.option.correct { border-color: var(--good); background: var(--good-bg); color: var(--text-strong); animation: pop 0.45s cubic-bezier(0.3,1.4,0.4,1); }
.option.correct::after { content: "✓"; color: var(--good); font-weight: 800; font-size: 1.1rem; }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake 0.4s; }
.option.wrong::after { content: "✕"; color: var(--bad); font-weight: 800; font-size: 1.1rem; }
.board-compact .option.correct::after, .board-compact .option.wrong::after { margin-left: 8px; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* floating +1 */
.floatstar {
  position: fixed; z-index: 60; pointer-events: none;
  font-family: var(--font-ui); font-weight: 800; font-size: 1.2rem;
  color: var(--accent); text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: floatup 0.9s cubic-bezier(0.2,0.7,0.2,1) forwards;
}
@keyframes floatup { 0% { opacity: 0; transform: translateY(0) scale(0.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-60px) scale(1.1); } }

/* ---------- FEEDBACK ---------- */
.feedback {
  margin-top: 20px; padding: 16px 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 5px;
  animation: rise 0.32s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feedback.ok { border-color: var(--good); background: var(--good-bg); }
.feedback.no { border-color: var(--bad); background: var(--bad-bg); }
.fb-head { font-family: var(--font-ui); font-weight: 800; font-size: 0.96rem; display: flex; align-items: center; justify-content: center; gap: 7px; }
.feedback.ok .fb-head { color: var(--good); }
.feedback.no .fb-head { color: var(--bad); }
.fb-body { font-size: 0.99rem; color: var(--text); }

/* ---------- CONTROLS / BUTTONS ---------- */
.controls { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 100px;
  font: inherit; font-family: var(--font-ui); font-weight: 700; font-size: 1rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.25s, background 0.2s, border-color 0.2s;
}
.btn-lg { padding: 16px 32px; font-size: 1.06rem; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--glow); }
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:hover::before { animation: sheen 0.8s; }
@keyframes sheen { to { left: 130%; } }
.btn-soft { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.btn-soft:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text-strong); border-color: var(--line-strong); background: var(--surface); }
.btn-arrow { transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ============================================================
   RESULT
   ============================================================ */
.view-result { display: flex; justify-content: center; padding-top: clamp(16px, 6vh, 60px); }
.result-card { max-width: 580px; text-align: center; animation: resultIn 0.5s cubic-bezier(0.2,0.7,0.2,1); box-shadow: var(--shadow); }
@keyframes resultIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }
.result-badge { font-size: 3.6rem; line-height: 1; display: inline-block; animation: badgePop 0.7s cubic-bezier(0.3,1.5,0.4,1) both; }
@keyframes badgePop { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.result-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.65rem, 4vw, 2.2rem); color: var(--text-strong); margin: 14px 0 10px; }
.result-score { font-size: 1.12rem; margin: 0 0 6px; }
.result-sub { color: var(--muted); margin: 0 0 26px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* confetti */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* ============================================================
   SETTINGS (unlock threshold)
   ============================================================ */
.settings {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-bottom: 22px; padding: 13px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); backdrop-filter: blur(8px);
  animation: viewIn 0.5s both;
}
.set-label { font-family: var(--font-ui); font-weight: 700; font-size: 0.9rem; color: var(--text-strong); }
.set-options { display: inline-flex; gap: 4px; background: var(--line); padding: 4px; border-radius: 100px; }
.set-options button {
  font: inherit; font-family: var(--font-ui); font-weight: 700; font-size: 0.84rem;
  color: var(--muted); padding: 7px 14px; border: none; border-radius: 100px;
  background: transparent; cursor: pointer; transition: color 0.2s, background 0.2s, box-shadow 0.2s; white-space: nowrap;
}
.set-options button:hover { color: var(--text-strong); }
.set-options button.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-sm); }
.set-hint { font-size: 0.82rem; color: var(--muted); width: 100%; }

/* ============================================================
   FINALE CARD
   ============================================================ */
.finale { margin-top: clamp(16px, 2.5vw, 24px); }
.finale-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px;
  width: 100%; text-align: center; font: inherit; color: inherit;
  padding: 22px 26px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(12px);
}
.finale-card.locked { opacity: 0.85; cursor: not-allowed; }
.finale-card.unlocked {
  cursor: pointer;
  border-color: rgba(243, 201, 105, 0.5);
  background: linear-gradient(120deg, var(--accent-soft), transparent 70%);
  box-shadow: var(--glow);
}
.finale-card.unlocked:hover { transform: translateY(-3px); transition: transform 0.25s; }
.finale-trophy { font-size: 2.5rem; flex-shrink: 0; }
.finale-card.unlocked .finale-trophy { animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.finale-body { flex: 1; min-width: 0; }
.finale-title { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; color: var(--text-strong); margin: 0 0 3px; }
.finale-sub { font-size: 0.9rem; color: var(--muted); margin: 0; }
.finale-bar { height: 6px; max-width: 340px; border-radius: 100px; background: var(--line); overflow: hidden; margin: 10px auto 0; }
.finale-bar span { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent-3), var(--accent)); transition: width 0.7s cubic-bezier(0.3,0.8,0.2,1); }
.finale-go { flex-shrink: 0; font-family: var(--font-ui); font-weight: 800; color: var(--accent); font-size: 1.4rem; }

/* ============================================================
   CERTIFICATE
   ============================================================ */
.view-cert { display: flex; justify-content: center; padding-top: clamp(8px, 3vh, 32px); }
.cert-wrap { width: 100%; max-width: 660px; }
.cert {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(30px, 5vw, 52px) clamp(22px, 5vw, 46px);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #fffdf6, #f1e6cb);
  color: #2c2415;
  border: 1px solid rgba(150, 110, 40, 0.45);
  box-shadow: var(--shadow);
  animation: resultIn 0.55s cubic-bezier(0.2,0.7,0.2,1);
}
.cert::before { content: ""; position: absolute; inset: 13px; border: 2px solid rgba(150, 110, 40, 0.35); border-radius: 13px; pointer-events: none; }
.cert-seal {
  position: absolute; bottom: 26px; right: 30px;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
  background: radial-gradient(circle at 35% 30%, #e8b85c, #a9701e);
  box-shadow: 0 4px 14px rgba(120, 80, 20, 0.4);
  transform: rotate(-8deg);
}
.cert-eyebrow { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9a6a1f; }
.cert-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 7vw, 3.1rem); margin: 6px 0 12px; color: #7a4e12; letter-spacing: 0.04em; }
.cert-line { font-size: 1rem; color: #5c5142; margin: 6px 0; }
.cert-name {
  display: block; width: 100%; max-width: 440px; margin: 10px auto; text-align: center;
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: clamp(1.45rem, 4.5vw, 2.1rem);
  color: #2c2415; background: transparent; border: none;
  border-bottom: 2px dashed rgba(150, 110, 40, 0.55); padding: 6px 4px; outline: none;
}
.cert-name:focus { border-bottom-color: #a9701e; }
.cert-name::placeholder { color: rgba(120, 90, 40, 0.4); font-weight: 500; }
.cert-stats { display: flex; justify-content: center; gap: clamp(18px, 6vw, 48px); margin: 22px 0 8px; }
.cert-stat { display: flex; flex-direction: column; gap: 2px; }
.cert-stat span { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; color: #7a4e12; }
.cert-stat small { font-family: var(--font-ui); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9a7d4a; }
.cert-date { font-size: 0.85rem; color: #7a6a4a; margin: 12px 0 0; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }

/* ============================================================
   ANALYSIS / RECOMMENDATIONS
   ============================================================ */
.view-analysis { display: flex; justify-content: center; padding-top: clamp(8px, 3vh, 28px); }
.analysis-wrap { width: 100%; max-width: 680px; text-align: center; }
.analysis-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 4.5vw, 2.2rem); color: var(--text-strong); margin: 0 0 8px; }
.analysis-sub { color: var(--muted); margin: 0 auto 18px; max-width: 56ch; }
.analysis-body { text-align: left; }
.an-h { font-family: var(--font-ui); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 18px 0 10px; }
.an-h-weak { color: var(--accent); }
.an-h-strong { color: var(--good); }
.an-card {
  --hue: 40;
  border: 1px solid var(--line); border-left: 3px solid hsl(var(--hue) 72% 60%);
  border-radius: var(--radius-sm); background: var(--surface);
  padding: 14px 16px; margin-bottom: 10px; backdrop-filter: blur(8px);
}
.an-card.pri { border-left-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-soft); }
.an-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.an-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 0.8rem;
  color: hsl(var(--hue) 78% 74%); background: hsl(var(--hue) 60% 55% / 0.16); border: 1px solid hsl(var(--hue) 60% 60% / 0.3);
}
.an-name { font-weight: 700; color: var(--text-strong); flex: 1; }
.an-score { font-family: var(--font-ui); font-weight: 700; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.an-card.pri .an-score { color: var(--accent-2); }
.an-tip { margin: 0; font-size: 0.94rem; color: var(--text); }
.an-strong { display: flex; flex-wrap: wrap; gap: 8px; }
.an-chip {
  --hue: 40; font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 100px;
  color: hsl(var(--hue) 72% 72%); background: hsl(var(--hue) 60% 50% / 0.14); border: 1px solid hsl(var(--hue) 60% 55% / 0.3);
}
@media (prefers-color-scheme: light) { .an-tag, .an-chip { color: hsl(var(--hue) 70% 30%); } }
.analysis-arina {
  margin: 22px auto 0; max-width: 58ch; padding: 18px 20px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), transparent 82%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.arina-ico { font-size: 1.7rem; }
.analysis-arina p { margin: 0; color: var(--text); }
.analysis-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px);
  z-index: 80; padding: 12px 20px; border-radius: 100px;
  background: var(--surface-3); color: var(--text-strong);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px);
  font-family: var(--font-ui); font-weight: 700; font-size: 0.92rem;
  opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   STICKY CTA
   ============================================================ */
.cta-banner {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 0 auto clamp(18px, 3vw, 30px); max-width: 100%;
  padding: 12px 20px 12px 14px; border-radius: 100px;
  text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: glowPulse 2.6s 1s ease-in-out infinite;
}
.cta-banner:hover { transform: translateY(-3px); }
.cta-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.22); flex-shrink: 0; }
.cta-content { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; text-align: left; }
.cta-content strong { font-family: var(--font-ui); font-size: 0.98rem; font-weight: 800; }
.cta-sub { font-size: 0.78rem; opacity: 0.9; }
.cta-arrow { font-size: 1.2rem; font-weight: 800; transition: transform 0.2s ease; }
.cta-banner:hover .cta-arrow { transform: translateX(3px); }

/* ============================================================
   MOBILE: fit the question screen without scrolling
   ============================================================ */
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; }
  .progress-orb { justify-self: center; order: -1; }
  .cta-sub { white-space: normal; }
  .page { padding-bottom: 22px; }

  /* put the full station name on its own row so it never gets cut off */
  .view-station .station-bar { margin-bottom: 8px; flex-wrap: wrap; row-gap: 6px; }
  .station-bar .hud { margin-left: auto; }
  .station-meta { order: 1; flex-basis: 100%; margin: 2px 0 0; justify-content: center; }
  .station-name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }

  /* Full-height column: only the question card scrolls, while the "Следующий
     вопрос" button stays pinned to its bottom — always tappable, no page scroll.
     Sticky-in-the-card (not position:fixed) is immune to ancestor transforms
     from the entrance / question-swap animations. */
  .view-station { display: flex; flex-direction: column; min-height: calc(100svh - 40px); }
  .view-station .content { flex: 1 1 auto; min-height: 0; display: flex; }
  .view-station .track { margin-bottom: 12px; flex: 0 0 auto; }
  .view-station .card {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 15px 16px; backdrop-filter: none; background: var(--bg-2);
  }
  .question-head { margin-bottom: 5px; }
  .qtext { font-size: 1.05rem; line-height: 1.27; }
  .qpassage { padding: 9px 12px; font-size: 0.95rem; margin: 9px auto 2px; }
  .board { gap: 8px; margin-top: 11px; }
  .option { padding: 11px 14px; font-size: 0.96rem; }
  .board-compact .option { padding: 12px; font-size: 1.16rem; }
  .feedback { margin-top: 10px; padding: 11px 14px; }
  .fb-body { font-size: 0.9rem; }
  .view-station .controls {
    position: sticky; bottom: 0; margin-top: auto;
    padding: 10px 0 2px; background: var(--bg-2); z-index: 5;
    box-shadow: 0 -12px 14px -10px rgba(0,0,0,0.4);
  }
  .view-station #next-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .blob { display: none; }
}

/* ============================================================
   TEACHER ACCESS BUTTON (corner of the start page)
   ============================================================ */
.teacher-btn {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 100px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.84rem;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line); cursor: pointer; backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.teacher-btn:hover { color: var(--text-strong); border-color: var(--accent); background: var(--surface-3); transform: translateY(-2px); }
.teacher-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.teacher-btn .tb-ico { font-size: 1rem; line-height: 1; }
.teacher-btn.is-active {
  color: var(--text-strong); border-color: var(--accent);
  background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-sm);
}
@media (max-width: 520px) {
  .teacher-btn { left: 12px; bottom: 12px; padding: 8px 12px; font-size: 0.8rem; }
}
