/* PHP Quest — мультяшный стиль: толстые «3D»-кнопки, яркие цвета, мягкие анимации.
   Цвета через переменные, тёмная тема переопределяет их. */

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-cyrillic.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --text: #3c3c3c;
  --muted: #777777;
  --border: #e5e5e5;
  --border-strong: #d7d7d7;

  --green: #58cc02;   --green-dark: #58a700;  --green-light: #d7ffb8; --green-text: #58a700;
  --blue: #1cb0f6;    --blue-dark: #1899d6;   --blue-light: #ddf4ff;  --blue-text: #1899d6;
  --red: #ff4b4b;     --red-dark: #ea2b2b;    --red-light: #ffdfe0;   --red-text: #ea2b2b;
  --yellow: #ffc800;  --yellow-dark: #e5a500; --yellow-light: #fff5d3;
  --orange: #ff9600;  --orange-dark: #e08600;
  --purple: #ce82ff;  --purple-dark: #a568cc;
  --pink: #ff86d0;    --pink-dark: #db6ab0;
  --teal: #00cd9c;    --teal-dark: #00a87f;

  --code-bg: #f7f7f7;
  --term-bg: #1f2a30;
  /* Тепловая карта: одна шкала зелёного от светлого к тёмному. */
  --hm1: #d4f5b6; --hm2: #9de069; --hm3: #58cc02; --hm4: #3a8a00;
  --radius: 18px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --hm1: #1d3b13; --hm2: #2e6614; --hm3: #48a80a; --hm4: #7fe035;
  --bg: #131f24;
  --surface: #131f24;
  --surface-2: #1b2930;
  --text: #f1f7fb;
  --muted: #a0b0ba;
  --border: #37464f;
  --border-strong: #46555e;
  --green-light: #1f3a12;  --green-text: #79e030;
  --blue-light: #12303f;   --blue-text: #49c0f8;
  --red-light: #3d1a1d;    --red-text: #ff7878;
  --yellow-light: #3a3214;
  --code-bg: #1b2930;
  --term-bg: #0d1518;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--blue-text); text-decoration: none; font-weight: 700; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
::selection { background: var(--blue-light); }

/* ============ Каркас ============ */
.container { max-width: 760px; margin: 0 auto; padding: 24px 16px 96px; }
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  border-radius: var(--radius);
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--muted); margin: 0 0 .4em; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--green); font-weight: 900; font-size: 1.2rem; white-space: nowrap; letter-spacing: -.01em; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--green); color: #fff;
  font: 800 14px/1 var(--mono);
  box-shadow: 0 3px 0 var(--green-dark);
  transition: transform .25s var(--spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.hud-wrap { flex: 1; min-width: 0; display: flex; justify-content: center; }
.hud { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 800; }
.hud-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px; transition: background .2s; }
.hud-pill:hover { background: var(--surface-2); }
.hud-pill .icon { width: 22px; height: 22px; }
.hud-level { color: var(--orange); }
.hud-level .hud-title { color: var(--muted); font-weight: 700; font-size: .85rem; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.hud-xp { color: var(--orange); }
.hud-xp b { display: inline-block; min-width: 2ch; }
.hud-xp.bump b { animation: bump .5s var(--spring); }
.hud-today { color: var(--blue); }
.hud-streak { color: var(--muted); }
.hud-streak .icon { filter: grayscale(1); opacity: .6; }
.hud-streak.lit { color: var(--orange); }
.hud-streak.lit .icon { filter: none; opacity: 1; animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.xpbar { width: 120px; height: 14px; border-radius: 99px; background: var(--border); overflow: hidden; }
.xpbar > span {
  display: block; height: 100%; border-radius: inherit;
  background: var(--yellow);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08), inset 0 4px 0 rgba(255, 255, 255, .35);
  transition: width .9s var(--spring);
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions form { margin: 0; display: flex; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 2px solid transparent; background: none; color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s, transform .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--blue); }
.icon-btn:active { transform: scale(.9); }
.icon-btn .icon { width: 22px; height: 22px; }

/* ============ Кнопки ============ */
.btn {
  --c: var(--surface); --shade: var(--border); --ink: var(--blue-text);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px;
  border: 2px solid transparent; border-radius: 16px;
  background: var(--c); color: var(--ink);
  font: 800 .95rem/1 var(--font); text-transform: uppercase; letter-spacing: .06em;
  box-shadow: 0 4px 0 var(--shade);
  cursor: pointer; user-select: none; text-decoration: none !important;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--shade); }
.btn:disabled, .btn.htmx-request { filter: saturate(.4) brightness(.97); cursor: progress; }
.btn .icon { width: 20px; height: 20px; }
.btn small { text-transform: none; letter-spacing: 0; font-weight: 700; opacity: .8; }
.btn.primary { --c: var(--green); --shade: var(--green-dark); --ink: #fff; }
.btn.blue { --c: var(--blue); --shade: var(--blue-dark); --ink: #fff; }
.btn.secondary { --c: var(--surface); --shade: var(--border); --ink: var(--blue-text); border-color: var(--border); }
.btn.ghost { --shade: transparent; background: none; border: 2px dashed var(--border); color: var(--muted); box-shadow: none; text-transform: none; letter-spacing: 0; font-size: .95rem; min-height: 44px; }
.btn.ghost:hover { color: var(--blue-text); border-color: var(--blue); }
.btn.ghost:active { transform: scale(.97); }
.btn.big { min-height: 56px; padding: 14px 28px; font-size: 1.05rem; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: .8rem; }
.btn.wide { width: 100%; }
/* Пульс у главной кнопки «Дальше» */
.btn[data-autofocus] { animation: btn-breathe 1.8s ease-in-out .6s infinite; }

input, textarea {
  width: 100%; font: 600 1rem/1.4 var(--font); color: var(--text);
  background: var(--surface-2); border: 2px solid var(--border); border-radius: 14px;
  padding: 13px 15px; margin-top: 6px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 4px var(--blue-light); }
label.field { display: block; font-weight: 800; font-size: .95rem; margin: 14px 0 0; }
.answer-input { font-family: var(--mono); font-weight: 500; }
kbd { display: inline-block; padding: 1px 6px; border: 2px solid var(--border); border-bottom-width: 3px; border-radius: 7px; font-size: .75rem; color: var(--muted); background: var(--surface); }

/* ============ Пузырь реплики ============ */
.bubble {
  position: relative;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  font-weight: 700;
  animation: bubble-in .45s var(--spring) both;
}
.bubble::before {
  content: ""; position: absolute;
  width: 14px; height: 14px; background: inherit;
  border: inherit; border-width: 0 0 2px 2px;
  border-radius: 0 0 0 4px;
}
.bubble-left::before { left: -9px; top: 50%; transform: translateY(-50%) rotate(45deg); }
.bubble-up::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }

/* ============ Маскот ============ */
.mascot { --mb: #aab7f2; --md: #8e9ce2; display: block; flex: none; overflow: visible; width: 64px; height: auto; }
.mascot-sm { width: 60px; }
.mascot-md { width: 96px; }
.mascot-lg { width: 128px; }
.mascot-xl { width: 168px; }
.mascot g, .mascot ellipse, .mascot path, .mascot circle { transform-box: fill-box; transform-origin: center; }
.m-body { fill: var(--mb); }
.m-dark { fill: var(--md); }
.m-stroke { stroke: var(--mb); }
.m-pink { fill: #f7a6c4; }
.m-shadow { fill: rgba(0, 0, 0, .1); animation: m-shadow 3.2s ease-in-out infinite; }
.m-eyes-happy, .m-brows-sad, .m-brows-think, .m-trunk-up { display: none; }
.mood-happy .m-eyes-open, .mood-cheer .m-eyes-open { display: none; }
.mood-happy .m-eyes-happy, .mood-cheer .m-eyes-happy { display: inline; }
.mood-cheer .m-trunk-down { display: none; }
.mood-cheer .m-trunk-up { display: inline; }
.mood-sad .m-brows-sad, .mood-think .m-brows-think { display: inline; }
.mood-sad .m-mouth { transform: scaleY(-1) translateY(-3px); }
.mood-sad .m-pupil { transform: translateY(2.5px); }
.mood-think .m-pupil { transform: translate(-2px, -3px); }
.m-pupil { transition: transform .3s ease; }

.m-bounce { animation: m-float 3.2s ease-in-out infinite; }
.m-eye { animation: m-blink 4.6s infinite; }
.m-eye + .m-eye { animation-delay: .02s; }
.m-ear-l { transform-origin: 85% 50%; animation: m-ear-l 3.2s ease-in-out infinite; }
.m-ear-r { transform-origin: 15% 50%; animation: m-ear-r 3.2s ease-in-out infinite; }
.mood-happy .m-bounce { animation: m-hop 1.6s var(--spring) infinite; }
.mood-cheer .m-bounce { animation: m-hop 0.9s var(--spring) infinite; }
.mood-cheer .m-trunk-up { transform-origin: 0% 100%; animation: m-trunk 0.45s ease-in-out infinite alternate; }
.mood-cheer .m-ear-l, .mood-cheer .m-ear-r { animation-duration: .45s; }
.mood-sad .m-bounce { animation: m-droop 2.4s ease-in-out infinite; }
.mood-think .m-bounce { animation: m-tilt 2.6s ease-in-out infinite; }
.mascot.react { animation: m-react .6s var(--spring); }

/* ============ Вход ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-stack { width: 100%; max-width: 380px; display: grid; gap: 18px; justify-items: center; }
.login-hero { display: grid; justify-items: center; gap: 14px; }
.login-card { width: 100%; padding: 26px 24px 24px; display: grid; gap: 12px; animation: rise .5s var(--spring) both .1s; }
.login-card input { margin: 0; }
.login-card .btn { margin-top: 6px; }
.login-card p { margin: 0 0 4px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 900; color: var(--green); }

/* ============ Карта ============ */
.hero {
  display: flex; align-items: center; gap: 18px;
  margin: 8px 0 34px;
}
.hero-text { display: grid; gap: 16px; justify-items: start; flex: 1; }
.hero .bubble { font-size: 1.05rem; }
.unit { margin-bottom: 40px; --c: var(--green); --cd: var(--green-dark); }
.unit-green { --c: var(--green); --cd: var(--green-dark); }
.unit-purple { --c: var(--purple); --cd: var(--purple-dark); }
.unit-blue { --c: var(--blue); --cd: var(--blue-dark); }
.unit-orange { --c: var(--orange); --cd: var(--orange-dark); }
.unit-pink { --c: var(--pink); --cd: var(--pink-dark); }
.unit-teal { --c: var(--teal); --cd: var(--teal-dark); }
.unit-banner {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--c); color: #fff;
  box-shadow: 0 5px 0 var(--cd);
  animation: rise .5s var(--spring) both;
}
.unit-banner h2 { margin: 0 0 4px; font-size: 1.25rem; }
.unit-kicker { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 900; opacity: .85; }
.unit-goal { margin: 0; font-weight: 600; opacity: .95; font-size: .95rem; }
.unit-badge {
  flex: none; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255, 255, 255, .22); border: 2px solid rgba(255, 255, 255, .35);
}
.unit-badge .icon { width: 26px; height: 26px; }
.unit .chips { margin-top: 12px; }
.unit .chip { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); color: #fff; }
.unit-soon .unit-banner { background: var(--surface-2); color: var(--muted); box-shadow: 0 5px 0 var(--border); border: 2px solid var(--border); }
.unit-soon .unit-badge { background: var(--border); border-color: transparent; }
.unit-soon .chip { background: var(--surface); border-color: var(--border); color: var(--muted); }
.unit-soon-label { text-align: center; color: var(--muted); font-weight: 800; margin: 16px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); border: 2px solid var(--border);
}
.chip .icon { width: 14px; height: 14px; }

.path { list-style: none; margin: 64px 0 0; padding: 0; display: grid; justify-items: center; gap: 22px; }
.path-item {
  display: grid; justify-items: center; gap: 6px;
  transform: translateX(var(--x));
  animation: node-in .55s var(--spring) both;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}
.node { position: relative; display: grid; place-items: center; width: 84px; height: 84px; -webkit-tap-highlight-color: transparent; }
.node-btn {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 70px; height: 64px; border-radius: 50%;
  background: var(--c); color: #fff;
  box-shadow: 0 7px 0 var(--cd), inset 0 -4px 0 rgba(0, 0, 0, .08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.node-btn .icon { width: 32px; height: 32px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
.node:hover .node-btn { transform: translateY(-2px); box-shadow: 0 9px 0 var(--cd), inset 0 -4px 0 rgba(0, 0, 0, .08); }
.node:active .node-btn { transform: translateY(7px); box-shadow: 0 0 0 var(--cd); }
.node-done .node-btn { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-dark), inset 0 -4px 0 rgba(0, 0, 0, .06); }
.node-locked .node-btn { background: var(--border); color: var(--muted); box-shadow: 0 7px 0 var(--border-strong); }
.node-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--border) 0);
  -webkit-mask: radial-gradient(circle, transparent 37px, #000 38px);
  mask: radial-gradient(circle, transparent 37px, #000 38px);
  opacity: 0;
}
.node-current .node-ring { opacity: 1; }
.node-current .node-btn { animation: node-glow 2s ease-in-out infinite; }
.node-start {
  position: absolute; bottom: calc(100% + 10px); left: 50%; z-index: 2;
  padding: 8px 14px; border-radius: 12px;
  background: var(--surface); border: 2px solid var(--border);
  color: var(--c); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: float-tag 1.4s ease-in-out infinite;
}
.node-start::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 12px; height: 12px; background: inherit;
  border: 2px solid var(--border); border-width: 0 2px 2px 0;
  transform: translate(-50%, -6px) rotate(45deg);
}
.node-boss .node-btn { width: 84px; height: 76px; border-radius: 28px; }
.node-boss { width: 100px; height: 96px; }
.node-boss .node-btn .icon { width: 38px; height: 38px; }
.node-boss .node-ring { -webkit-mask: radial-gradient(circle, transparent 45px, #000 46px); mask: radial-gradient(circle, transparent 45px, #000 46px); }
.boss-tag { display: block; font-style: normal; font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.node-label { max-width: 220px; text-align: center; font-weight: 800; font-size: .9rem; line-height: 1.25; color: var(--text); }
.node-label small { display: block; color: var(--muted); font-weight: 700; }
.path-trophy .trophy {
  display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: var(--yellow-light); color: var(--yellow-dark); border: 3px solid var(--yellow);
  animation: wobble 2.4s ease-in-out infinite;
}
.path-trophy .icon { width: 38px; height: 38px; }

/* ============ Серия и задания на день ============ */
.streak-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 36px; animation: rise .45s var(--spring) both .05s;
}
.streak-top { display: flex; align-items: center; gap: 14px; }
.streak-flame { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--surface-2); color: var(--border-strong); flex: none; }
.streak-flame .icon { width: 36px; height: 36px; }
.streak-card.lit .streak-flame { background: #fff1db; color: var(--orange); }
:root[data-theme="dark"] .streak-card.lit .streak-flame { background: #3a2a12; }
.streak-card.lit .streak-flame .icon { animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.streak-number { font-size: 1.5rem; font-weight: 900; color: var(--orange); line-height: 1.1; }
.streak-card:not(.lit) .streak-number { color: var(--muted); }
.streak-sub { font-weight: 700; font-size: .9rem; color: var(--muted); }
.week-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, 34px); gap: 4px; text-align: center; }
.wd { display: grid; justify-items: center; gap: 4px; }
.wd-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--border); color: #fff; }
.wd-dot .icon { width: 17px; height: 17px; }
.wd-label { font-size: .72rem; font-weight: 800; color: var(--muted); }
.wd-done .wd-dot { background: var(--orange); box-shadow: 0 3px 0 var(--orange-dark); animation: pop .4s var(--spring) both; }
.wd-frozen .wd-dot { background: var(--blue); box-shadow: 0 3px 0 var(--blue-dark); }
.wd-today .wd-dot { background: var(--surface); border: 3px dashed var(--orange); }
.wd-today .wd-label { color: var(--orange); }
.wd-missed .wd-dot { background: var(--red-light); }
.wd-future .wd-dot { background: var(--surface-2); border: 2px solid var(--border); }

.quest { padding: 16px 18px 14px; margin-bottom: 22px; animation: rise .45s var(--spring) both .12s; }
.quest-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.quest-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.quest-head h2 .icon { color: var(--purple); width: 26px; height: 26px; }
.mode-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--border); }
.mode {
  display: grid; justify-items: center; padding: 4px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font: 800 .8rem/1.15 var(--font); cursor: pointer;
  transition: background .15s, color .15s, transform .15s var(--spring);
}
.mode small { font-weight: 700; font-size: .66rem; opacity: .8; }
.mode:hover { color: var(--text); }
.mode.on { background: var(--surface); color: var(--blue-text); box-shadow: 0 2px 0 var(--border); transform: scale(1.03); }
.quest-tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quest-task { display: flex; align-items: center; gap: 12px; animation: rise .4s var(--spring) both; animation-delay: calc(var(--i) * 70ms + .2s); }
.quest-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: #fff; }
.quest-icon .icon { width: 22px; height: 22px; }
.quest-xp { background: var(--orange); }
.quest-solved { background: var(--blue); }
.quest-clean { background: var(--purple); }
.quest-cards { background: var(--pink); }
.quest-body { flex: 1; min-width: 0; }
.quest-title { font-weight: 800; font-size: .92rem; margin-bottom: 4px; }
.quest-bar { position: relative; height: 18px; border-radius: 99px; background: var(--border); overflow: hidden; }
.quest-bar span { display: block; height: 100%; border-radius: inherit; background: var(--yellow); transition: width .8s var(--spring); }
.quest-task.done .quest-bar span { background: var(--green); }
.quest-bar em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 900; color: var(--text); }
.quest-check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; animation: pop .4s var(--spring); }
.quest-check .icon { width: 17px; height: 17px; }
.quest-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--border); font-size: .88rem; font-weight: 700; color: var(--muted); }
.chest { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--purple); flex: none; }
.quest-foot.claimed { color: var(--green-text); }
.quest-foot.claimed .chest { background: var(--purple); color: #fff; animation: wobble 1.6s ease-in-out infinite; }

.bonus-line {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .6);
  font-weight: 900; animation: pop .5s var(--spring) both .45s;
}
:root[data-theme="dark"] .bonus-line { background: rgba(0, 0, 0, .25); }
.bonus-line .icon { width: 22px; height: 22px; }
.streak-line { color: var(--orange-dark); }
.streak-line .icon { color: var(--orange); animation: flicker 1.4s ease-in-out infinite; }
.quest-line { color: var(--purple-dark); }
.quest-line .icon { color: var(--purple); }

/* ============ Боссы ============ */
.boss-timer {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 12px; font-weight: 900; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted); border: 2px solid var(--border);
}
.boss-timer .icon { width: 20px; height: 20px; }
.boss-timer.live { background: var(--blue-light); color: var(--blue-text); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.boss-timer.hurry { background: var(--yellow-light); color: var(--orange-dark); border-color: var(--yellow); animation: btn-breathe 1s ease-in-out infinite; }
.boss-timer.overtime { background: var(--red-light); color: var(--red-text); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.boss-timer.done { background: var(--yellow-light); color: var(--orange-dark); border-color: var(--yellow); }
.boss-stars { letter-spacing: 1px; color: var(--yellow-dark); }
.boss-card { background: linear-gradient(160deg, var(--yellow-light), var(--surface) 60%); border-color: color-mix(in srgb, var(--yellow) 60%, transparent); }
.boss-card > h2 { color: var(--orange-dark); }
:root[data-theme="dark"] .boss-card > h2 { color: var(--yellow); }
.boss-rules { list-style: none; padding: 0; display: grid; gap: 8px; }
.boss-rules li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); font-weight: 800; }
.boss-rules .star { color: var(--yellow); font-size: 1.4rem; line-height: 1; }
.boss-stars-big { display: flex; gap: 6px; font-size: 3rem; line-height: 1; margin: 4px 0; }
.bstar { color: var(--border); animation: pop .6s var(--spring) both; animation-delay: calc(var(--i) * 220ms + 400ms); }
.bstar.on { color: var(--yellow); text-shadow: 0 3px 0 var(--yellow-dark); }
.boss-criteria { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-weight: 800; font-size: .9rem; }
.boss-criteria li { display: flex; align-items: center; justify-content: center; gap: 6px; }
.boss-criteria .ok { color: var(--green-text); }
.boss-criteria .no { color: var(--red-text); }
.map-stars { color: var(--yellow-dark); letter-spacing: 1px; }
.q-chip { text-decoration: none !important; transition: transform .15s var(--spring); }
.q-chip:hover { transform: translateY(-2px); }
.q-pct { margin-left: 4px; padding: 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .3); font-size: .72rem; }
.unit-soon .q-pct { background: var(--surface-2); }

/* ============ Прогресс ============ */
.stat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: -10px 0 24px; }
.stat-tiles .tile { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--border); border-bottom-width: 4px; animation: rise .4s var(--spring) both; }
.stat-tiles .tile .icon { width: 24px; height: 24px; }
.stat-tiles .tile b { font-size: 1.4rem; font-weight: 900; line-height: 1.1; color: var(--text); }
.stat-tiles .tile span { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.t-xp .icon, .t-streak .icon { color: var(--orange); }
.t-level .icon { color: var(--yellow-dark); }
.t-days .icon { color: var(--blue); }
.t-solved .icon { color: var(--green); }
.t-cards .icon { color: var(--pink); }
.panel { padding: 18px 20px 20px; margin-bottom: 22px; animation: rise .45s var(--spring) both; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.overall-pill { padding: 4px 12px; border-radius: 99px; background: var(--green-light); color: var(--green-text); font-weight: 900; }
.radar-wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; margin-top: 10px; }
.radar { width: 100%; height: auto; overflow: visible; }
.radar-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis { stroke: var(--border); stroke-width: 1; }
.radar-axis.locked { stroke-dasharray: 3 4; }
.radar-area { fill: color-mix(in srgb, var(--green) 22%, transparent); stroke: var(--green); stroke-width: 2; stroke-linejoin: round; animation: radar-in .9s var(--spring) both; transform-origin: 50% 50%; }
.radar-point .hit { fill: transparent; }
.radar-point .dot { fill: var(--green); stroke: var(--surface); stroke-width: 2; transition: r .15s; }
.radar-point.weak .dot { fill: var(--red); }
.radar-point.locked .dot { fill: var(--border-strong); }
.radar-point:hover .dot { r: 7; }
.radar-label { fill: var(--muted); font: 800 11px/1 var(--font); }
.radar-point.weak .radar-label { fill: var(--red-text); }
.readiness-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 470px; overflow-y: auto; scrollbar-width: thin; }
.rl a { display: grid; grid-template-columns: 24px minmax(0, 1fr) 48px 36px auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; color: var(--text); font-weight: 700; font-size: .85rem; text-decoration: none !important; }
.rl a:hover { background: var(--surface-2); }
.rl-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); font-weight: 900; font-size: .75rem; }
.rl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.rl-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.rl-pct { text-align: right; font-variant-numeric: tabular-nums; }
.rl-tag { font-size: .72rem; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.rl-tag .icon { width: 13px; height: 13px; }
.rl.weak .rl-tag { color: var(--red-text); }
.rl.weak .rl-bar span { background: var(--red); }
.rl.locked { opacity: .6; }

.heatmap-scroll { overflow-x: auto; padding: 6px 0 4px; }
.heatmap { display: inline-grid; grid-auto-flow: column; gap: 4px; }
.hm-days, .hm-col { display: grid; grid-template-rows: 16px repeat(7, 18px); gap: 4px; }
.hm-days span { font-size: .65rem; font-weight: 800; color: var(--muted); line-height: 18px; padding-right: 4px; }
.hm-month { font-size: .7rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.hm-cell { display: inline-block; width: 18px; height: 18px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
.hm-cell.l1 { background: var(--hm1); border-color: transparent; }
.hm-cell.l2 { background: var(--hm2); border-color: transparent; }
.hm-cell.l3 { background: var(--hm3); border-color: transparent; }
.hm-cell.l4 { background: var(--hm4); border-color: transparent; }
.hm-cell.future { opacity: .35; }
.hm-col .hm-cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: .75rem; font-weight: 800; color: var(--muted); }
.hm-legend .hm-cell { width: 14px; height: 14px; }

.ach-group { margin: 18px 0 8px; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach {
  display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center;
  padding: 14px 10px 12px; border-radius: 18px; border: 2px solid var(--border); border-bottom-width: 4px;
  animation: rise .4s var(--spring) both; animation-delay: calc(var(--i) * 25ms);
}
.ach b { font-weight: 900; font-size: .9rem; line-height: 1.2; }
.ach-desc { font-size: .75rem; font-weight: 600; color: var(--muted); line-height: 1.3; }
.ach-medal {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  font-size: 30px; background: var(--surface-2); border: 3px solid var(--border);
  filter: grayscale(1); opacity: .55; transition: transform .2s var(--spring);
}
.ach.got { border-color: color-mix(in srgb, var(--yellow) 60%, var(--border)); background: linear-gradient(180deg, var(--yellow-light), var(--surface) 70%); }
.ach.got .ach-medal { filter: none; opacity: 1; background: var(--surface); border-color: var(--yellow); box-shadow: 0 4px 0 var(--yellow-dark); }
.ach.got:hover .ach-medal { transform: rotate(-8deg) scale(1.08); }
.ach-bar { width: 80%; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 4px; }
.ach-bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.ach-count { font-size: .7rem; font-weight: 800; color: var(--muted); }

.achievement-pop { position: fixed; right: 16px; bottom: 16px; z-index: 85; display: grid; gap: 10px; max-width: min(360px, calc(100% - 32px)); pointer-events: none; }
.achievement-pop:empty { display: none; }
.ach-toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: var(--surface); border: 2px solid var(--yellow); border-bottom-width: 5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  pointer-events: auto; cursor: pointer;
  animation: ach-in .7s var(--spring) both; animation-delay: calc(var(--i) * 250ms);
}
.ach-toast .ach-medal { width: 50px; height: 50px; font-size: 26px; filter: none; opacity: 1; border-color: var(--yellow); background: var(--yellow-light); animation: wobble 1.6s ease-in-out infinite; }
.ach-toast small { display: block; font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); }
.ach-toast b { display: block; font-weight: 900; }
.ach-toast span:not(.ach-medal) { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ach-toast.out { animation: ach-out .35s ease forwards; }
.ach-more { text-decoration: none !important; color: var(--text); }

/* ============ Навигация ============ */
.mainnav { display: flex; gap: 4px; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 12px; border: 2px solid transparent;
  color: var(--muted); font-weight: 900; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-link .icon { width: 22px; height: 22px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.on { color: var(--blue-text); background: var(--blue-light); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.nav-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 99px;
  background: var(--red); color: #fff; font: 900 .7rem/1 var(--font); font-style: normal;
  border: 2px solid var(--bg); animation: pop .4s var(--spring);
}

/* ============ Interview Arena ============ */
.arena-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: -10px 0 30px; }
.astat { display: grid; justify-items: center; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--border); border-bottom-width: 4px; animation: rise .4s var(--spring) both; }
.astat b { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.astat span { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.astat-known b { color: var(--green); }
.astat-learning b { color: var(--orange); }
.astat-new b { color: var(--blue); }
.astat-locked b { color: var(--muted); }
.arena-group { margin-bottom: 30px; }
.arena-group h2 { display: flex; align-items: center; gap: 8px; }
.arena-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.arena-tile {
  --c: var(--blue); --cd: var(--blue-dark);
  position: relative; display: grid; gap: 6px; align-content: start; min-height: 116px;
  padding: 14px 14px 12px; border-radius: 18px;
  background: var(--surface); border: 2px solid var(--border); border-bottom-width: 5px;
  color: var(--text); text-decoration: none !important;
  transition: transform .15s var(--spring), border-color .15s;
  animation: rise .4s var(--spring) both; animation-delay: calc(var(--i) * 30ms);
}
.arena-tile:hover { transform: translateY(-3px); border-color: var(--c); }
.arena-tile:active { transform: translateY(2px); border-bottom-width: 2px; }
.tile-num {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  background: var(--c); color: #fff; font-weight: 900; box-shadow: 0 3px 0 var(--cd);
}
.tile-title { font-weight: 900; line-height: 1.25; }
.tile-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; color: var(--c); }
.tile-status .icon { width: 16px; height: 16px; }
.tile-note { font-style: normal; color: var(--purple-dark); margin-left: auto; }
.st-new { --c: var(--blue); --cd: var(--blue-dark); }
.st-due { --c: var(--orange); --cd: var(--orange-dark); border-color: color-mix(in srgb, var(--orange) 50%, var(--border)); }
.st-learning { --c: var(--purple); --cd: var(--purple-dark); }
.st-known { --c: var(--green); --cd: var(--green-dark); }
.st-locked { --c: var(--border-strong); --cd: var(--border-strong); opacity: .7; }
.st-locked .tile-status { color: var(--muted); }

.arena-review { max-width: 800px; }
.back-link { display: inline-block; margin: 6px 0 12px; }
.arena-card { padding: 18px 20px 22px; animation: slide-in .4s var(--spring) both; }
.arena-question { font-size: 1.15rem; line-height: 1.35; }
.arena-tip { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--yellow-light); font-weight: 700; font-size: .92rem; }
.arena-tip .icon { color: var(--orange); flex: none; margin-top: 2px; }
.arena-answer { margin-top: 14px; }
.arena-answer label small { display: block; font-weight: 600; margin: 2px 0 0; }
#arena-card:has(#arena-reveal:not(:empty)) .arena-answer .ex-actions { display: none; }
#arena-reveal:not(:empty) { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#arena-reveal > * { min-width: 0; }
#arena-reveal .feedback { margin-bottom: 0; }
.arena-block { padding: 14px 16px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); animation: rise .4s var(--spring) both; }
.arena-block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1rem; }
.arena-block .prose > :first-child { margin-top: 0; }
.arena-short { background: var(--green-light); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.arena-short h3 { color: var(--green-text); }
.arena-mine { background: var(--blue-light); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.arena-mine p { margin: .3em 0; }
.arena-full summary, .followup summary { cursor: pointer; font-weight: 900; list-style: none; display: flex; align-items: center; gap: 8px; }
.arena-full summary::-webkit-details-marker, .followup summary::-webkit-details-marker { display: none; }
.arena-full summary::after, .followup summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.arena-full[open] summary::after, .followup[open] summary::after { transform: rotate(180deg); }
.arena-full[open] summary { margin-bottom: 8px; }
.followup { padding: 10px 0; border-top: 2px solid var(--border); }
.followup:first-of-type { border-top: 0; }
.followup summary { font-weight: 800; }
.followup p { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.arena-code { background: var(--surface-2); }
.grade-form { margin-top: 6px; }
.grade-label { text-align: center; font-weight: 900; margin: 6px 0 10px; }
.grade-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn.grade { display: grid; gap: 2px; min-height: 64px; text-align: center; }
.btn.grade small { font-size: .68rem; text-transform: none; letter-spacing: 0; font-weight: 700; opacity: .9; }
.grade-dont { --c: var(--red); --shade: var(--red-dark); --ink: #fff; }
.grade-partial { --c: var(--yellow); --shade: var(--yellow-dark); --ink: #6b4d00; }
.grade-know { --c: var(--green); --shade: var(--green-dark); --ink: #fff; }
.arena-xp {
  position: fixed; left: 50%; top: 110px; z-index: 40; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 12px;
  background: var(--yellow); color: #7a4b00; font-weight: 900; box-shadow: 0 3px 0 var(--yellow-dark);
  animation: xp-float 1.4s ease forwards; pointer-events: none;
}
.arena-done, .arena-graded { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 22px; }
.arena-done h2, .arena-graded h2 { margin: 6px 0 0; font-size: 1.6rem; }
.constructor { margin-top: 18px; padding: 18px 20px 20px; }
.constructor h2 { display: flex; align-items: center; gap: 8px; }
.constructor label small { display: block; font-weight: 600; margin-top: 2px; }
.constructor textarea { font-family: var(--font); font-weight: 600; }
.saved { color: var(--green-text); font-weight: 900; animation: pop .4s var(--spring); }

/* ============ Урок: сначала теория карточками, потом практика ============ */
.lesson-layout { max-width: 800px; margin: 0 auto; padding: 0 16px 96px; }
.lesson-strip {
  position: sticky; top: 62px; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0 12px;
  background: var(--bg);
}
.strip-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); transition: background .15s, color .15s, transform .2s; }
.strip-close:hover { background: var(--surface-2); color: var(--text); transform: rotate(90deg); }
.strip-close .icon { width: 24px; height: 24px; }
.strip-theory { flex: none; }
body[data-lesson-mode="theory"] .strip-theory { display: none; }
.lesson-progress { flex: 1; display: flex; align-items: center; gap: 12px; }
.lp-track { flex: 1; height: 18px; border-radius: 99px; background: var(--border); overflow: hidden; }
.lp-fill {
  position: relative; height: 100%; min-width: 18px; border-radius: inherit;
  background: var(--green);
  transition: width .7s var(--spring);
}
.lp-shine { position: absolute; left: 10px; right: 10px; top: 4px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .35); }
.lp-count { font-weight: 900; color: var(--muted); min-width: 3ch; }

.theory-head { position: relative; margin: 6px 0 16px; }
.theory-head h1 { margin: 0; padding-right: 48px; }
.theory-close { display: none; position: absolute; right: 0; top: 0; }
.theory-card { display: none; padding: 24px 26px 26px; }
.theory-card > h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 8px; }
.card-mascot { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.card-mascot .bubble { flex: 1; }
.interview-card { background: var(--yellow-light); border-color: color-mix(in srgb, var(--yellow) 55%, transparent); }
.interview-card > h2 { color: var(--orange-dark); }
:root[data-theme="dark"] .interview-card > h2 { color: var(--yellow); }
.interview-card .chips { margin-bottom: 10px; }
.say { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); font-weight: 700; font-style: italic; }
.say-label { display: block; font-size: .75rem; font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 900; margin-bottom: 2px; }
.theory-nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 14px 0 18px;
  background: linear-gradient(to bottom, transparent, var(--bg) 35%);
}
.theory-nav .btn { min-width: 130px; }
.theory-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.theory-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); transition: background .3s, transform .3s var(--spring); }
.theory-dots span.on { background: var(--green); }
.theory-dots span.now { transform: scale(1.35); }

.lesson-flow[data-mode="theory"] .practice { display: none; }
.lesson-flow[data-mode="theory"] .theory-card.is-active { display: block; animation: card-in .45s var(--spring) both; }
.lesson-flow[data-mode="theory"] .theory-card.is-active.from-left { animation-name: card-in-back; }
.lesson-flow[data-mode="practice"] .theory-flow { display: none; }
.lesson-flow[data-mode="practice"] .practice { animation: rise .45s var(--spring) both; }

/* Повтор теории во время практики: все карточки в полноэкранной ленте */
.lesson-flow[data-mode="review"] .theory-flow {
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 16px 60px;
  background: var(--bg);
  animation: fade-in .25s ease both;
}
.lesson-flow[data-mode="review"] .theory-flow > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.lesson-flow[data-mode="review"] .theory-card { display: block; margin-bottom: 16px; animation: rise .4s var(--spring) both; }
.lesson-flow[data-mode="review"] .theory-nav { display: none; }
.lesson-flow[data-mode="review"] .theory-close { display: grid; }
body.no-scroll { overflow: hidden; }

.prose { overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.3em; color: var(--text); }
.prose p { margin: .6em 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose strong { font-weight: 900; }
.prose pre {
  background: var(--code-bg); border: 2px solid var(--border); border-radius: 14px;
  padding: 12px 16px; overflow-x: auto; line-height: 1.55;
}
.prose pre:has(> code.language-output) { background: var(--term-bg); color: #e8f0f3; border-color: transparent; position: relative; padding-top: 30px; }
.prose pre:has(> code.language-output)::before { content: "экран"; position: absolute; top: 8px; left: 16px; font: 800 .7rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: #8fa3ad; }
.prose .editor { margin: 12px 0; }
.prose :not(pre) > code { background: var(--code-bg); padding: 1px 7px; border-radius: 8px; border: 2px solid var(--border); font-size: .85em; }
.prose blockquote { margin: 1em 0; padding: 12px 16px; border-radius: 14px; background: var(--blue-light); border: 2px solid color-mix(in srgb, var(--blue) 30%, transparent); }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 12px 0; border: 2px solid var(--border); border-radius: 14px; overflow: hidden; font-size: .92rem; }
.prose th, .prose td { padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); }
.prose th { background: var(--surface-2); font-weight: 900; }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 2px solid var(--border); }

/* ============ Упражнение ============ */
.exercise { padding: 18px 20px 22px; animation: slide-in .4s var(--spring) both; }
#exercise-panel { scroll-margin-top: 140px; }
.exercise.htmx-swapping { opacity: 0; transform: translateX(-24px); transition: opacity .18s ease, transform .18s ease; }
.exercise.shake { animation: shake .45s ease; }
.ex-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ex-tab {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  border: 2px solid var(--border); border-bottom-width: 4px;
  background: var(--surface); color: var(--muted);
  font: 900 .95rem/1 var(--font); cursor: pointer;
  transition: transform .15s var(--spring), background .2s, border-color .2s;
}
.ex-tab:hover { transform: translateY(-2px); }
.ex-tab:active { transform: translateY(2px); border-bottom-width: 2px; }
.ex-tab .icon { width: 20px; height: 20px; }
.ex-tab.done { background: var(--green); border-color: var(--green-dark); color: #fff; }
.ex-tab.current { border-color: var(--blue); color: var(--blue-text); background: var(--blue-light); }
.ex-tab.done.current { background: var(--green); border-color: var(--blue); color: #fff; }
.ex-intro { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.ex-bubble { flex: 1; display: grid; gap: 2px; }
.ex-bubble strong { font-size: 1.15rem; font-weight: 900; }
.ex-type { font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--purple-dark); }
.xp-badge { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; color: var(--orange); font-size: 1rem; align-self: flex-start; }
.xp-badge .icon { width: 20px; height: 20px; }
.solved-banner {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 2px;
  padding: 5px 12px; border-radius: 99px;
  background: var(--green-light); color: var(--green-text); font-weight: 800; font-size: .88rem;
  animation: pop .4s var(--spring);
}
.ex-prompt { margin-top: 6px; }
.ex-form { margin-top: 10px; }
.ex-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.kbd-hint { font-size: .8rem; color: var(--muted); font-weight: 700; }

.editor {
  border: 2px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--code-bg); min-height: 60px; font-size: 15px;
  white-space: pre; font-family: var(--mono);
  transition: border-color .15s, box-shadow .15s;
}
.editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
.editor .cm-editor { max-height: 440px; background: transparent; }
.editor .cm-scroller { font-family: var(--mono); line-height: 1.6; }
.editor:not([data-readonly]) .cm-editor { min-height: 190px; }
.editor .cm-editor.cm-focused { outline: none; }
.editor .cm-gutters { background: transparent; border-right: 2px solid var(--border); }

.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 16px; margin: 0; border-radius: 16px;
  border: 2px solid var(--border); border-bottom-width: 4px;
  font-weight: 700; cursor: pointer; background: var(--surface);
  transition: transform .12s ease, background .15s, border-color .15s;
  animation: rise .4s var(--spring) both;
  animation-delay: calc(var(--i) * 60ms + 100ms);
  -webkit-tap-highlight-color: transparent;
}
.option:hover { background: var(--surface-2); }
.option:active { transform: translateY(2px); border-bottom-width: 2px; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-key {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  border: 2px solid var(--border); color: var(--muted); font-weight: 900; font-size: .85rem;
  transition: all .15s;
}
.option:has(input:checked) { border-color: var(--blue); background: var(--blue-light); color: var(--blue-text); }
.option:has(input:checked) .option-key { border-color: var(--blue); color: var(--blue-text); background: var(--surface); }
.option:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.options.locked .option { pointer-events: none; }

/* SQL: таблицы учебной базы и результаты запросов */
.sql-tables { margin: 10px 0 12px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface-2); }
.sql-tables summary { cursor: pointer; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.sql-tables[open] summary { margin-bottom: 8px; }
.sql-table-wrap { margin: 8px 0; min-width: 0; }
.sql-caption { font-weight: 900; font-family: var(--mono); font-size: .85rem; margin-bottom: 4px; }
.sql-caption small { font-family: var(--font); font-weight: 700; }
.sql-scroll { overflow-x: auto; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); }
.sql-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .82rem; }
.sql-table th { text-align: left; padding: 6px 10px; background: var(--blue-light); color: var(--blue-text); font-weight: 800; white-space: nowrap; }
.sql-table td { padding: 5px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
.sql-table td.null { color: var(--muted); font-style: italic; }
.sql-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.sql-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }

/* «Заполни пропуски» */
.fill-code {
  margin: 4px 0 0; padding: 16px 18px; border-radius: 16px;
  background: var(--code-bg); border: 2px solid var(--border);
  font: 500 15px/2.1 var(--mono); white-space: pre-wrap; overflow-x: auto;
}
.blank {
  display: inline-block; width: calc(var(--w) * 1ch + 22px); margin: 0 2px; padding: 2px 8px;
  font: 700 15px/1.4 var(--mono); text-align: center; vertical-align: baseline;
  background: var(--surface); border: 2px solid var(--border); border-bottom-width: 3px; border-radius: 10px;
  color: var(--blue-text);
}
.blank:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.blank.ok { border-color: var(--green); background: var(--green-light); color: var(--green-text); animation: pop .35s var(--spring); }
.blank.bad { border-color: var(--red); background: var(--red-light); color: var(--red-text); animation: shake .4s ease; }

/* «Собери код из строк» */
.order { display: grid; gap: 14px; }
.order-answer {
  min-height: 120px; padding: 12px; border-radius: 16px;
  border: 2px dashed var(--border-strong); background: var(--code-bg);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.order-empty { color: var(--muted); font-weight: 700; padding: 6px 4px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 2px solid var(--border); }
.order-chip {
  max-width: 100%; padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface);
  color: var(--text); cursor: pointer; text-align: left;
  transition: transform .12s ease, border-color .15s;
  animation: rise .35s var(--spring) both; animation-delay: calc(var(--i) * 40ms);
}
.order-chip code { white-space: pre; font-size: 14px; font-weight: 600; }
.order-chip:hover { border-color: var(--blue); }
.order-chip:active { transform: translateY(2px); border-bottom-width: 2px; }
.order-chip.moved { animation: pop .3s var(--spring); }
.order-answer .order-chip { background: var(--surface); border-color: var(--blue); }
.order.locked .order-chip { pointer-events: none; }

/* «Объясни словами» */
.explain-input { font-family: var(--font); font-weight: 600; line-height: 1.5; }
.char-count { margin-top: 6px; text-align: right; font-size: .8rem; font-weight: 800; color: var(--muted); transition: color .2s; }
.char-count.enough { color: var(--green-text); }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checklist li {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--border); font-weight: 700;
  animation: rise .35s var(--spring) both; animation-delay: calc(var(--i) * 70ms);
}
.checklist li.pass .test-icon { background: var(--green); }
.checklist li.miss .test-icon { background: var(--red); }
.checklist li.miss { color: var(--muted); }
.reference { padding: 4px 2px; }

/* ============ Обратная связь ============ */
.ex-result:not(:empty) { margin-top: 18px; }
.feedback {
  padding: 16px 18px 18px; border-radius: var(--radius); margin-bottom: 12px;
  animation: sheet-up .45s var(--spring) both;
}
.feedback-ok { background: var(--green-light); color: var(--green-text); }
.feedback-fail { background: var(--red-light); color: var(--red-text); }
.feedback-head { display: flex; align-items: center; gap: 12px; }
.feedback-icon {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); animation: pop .5s var(--spring) .1s both;
}
.feedback-icon .icon { width: 28px; height: 28px; }
.feedback-title { font-size: 1.35rem; font-weight: 900; line-height: 1.2; }
.feedback-text { font-weight: 700; opacity: .9; }
.feedback .ex-actions { margin-top: 14px; }
.xp-gain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.xp-gain-total {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 12px;
  background: var(--surface); color: var(--orange); font-weight: 900; font-size: 1.15rem;
  border: 2px solid var(--yellow); box-shadow: 0 3px 0 var(--yellow);
  animation: pop .55s var(--spring) .2s both;
}
.xp-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.xp-parts span {
  padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .55); color: var(--green-text);
  font-size: .8rem; font-weight: 800;
  animation: pop .45s var(--spring) both; animation-delay: calc(var(--i) * 90ms + 350ms);
}
:root[data-theme="dark"] .xp-parts span { background: rgba(0, 0, 0, .2); }
.alert { padding: 12px 16px; border-radius: 14px; font-weight: 700; margin-bottom: 10px; animation: rise .35s var(--spring) both; }
.alert.fail { background: var(--red-light); color: var(--red-text); }
.alert.warn { background: var(--yellow-light); color: var(--orange-dark); }
:root[data-theme="dark"] .alert.warn { color: var(--yellow); }

.errors { display: grid; gap: 8px; margin-bottom: 12px; }
.error-item {
  padding: 12px 14px; border-radius: 14px; background: var(--surface);
  border: 2px solid var(--red-light); border-left: 6px solid var(--red);
  font-weight: 600; font-size: .95rem;
  animation: rise .4s var(--spring) both; animation-delay: calc(var(--i) * 80ms);
}
.error-item details { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.error-item summary { cursor: pointer; font-weight: 800; }
.error-item details code { display: block; white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.line-badge { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 8px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 900; }

.tests { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.tests li {
  padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: .95rem;
  border: 2px solid var(--border); background: var(--surface);
  animation: rise .35s var(--spring) both; animation-delay: calc(var(--i) * 70ms);
}
.test-name { display: flex; align-items: center; gap: 10px; }
.test-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; color: #fff; }
.test-icon .icon { width: 16px; height: 16px; }
.tests li.pass .test-icon { background: var(--green); }
.tests li.fail .test-icon { background: var(--red); }
.tests li.fail { border-color: var(--red-light); }
.diff { margin: 8px 0 0 36px; display: grid; gap: 6px; font-size: .88rem; }
.diff pre { margin: 3px 0 0; padding: 8px 12px; background: var(--code-bg); border-radius: 10px; border: 2px solid var(--border); white-space: pre-wrap; }

.terminal { border-radius: 16px; overflow: hidden; background: var(--term-bg); animation: rise .4s var(--spring) both; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 9px 14px; background: rgba(255, 255, 255, .06); }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em { margin-left: auto; color: #8fa3ad; font-style: normal; font-size: .78rem; font-weight: 700; }
.output {
  margin: 0; padding: 12px 16px; color: #e8f0f3; font-family: var(--mono); font-size: .92rem;
  white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto;
}
.solution .output, .help .output { border-radius: 12px; background: var(--term-bg); }

.help { margin-top: 18px; display: grid; gap: 10px; justify-items: start; }
.hint {
  width: 100%; display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--blue-light); color: var(--text); font-size: .95rem;
  animation: rise .4s var(--spring) both;
}
.hint-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; }
.hint strong { display: block; color: var(--blue-text); font-weight: 900; }
.hint p { margin: .2em 0 0; }
.solution { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface-2); animation: rise .4s var(--spring) both; }
.solution > strong { display: flex; align-items: center; gap: 6px; font-weight: 900; }
.solution .editor { margin-top: 10px; }
.correct-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.correct-list li { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--green-text); }

/* ============ Финал урока ============ */
.celebrate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  animation: fade-in .3s ease both;
}
.celebrate-card { width: 100%; max-width: 400px; display: grid; justify-items: center; gap: 6px; text-align: center; animation: pop .6s var(--spring) .1s both; }
.celebrate-card h2 { font-size: 2rem; color: var(--yellow-dark); margin: 10px 0 0; }
.celebrate-card p { margin: 0 0 10px; font-weight: 700; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 6px 0 18px; }
.stat { border-radius: 16px; border: 2px solid var(--c); overflow: hidden; animation: rise .5s var(--spring) both .4s; }
.stat + .stat { animation-delay: .55s; }
.stat > span { display: block; padding: 4px; background: var(--c); color: #fff; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.stat > b { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; font-size: 1.35rem; font-weight: 900; color: var(--c); background: var(--surface); }
.stat-xp { --c: var(--yellow); }
.stat-xp > b { color: var(--orange); }
.stat-done { --c: var(--green); }
.stat-streak { --c: var(--orange); }
.stat + .stat + .stat { animation-delay: .7s; }
.celebrate-actions { display: grid; gap: 12px; width: 100%; }

/* ============ Прочее ============ */
.flash { padding: 12px 16px; border-radius: 14px; background: var(--blue-light); margin-bottom: 16px; font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  max-width: calc(100% - 32px); padding: 13px 20px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translateX(-50%);
  animation: toast-in .4s var(--spring);
}
.xp-fly {
  position: fixed; z-index: 90; pointer-events: none;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 12px;
  background: var(--yellow); color: #7a4b00; font-weight: 900; font-size: 1rem;
  box-shadow: 0 3px 0 var(--yellow-dark);
}
.confetti-canvas { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

/* ============ Анимации ============ */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateX(40px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@keyframes card-in-back { from { opacity: 0; transform: translateX(-40px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes bubble-in { from { opacity: 0; transform: scale(.85) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes node-in { from { opacity: 0; transform: translateX(var(--x)) scale(.4); } to { opacity: 1; transform: translateX(var(--x)) scale(1); } }
@keyframes node-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@keyframes float-tag { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@keyframes xp-float { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; transform: translate(-50%, -10px); } 100% { opacity: 0; transform: translate(-50%, -40px); } }
@keyframes radar-in { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ach-in { from { opacity: 0; transform: translateX(120%) rotate(6deg); } to { opacity: 1; transform: none; } }
@keyframes ach-out { to { opacity: 0; transform: translateX(120%); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, .95) rotate(-3deg); } 60% { transform: scale(.96, 1.06) rotate(2deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes btn-breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes m-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes m-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.88); } }
@keyframes m-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes m-ear-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes m-ear-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(6deg); } }
@keyframes m-hop { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(1px) scale(1.06, .94); } 32% { transform: translateY(-11px) scale(.96, 1.05); } }
@keyframes m-trunk { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
@keyframes m-droop { 0%, 100% { transform: rotate(-3deg) translateY(1px); } 50% { transform: rotate(-6deg) translateY(2px); } }
@keyframes m-tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(5deg); } }
@keyframes m-react { 0% { transform: scale(1); } 30% { transform: scale(1.18, .85); } 60% { transform: scale(.92, 1.1) translateY(-6px); } 100% { transform: scale(1); } }

/* ============ Телефон ============ */
@media (max-width: 1180px) {
  .xpbar, .hud-today, .hud-title { display: none !important; }
}
@media (max-width: 900px) {
  .nav-link span, .brand-name { display: none; }
  .nav-link { padding: 6px 9px; }
  .topbar { gap: 8px; }
}
@media (max-width: 760px) {
  .week-strip { grid-template-columns: repeat(7, 1fr); width: 100%; }
  .radar-wrap { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .stat > b { font-size: 1.1rem; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .brand-name { display: none; }
  .nav-link span { display: none; }
  .rl a { grid-template-columns: 24px minmax(0, 1fr) 50px 36px; }
  .rl-tag { display: none; }
  .nav-link { padding: 6px 8px; }
  .arena-stats { grid-template-columns: repeat(2, 1fr); }
  .grade-row { gap: 6px; }
  .btn.grade { padding: 10px 6px; font-size: .8rem; }
  .hud { gap: 2px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero { flex-direction: column; text-align: center; }
  .hero-text { justify-items: center; }
  .hero .bubble-left::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }
  .theory-card { padding: 18px 16px 20px; }
  .theory-card > h2 { font-size: 1.3rem; }
  .theory-nav .btn { min-width: 0; flex: 1; }
  .theory-dots { display: none; }
  .strip-theory span { display: none; }
  .card-mascot .mascot { width: 48px; }
  .exercise { padding: 14px 14px 18px; }
  .ex-intro .mascot { width: 48px; }
  .kbd-hint { display: none; }
  .path { gap: 18px; }
  .path-item { transform: translateX(calc(var(--x) * .7)); }
  @keyframes node-in { from { opacity: 0; transform: translateX(calc(var(--x) * .7)) scale(.4); } to { opacity: 1; transform: translateX(calc(var(--x) * .7)) scale(1); } }
  h1 { font-size: 1.5rem; }
  .unit-banner { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
