/* DY — палитра «Тиффани + Море» */
:root {
  --bg: #F3F8FB;
  --surface: #FFFFFF;
  --surface-2: #EDF4F8;
  --line: #D8E6EE;
  --text: #10263A;
  --muted: #50657A;
  --ink: #10263A;            /* текст на пастельных плашках */
  --primary: #1B7A93;
  --on-primary: #FFFFFF;
  --cta: #17466F;
  --on-cta: #FFFFFF;
  --tiffany: #81D8D0;
  --sky: #D9EEF7;
  --coral: #F9C8B4;
  --sand: #F4E4BE;
  --ok: #2F7A52;
  --ok-bg: #E1F3E9;
  --bad: #B24A43;
  --bad-bg: #FDEDE5;
  --brand: #1A1712;
  --deep: #17466F;           /* тёмный акцент: иконки и кнопки на пастельных плитках */
  --hero-a: #0F2F48; --hero-b: #17466F; --hero-c: #1B7A93; /* градиент больших блоков вверху страниц */
  --shadow: 0 1px 2px rgba(16, 38, 58, .05), 0 4px 16px rgba(16, 38, 58, .05);
  --r: 18px;
  --font: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Unbounded, Onest, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --on-primary: #0E1A24;     /* текст на светлом акценте в тёмной теме */
  --bg: #0E1A24;
  --surface: #172633;
  --surface-2: #1F3242;
  --line: #2B4254;
  --text: #E8F1F6;
  --muted: #A6B8C6;
  --primary: #45A9C2;        /* светлее прежнего #2B8FAA: текст читается на тёмных карточках */
  --cta: #81D8D0;
  --on-cta: #0E1A24;
  --sky: #1F3A4E;
  --ok: #7FD3A6;
  --ok-bg: #173628;
  --bad: #F2A39C;
  --bad-bg: #3A2320;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
.h2 { font-size: 22px; }
.h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); }
:root[data-theme="dark"] a { color: var(--tiffany); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tiffany); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }
img, svg { flex-shrink: 0; }

/* ——— Раскладка ——— */
#app { min-height: 100vh; }
.shell { min-height: 100vh; }
.page { padding: 20px 16px 100px; max-width: 1180px; margin: 0 auto; outline: none; }
.focus { padding: 16px 16px 32px; max-width: 640px; margin: 0 auto; min-height: 100vh; outline: none; }
.sidenav { display: none; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 12px; }
.bottomnav a.active { color: var(--primary); }
:root[data-theme="dark"] .bottomnav a.active { color: var(--tiffany); }
.desktop-only { display: none !important; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 256px 1fr; }
  .sidenav { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line); }
  .bottomnav, .mobile-only { display: none !important; }
  .desktop-only { display: block !important; }
  .page { padding: 36px 40px 48px; width: 100%; }
  h1 { font-size: 30px; }
}
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.side-brand b { font-family: var(--display); font-size: 16px; display: block; }
.side-brand small { color: var(--muted); font-size: 13px; }
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-links a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.side-links a:hover { background: var(--surface-2); }
.side-links a.active { background: var(--sky); color: var(--primary); }
:root[data-theme="dark"] .side-links a.active { color: var(--tiffany); }
.side-pair { align-self: flex-start; }

/* ——— Утилиты ——— */
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 16px; } .gap-sm { gap: 10px; } .gap-xs { gap: 6px; }
.wrap { flex-wrap: wrap; }
.center { align-self: center; justify-content: center; }
.center-text { text-align: center; align-items: center; }
.grow { flex: 1; min-width: 0; }
.narrow { max-width: 560px; margin: 0 auto; width: 100%; }
.narrow-wide { max-width: 720px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.b { font-weight: 700; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.label.light { color: inherit; opacity: .9; }
.label.sand { color: var(--sand); }
.lead { font-size: 17px; line-height: 1.6; }
.pad { padding: 20px; }
.quote { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sep { width: 56px; height: 4px; border-radius: 999px; background: var(--sand); margin: 8px auto; }
.ok-text { color: var(--ok); }
.accent { color: var(--primary); }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 50vh; opacity: 0; animation: ld-in .3s ease .15s forwards; }
@keyframes ld-in { to { opacity: 1; } }
.ld-mascot { animation: bob 1.4s ease-in-out infinite; }
.ld-bubble { display: inline-flex; gap: 5px; padding: 9px 12px; margin-left: 46px; border-radius: 14px 14px 14px 4px; background: var(--surface); box-shadow: 0 4px 14px rgba(16, 38, 58, .1); }
.ld-bubble i, .sp-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: typing 1.2s ease-in-out infinite; }
.ld-bubble i:nth-child(2), .sp-dots i:nth-child(2) { animation-delay: .15s; }
.ld-bubble i:nth-child(3), .sp-dots i:nth-child(3) { animation-delay: .3s; }
:root[data-theme="dark"] .ld-bubble i { background: var(--tiffany); }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Заставка при запуске: пока грузится приложение и отвечает сервер */
.splash { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; overflow: hidden; color: #fff; text-align: center;
  background: radial-gradient(120% 90% at 100% 0%, rgba(129, 216, 208, .35), transparent 55%), radial-gradient(90% 70% at 0% 100%, rgba(244, 228, 190, .2), transparent 60%), linear-gradient(160deg, #0F2F48 0%, #17466F 55%, #1B7A93 100%); }
.splash::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.6) 1px, transparent 1.5px); background-size: 34px 34px; mask-image: radial-gradient(circle at 50% 45%, transparent 18%, #000 75%); }
.splash > * { position: relative; z-index: 1; }
.sp-glow { position: absolute; z-index: 0; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(60px); opacity: .35; animation: drift 9s ease-in-out infinite alternate; }
.sp-glow.g1 { background: #81D8D0; top: -30vmax; right: -25vmax; }
.sp-glow.g2 { background: #81D8D0; bottom: -38vmax; left: -32vmax; animation-delay: -4s; opacity: .14; }
.sp-stage { position: relative; width: 170px; height: 138px; display: flex; align-items: flex-end; justify-content: center; }
.sp-mascot { position: relative; z-index: 1; animation: sp-hop 2.4s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); }
.sp-eyes { transform-origin: 50% 42%; animation: sp-blink 4s infinite; }
.sp-shadow { position: absolute; bottom: -6px; left: 50%; width: 70px; height: 10px; margin-left: -35px; border-radius: 50%; background: rgba(0, 0, 0, .25); animation: sp-shadow 2.4s ease-in-out infinite; }
.sp-say { position: absolute; top: 0; right: -14px; z-index: 2; min-width: 86px; height: 36px; padding: 0 14px; border-radius: 16px 16px 16px 4px; background: #fff; color: #17466F; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.sp-say b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 15px; font-weight: 700; opacity: 0; animation: sp-word 6s ease-in-out infinite both; }
.sp-say b:nth-child(2) { animation-delay: 2s; }
.sp-say b:nth-child(3) { animation-delay: 4s; }
.sp-brand { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: 8px; }
.sp-brand i { font-style: normal; font-weight: 500; color: #81D8D0; }
.sp-dots { display: flex; gap: 7px; }
.sp-dots i { background: #fff; }
.sp-hint { margin: 6px 0 0; max-width: 280px; font-size: 14px; color: rgba(255, 255, 255, .78); animation: sp-hint .6s ease 4s both; }
.sp-hint span { display: none; }
:root:lang(ru) .sp-hint [lang="ru"], :root:lang(uk) .sp-hint [lang="uk"], :root:not(:lang(ru)):not(:lang(uk)) .sp-hint [lang="en"] { display: inline; }
@keyframes sp-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 10% { transform: translateY(0) scale(1.06, .94); } 40% { transform: translateY(-18px) scale(.97, 1.03); } 70% { transform: translateY(0) scale(1.04, .96); } 80% { transform: translateY(0) scale(1, 1); } }
@keyframes sp-shadow { 0%, 100%, 80% { transform: scale(1); opacity: .25; } 40% { transform: scale(.7); opacity: .12; } }
@keyframes sp-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes sp-word { 0% { opacity: 0; transform: translateY(6px); } 5%, 28% { opacity: 1; transform: none; } 33%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes sp-hint { from { opacity: 0; transform: translateY(6px); } }
/* Без анимаций: показываем первое приветствие */
@media (prefers-reduced-motion: reduce) { .sp-say b:first-child, .loading { opacity: 1; } }
.empty { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 48px 16px; }
@keyframes pulse { 50% { opacity: .5; } }

/* ——— Кнопки ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .08s ease, filter .15s; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-lg { min-height: 56px; font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.btn-cta { background: var(--cta); color: var(--on-cta); }
a.btn-cta { color: var(--on-cta) !important; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-sand { background: var(--sand); color: var(--ink); }
.btn-coral { background: var(--coral); color: var(--ink); }
.btn-tiffany { background: var(--tiffany); color: var(--ink); }
.btn-dashed { background: transparent; border: 2px dashed currentColor; min-height: 48px; font-weight: 600; }
.btn-link { background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 6px; min-height: 36px; }
:root[data-theme="dark"] .btn-link { color: var(--tiffany); }
.btn-link-light { background: none; border: none; color: #fff; font-weight: 700; cursor: pointer; min-height: 44px; }
.btn-ghost-light { background: transparent; border: 2px solid rgba(255, 255, 255, .5); color: #fff; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; border: none; background: var(--surface-2); color: var(--primary); cursor: pointer; text-decoration: none; flex-shrink: 0; }
:root[data-theme="dark"] .icon-btn { color: var(--tiffany); }
.icon-btn.btn { width: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; }
.pill-coral { background: var(--coral); color: var(--ink); }
.pill-sand { background: var(--sand); color: var(--ink); }
.pill-tiffany { background: var(--tiffany); color: var(--ink); }
.pill-dark { background: var(--cta); color: var(--on-cta); }
.pair-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text) !important; font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: var(--shadow); }
.pair-big { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 17px; }
.logo { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 30%; color: #fff;
  background: linear-gradient(135deg, #1B7A93 0%, #5CC4BC 100%); box-shadow: 0 4px 14px rgba(27, 122, 147, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
  font-family: var(--display); font-weight: 800; letter-spacing: -0.06em; line-height: 1; }
.logo span { color: #F7D9A8; }
/* хвостик реплики — знак «говорим на языках» */
.logo::after { content: ''; position: absolute; left: 18%; bottom: -9%; width: 22%; height: 22%; background: #2A93A6; clip-path: polygon(0 0, 100% 0, 0 100%); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.seg button { min-height: 40px; border: none; border-radius: 999px; background: transparent; font-weight: 700; cursor: pointer; padding: 0 12px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.seg.small button { min-height: 34px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: none; background: var(--sand); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--cta); color: var(--on-cta); }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 8px; border-radius: 16px; border: 3px solid transparent; background: var(--surface); font-weight: 700; font-size: 16px; cursor: pointer; color: var(--text); box-shadow: var(--shadow); }
.opt small { font-size: 12px; font-weight: 500; color: var(--muted); }
.opt.on { border-color: var(--primary); background: var(--sand); color: var(--ink); }
.opt-t.on { background: var(--tiffany); }
.opt.on small { color: var(--ink); }
.opt:disabled { background: transparent; border: 3px dashed var(--line); box-shadow: none; color: var(--muted); cursor: default; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; border: 2px solid transparent; border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 700; font-size: 13px; }
.tabs button span { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.tabs button small { font-weight: 500; color: var(--muted); font-size: 11px; }
.tabs button[aria-selected="true"] { border-color: var(--primary); background: var(--sky); }

/* ——— Карточки и плитки ——— */
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card-dark { background: var(--cta); color: var(--on-cta); }
:root[data-theme="dark"] .card-dark { background: color-mix(in srgb, var(--hero-c) 45%, var(--surface)); color: #fff; }
.card-sand { background: var(--sand); color: var(--ink); }
.card-sand a { color: var(--ink); }
.link-card { text-decoration: none; color: var(--text) !important; }
.link-card:hover { filter: brightness(.98); }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 20px; text-decoration: none; color: var(--ink) !important; min-height: 120px; }
.tile-title { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.25; }
.tile-tiffany { background: var(--tiffany); }
.tile-coral { background: var(--coral); }
.tile-sand { background: var(--sand); }
.tile-sky { background: #CFE7F3; }
.tile-primary { background: var(--primary); color: var(--on-primary) !important; }
.mini-bar { display: block; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .8); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--cta); border-radius: 999px; }
:root[data-theme="dark"] .tile .mini-bar i { background: var(--deep); }
.tiles-5 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qtile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 16px; background: var(--surface); color: var(--primary) !important; text-decoration: none; font-size: 12px; font-weight: 700; box-shadow: var(--shadow); }
.qtile span { color: var(--text); }
.practice-grid .tile { min-height: 150px; }

/* ——— Главная ——— */
.home-grid { display: grid; gap: 24px; }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; } }
.side-col { display: flex; }
.mascot-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: -30px; position: relative; z-index: 1; padding-left: 10px; }
.bubble { margin-bottom: 36px; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.goal-card { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; padding: 34px 20px 22px; border-radius: 26px; background: var(--primary); color: var(--on-primary); }
.goal-title { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; }
.deco { position: absolute; pointer-events: none; }
.d1 { width: 150px; height: 150px; border-radius: 999px; background: #fff; opacity: .08; right: -40px; top: -60px; }
.d2 { width: 64px; height: 64px; border-radius: 18px; background: var(--sand); opacity: .25; right: 36px; bottom: -26px; transform: rotate(24deg); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 140px; align-items: end; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.week-bar { width: 100%; border-radius: 8px; background: var(--sky); min-height: 4px; }
:root[data-theme="dark"] .week-bar { background: color-mix(in srgb, var(--primary) 22%, var(--surface-2)); }
:root[data-theme="dark"] .week-bar.today { background: var(--primary); }
.week-bar.today { background: var(--primary); }
.counts .count { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; border-radius: 16px; border: 3px solid transparent; color: var(--ink) !important; text-decoration: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.counts .count b { font-family: var(--display); font-size: 20px; }
.count.c-coral { background: var(--coral); } .count.c-sand { background: var(--sand); } .count.c-tiffany { background: var(--tiffany); }
.count.on { border-color: var(--cta); }

/* ——— Карточки слов ——— */
.focus-top { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.learn { display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 48px); }
.learn .word-card { flex: 1; }
.word-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 28px 20px; min-height: 280px; border-radius: 28px; }
.word-big { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 8vw, 42px); letter-spacing: -0.02em; word-break: break-word; }
.word-tr { font-size: 22px; font-weight: 700; }
.example { font-size: 15px; line-height: 1.55; }
.example mark { background: var(--sand); color: var(--ink); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.flip-in { animation: flip .35s ease-out; }
@keyframes flip { from { transform: perspective(800px) rotateY(-70deg); opacity: .3; } to { transform: none; opacity: 1; } }
.grades { gap: 10px; }
.grade { flex-direction: column; min-height: 64px; gap: 0; color: var(--ink); }
.grade small { font-weight: 500; font-size: 12px; }
.g0 { background: var(--coral); } .g1 { background: var(--sand); } .g2 { background: var(--tiffany); }

/* ——— Темы ——— */
.level-banner { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-radius: 18px; color: var(--ink); font-size: 14px; font-weight: 600; }
.level-banner b { font-family: var(--display); font-size: 22px; }
.lv-A1 { background: var(--tiffany); } .lv-A2 { background: var(--sand); } .lv-B1 { background: var(--coral); } .lv-B2 { background: #C9DDF6; } .lv-C1 { background: #DCD6F2; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.topic { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--surface); text-decoration: none; color: var(--text) !important; box-shadow: var(--shadow); }
.topic-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--sky); color: var(--primary); }
:root[data-theme="dark"] .topic-ic { color: var(--tiffany); }
.topic-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.topic .mini-bar { background: var(--surface-2); }
.topic .mini-bar i { background: var(--primary); }

/* ——— Карта курса ——— */
.path { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 40px; }
.path .level-banner { width: 100%; max-width: 520px; margin: 14px 0 8px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0; }
.node { width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; text-decoration: none; border: 4px solid var(--line); background: var(--surface); color: var(--muted) !important; box-shadow: 0 5px 0 var(--line); }
.node-done { background: var(--tiffany); color: var(--ink) !important; border-color: var(--primary); box-shadow: 0 5px 0 #BFD9D5; }
.node-now { width: 76px; height: 76px; background: var(--primary); color: var(--on-primary) !important; border-color: var(--cta); animation: ping 1.6s ease-out infinite; }
.node-exam { width: 78px; height: 78px; background: #FBF1DC; color: var(--ink) !important; border-style: dashed; border-color: #E0CFA0; }
.node-exam.node-now { background: var(--sand); border-style: solid; }
.node-exam.node-done { background: var(--sand); border-color: var(--primary); border-style: solid; }
.node-label { max-width: 160px; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.3; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(27, 122, 147, .45), 0 5px 0 var(--cta); } 100% { box-shadow: 0 0 0 18px rgba(27, 122, 147, 0), 0 5px 0 var(--cta); } }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ——— Урок и упражнения ——— */
.lesson-title { font-size: 28px; }
.formula { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.f { padding: 6px 12px; border-radius: 10px; color: var(--ink); }
.f-who { background: #B9DDEE; } .f-verb { background: var(--tiffany); } .f-aux { background: var(--sand); } .f-neg { background: var(--coral); } .f-rest { background: #F4D5C8; }
.f-op { color: inherit; opacity: .8; }
.example-row { display: flex; gap: 12px; align-items: flex-start; }
.ex-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.q-card { padding: 22px; }
.q-text { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.45; }
.blank { display: inline-block; min-width: 76px; border-bottom: 3px solid var(--primary); text-align: center; }
.choice { display: block; width: 100%; min-height: 54px; text-align: left; padding: 10px 18px; border-radius: 16px; border: 3px solid transparent; background: var(--surface-2); font-size: 17px; font-weight: 600; cursor: pointer; color: var(--text); }
.choice:hover:not(:disabled) { border-color: var(--line); }
.small-choice { min-height: 46px; font-size: 15px; }
.choice.right { background: var(--ok-bg); border-color: var(--ok); }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); }
.choice:disabled { cursor: default; }
.input-row { align-items: stretch; }
.answer, .form input, .field-label input, .search input, .set-row input, textarea, select { min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); width: 100%; font-size: 17px; }
.answer.right { border-color: var(--ok); background: var(--ok-bg); }
.answer.wrong { border-color: var(--bad); background: var(--bad-bg); text-decoration: line-through; }
.order-built { min-height: 64px; padding: 8px; border-radius: 14px; border: 2px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.order-built.right { border-color: var(--ok); background: var(--ok-bg); }
.order-built.wrong { border-color: var(--bad); background: var(--bad-bg); }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.tile-w { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.feedback:empty { display: none; }
.feedback { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback span { color: var(--text); }
.feedback .btn { align-self: stretch; }

/* ——— Глаголы ——— */
.search { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-radius: 16px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); }
.search input { border: none; background: transparent; padding-left: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--tiffany); }
.search.big input { min-height: 60px; font-size: 19px; }
.verbs-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.verb-row { background: var(--surface); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.verb-row .icon-btn { width: 36px; height: 36px; }
.verb-forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-weight: 700; }
.vf { display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; border-radius: 8px; color: var(--ink); word-break: break-word; }
.vf small { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.vf1 { background: #D9EEF7; } .vf2 { background: #D4F1EC; } .vf3 { background: #FDE3D8; }
.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field-label input { text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 700; }
@media (min-width: 900px) { [data-list].stack-xs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ——— Словарик ——— */
.list-card { padding: 4px 0; }
.dict-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dict-row:last-child { border-bottom: none; }
.dict-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

/* ——— Чтение ——— */
.text-body { font-size: 18px; line-height: 1.8; display: flex; flex-direction: column; gap: 14px; }
.tok { border: none; background: none; padding: 0 1px; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; line-height: inherit; }
.tok:hover { background: var(--sky); }
.tok.sel { background: var(--primary); color: var(--on-primary); }
.sheet { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 40; background: var(--cta); color: #fff; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); animation: up .2s ease-out; }
:root[data-theme="dark"] .sheet { background: color-mix(in srgb, var(--hero-c) 40%, var(--surface)); }
.sheet .muted { color: #D9EEF7; }
.sheet-close { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .15); color: #fff; width: 36px; height: 36px; }
.sheet-word { font-family: var(--display); font-size: 22px; padding-right: 40px; }
.sheet-tr { font-size: 18px; font-weight: 700; }
.sheet .icon-btn.btn { background: rgba(255, 255, 255, .15); color: #fff; height: 48px; width: 100%; }
@keyframes up { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ——— Диалоги ——— */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { align-self: flex-start; max-width: 85%; padding: 12px 52px 12px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); position: relative; box-shadow: var(--shadow); }
.msg.me { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--sky); }
.msg-t { font-size: 16px; font-weight: 600; }
.msg-speak { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; }
.w-ok { color: var(--ok); }
.w-miss { color: var(--bad); text-decoration: underline wavy; }
.say-line { font-size: 19px; font-weight: 700; text-align: center; }
.speak-panel { align-items: center; text-align: center; }
.mic-btn { width: 78px; height: 78px; border-radius: 999px; border: none; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 8px var(--sky); }
.mic-btn:disabled { opacity: .4; }
.mic-btn.rec, .btn.rec { animation: rec 1s ease-in-out infinite; background: var(--bad); color: #fff; }
@keyframes rec { 50% { box-shadow: 0 0 0 14px rgba(178, 74, 67, .25); } }

/* ——— Тесты ——— */
.lv-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--ink); }
.exam-locked { opacity: .7; }
textarea.writing { min-height: 220px; padding: 14px; line-height: 1.6; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 32px; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); }
details summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.da-text { line-height: 1.7; }

/* ——— Профиль ——— */
.profile-grid { display: grid; gap: 24px; }
@media (min-width: 1100px) { .profile-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.level-badge { width: 72px; height: 72px; border-radius: 22px; background: var(--sand); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; }
.stat-row .card { padding: 14px 6px; display: flex; flex-direction: column; }
.num { font-family: var(--display); font-size: 22px; }
/* Достижения: полученные — медаль в кольце цвета темы на пастельной карточке; остальные — серые, с подсказкой */
.ach-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ach-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--tiffany)); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ach { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; border-radius: 18px; text-align: center;
  border: 1.5px dashed var(--line); color: var(--muted); font-size: 12px; transition: transform .15s ease; }
.ach b { font-size: 12.5px; line-height: 1.25; font-weight: 700; }
.ach small { font-size: 10.5px; line-height: 1.25; opacity: .85; }
.ach-medal { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); color: var(--muted); filter: grayscale(1); opacity: .7; }
.ach.on { border: none; color: var(--ink); box-shadow: var(--shadow); }
.ach.on:hover { transform: translateY(-2px); }
.ach.on .ach-medal { filter: none; opacity: 1; color: var(--deep); background: radial-gradient(circle at 35% 30%, #fff 0 40%, rgba(255, 255, 255, .75) 70%);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary), 0 4px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.ach-ok { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
/* блик, пробегающий по полученной медали при наведении */
.ach.on::after { content: ''; position: absolute; top: -50%; left: -60%; width: 40%; height: 200%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transition: left .6s ease; pointer-events: none; }
.ach.on:hover::after { left: 120%; }
:root[data-theme="dark"] .ach.on { color: var(--ink); }
.league-row { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.league-row.me { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0; border: none; background: none; width: 100%; text-align: left; cursor: pointer; font-weight: 600; color: var(--text) !important; text-decoration: none; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row select { width: auto; min-height: 44px; }
.set-row label { display: flex; flex-direction: column; gap: 4px; }
.set-row input { min-height: 44px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--line); padding: 3px; display: flex; flex-shrink: 0; transition: background .2s; }
.switch i { width: 24px; height: 24px; border-radius: 999px; background: #fff; transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on i { transform: translateX(20px); }

/* ——— Вход ——— */
.auth { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-card { display: flex; flex-direction: column; gap: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.pwd { position: relative; display: block; }
.pwd input { width: 100%; padding-right: 48px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; }
.pwd-eye:hover, .pwd-eye[aria-pressed="true"] { color: var(--text); }
.google-box { display: flex; flex-direction: column; gap: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line, rgba(127,127,127,.25)); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; text-decoration: none; }
.btn-google:hover { background: #f7f8f8; }
.form-error { color: var(--bad); font-weight: 600; min-height: 1em; }

/* ——— Окна ——— */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(8, 20, 30, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 24px; padding: 22px; width: min(560px, 100%); max-height: 88vh; overflow-y: auto; }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--cta); color: var(--on-cta); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); animation: up2 .2s ease-out; }
.toast.ok { background: var(--primary); color: var(--on-primary); }
@keyframes up2 { from { transform: translateY(-10px); opacity: 0; } }

/* ——— Празднование ——— */
.celebrate { position: fixed; inset: 0; z-index: 60; background: var(--primary); color: var(--on-primary); overflow: hidden auto; display: flex; justify-content: center; }
.celebrate-in { position: relative; width: min(460px, 100%); padding: 40px 20px 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.celebrate-in::before { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 999px; background: rgba(255, 255, 255, .08); top: 50px; z-index: -1; }
.celebrate h1 { font-size: 32px; }
.celebrate-sub { font-size: 16px; }
.celebrate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; width: 100%; }
.cstat { padding: 14px 6px; border-radius: 18px; color: var(--ink); display: flex; flex-direction: column; }
.cstat b { font-family: var(--display); font-size: 22px; }
.cstat span { font-size: 12px; font-weight: 600; }
.ach-note { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(0, 0, 0, .15); text-align: left; font-size: 14px; width: 100%; }
.celebrate-actions { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 12px; }
.conf { position: absolute; top: 0; animation: fall linear infinite; }
@keyframes fall { 0% { transform: translateY(-60px) rotate(0); } 100% { transform: translateY(105vh) rotate(540deg); } }
.jump { animation: jump 1.4s ease-in-out infinite; }
@keyframes jump { 40% { transform: translateY(-22px) scale(1.04); } 60% { transform: translateY(0) scale(.97, 1.03); } }
.pop { animation: pop .6s ease-out both; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ——— Сертификат и уровень ——— */
.level-big { font-family: var(--display); font-weight: 800; font-size: 72px; color: var(--primary); line-height: 1; }
:root[data-theme="dark"] .level-big { color: var(--tiffany); }
/* Сертификат: тёмная шапка как на остальных страницах, печать уровня в цвете главы */
.cert { background: #fff; color: #10263A; border-radius: 24px; overflow: hidden; box-shadow: 0 12px 32px rgba(15, 47, 72, .18); border: 1px solid #E3ECF2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(129, 216, 208, .35), transparent 55%), linear-gradient(135deg, #0F2F48 0%, #17466F 55%, #1B7A93 100%); }
.cert-brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.04em; }
.cert-brand i { font-style: normal; font-weight: 500; color: #81D8D0; }
.cert-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.cert-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 24px 24px;
  background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--ch) 22%, #fff), #fff 70%); }
.cert-seal { width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 6px;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ch) 55%, #fff), var(--ch)); color: var(--ch-deep);
  box-shadow: 0 0 0 6px #fff, 0 0 0 8px var(--ch), 0 10px 24px color-mix(in srgb, var(--ch-deep) 30%, transparent); }
.cert-seal b { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.cert-seal small { font-size: 13px; font-weight: 800; margin-top: 2px; }
.cert-lead { margin: 0; font-size: 13px; color: #50657A; }
.cert-name { font-size: 28px; line-height: 1.15; color: #10263A; overflow-wrap: anywhere; padding-bottom: 10px; border-bottom: 2px solid var(--ch); }
.cert-text { margin: 0; font-size: 15px; line-height: 1.5; color: #2A3F52; }
.cert-text b { font-family: var(--display); font-weight: 600; color: var(--ch-deep); }
.cert-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 440px; margin-top: 8px; }
.cert-parts span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: color-mix(in srgb, var(--ch) 18%, #fff); }
.cert-parts small { color: #50657A; font-size: 11px; }
.cert-parts b { font-family: var(--display); font-size: 16px; color: #10263A; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 16px 24px 20px; border-top: 1px dashed #D5E1EA; }
.cert-foot span { display: flex; flex-direction: column; gap: 2px; }
.cert-foot small { font-size: 11px; color: #50657A; }
.cert-foot b { font-size: 14px; }
.cert-sign { text-align: right; }
.cert-sign b { font-family: var(--display); letter-spacing: -0.03em; }
.cert-actions { display: flex; justify-content: center; padding-top: 4px; }
.cert-print { border-radius: 999px; padding: 0 28px; box-shadow: 0 8px 20px rgba(23, 70, 111, .22); }
@media (max-width: 480px) {
  .cert-head { padding: 16px 18px; }
  .cert-brand { font-size: 19px; }
  .cert-body { padding: 26px 16px 20px; }
  .cert-seal { width: 92px; height: 92px; }
  .cert-seal b { font-size: 32px; }
  .cert-name { font-size: 22px; }
  .cert-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert-foot { padding: 14px 18px 18px; }
  .cert-print { width: 100%; padding: 0 18px; }
}
@media print {
  .no-print, .bottomnav, .sidenav { display: none !important; }
  body { background: #fff; }
  .cert { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Открытая админом тема: доступна, но ещё не пройдена */
.node-open { background: var(--sky); color: var(--text) !important; border-color: var(--primary); box-shadow: 0 5px 0 var(--line); }
.node-exam.node-open { background: var(--sand); color: var(--ink) !important; }

/* ——— Мини-игры со словами ——— */
.hud { gap: 10px; }
.hud-xp { min-width: 52px; text-align: right; }
/* Серия верных ответов в занятии */
.combo { --cg: 255, 140, 40; position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); font-family: var(--display); font-weight: 800; font-size: 16px; box-shadow: var(--shadow); }
.combo b { display: inline-block; min-width: 1ch; text-align: center; }
.combo-t7 { --cg: 255, 60, 90; } .combo-t14 { --cg: 170, 80, 255; } .combo-t30 { --cg: 60, 160, 255; } .combo-t100 { --cg: 255, 200, 40; }
/* 3+ подряд: тёмная «горящая» таблетка со свечением цвета огня */
.combo.hot { color: #fff; background: radial-gradient(120% 140% at 20% 100%, rgba(var(--cg), .45), transparent 60%), linear-gradient(135deg, #2B1A2E, #3D1F1A);
  box-shadow: 0 0 0 1px rgba(var(--cg), .5), 0 6px 20px rgba(var(--cg), .35); }
.combo.hot b { text-shadow: 0 0 10px rgba(var(--cg), .9); }
/* Новый верный ответ: прыжок и число въезжает снизу */
.combo.bump { animation: combo-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.combo.bump b { animation: combo-num .35s ease-out; }
@keyframes combo-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-3deg); } 100% { transform: scale(1); } }
@keyframes combo-num { from { transform: translateY(70%); opacity: 0; } }
/* Искры разлетаются во все стороны */
.combo-sparks { position: absolute; left: 22px; top: 50%; width: 0; height: 0; pointer-events: none; }
.combo-sparks i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: rgb(var(--cg)); box-shadow: 0 0 6px rgb(var(--cg)); opacity: 0; animation: combo-spark .7s ease-out forwards; }
.combo-sparks i:nth-child(1) { --a: 0deg; } .combo-sparks i:nth-child(2) { --a: 45deg; } .combo-sparks i:nth-child(3) { --a: 90deg; } .combo-sparks i:nth-child(4) { --a: 135deg; }
.combo-sparks i:nth-child(5) { --a: 180deg; } .combo-sparks i:nth-child(6) { --a: 225deg; } .combo-sparks i:nth-child(7) { --a: 270deg; } .combo-sparks i:nth-child(8) { --a: 315deg; }
@keyframes combo-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(30px) scale(.3); } }
/* Надпись на рубеже: всплывает под плашкой и исчезает */
.combo-burst { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-family: var(--display); font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, rgb(var(--cg)), color-mix(in srgb, rgb(var(--cg)) 60%, #000)); box-shadow: 0 8px 22px rgba(var(--cg), .45); animation: combo-burst 2.2s ease forwards; pointer-events: none; }
@keyframes combo-burst { 0% { opacity: 0; transform: translateY(-6px) scale(.6); } 12% { opacity: 1; transform: translateY(0) scale(1.08); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(4px); } }
/* Ошибка после серии */
.combo-lost { position: absolute; top: calc(100% + 6px); right: 0; white-space: nowrap; font-size: 12px; font-weight: 700; font-family: inherit; color: var(--muted); animation: combo-lost 1.8s ease forwards; pointer-events: none; }
@keyframes combo-lost { 0% { opacity: 0; transform: translateY(-4px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .combo-sparks { display: none; } .combo-burst, .combo-lost { animation: none; } }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wchip { position: relative; width: 26px; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wchip i { position: absolute; inset: 0 auto 0 0; background: var(--tiffany); border-radius: 999px; transition: width .3s; }
.wchip.full i { background: var(--ok); }
.wchip.weak i { background: var(--coral); }
.game-box { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.game-card { gap: 16px; }
.game-q { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 6vw, 30px); text-align: center; word-break: break-word; }
.choice .kbd { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 7px; border: 2px solid var(--line); font-size: 12px; color: var(--muted); vertical-align: 1px; }
.intro-btns .btn { min-height: 60px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.spell-slots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.spell-pre { font-weight: 700; color: var(--muted); margin-right: 6px; }
.spell-gap { width: 14px; }
.slot { width: 34px; height: 44px; display: grid; place-items: center; border-bottom: 3px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 22px; }
.slot.filled { border-color: var(--ok); animation: pop .25s ease-out; }
.slot.shown { border-color: var(--bad); color: var(--bad); }
.spell-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tile-l { width: 46px; height: 50px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--text); cursor: pointer; }
.tile-l:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tile-l.used { opacity: .2; box-shadow: none; }
.tile-l.shake { border-color: var(--bad); background: var(--bad-bg); }
.spell-meta { justify-content: space-between; min-height: 24px; }
.reveal-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface); color: var(--text); text-align: center; }
.reveal-w { font-family: var(--display); font-size: 22px; }
.reveal-tr { font-weight: 600; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-b { min-height: 54px; padding: 8px 10px; border-radius: 14px; border: 3px solid transparent; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity .3s, transform .15s; }
.match-b.sel { border-color: var(--primary); transform: scale(1.03); }
.match-b.miss { border-color: var(--bad); background: var(--bad-bg); }
.match-b.matched { border-color: var(--ok); background: var(--ok-bg); opacity: .35; cursor: default; }
@media (prefers-reduced-motion: reduce) { .shake, .slot.filled { animation: none; } }

/* Название рядом с логотипом: спокойно и аккуратно */
.side-brand .brand-name { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.05em; line-height: 1.05; color: var(--text); }
.side-brand .brand-name i { font-style: normal; font-weight: 800; background: linear-gradient(120deg, var(--hero-c), var(--tiffany)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .side-brand .brand-name i { color: var(--tiffany); }

/* Экзамен */
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.exam-text summary { cursor: pointer; }
.exam-text .text-body { max-height: 45vh; overflow: auto; margin-top: 10px; }
[data-timer].late { color: var(--bad); }

/* Семьи глаголов */
.verb-fam { padding-top: 6px; }
.verb-fam-head { padding: 4px 2px; }
.verb-fam-head b { font-family: var(--display); font-size: 17px; }
.verb-fam-head p { margin: 4px 0 0; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chips-scroll .chip { flex-shrink: 0; }

/* Мои языки */
.my-lang { gap: 10px; }
.my-lang.on { border: 2px solid var(--tiffany); }
.my-lang .level-badge { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; flex-shrink: 0; }

/* Экранная клавиатура */
.kb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: 100%; }
.kb-toggle { background: var(--surface-2); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.kb-translit { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.kb-translit small { color: var(--muted); }
.kb-rows { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.kb-rows[hidden] { display: none; }
.kb-row { display: flex; justify-content: center; gap: 4px; }
.kb-key { min-width: 34px; height: 42px; padding: 0 6px; border-radius: 9px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 2px 0 var(--line); font-size: 17px; font-weight: 600; color: var(--text); cursor: pointer; }
.kb-key:active { transform: translateY(1px); box-shadow: none; }
.kb-wide { min-width: 96px; font-size: 14px; }
@media (max-width: 420px) { .kb-key { min-width: 26px; height: 40px; font-size: 15px; padding: 0 3px; } }

/* ——— Профиль ——— */
.profile { display: flex; flex-direction: column; gap: 24px; }
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: 24px;
  background: linear-gradient(120deg, var(--surface) 0%, var(--sky) 100%); }
/* Обложка профиля: баннер над именем, аватар заходит на него снизу */
.profile-hero.has-cover { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.cover { position: relative; height: 150px; background: linear-gradient(120deg, var(--sky) 0%, color-mix(in srgb, var(--tiffany) 45%, var(--sky)) 100%); }
.cover-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cover-edit { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: none; border-radius: 999px; cursor: pointer;
  background: rgba(15, 30, 45, .45); color: #fff; font: inherit; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cover-edit:hover { background: rgba(15, 30, 45, .6); }
/* Обложка на весь блок: картинка под всем, имя и почта — на матовой плашке поверх */
.profile-hero.has-cover { position: relative; isolation: isolate; }
.has-cover .cover { position: absolute; inset: 0; height: auto; z-index: 0; }
.has-cover .profile-id { position: relative; z-index: 1; margin: 112px 14px 14px; padding: 16px 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 50%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.profile-id { display: flex; align-items: flex-start; gap: 18px; padding: 0 22px 22px; }
.profile-id .avatar { margin-top: -36px; border: 4px solid var(--surface); position: relative; }
.profile-id > .grow { padding-top: 12px; min-width: 0; }
@media (max-width: 560px) {
  .cover { height: 116px; }
  .has-cover .cover { height: auto; }
  .has-cover .profile-id { margin: 86px 10px 10px; padding: 14px; }
  .profile-id { gap: 14px; padding: 0 16px 18px; }
  .profile-id .avatar { width: 64px; height: 64px; font-size: 26px; margin-top: -30px; }
  .cover-edit span { display: none; }
  .cover-edit { padding: 8px; }
}
/* Выбор обложки */
.cover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.cover-opt { display: flex; flex-direction: column; gap: 6px; padding: 0 0 8px; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; text-align: center; }
.cover-opt .cover-thumb { position: relative; height: 64px; background-color: var(--sky); background-image: linear-gradient(120deg, var(--sky) 0%, color-mix(in srgb, var(--tiffany) 45%, var(--sky)) 100%); }
.cover-opt.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
:root[data-theme="dark"] .cover-opt.on { border-color: var(--tiffany); }
/* Анимации обложек — медленные и спокойные; только transform и opacity */
.cover-art .cv-twinkle { animation: cv-twinkle 3s ease-in-out infinite; }
.cover-art .cv-drift { animation: cv-drift 9s ease-in-out infinite alternate; }
.cover-art .cv-slow { animation-duration: 14s; }
.cover-art .cv-shimmer { animation: cv-shimmer 2.4s ease-in-out infinite; }
.cover-art .cv-bob { animation: cv-bob 4s ease-in-out infinite; }
.cover-art .cv-wave { animation: cv-wave 12s linear infinite; }
.cover-art .cv-wave.cv-slow { animation-duration: 20s; }
.cover-art .cv-float { transform-box: fill-box; transform-origin: center; animation: cv-float 5s ease-in-out infinite; }
.cover-art .cv-shoot { stroke-dasharray: 70; stroke-dashoffset: 70; animation: cv-shoot 6s ease-in infinite; }
/* Дыхание (прозрачность), пульс свечения, покачивание лодки */
.cover-art .cv-breathe { animation: cv-breathe 7s ease-in-out infinite; }
.cover-art .cv-aurora { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-aurora 11s ease-in-out infinite alternate; }
.cover-art .cv-weed { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-weed 4s ease-in-out infinite alternate; }
.cover-art .cv-pulse { transform-box: fill-box; transform-origin: center; animation: cv-pulse 5s ease-in-out infinite; }
.cover-art .cv-rock { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-rock 5s ease-in-out infinite; }
/* Полёт через всю картинку: птицы и облака рисуем около x=150, рыб влево — около x=490 */
.cover-art .cv-fly { animation: cv-fly 26s linear infinite; }
.cover-art .cv-fly-l { animation: cv-fly-l 22s linear infinite; }
.cover-art .cv-cloud { animation: cv-cloud 80s linear infinite; }
.cover-art .cv-flap { transform-box: fill-box; transform-origin: center; animation: cv-flap .9s ease-in-out infinite; }
/* Падение и подъём слоями: слой нарисован дважды со сдвигом 200, поэтому петля бесшовная */
.cover-art .cv-fall { animation: cv-fall 12s linear infinite; }
.cover-art .cv-rise { animation: cv-rise 10s linear infinite; }
.cover-art .cv-rain { animation: cv-rain .8s linear infinite; }
.cover-art .cv-sway { animation: cv-sway 3s ease-in-out infinite alternate; }
.cover-art .cv-tumble { transform-box: fill-box; transform-origin: center; animation: cv-tumble 3s linear infinite; }
/* Окна, огоньки, пламя, пар */
.cover-art .cv-flicker { animation: cv-flicker 6s ease-in-out infinite; }
.cover-art .cv-blink { animation: cv-blink 9s ease-in-out infinite; }
.cover-art .cv-beacon { animation: cv-beacon 1.6s ease-in-out infinite; }
.cover-art .cv-wander { animation: cv-wander 8s ease-in-out infinite; }
.cover-art .cv-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-flame 1.8s ease-in-out infinite; }
.cover-art .cv-steam { transform-box: fill-box; transform-origin: 50% 100%; animation: cv-steam 5s ease-out infinite; }
.cover-art .cv-ripple { transform-box: fill-box; transform-origin: center; animation: cv-ripple 3.2s ease-out infinite; }
/* Вращение: лопасти ветряков, полосы планеты */
.cover-art .cv-spin { transform-box: fill-box; transform-origin: center; animation: cv-spin 6s linear infinite; }
.cover-art .cv-band { animation: cv-band 18s linear infinite; }
.cover-art .cv-orbit-x { animation: cv-orbit-x 9s ease-in-out infinite alternate; }
.cover-art .cv-orbit-y { animation: cv-orbit-y 9s ease-in-out -4.5s infinite alternate; }
/* Мягкие пузыри */
.cover-art .cv-blob { transform-box: fill-box; transform-origin: center; animation: cv-blob 16s ease-in-out infinite alternate; }
.cover-art .cv-blob2 { transform-box: fill-box; transform-origin: center; animation: cv-blob2 19s ease-in-out infinite alternate; }
@keyframes cv-twinkle { 50% { opacity: .15; } }
@keyframes cv-drift { from { transform: translateX(-24px); } to { transform: translateX(24px); } }
@keyframes cv-shimmer { 50% { opacity: .3; transform: translateX(6px); } }
@keyframes cv-bob { 50% { transform: translateY(-4px); } }
@keyframes cv-wave { to { transform: translateX(-640px); } }
@keyframes cv-float { 50% { transform: translateY(-6px) rotate(25deg); } }
@keyframes cv-shoot { 0%, 80% { stroke-dashoffset: 70; opacity: 0; } 85% { opacity: 1; } 100% { stroke-dashoffset: -70; opacity: 0; } }
@keyframes cv-breathe { 50% { opacity: .45; } }
@keyframes cv-aurora { from { transform: translateX(-50px) scaleY(.85); } to { transform: translateX(50px) scaleY(1.12); } }
@keyframes cv-weed { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes cv-pulse { 50% { transform: scale(1.14); opacity: .6; } }
@keyframes cv-rock { 25% { transform: translateY(-5px) rotate(-2deg); } 75% { transform: translateY(2px) rotate(2deg); } }
@keyframes cv-fly { from { transform: translateX(-330px); } to { transform: translateX(670px); } }
@keyframes cv-fly-l { from { transform: translateX(330px); } to { transform: translateX(-670px); } }
@keyframes cv-cloud { from { transform: translateX(-390px); } to { transform: translateX(630px); } }
@keyframes cv-flap { 50% { transform: scaleY(.45); } }
@keyframes cv-fall { from { transform: translateY(0); } to { transform: translateY(200px); } }
@keyframes cv-rise { from { transform: translateY(0); } to { transform: translateY(-200px); } }
@keyframes cv-rain { from { transform: translate(0, 0); } to { transform: translate(-30px, 200px); } }
@keyframes cv-sway { from { transform: translateX(-9px); } to { transform: translateX(9px); } }
@keyframes cv-tumble { from { transform: rotate(0) scaleY(1); } 50% { transform: rotate(180deg) scaleY(.35); } to { transform: rotate(360deg) scaleY(1); } }
@keyframes cv-flicker { 0%, 100% { opacity: .95; } 40% { opacity: .7; } 55% { opacity: .9; } 70% { opacity: .6; } }
@keyframes cv-blink { 0%, 38%, 62%, 100% { opacity: 1; } 45%, 55% { opacity: .12; } }
@keyframes cv-beacon { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes cv-wander { 0%, 100% { transform: translate(0, 0); opacity: .25; } 25% { transform: translate(12px, -9px); opacity: 1; } 50% { transform: translate(-5px, -18px); opacity: .45; } 75% { transform: translate(-13px, -6px); opacity: 1; } }
@keyframes cv-flame { 0%, 100% { transform: scale(1, 1) rotate(0); } 30% { transform: scale(.92, 1.1) rotate(-3deg); } 60% { transform: scale(1.05, .94) rotate(2deg); } }
@keyframes cv-steam { from { transform: translateY(0) scaleX(.8); opacity: 0; } 30% { opacity: .7; } to { transform: translateY(-46px) scaleX(1.3); opacity: 0; } }
@keyframes cv-ripple { from { transform: scale(.2); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes cv-spin { to { transform: rotate(360deg); } }
@keyframes cv-band { to { transform: translateX(-120px); } }
@keyframes cv-orbit-x { from { transform: translateX(-192px); } to { transform: translateX(0); } }
@keyframes cv-orbit-y { from { transform: translateY(-22px); } to { transform: translateY(22px); } }
@keyframes cv-blob { 33% { transform: translate(70px, -30px) scale(1.15); } 66% { transform: translate(-40px, 25px) scale(.9); } to { transform: translate(30px, 10px) scale(1.08); } }
@keyframes cv-blob2 { 33% { transform: translate(-80px, 20px) scale(.88); } 66% { transform: translate(50px, -35px) scale(1.18); } to { transform: translate(-20px, -10px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .cover-art * { animation: none !important; } }
.avatar { width: 72px; height: 72px; flex-shrink: 0; border-radius: 22px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 30px; color: #fff; background: linear-gradient(135deg, var(--primary), #2FA8A0); box-shadow: var(--shadow); }
.profile-hero .h2 { margin: 0 0 2px; }
.hero-pills { margin-top: 10px; gap: 6px; flex-wrap: wrap; }
.section-title { font-family: var(--display); font-size: 17px; font-weight: 700; margin: 0; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); color: var(--primary); }
:root[data-theme="dark"] .stat-tile { color: var(--tiffany); }
.stat-tile b { font-family: var(--display); font-size: 24px; color: var(--text); line-height: 1.1; }
.stat-tile span { font-size: 12px; color: var(--muted); }
.lang-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); border: 2px solid transparent; }
.lang-card.on { border-color: var(--tiffany); }
.lang-code { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: var(--sand); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 14px; }
.lang-progress { display: flex; flex-direction: column; gap: 6px; }
.lang-progress .bar { height: 8px; }
.lang-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.lang-stats span { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.lang-stats b { font-family: var(--display); font-size: 17px; color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.profile .ach-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

/* Латиница под украинским текстом */
.lat { display: block; font-size: 13px; font-style: italic; color: var(--muted); font-weight: 400; letter-spacing: .01em; }
.lat-opt { font-size: 12px; margin-top: 1px; }
.lat-block { margin: 2px 0 6px; }
.lat-para { margin: -6px 0 12px; font-size: 14px; }
.game-q + .lat { margin-top: -8px; }
.match-b .lat, .choice .lat { color: var(--muted); }
.vf .lat { font-size: 11px; font-weight: 500; opacity: .75; color: var(--ink); }

/* Настройки: выбор кнопками */
.set-block { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-block small { font-size: 12px; }
.pick-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pick-row.pick-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 4px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.pick b { font-family: var(--display); font-size: 17px; }
.pick-2 .pick b { font-size: 15px; }
.pick small { font-size: 11px; color: var(--muted); text-align: center; }
.pick .ic { color: var(--primary); }
.pick:hover { border-color: var(--tiffany); }
.pick.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27, 122, 147, .25); }
.pick.on small, .pick.on .ic { color: rgba(255, 255, 255, .85); }
:root[data-theme="dark"] .pick.on { background: var(--tiffany); border-color: var(--tiffany); color: var(--ink); }
:root[data-theme="dark"] .pick.on small, :root[data-theme="dark"] .pick.on .ic { color: var(--ink); }
@media (max-width: 420px) { .pick small { display: none; } .pick-2 .pick small { display: block; } }

/* Карточка уровня на главной */
.level-card { display: flex; flex-direction: column; gap: 12px; }
.level-chip { width: 48px; height: 48px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ink); }
.level-card .bar { height: 8px; }
.level-link { justify-content: center; gap: 8px; min-height: 44px; }

/* Полосы прокрутки не показываем нигде — прокрутка работает как обычно */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Название рядом с логотипом: компактно, без больших пробелов */
.side-brand > span:not(.logo) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.side-brand small { font-size: 12px; line-height: 1.3; letter-spacing: 0; word-spacing: 0; white-space: nowrap; }

/* Круглые флаги */
.flag { display: inline-block; flex-shrink: 0; border-radius: 50%; overflow: hidden; vertical-align: middle;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(16, 38, 58, .18); }
:root[data-theme="dark"] .flag { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 2px 6px rgba(0, 0, 0, .35); }
.flag svg { display: block; width: 100%; height: 100%; }
.pair-chip .flag { margin-right: 2px; }
.opt .flag { margin-bottom: 6px; }
.opt:disabled .flag { filter: grayscale(.6); opacity: .6; }
.pill-flag { gap: 6px; }

/* Выбор языка: аккуратные строки — флаг, название, подпись, галочка */
.lang-opt { flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; text-align: left; border-width: 2px; }
.lang-opt .flag { margin: 0; }
.lang-opt-t { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.lang-opt-t b { font-size: 15px; font-weight: 600; line-height: 1.2; }
.lang-opt-t small { font-size: 12px; font-weight: 500; color: var(--muted); }
.lang-opt .ic { color: var(--primary); flex-shrink: 0; }
.lang-opt.on { background: var(--sky); border-color: var(--primary); color: var(--text); }
.opt-t.lang-opt.on { background: var(--sky); }
.lang-opt.on small { color: var(--primary); }
:root[data-theme="dark"] .lang-opt.on { background: var(--sky); border-color: var(--tiffany); }
:root[data-theme="dark"] .lang-opt.on small, :root[data-theme="dark"] .lang-opt .ic { color: var(--tiffany); }
.lang-opt:disabled { border-width: 2px; }

/* Урок: шаги, теория, разбор ошибок */
.lesson-steps { display: flex; gap: 6px; }
.lesson-steps span { flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.lesson-steps i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; background: var(--line); color: var(--text); }
.lesson-steps .on { color: var(--text); box-shadow: inset 0 0 0 2px var(--primary); }
.lesson-steps .on i { background: var(--primary); color: var(--on-primary); }
.lesson-steps .done i { background: var(--ok); color: #fff; }
.theory-h { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--display); font-size: 17px; }
.theory-n { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: var(--sand); color: var(--ink); font-size: 14px; }
.theory-sec p { margin: 0; line-height: 1.55; }
.theory-tip { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--sky); font-size: 14px; }
.theory-tip .ic { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.mistake-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.mistakes b + .mistake-row { border-top: 0; }
@media (max-width: 520px) { .grid2:has(.lang-opt) { grid-template-columns: 1fr; } }

/* ——— Боковое меню ——— */
.side-links { gap: 14px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 0 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-links a { position: relative; gap: 10px; min-height: 42px; padding: 0 10px; font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.side-links a:hover { background: var(--surface-2); }
.side-links a.active { background: var(--sky); color: var(--text); font-weight: 600; }
.side-links a.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
:root[data-theme="dark"] .side-links a.active { background: var(--sky); color: var(--text); }
:root[data-theme="dark"] .side-links a.active::before { background: var(--tiffany); }
.nav-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; color: var(--ink); }
/* Пастельные плитки: по умолчанию прежние цвета, тема подставляет свои оттенки (theme.js) */
.tone-sky { background: var(--t-sky, #D9EEF7); } .tone-tiffany { background: var(--t-tiff, color-mix(in srgb, var(--tiffany) 40%, #fff)); } .tone-sand { background: var(--t-sand, #F4E4BE); }
.tone-coral { background: var(--t-coral, #F9D5C6); } .tone-lilac { background: var(--t-lilac, #E3DEF5); }
:root[data-theme="dark"] .nav-ic { filter: saturate(.8) brightness(.92); }
.side-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); color: var(--text) !important; text-decoration: none; }
.side-me:hover, .side-me.active { box-shadow: inset 0 0 0 2px var(--tiffany); }
.side-me b { display: block; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me small { font-size: 11.5px; color: var(--muted); }
.side-me .ic { color: var(--muted); flex-shrink: 0; }
.side-avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--primary), #2FA8A0); }

/* ——— Огонёк серии ——— */
.fire { display: inline-block; flex-shrink: 0; position: relative; vertical-align: middle; }
.fire svg { position: relative; width: 100%; height: 100%; overflow: visible; display: block; }
.fire path { transform-box: fill-box; transform-origin: 50% 100%; }
/* Цвета огня: переменные на каждую ступень серии (градиенты SVG берут цвет из CSS) */
.fire { --fa0: #E8341C; --fa1: #FF6A00; --fa2: #FFB02E; --fb0: #FF8A00; --fb1: #FFD54A; --fc0: #FFFBE6; --fc1: #FFE27A; --spark: #FFC23D; --glow: 255, 150, 20; }
.fire.t7 { --fa0: #C2103A; --fa1: #FF2D55; --fa2: #FF7A45; --fb0: #FF4D6D; --fb1: #FFB199; --fc0: #FFF4F0; --fc1: #FFC2B3; --spark: #FF7A8A; --glow: 255, 60, 90; }
.fire.t14 { --fa0: #4B12B8; --fa1: #8B2CF5; --fa2: #E36BFF; --fb0: #B04DFF; --fb1: #F4A8FF; --fc0: #FFF5FF; --fc1: #F2C9FF; --spark: #E7A6FF; --glow: 170, 80, 255; }
.fire.t30 { --fa0: #0A3FD1; --fa1: #1E7BFF; --fa2: #4FD2FF; --fb0: #3AA0FF; --fb1: #A6ECFF; --fc0: #FFFFFF; --fc1: #C9F4FF; --spark: #8FE3FF; --glow: 60, 160, 255; }
.fire.t100 { --fa0: #B8860B; --fa1: #FFB300; --fa2: #FFE066; --fb0: #FFD23F; --fb1: #FFF3B0; --fc0: #FFFFFF; --fc1: #FFF8D6; --spark: #FFE680; --glow: 255, 200, 40; }
.fa0 { stop-color: var(--fa0); } .fa1 { stop-color: var(--fa1); } .fa2 { stop-color: var(--fa2); }
.fb0 { stop-color: var(--fb0); } .fb1 { stop-color: var(--fb1); }
.fc0 { stop-color: var(--fc0); } .fc1 { stop-color: var(--fc1); }
/* Свечение за огнём — в цвет ступени */
.fire.on::before { content: ""; position: absolute; inset: 10% 5% -5%; border-radius: 50%; background: radial-gradient(circle at 50% 65%, rgba(var(--glow), .6), rgba(var(--glow), 0) 70%); filter: blur(3px); animation: fire-glow 1.6s ease-in-out infinite; }
/* Три слоя пламени колышутся в разном ритме — так огонь выглядит живым */
.fire.on .fire-outer { animation: fire-flicker 1.3s ease-in-out infinite; }
.fire.on .fire-mid { animation: fire-flicker-mid 1.05s ease-in-out infinite; }
.fire.on .fire-inner { animation: fire-flicker-in .8s ease-in-out infinite; }
.fire-sparks circle { fill: var(--spark); opacity: 0; transform-box: fill-box; transform-origin: center; }
.fire.off path { fill: var(--line); }
.fire.off .fire-inner { fill: var(--surface-2); }
.fire.off .fire-mid { fill: color-mix(in srgb, var(--line) 60%, var(--surface-2)); }
/* 3+ дня: искры */
.fire.sparky .fire-sparks circle:nth-child(-n+3) { animation: fire-spark 1.6s ease-out infinite; }
.fire.sparky .fire-sparks circle:nth-child(2) { animation-delay: .55s; }
.fire.sparky .fire-sparks circle:nth-child(3) { animation-delay: 1.1s; }
/* 7+ дней: пламя сильнее, свечение больше, искр больше */
.fire.t7::before, .fire.t14::before, .fire.t30::before, .fire.t100::before { inset: -10% -15% -10%; background: radial-gradient(circle at 50% 60%, rgba(var(--glow), .75), rgba(var(--glow), 0) 70%); filter: blur(4px); }
.fire.t7 .fire-outer, .fire.t14 .fire-outer, .fire.t30 .fire-outer, .fire.t100 .fire-outer { animation-duration: 1s; }
.fire.t7 .fire-sparks circle, .fire.t14 .fire-sparks circle, .fire.t30 .fire-sparks circle, .fire.t100 .fire-sparks circle { animation: fire-spark 1.3s ease-out infinite; }
.fire.on .fire-sparks circle:nth-child(2) { animation-delay: .25s; }
.fire.on .fire-sparks circle:nth-child(3) { animation-delay: .5s; }
.fire.on .fire-sparks circle:nth-child(4) { animation-delay: .75s; }
.fire.on .fire-sparks circle:nth-child(5) { animation-delay: 1s; }
.fire.sparky:not(.t7):not(.t14):not(.t30):not(.t100) .fire-sparks circle:nth-child(2) { animation-delay: .55s; }
.fire.sparky:not(.t7):not(.t14):not(.t30):not(.t100) .fire-sparks circle:nth-child(3) { animation-delay: 1.1s; }
/* 100+ дней: золотой легендарный огонь — сияние переливается */
.fire.t100::after { content: ""; position: absolute; inset: -16%; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 90, 90, .35), rgba(255, 210, 60, .35), rgba(90, 220, 160, .35), rgba(90, 160, 255, .35), rgba(200, 110, 255, .35), rgba(255, 90, 90, .35)); filter: blur(6px); z-index: -1; animation: fire-halo 4s linear infinite; }
@keyframes fire-halo { to { transform: rotate(360deg); } }
@keyframes fire-flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(.96, 1.07) skewX(-3deg); }
  50% { transform: scale(1.03, .96) skewX(2deg); }
  75% { transform: scale(.98, 1.05) skewX(-1.5deg); }
}
@keyframes fire-flicker-mid {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(.94, 1.1) skewX(3deg); }
  60% { transform: scale(1.04, .94) skewX(-2deg); }
}
@keyframes fire-flicker-in {
  0%, 100% { transform: scale(1, 1) translateY(0); opacity: 1; }
  40% { transform: scale(.9, 1.14) translateY(-5%); opacity: .88; }
  70% { transform: scale(1.06, .92) translateY(2%); opacity: 1; }
}
@keyframes fire-spark {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx, 1px), -10px) scale(.3); opacity: 0; }
}
.fire-sparks circle:nth-child(1) { --dx: -2px; } .fire-sparks circle:nth-child(2) { --dx: 2px; } .fire-sparks circle:nth-child(4) { --dx: -1px; } .fire-sparks circle:nth-child(5) { --dx: 3px; }
@keyframes fire-glow { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .fire.on path, .fire.on::before, .fire.on::after, .fire-sparks circle { animation: none; } }
.fire.on { isolation: isolate; }
.streak-pill { gap: 6px; background: var(--surface); color: var(--muted); }
.streak-pill.hot { background: #FFF1E0; color: #B4410F; }
:root[data-theme="dark"] .streak-pill.hot { background: #3A2412; color: #FFB36B; }
.stat-tile .fire { margin-bottom: 2px; }

/* «Скажи сам» */
.speak-card { gap: 10px; }
.speak-ask { align-items: center; font-family: var(--display); font-size: 20px; }
.speak-q { margin: 0; font-size: 16px; line-height: 1.5; }
.speak-result.ok { box-shadow: inset 0 0 0 2px var(--ok); }
.speak-result.ok > .row { color: var(--ok); }
.speak-result.bad { box-shadow: inset 0 0 0 2px var(--coral); }
.speak-result.bad > .row { color: var(--bad); }
.speak-model { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.speak-model b { font-size: 16px; }

/* Лига: строки-кнопки с аватаром */
button.league-row { width: 100%; border: 0; font: inherit; cursor: pointer; text-align: left; align-items: center; }
button.league-row:not(.me) { color: var(--text); }
button.league-row:hover { filter: brightness(.97); }
.league-rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.league-av { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--primary), #2FA8A0); flex-shrink: 0; }
button.league-row small { color: inherit; opacity: .8; }

/* Языки в шапке профиля */
.hero-langs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lang-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.lang-chip.on { box-shadow: inset 0 0 0 2px var(--tiffany); }

/* Мини-профиль участника */
.user-card { position: relative; display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.user-card-x { position: absolute; top: 10px; right: 10px; }
.avatar-sm { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
.user-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.user-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); color: var(--primary); }
.user-stats b { font-family: var(--display); font-size: 17px; color: var(--text); }
.user-stats small { font-size: 10.5px; color: var(--muted); text-align: center; }
.user-lang { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.user-lang .right { text-align: right; }

/* Языки, которыми владею / которые учу */
.hero-langs-t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); align-self: center; margin-right: 2px; }
.speak-chips, .speak-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.speak-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.speak-chip.on { border-color: var(--primary); background: var(--sky); }
:root[data-theme="dark"] .speak-chip.on { border-color: var(--tiffany); background: var(--sky); }
.speak-chip:disabled { cursor: default; opacity: .85; }

/* Версия и «Что нового» */
.side-ver { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; text-decoration: none; color: var(--text) !important;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tiffany) 22%, var(--surface)), color-mix(in srgb, var(--sand) 30%, var(--surface))); border: 1px solid color-mix(in srgb, var(--tiffany) 35%, transparent); }
.side-ver:hover, .side-ver.active { box-shadow: inset 0 0 0 2px var(--tiffany); }
.side-ver b { display: block; font-size: 13px; line-height: 1.2; }
.side-ver small { font-size: 11px; color: var(--muted); }
.side-ver .ic { color: var(--muted); }
.side-ver-ic, .ver-card-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(145deg, var(--deep), var(--hero-c)); color: #fff; flex-shrink: 0; }
.news-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #E0674B; box-shadow: 0 0 0 3px color-mix(in srgb, #E0674B 25%, transparent); flex-shrink: 0; }
.ver-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 20px; text-decoration: none; color: var(--text) !important; box-shadow: var(--shadow);
  background: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--tiffany) 30%, transparent), transparent 60%), var(--surface); }
.ver-card:hover { box-shadow: inset 0 0 0 2px var(--tiffany), var(--shadow); }
.ver-card b { display: block; }
.ver-card small { color: var(--muted); font-size: 12.5px; }
.ver-card-ic { width: 42px; height: 42px; border-radius: 14px; }
.ver-badge { display: inline-flex; align-items: center; font-family: var(--display); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--cta); color: var(--on-cta); vertical-align: middle; }
.map-hero .ver-badge { background: rgba(255, 255, 255, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .3); font-size: 14px; margin-left: 6px; }
.news-logo { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; background: rgba(255, 255, 255, .92); flex-shrink: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 8px; position: relative; display: flex; flex-direction: column; gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 23px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--tiffany), var(--line)); }
.tl-item { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.tl-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--primary); border: 2px solid var(--line); flex-shrink: 0; margin-top: 14px; }
.tl-latest .tl-dot { background: linear-gradient(145deg, var(--deep), var(--hero-c)); color: #fff; border-color: #fff; box-shadow: 0 0 0 3px var(--tiffany); }
.tl-card { flex: 1; min-width: 0; background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.tl-latest .tl-card { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tiffany) 70%, transparent), var(--shadow); }
.tl-ver { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--primary); display: inline-flex; align-items: center; gap: 8px; }
.tl-new { font-style: normal; font-family: var(--font); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: #E0674B; color: #fff; }
.tl-title { font-family: var(--display); font-size: 17px; line-height: 1.25; }
.tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-list li { display: flex; gap: 12px; align-items: center; line-height: 1.4; }
.tl-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb, var(--tiffany) 25%, var(--surface)); color: var(--primary); flex-shrink: 0; }

/* ——— Карта курса: маршрут по главам ——— */
.course-map { gap: 22px; }
.map-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; border-radius: 24px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tiffany) 35%, transparent), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(244, 228, 190, .18), transparent 60%), linear-gradient(135deg, var(--hero-a) 0%, var(--deep) 55%, var(--hero-c) 100%);
  box-shadow: 0 12px 32px rgba(15, 47, 72, .25); }
.map-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.5px); background-size: 34px 34px; mask-image: linear-gradient(90deg, transparent, #000 70%); }
.map-hero > * { position: relative; z-index: 1; }
.map-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; display: grid; place-items: center; }
.map-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.map-ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: rgba(255, 255, 255, .15); }
.ring-fg { stroke: var(--tiffany); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.map-ring b { font-family: var(--display); font-size: 17px; }
.map-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.map-title { font-size: 22px; line-height: 1.2; color: #fff; margin: 0; }
.map-sub { font-size: 13px; color: rgba(255, 255, 255, .75); }
.btn-hero { background: #fff; color: var(--hero-a) !important; font-weight: 800; border-radius: 999px; padding: 12px 20px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-hero:hover { transform: translateY(-1px); }

.chapter { --ch: var(--tiffany); --ch-deep: var(--hero-c); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.ch-A1 { --ch: var(--tiffany); --ch-deep: var(--hero-c); }
.ch-A2 { --ch: #EBCB86; --ch-deep: #A77B1E; }
.ch-B1 { --ch: #F2A68A; --ch-deep: #B4553A; }
.ch-B2 { --ch: #9DC0EC; --ch-deep: #2F62A6; }
.ch-C1 { --ch: #B9ADE6; --ch-deep: #5B47A8; }
.chapter-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: var(--ink);
  background: radial-gradient(80% 160% at 100% 0%, rgba(255, 255, 255, .55), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--ch) 70%, #fff) 0%, var(--ch) 100%); }
.chapter-code { font-family: var(--display); font-size: 30px; font-weight: 800; width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .6); color: var(--ch-deep); flex-shrink: 0; }
.chapter-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.chapter-title { font-family: var(--display); font-size: 18px; line-height: 1.2; }
.chapter-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .55); overflow: hidden; margin-top: 4px; max-width: 260px; }
.chapter-bar i { display: block; height: 100%; background: var(--ch-deep); border-radius: inherit; }
.chapter-count { font-weight: 800; font-size: 14px; color: var(--ch-deep); background: rgba(255, 255, 255, .65); padding: 6px 10px; border-radius: 99px; display: inline-flex; }
.chapter-future .chapter-head { filter: saturate(.55); }
.chapter-future .route { opacity: .78; }

.route { position: relative; margin: 8px auto 12px; max-width: 520px; }
.chapter { background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--ch) 7%, var(--surface)) 100%); }
.route-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.route-line path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.route-track { stroke: var(--line); stroke-width: 4; stroke-dasharray: 2 10; }
.route-lit { stroke: var(--ch-deep); stroke-width: 5; opacity: .85; }

.mnode-wrap { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; }
.mnode-wrap.lbl-left { flex-direction: row-reverse; }
.mnode-wrap.lbl-below { flex-direction: column; gap: 6px; }
.mnode-wrap.lbl-left .mnode-label { text-align: right; }
.mnode-wrap.lbl-below .mnode-label { text-align: center; }
.mnode-wrap:not(.lbl-below) { width: 58px; }
.mnode-wrap.lbl-right .mnode-label { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
.mnode-wrap.lbl-left .mnode-label { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
.mnode-label { display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: min(34vw, 170px); font-size: 12.5px; line-height: 1.3; color: var(--text); }
.mnode-label b { font-weight: 600; }
.mnode-label small { color: var(--muted); font-size: 11.5px; }
.mnode-label em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ch-deep); }

.mnode { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 15px;
  background: var(--surface); color: var(--muted) !important; border: 2px solid var(--line); box-shadow: 0 2px 6px rgba(16, 38, 58, .06); transition: transform .15s ease; }
.mnode:hover { transform: scale(1.06); }
.mnode-done { background: var(--ch-deep); border-color: var(--ch-deep); color: #fff !important; box-shadow: 0 4px 12px color-mix(in srgb, var(--ch-deep) 35%, transparent); }
.mnode-open { background: color-mix(in srgb, var(--ch) 30%, var(--surface)); border-color: var(--ch); color: var(--text) !important; }
.mnode-now { width: 62px; height: 62px; font-size: 18px; background: linear-gradient(145deg, var(--deep), var(--hero-c)); border: 3px solid #fff; color: #fff !important;
  box-shadow: 0 0 0 4px var(--ch), 0 10px 24px rgba(23, 70, 111, .35); animation: halo 2.2s ease-out infinite; }
.mnode-wrap.is-now:not(.lbl-below) { width: 62px; }
@keyframes halo { 0% { box-shadow: 0 0 0 4px var(--ch), 0 0 0 4px color-mix(in srgb, var(--ch) 60%, transparent), 0 10px 24px rgba(23, 70, 111, .35); }
  100% { box-shadow: 0 0 0 4px var(--ch), 0 0 0 20px transparent, 0 10px 24px rgba(23, 70, 111, .35); } }
.mnode-exam { width: 56px; height: 56px; border-radius: 16px; transform: rotate(45deg); }
.mnode-exam > span { transform: rotate(-45deg); display: grid; }
.mnode-exam:hover { transform: rotate(45deg) scale(1.06); }
.mnode-exam.mnode-lock { border-style: dashed; }
.mnode-exam.mnode-now { width: 60px; height: 60px; border-radius: 16px; }
.mnode-exam.mnode-done { background: linear-gradient(145deg, #E9C46A, #C99A2E); border-color: #C99A2E; }
[data-theme="dark"] .chapter-head, [data-theme="dark"] .chapter-code, [data-theme="dark"] .chapter-count { color: #10263A; }
/* Телефон: шапка карты в одну строку — кольцо, тема, круглая кнопка */
@media (max-width: 640px) {
  .course-map { gap: 16px; }
  .map-hero { flex-wrap: nowrap; gap: 12px; padding: 14px 14px 14px 12px; border-radius: 20px; }
  .map-ring { width: 54px; height: 54px; }
  .map-ring circle { stroke-width: 5; }
  .map-ring b { font-size: 13px; }
  .map-kicker { font-size: 10.5px; }
  .map-title { font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .map-sub { font-size: 12px; }
  .map-sub-x { display: none; }
  .map-hero .btn-hero { width: 44px; height: 44px; padding: 0; justify-content: center; flex-shrink: 0; }
  .btn-hero-t { display: none; }
  .chapter { border-radius: 20px; }
  .chapter-head { gap: 12px; padding: 14px 16px; }
  .chapter-code { width: 46px; height: 46px; font-size: 21px; border-radius: 14px; }
  .chapter-kicker { font-size: 10.5px; }
  .chapter-title { font-size: 16px; }
  .chapter-count { font-size: 12.5px; padding: 5px 9px; }
  .mnode-label { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { .mnode-now { animation: none; } }

/* ——— Слова по темам ——— */
.words-page { gap: 20px; }
.words-of { font-size: .6em; opacity: .75; font-weight: 600; }
.going-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.going { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; text-decoration: none; color: #10263A !important; transition: transform .15s ease; }
.going:hover { transform: translateY(-2px); }
.going b { font-size: 14px; line-height: 1.25; min-height: 2.5em; }
.going small { font-weight: 700; font-size: 12px; opacity: .75; }
.going-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: var(--deep); }
.going-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .7); overflow: hidden; }
.going-bar i { display: block; height: 100%; background: var(--deep); border-radius: inherit; }
.words-tools { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: linear-gradient(var(--bg) 80%, transparent); }
.words-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.words-search input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 15px; color: var(--text); padding: 0; height: 100%; box-shadow: none; }
.words-search:focus-within { box-shadow: inset 0 0 0 2px var(--tiffany), var(--shadow); }
.lvl-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lvl-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); color: var(--text); cursor: pointer; font: inherit; }
.lvl-tab b { font-family: var(--display); font-size: 16px; color: var(--ch-deep); }
.lvl-tab small { font-size: 11px; color: var(--muted); font-weight: 600; }
.lvl-tab[aria-selected="true"] { background: color-mix(in srgb, var(--ch) 55%, var(--surface)); border-color: var(--ch-deep); }
.lvl-tab[aria-selected="true"] b, .lvl-tab[aria-selected="true"] small { color: #10263A; }
.lvl-panel { border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--ch) 16%, var(--surface)), var(--surface) 240px); box-shadow: var(--shadow); }
.lvl-panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 6px; }
.lvl-panel-head .chapter-code { background: var(--ch); }
.lvl-panel .wtopic-grid { padding: 14px 16px 18px; }
.wtopic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.wtopic { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text) !important; transition: transform .15s ease, box-shadow .15s ease; }
.wtopic:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 38, 58, .08); }
.wtopic-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--deep); flex-shrink: 0; }
.wtopic-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wtopic-body b { font-size: 14.5px; line-height: 1.25; }
.wtopic-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.wtopic-bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.wtopic-bar i { display: block; height: 100%; background: var(--ch-deep, var(--primary)); border-radius: inherit; }
.wtopic.is-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.wtopic.is-done .wtopic-meta { color: var(--ok); }
.wtopic.is-done .wtopic-bar i { background: var(--ok); }
.lvl-mini { display: inline-block; font-family: var(--display); font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--ch); color: #10263A; vertical-align: 1px; }
:root[data-theme="dark"] .lvl-panel-head .chapter-code { color: #10263A; }
@media (max-width: 640px) {
  .going-row { grid-template-columns: 1fr 1fr; }
  .lvl-tabs { gap: 6px; }
  .lvl-tab b { font-size: 14px; }
  .lvl-panel-head { padding: 14px 14px 4px; gap: 12px; }
  .lvl-panel .wtopic-grid { padding: 12px 10px 14px; }
  .wtopic-grid { grid-template-columns: 1fr; gap: 8px; }
  .wtopic-ic { width: 46px; height: 46px; border-radius: 14px; }
}
.lvl-panel-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ——— Чтение: карточки текстов ——— */
.rtext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.lvl-panel .rtext-grid { padding: 14px 16px 18px; }
.rtext { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text) !important; transition: transform .15s ease, box-shadow .15s ease; }
.rtext:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 38, 58, .08); }
.rtext-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--deep); flex-shrink: 0; }
.rtext-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rtext-body b { font-size: 15px; line-height: 1.25; }
.rtext-ex { font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rtext-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rtext-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.rtext-done { color: var(--ok); }
.rtext.is-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
@media (max-width: 640px) {
  .rtext-grid { grid-template-columns: 1fr; gap: 8px; }
  .lvl-panel .rtext-grid { padding: 12px 10px 14px; }
  .rtext { padding: 12px; gap: 12px; }
  .rtext-ic { width: 42px; height: 42px; border-radius: 13px; }
}

/* ——— Диалоги: карточки-чаты ——— */
.dcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lvl-panel .dcard-grid { padding: 14px 16px 18px; }
.dcard { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text) !important; transition: transform .15s ease, box-shadow .15s ease; }
.dcard:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 38, 58, .08); }
.dcard header b { font-size: 15px; line-height: 1.25; }
.dcard-done { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; flex-shrink: 0; }
.dcard.is-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.dcard-chat { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; }
.dbub { align-self: flex-start; max-width: 88%; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: #fff; color: #10263A; font-size: 13px; line-height: 1.35; box-shadow: 0 1px 2px rgba(16, 38, 58, .08); }
.dbub.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--deep); color: #fff; }
.dbub small { display: block; font-size: 10.5px; font-weight: 700; opacity: .6; margin-bottom: 1px; }
@media (max-width: 640px) {
  .dcard-grid { grid-template-columns: 1fr; gap: 10px; }
  .lvl-panel .dcard-grid { padding: 12px 10px 14px; }
}

/* ——— Тесты ——— */
.test-duo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.test-feature { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 22px; text-decoration: none; color: #10263A !important;
  background: radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--tiffany) 40%, #fff), var(--tiffany)); box-shadow: var(--shadow); transition: transform .15s ease; }
.test-feature:hover { transform: translateY(-2px); }
.test-feature-coral { background: radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(135deg, #FBE0D4, #F2A68A); }
.test-feature .label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.test-feature-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: var(--deep); margin-bottom: 4px; }
.test-feature-go { margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-weight: 800; font-size: 14px; background: var(--deep); color: #fff; padding: 9px 14px; border-radius: 99px; }
.test-info { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.test-info-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); margin-bottom: 4px; }
.exam-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.exam-ladder::before { content: ""; position: absolute; left: 35px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.exam-step { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text) !important; border: 2px solid transparent; transition: transform .15s ease; }
.exam-step:hover { transform: translateX(3px); }
.exam-badge { position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 15px; background: color-mix(in srgb, var(--ch) 45%, var(--surface)); color: var(--ch-deep); flex-shrink: 0; }
.exam-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.exam-step .wtopic-bar { max-width: 220px; }
.exam-step .wtopic-bar i { background: var(--ch-deep); }
.exam-go { font-weight: 800; font-size: 13px; color: var(--muted); display: inline-flex; }
.exam-open { border-color: var(--ch-deep); background: linear-gradient(90deg, color-mix(in srgb, var(--ch) 22%, var(--surface)), var(--surface)); }
.exam-open .exam-badge { background: var(--ch-deep); color: #fff; }
.exam-open .exam-status { color: var(--ch-deep); }
.exam-open .exam-go { background: var(--ch-deep); color: #fff; padding: 8px 14px; border-radius: 99px; }
.exam-passed .exam-badge { background: linear-gradient(145deg, #E9C46A, #C99A2E); color: #fff; }
.exam-passed .exam-status { color: #A77B1E; }
.exam-passed .exam-go { color: #A77B1E; }
.exam-locked { opacity: .85; }
.test-chip { display: none; }
.test-short { display: none; }
@media (max-width: 640px) {
  .test-duo { grid-template-columns: 1fr; gap: 10px; }
  .test-feature, .test-info { padding: 16px; }
  /* Телефон: карточки компактные — иконка слева, короткий текст */
  .test-feature { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; row-gap: 4px; align-items: center; }
  .test-feature .test-feature-ic { grid-row: span 2; margin: 0; }
  .test-feature .label { grid-column: 2; }
  .test-feature .tile-title { grid-column: 2; font-size: 18px; }
  .test-feature .test-desc { display: none; }
  .test-feature .test-chip { display: inline-flex; align-items: center; gap: 4px; grid-column: 1 / -1; justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .6); margin-top: 6px; }
  .test-feature .test-feature-go { grid-column: 1 / -1; justify-self: stretch; justify-content: center; padding: 12px 14px; }
  .test-feature-coral .small { grid-column: 1 / -1; }
  .test-info { display: grid; grid-template-columns: 42px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 14px 16px; }
  .test-info .test-info-ic { grid-row: span 2; margin: 0; }
  .test-info .test-desc { display: none; }
  .test-info .test-short { display: block; }
  .exam-step { padding: 12px; gap: 12px; }
  .exam-ladder::before { left: 31px; }
}

/* ——— Неправильные глаголы ——— */
.fam-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.fam-chips::-webkit-scrollbar { display: none; }
.fam-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; border: 0; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fam-chip small { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.fam-chip.on { background: var(--deep); color: #fff; }
.fam-chip.on small { background: rgba(255, 255, 255, .2); color: #fff; }
.vfam .lvl-panel-head { align-items: flex-start; }
.vfam .lvl-panel-head .grow { gap: 4px; }
.vcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 14px 16px 18px; }
.vcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.vcard { transition: background .2s ease, border-color .2s ease; }
.vcard.is-learned { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: color-mix(in srgb, var(--ok-bg) 70%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
.vcard.is-learned .vf { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.vcard.is-learned .vf1 b { color: var(--ok); }
.vcard-mark { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.vcard-mark:hover { border-color: var(--ok); color: var(--ok); }
.vcard-mark[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.vcard-forms { display: flex; align-items: stretch; gap: 4px; }
.vf { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--ch) 22%, var(--surface)); }
.vf small { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf b { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.vf1 b { color: var(--ch-deep); }
.vf-arrow { display: grid; place-items: center; color: var(--muted); opacity: .6; }
.vcard-foot .icon-btn { width: 34px; height: 34px; }
.vcard-ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; margin-right: 6px; vertical-align: -3px; }
@media (max-width: 640px) {
  .vcard-grid { grid-template-columns: 1fr; padding: 12px 10px 14px; gap: 8px; }
  .vf { padding: 7px 8px; }
  .vf b { font-size: 14px; }
}

/* ——— Главная ——— */
.home-main { gap: 18px; }
.home-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 28px; color: #fff;
  background: linear-gradient(140deg, var(--hero-a) 0%, var(--hero-b) 45%, var(--hero-c) 100%); box-shadow: 0 16px 40px rgba(12, 36, 56, .28); }
.home-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: radial-gradient(rgba(255,255,255,.6) 1px, transparent 1.5px); background-size: 30px 30px; mask-image: radial-gradient(80% 90% at 100% 0%, #000, transparent 70%); }
.hh-glow { position: absolute; border-radius: 50%; filter: blur(40px); pointer-events: none; }
.hh-glow.g1 { width: 260px; height: 260px; right: -60px; top: -80px; background: color-mix(in srgb, var(--tiffany) 45%, transparent); animation: drift 12s ease-in-out infinite alternate; }
.hh-glow.g2 { width: 220px; height: 220px; left: -70px; bottom: -110px; background: color-mix(in srgb, var(--hero-c) 40%, rgba(244, 228, 190, .3)); animation: drift 14s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-30px, 20px) scale(1.1); } }
.home-hero > *:not(.hh-glow) { position: relative; z-index: 1; }
.hh-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hh-pair { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: #fff !important; text-decoration: none; font-size: 13px; }
.hh-streak { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-family: var(--display); font-weight: 800; }
.hh-streak.hot { background: rgba(255, 150, 80, .22); border-color: rgba(255, 170, 110, .5); }
.hh-body { display: flex; align-items: center; gap: 16px; }
.hh-title { font-size: 30px; line-height: 1.1; margin: 0; color: #fff; overflow-wrap: anywhere; }
.hh-sub { margin: 4px 0 0; color: rgba(255, 255, 255, .8); font-size: 14.5px; }
.hh-ring { position: relative; width: 118px; height: 118px; flex-shrink: 0; display: grid; place-items: center; }
.hh-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hh-ring circle { fill: none; stroke-width: 9; }
.hh-ring > span { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hh-ring b { font-family: var(--display); font-size: 26px; line-height: 1; }
.hh-ring b small { font-size: 14px; opacity: .7; }
.hh-ring > span > small { font-size: 10.5px; opacity: .75; margin-top: 4px; max-width: 70px; line-height: 1.2; }
.hh-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-size: 13px; color: rgba(255, 255, 255, .85); }
.hh-stats b { color: #fff; font-family: var(--display); }
.hh-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hh-time { display: inline-flex; padding: 4px; border-radius: 99px; background: rgba(0, 0, 0, .2); }
.hh-time button { border: 0; background: none; color: rgba(255, 255, 255, .75); font: inherit; font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 99px; cursor: pointer; }
.hh-time button.on { background: rgba(255, 255, 255, .95); color: var(--hero-a); }
.hh-go { flex: 1; min-width: 180px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 99px; background: var(--tiffany); color: var(--hero-a) !important; font-weight: 800; font-size: 16px; text-decoration: none; box-shadow: 0 8px 24px color-mix(in srgb, var(--tiffany) 35%, transparent); transition: transform .15s ease; }
.hh-go:hover { transform: translateY(-2px); }
.home-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.next-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; text-decoration: none; color: #10263A !important;
  background: radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .55), transparent 60%), linear-gradient(145deg, color-mix(in srgb, var(--ch) 55%, #fff), var(--ch)); box-shadow: var(--shadow); transition: transform .15s ease; }
.next-card:hover { transform: translateY(-3px); }
.next-card b { font-family: var(--display); font-size: 17px; line-height: 1.25; }
.next-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: var(--deep); flex-shrink: 0; margin-bottom: 4px; }
.next-kicker { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.next-go { margin-top: auto; padding-top: 4px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ch-deep); }
.next-card .wtopic-bar { background: rgba(255, 255, 255, .6); }
.next-card .wtopic-bar i { background: var(--ch-deep); }
.review-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text) !important; }
.review-strip .next-ic { background: var(--sand); margin: 0; width: 40px; height: 40px; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 18px; text-decoration: none; color: #10263A !important; font-size: 12.5px; transition: transform .15s ease; }
.quick:hover { transform: translateY(-2px); }
.quick-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .75); color: var(--deep); }
@media (max-width: 900px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .home-hero { padding: 18px; border-radius: 24px; gap: 14px; }
  .hh-title { font-size: 24px; }
  .hh-sub { font-size: 13.5px; }
  .hh-ring { width: 96px; height: 96px; }
  .hh-ring b { font-size: 21px; }
  .hh-actions { flex-direction: column; align-items: stretch; }
  .hh-time { align-self: stretch; }
  .hh-time button { flex: 1; }
  .home-next { grid-template-columns: 1fr; }
  .next-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .hh-glow { animation: none; } }

/* ——— Пройденные уровни и награды ——— */
.lvl-tab.is-complete { background: linear-gradient(145deg, #F7E7B4, #E9C46A); border-color: #C99A2E; }
.lvl-tab.is-complete b, .lvl-tab.is-complete small { color: #6B4E12; }
.lvl-tab.is-complete small::before { content: "✓ "; }
.chapter-done { box-shadow: 0 0 0 2px #E9C46A, var(--shadow); }
.chapter-done .chapter-head { background: radial-gradient(80% 160% at 100% 0%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(135deg, #FBF0CF 0%, #E9C46A 100%); }
.chapter-done .chapter-code { color: #A77B1E; }
.chapter-done .chapter-count { color: #fff; background: linear-gradient(145deg, #E9C46A, #C99A2E); }
.chapter-done .chapter-bar i { background: #C99A2E; }
.chapter-won { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 2px; font-size: 11.5px; font-weight: 800; color: #6B4E12; background: rgba(255, 255, 255, .6); padding: 3px 9px; border-radius: 99px; }
.awards .section-title .ic { color: #C99A2E; }
.award-row { display: flex; flex-direction: column; gap: 8px; }
.award-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.award-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 16px; background: var(--surface-2); color: var(--muted) !important; text-decoration: none; text-align: center; }
.award b { font-family: var(--display); font-size: 14px; }
.award small { font-size: 10.5px; line-height: 1.2; }
.award-medal { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line); color: var(--muted); margin-bottom: 2px; }
.award.won { background: linear-gradient(180deg, color-mix(in srgb, #E9C46A 25%, var(--surface)), var(--surface)); color: var(--text) !important; box-shadow: 0 0 0 1px color-mix(in srgb, #E9C46A 60%, transparent); }
.award.won .award-medal { border: 0; color: #fff; background: radial-gradient(circle at 30% 25%, #FFF3C4, #E9C46A 45%, #B8871F 100%); box-shadow: 0 4px 12px rgba(185, 135, 31, .4), inset 0 -2px 0 rgba(0, 0, 0, .12); animation: medal-in .6s ease both; }
.award.won small { color: #A77B1E; font-weight: 700; }
a.award.won:hover { transform: translateY(-2px); }
@keyframes medal-in { from { transform: scale(.6) rotate(-15deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .award.won .award-medal { animation: none; } }
@media (max-width: 420px) { .award-list { gap: 5px; } .award-medal { width: 40px; height: 40px; } .award small { font-size: 9.5px; } }

/* ——— Словничок ——— */
.dstat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dstat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 20px; border: 2px solid transparent; color: #10263A; font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease; }
.dstat:hover { transform: translateY(-2px); }
.dstat.on { border-color: var(--deep); box-shadow: 0 8px 20px rgba(16, 38, 58, .12); }
.dstat b { font-family: var(--display); font-size: 26px; line-height: 1.1; margin-top: 6px; }
.dstat > span:not(.dstat-ic) { font-weight: 700; font-size: 14px; }
.dstat small { font-size: 11.5px; opacity: .7; }
.dstat-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .75); color: var(--deep); }
.dict-tools { display: flex; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: linear-gradient(var(--bg) 80%, transparent); }
.dict-add { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 18px; border-radius: 16px; background: var(--deep); color: #fff; font-weight: 800; flex-shrink: 0; }
.wcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.wcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.wcard.st-learning { border-left-color: #F2A68A; }
.wcard.st-learned { border-left-color: #E9C46A; }
.wcard.st-known { border-left-color: var(--tiffany); }
.wcard-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wcard-main > b { font-size: 16px; }
.wcard-ipa { font-size: 12px; color: var(--muted); }
.wcard-tag { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 6px; background: var(--sand); color: #6B4E12; vertical-align: 2px; }
.wcard-tr { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.wcard-when { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 99px; }
.wcard-when.now { background: #FBE0D4; color: #B4553A; }
.wcard-act { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 7px 11px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.wcard-act:hover { border-color: var(--primary); color: var(--primary); }
.dict-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.dict-empty .dstat-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--sky); }
@media (max-width: 640px) {
  .dstat-row { gap: 8px; }
  .dstat { padding: 12px 10px; border-radius: 18px; }
  .dstat b { font-size: 22px; }
  .dstat small { display: none; }
  .dstat-ic { width: 32px; height: 32px; }
  .dict-add span { display: none; }
  .dict-add { padding: 0 14px; }
  .wcard-grid { grid-template-columns: 1fr; gap: 8px; }
}

/* ——— Экзамен закрыт: что осталось ——— */
.gate { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 20px; border-radius: 24px; background: linear-gradient(180deg, color-mix(in srgb, var(--ch) 35%, var(--surface)), var(--surface)); box-shadow: var(--shadow); }
.gate .map-kicker { color: var(--muted); }
.gate h1 { font-size: 22px; margin: 0; }
.gate p { margin: 0; max-width: 420px; }
.gate-lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--ch-deep); color: #fff; margin-bottom: 4px; box-shadow: 0 8px 20px color-mix(in srgb, var(--ch-deep) 35%, transparent); }
.gate-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text) !important; }
.gate-row small { color: var(--muted); font-weight: 600; }
.gate-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--sky); color: var(--primary); flex-shrink: 0; }
.gate-row.ok .gate-ic { background: var(--ok); color: #fff; }
.gate-row.ok .wtopic-bar i { background: var(--ok); }
.gate-go { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 99px; background: var(--deep); color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }

/* ——— Практика: список разделов в стиле остальных страниц ——— */
.practice-list .prac { align-items: center; }
.prac .rtext-body { gap: 3px; }
.prac-go { color: var(--muted); display: grid; flex-shrink: 0; }


/* Переводчик: недавние запросы — слово и крестик в одной «таблетке» */
.chip-x { display: inline-flex; align-items: center; padding: 0 4px 0 0; gap: 0; }
.chip-x > button { border: none; background: none; color: inherit; font: inherit; cursor: pointer; }
.chip-x > [data-r] { min-height: 38px; padding: 0 6px 0 14px; }
.chip-del { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; opacity: .55; }
.chip-del:hover { opacity: 1; background: rgba(0, 0, 0, .08); }
.link-btn { border: none; background: none; padding: 4px 2px; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] .link-btn { color: var(--tiffany); }

/* Переводчик: кнопка направления и карточка DeepL */
.tr-dir { border: none; cursor: pointer; font-family: inherit; }
.tr-dir:active { transform: scale(.96); }
.tr-online { border-left: 4px solid var(--tiffany); }
.tr-online-res { color: var(--text); overflow-wrap: anywhere; }
.tr-via { font-size: 11px; color: var(--muted, #8A98A8); margin-top: -4px; }

/* ——— Пробные датские экзамены (proeve.js) ——— */
.pd-page { max-width: 880px; }
main.focus:has(.pd-page) { max-width: 920px; } /* экзамену с длинными текстами нужно больше места, чем обычному «фокусу» */
.pd-tone-tiffany { --pd-a: var(--tiffany); --pd-b: var(--sky); }
.pd-tone-sand { --pd-a: var(--sand); --pd-b: var(--coral); }
.pd-tone-coral { --pd-a: var(--coral); --pd-b: var(--sand); }
.pd-tone-sky { --pd-a: var(--sky); --pd-b: var(--tiffany); }

/* Шапка экзамена */
.pd-hero { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 24px; overflow: hidden; color: var(--ink);
  background: linear-gradient(135deg, var(--pd-a) 0%, color-mix(in srgb, var(--pd-b) 70%, var(--pd-a)) 100%); }
.pd-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .25); pointer-events: none; }
.pd-hero h1 { font-size: clamp(26px, 5vw, 36px); position: relative; }
.pd-hero p { margin: 0; max-width: 60ch; opacity: .85; position: relative; }
.pd-hero .label { color: var(--ink); opacity: .7; }
.pd-hero-flag { position: absolute; right: 24px; top: 24px; z-index: 1; }
.pd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 600; position: relative; }
.pd-hero-score { display: flex; align-items: center; gap: 10px; position: relative; }
.pd-hero-score .pd-bar-mini { flex: 1; max-width: 240px; background: rgba(255, 255, 255, .55); }
.pd-bar-mini { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pd-bar-mini > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

/* Список экзаменов */
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pd-card { display: flex; align-items: center; gap: 16px; padding: 18px; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pd-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 38, 58, .1); }
.pd-card.pd-off { opacity: .55; pointer-events: none; }
.pd-level { flex: none; display: grid; place-items: center; width: 72px; height: 72px; padding: 6px; border-radius: 20px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 15px; text-align: center; line-height: 1.15;
  background: linear-gradient(135deg, var(--pd-a), color-mix(in srgb, var(--pd-b) 60%, var(--pd-a))); }
.pd-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.pd-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.pd-go { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--primary); }

/* Вкладки частей */
.pd-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.pd-tabs button { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid transparent; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.pd-tabs button[aria-selected="true"] { border-color: var(--primary); background: var(--sky); }
.pd-tab-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--primary); }
[aria-selected="true"] .pd-tab-ic { background: var(--primary); color: var(--on-cta, #fff); }
.pd-tab-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pd-tab-txt b { font-size: 15px; }
.pd-tab-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-tab-min { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .pd-tabs button { flex-direction: column; gap: 4px; padding: 10px 6px; text-align: center; }
  .pd-tab-txt small, .pd-tab-min { display: none; }
  .pd-hero { padding: 20px; }
}

/* Полоса с таймером: прилипает к верху при прокрутке */
.pd-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pd-bar > .small { display: inline-flex; align-items: center; gap: 6px; }
.pd-timer { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--primary); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.pd-timer.on { background: var(--cta); color: var(--on-cta); }

/* Задание */
.pd-task { gap: 18px; padding: 22px; }
.pd-task-head { display: flex; align-items: center; justify-content: space-between; }
.pd-task-no { display: inline-flex; padding: 5px 12px; border-radius: 999px; background: var(--cta); color: var(--on-cta); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pd-task-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pd-intro { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 3px solid var(--tiffany); }
.pd-intro b { font-size: 17px; line-height: 1.4; }

/* Тексты */
.pd-texts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.pd-texts-sm { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pd-text { padding: 18px 20px; border-radius: 16px; background: var(--surface-2); font-size: 16px; line-height: 1.7; }
.pd-text p { margin: 0 0 12px; }
.pd-text p:last-child { margin-bottom: 0; }
.pd-text-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pd-text-head b { font-size: 16px; line-height: 1.35; padding-top: 2px; }
.pd-sub { margin: 14px 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); }
.pd-text > .pd-sub:first-child, .pd-text-head + .pd-sub { margin-top: 0; }
.pd-label { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--cta); color: var(--on-cta); font-weight: 800; font-size: 13px; }
.gap { display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 8px; margin: 0 1px; border-bottom: 2px dashed var(--primary); border-radius: 6px; background: var(--sky); font-weight: 700; line-height: 1.5; }
.gap > b { font-size: 11px; color: var(--primary); }
.gap-ok { background: var(--ok-bg); border-color: var(--ok); border-bottom-style: solid; }
.gap-bad { background: var(--bad-bg); border-color: var(--bad); border-bottom-style: solid; }

/* Варианты-абзацы A–G */
.pd-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pd-opts li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); line-height: 1.55; font-size: 15px; }

/* Вопросы */
.pd-qs { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.pd-qs > .label { margin-top: 10px; }
.pd-q { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.pd-qh { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; line-height: 1.4; }
.pd-num { flex: none; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: var(--surface); color: var(--primary); font-size: 13px; font-weight: 800; box-shadow: var(--shadow); }
.pd-q .choice { margin: 0; background: var(--surface); }
.pd-q select, .pd-q input { font-size: 16px; background: var(--surface); }
.in-ok { border-color: var(--ok) !important; background: var(--ok-bg) !important; }
.in-bad { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
.pd-result { padding: 12px 16px; border-radius: 14px; background: var(--sky); }

/* Письмо и устная часть */
.pd-assign { padding: 16px 18px; border-radius: 16px; background: var(--sand); color: var(--ink); }
.pd-assign .pre { white-space: pre-line; line-height: 1.6; }
.pd-prompt { padding: 14px; border-radius: 16px; background: var(--surface-2); }
.pd-prompt .btn { align-self: flex-start; }
.pd-qs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pd-qs-grid > .label { grid-column: 1 / -1; }
.pd-qs-grid .pd-q { padding: 10px; gap: 6px; }
.pd-qs-grid select { min-height: 44px; }
.pd-wordbox { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border: 2px dashed var(--line); border-radius: 16px; }
.pd-wordbox span { padding: 6px 12px; border-radius: 999px; background: var(--sand); color: var(--ink); font-weight: 600; font-size: 15px; transition: opacity .2s; }
.pd-wordbox span.used { opacity: .35; text-decoration: line-through; }
/* Датские буквы под полем: маленькая подписанная панель, а не «варианты» */
.kb-da { align-items: center; gap: 4px; margin-top: 4px; }
.kb-hint { font-size: 12px; color: var(--muted); margin-right: 4px; }
.kb-da .kb-key { min-width: 30px; height: 30px; padding: 0 6px; border-width: 1px; border-radius: 8px; box-shadow: none; font-size: 15px; }
.pd-short { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.pd-short:focus { outline: none; border-color: var(--primary); }

/* ——— Выбор языков (onboarding.js) ——— */
.ob { gap: 22px; padding-bottom: 8px; }
.ob-hero { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; border-radius: 24px; overflow: hidden; color: var(--ink);
  background: linear-gradient(135deg, var(--sky) 0%, color-mix(in srgb, var(--tiffany) 55%, var(--sky)) 100%); }
.ob-hero::after { content: ''; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .3); pointer-events: none; }
.ob-hero h1 { outline: none; position: relative; }
.ob-hero p { margin: 0; max-width: 46ch; opacity: .85; position: relative; }
.ob-step { display: flex; flex-direction: column; gap: 12px; }
.ob-step-h { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font); font-size: 17px; font-weight: 800; }
.ob-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cta); color: var(--on-cta); font-size: 14px; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ob .lang-opt { min-height: 68px; padding: 12px 16px; border: 2px solid var(--line); box-shadow: none; transition: border-color .15s, transform .15s, background .15s; }
.ob .lang-opt:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.ob .lang-opt .flag { width: 34px; height: 34px; }
.ob .lang-opt b { font-size: 16px; }
.ob .lang-opt.on { border-color: var(--primary); background: var(--sky); color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.ob .lang-opt.on small { color: var(--primary); font-weight: 700; }
.ob .lang-opt > svg:last-child { margin-left: auto; color: var(--primary); }
.ob-soon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ob-soon-l { display: inline-flex; align-items: center; gap: 5px; }
.ob-soon-l .flag { filter: grayscale(.5); opacity: .7; }
.ob-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 14px; margin: 0 -14px; border-radius: 22px 22px 0 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ob-pair { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ob-pair > span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; }
.ob-pair .flag { width: 28px; height: 28px; }
.ob-arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sky); color: var(--primary); }
.ob-foot .btn-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ob-num-ic { background: var(--tiffany); color: var(--ink); }
.ob-note { margin: -4px 0 0; }
.ob .my-lang { padding: 12px 14px; border: 2px solid var(--line); box-shadow: none; }
.ob .my-lang.on { border-color: var(--tiffany); background: color-mix(in srgb, var(--tiffany) 12%, var(--surface)); }

/* ——— Сайт в стиле обложки: украшение фона (theme.js) ———
   Слой лежит под содержимым (z-index: -1), видно его только между карточками; клики проходят насквозь */
#cover-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#cover-fx i { position: absolute; left: var(--x); top: -10%; width: var(--s); height: var(--s); animation: fx-fall var(--d) linear var(--dl) infinite; }
@keyframes fx-fall { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(var(--sw), 120vh) rotate(360deg); } }
.fx-petals i { width: calc(var(--s) * 1.3); border-radius: 80% 0 80% 0; background: #F4A9C0; opacity: .7; }
.fx-snow i { border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(120, 160, 200, .6); opacity: .9; }
:root:not([data-theme="dark"]) .fx-snow i { background: #CFE0F0; }
.fx-rain i { width: 1.5px; height: 18px; background: linear-gradient(transparent, color-mix(in srgb, var(--primary) 55%, transparent)); animation-name: fx-rain; }
@keyframes fx-rain { from { transform: translate(0, 0); } to { transform: translate(-40px, 120vh); } }
.fx-confetti i { width: calc(var(--s) * .7); height: var(--s); border-radius: 2px; background: var(--c); opacity: .75; }
.fx-stars i { top: var(--y); border-radius: 50%; background: var(--tiffany); box-shadow: 0 0 6px var(--tiffany); animation: fx-twinkle var(--d) ease-in-out var(--dl) infinite; }
@keyframes fx-twinkle { 50% { opacity: .1; transform: scale(.6); } }
.fx-bubbles i { top: auto; bottom: -10%; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent); background: color-mix(in srgb, var(--sky) 40%, transparent); animation-name: fx-rise; }
@keyframes fx-rise { from { transform: translate(0, 0); } to { transform: translate(var(--sw), -120vh); } }
.fx-fireflies i { top: var(--y); width: 6px; height: 6px; border-radius: 50%; background: #FFE58A; box-shadow: 0 0 10px 3px rgba(255, 214, 102, .55); animation: fx-glow var(--d) ease-in-out var(--dl) infinite; }
@keyframes fx-glow { 0%, 100% { opacity: .1; transform: translate(0, 0); } 50% { opacity: .9; transform: translate(var(--sw), -30px); } }
@media (prefers-reduced-motion: reduce) { #cover-fx { display: none; } }
.cover-ask { position: relative; display: block; height: 96px; border-radius: 16px; overflow: hidden; } /* relative — иначе картинка растягивается на весь экран */

/* «Цвет сайта»: кружки-образцы */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 2px solid transparent; border-radius: 14px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.swatch > span { position: relative; display: block; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), var(--shadow); }
.swatch { min-width: 0; }
.swatch small { max-width: 100%; font-size: 11px; line-height: 1.2; color: var(--muted); text-align: center; overflow-wrap: break-word; } /* длинная подпись переносится, а не вылезает из блока */
.swatch.on { border-color: var(--primary); background: var(--sky); }
.swatch.on small { color: var(--text); font-weight: 700; }
.sw-cover > span .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Украшения: цвет из темы (--fxc) и золотые блёстки для «Люкс» */
.fx-petals i { background: var(--fxc, #F4A9C0); }
.fx-fireflies i { background: var(--fxc, #FFE58A); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--fxc, #FFD666) 55%, transparent); }
.fx-gold i { top: var(--y); width: var(--s); height: var(--s); background: var(--fxc, #D9B66A); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 3px rgba(217, 182, 106, .8)); animation: fx-twinkle var(--d) ease-in-out var(--dl) infinite; }
/* «Мрамор и золото»: золото мягко переливается, по картинке проходит блик */
.cover-art .cv-gold { animation: cv-gold 4s ease-in-out infinite; }
@keyframes cv-gold { 50% { opacity: .65; } }
.cover-art .cv-sweep { animation: cv-sweep 7s ease-in-out infinite; }
@keyframes cv-sweep { 0%, 15% { transform: skewX(-20deg) translateX(0); } 70%, 100% { transform: skewX(-20deg) translateX(1100px); } }
/* Пузырьки в цвете темы, если он задан (шампанское — золотые) */
.fx-bubbles i { border-color: color-mix(in srgb, var(--fxc, var(--primary)) 45%, transparent); background: color-mix(in srgb, var(--fxc, var(--sky)) 30%, transparent); }
/* «Жемчуг»: нитка бус мягко покачивается, подвешена сверху */
.cover-art .cv-swing { transform-box: fill-box; transform-origin: 50% 0; animation: cv-swing 9s ease-in-out infinite alternate; }
@keyframes cv-swing { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
/* Плашка с именем на тёмной обложке — тёмное стекло, белый текст */
.has-cover.cover-dark .profile-id { background: color-mix(in srgb, #0B0F14 42%, transparent); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.has-cover.cover-dark .profile-id .h2, .has-cover.cover-dark .profile-id h1 { color: #fff; }
.has-cover.cover-dark .profile-id .muted { color: rgba(255, 255, 255, .78); }
.has-cover.cover-dark .profile-id .lang-chip, .has-cover.cover-dark .profile-id .pill { color: var(--ink); }
:root[data-theme="dark"] .has-cover.cover-dark .profile-id .lang-chip { color: var(--text); }
/* Вкладки тем в окне выбора обложки */
.cover-cats { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
.cover-cats::-webkit-scrollbar { display: none; }
.cover-cats .chip { flex: none; white-space: nowrap; }
.cover-cats .chip.on { background: var(--cta); color: var(--on-cta); border-color: var(--cta); }
/* «Адмін · усе відкрито» — в цвете темы. --primary в каждой теме подобран так, что белый текст на нём читается (theme.js),
   а в тёмной теме он светлый — там текст тёмный. Светлая обводка отделяет плашку от тёмных обложек */
.pill.pill-admin, .has-cover .profile-id .pill.pill-admin { color: #fff;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 82%, #000));
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .6), 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent); }
:root[data-theme="dark"] .pill.pill-admin, :root[data-theme="dark"] .has-cover .profile-id .pill.pill-admin { color: #0E1A24;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 85%, #fff)); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
/* «Цвет сайта» сворачивается: в строке — текущий цвет, по нажатию раскрывается вся палитра */
.color-pick > summary { list-style: none; cursor: pointer; align-items: center; }
.color-pick > summary::-webkit-details-marker { display: none; }
.color-pick > summary > svg:last-child { flex: none; color: var(--muted); transition: transform .2s ease; }
.color-pick[open] > summary > svg:last-child { transform: rotate(180deg); }
.color-pick[open] > summary { margin-bottom: 10px; }
.sw-cur { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sw-dot { position: relative; display: inline-block; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), var(--shadow); }
.sw-dot-cover .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ——— Новое достижение (ui.js achPop): голографическая карточка, 3D-монета, дождь мотивов темы, маскот ———
   Редкость задаёт цвет монеты: --m1 (светлый) / --m2 (тёмный) */
.ach-pop-wrap { --m1: #FFE9A8; --m2: #E0A92E; position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; overflow: hidden; perspective: 900px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--m2) 25%, transparent), color-mix(in srgb, #0B1620 55%, transparent) 70%);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: ach-fade .25s ease both; }
.ach-pop-wrap.out { animation: ach-fade .35s ease reverse both; }
.tier-bronze { --m1: #F6C9A0; --m2: #B8693A; }
.tier-silver { --m1: #F4F7FA; --m2: #9AA6B4; }
.tier-gold { --m1: #FFE9A8; --m2: #E0A92E; }
.tier-diamond { --m1: #E6FBFF; --m2: #59C8DD; }
/* дождь: мотивы темы (бантики, цветы…) или цветные кусочки конфетти */
.ach-rain { position: absolute; inset: 0; pointer-events: none; }
.ach-rain i { position: absolute; left: var(--x); top: -40px; width: var(--s); height: calc(var(--s) * .6); border-radius: 3px; background: var(--c);
  animation: ach-rain var(--du) cubic-bezier(.3, .6, .5, 1) var(--dl) both; }
.ach-rain i.orn { height: var(--s); border-radius: 0; background: var(--orn) center / contain no-repeat; }
@keyframes ach-rain { 0% { transform: translateY(0) rotate(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(110vh) rotate(var(--r)); opacity: .9; } }
/* карточка: наклон за мышкой (--rx/--ry) и голографический блик (--mx) */
.ach-pop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(350px, 100%); padding: 28px 24px 22px; border-radius: 30px; text-align: center; overflow: visible;
  background: var(--surface); color: var(--text); transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .15s ease-out;
  box-shadow: 0 30px 70px rgba(8, 20, 32, .4), 0 0 0 2px color-mix(in srgb, var(--m2) 55%, transparent), 0 0 40px color-mix(in srgb, var(--m2) 35%, transparent);
  animation: ach-in .7s cubic-bezier(.2, 1.4, .35, 1) both; }
.ach-holo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: soft-light; opacity: .9;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .55) 35%, rgba(120, 220, 255, .55) 45%, rgba(255, 240, 140, .55) 55%, rgba(160, 255, 190, .5) 65%, transparent 80%);
  background-size: 250% 100%; background-position: var(--mx, 0%) 0; animation: ach-holo 3.5s ease-in-out infinite alternate; }
@keyframes ach-holo { from { background-position: 0% 0; } to { background-position: 100% 0; } }
/* 3D-монета: крутится и встаёт лицом; на обороте — DY */
.ach-coin { position: relative; width: 96px; height: 96px; margin: 4px 0 10px; transform-style: preserve-3d; animation: ach-coin 1.6s cubic-bezier(.2, .8, .3, 1) .1s both; }
.coin-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 32% 28%, #fff 0 12%, var(--m1) 35%, var(--m2) 100%);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--m2) 70%, #000 10%), inset 0 -6px 12px rgba(0, 0, 0, .18), 0 10px 24px color-mix(in srgb, var(--m2) 50%, transparent); color: #3A2A08; }
.coin-face.back { transform: rotateY(180deg); font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.05em; }
.tier-silver .coin-face, .tier-diamond .coin-face { color: #1B2A3A; }
.tier-diamond .coin-face { background: conic-gradient(from 30deg, #E6FBFF, #9FE8F0, #F6D8FF, #C8F7FF, #E6FBFF); }
@keyframes ach-coin { 0% { transform: translateY(-40px) rotateY(0) scale(.4); } 60% { transform: translateY(0) rotateY(900deg) scale(1.1); } 100% { transform: rotateY(1080deg) scale(1); } }
.ach-pop small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.ach-tier { color: color-mix(in srgb, var(--m2) 80%, #000 20%); }
:root[data-theme="dark"] .ach-tier { color: var(--m1); }
.ach-pop > b { font-family: var(--display); font-size: 25px; line-height: 1.2; }
.ach-pop-hint { font-size: 14px; color: var(--muted); }
.ach-pop .btn { margin-top: 10px; min-width: 170px; position: relative; z-index: 1; }
/* маскот DY выглядывает снизу слева */
.ach-buddy { position: absolute; right: -30px; top: -48px; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 2px; z-index: 2; animation: ach-buddy .6s cubic-bezier(.2, 1.6, .4, 1) .9s both; }
.ach-say { margin-bottom: 34px; padding: 6px 10px; border-radius: 12px 12px 3px 12px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 800; box-shadow: var(--shadow); white-space: nowrap; }
@keyframes ach-buddy { from { opacity: 0; transform: translateY(30px) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes ach-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ach-in { from { opacity: 0; transform: scale(.6) rotateX(30deg) translateY(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .ach-buddy { right: -6px; top: -54px; } }
/* вспышка света в момент появления */
.ach-flash { position: absolute; left: 50%; top: 45%; width: 20px; height: 20px; margin: -10px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff, color-mix(in srgb, var(--m1) 80%, transparent) 40%, transparent 70%); animation: ach-flash .9s ease-out both; }
@keyframes ach-flash { 0% { transform: scale(0); opacity: 1; } 60% { opacity: .85; } 100% { transform: scale(90); opacity: 0; } }
/* рубашка карточки с узором DY: видна, пока карточка разворачивается */
.ach-pop { animation: ach-flip .9s cubic-bezier(.2, 1.2, .35, 1) backwards; } /* backwards: после появления работает наклон за мышкой */
@keyframes ach-flip { 0% { opacity: 0; transform: scale(.5) rotateY(180deg); } 40% { opacity: 1; } 100% { transform: rotateY(0) scale(1); } }
.ach-back { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: repeating-linear-gradient(45deg, var(--m2) 0 10px, color-mix(in srgb, var(--m2) 75%, #000) 10px 20px); box-shadow: inset 0 0 0 6px var(--m1); }
.ach-back b { font-family: var(--display); font-size: 64px; color: var(--m1); text-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.ach-pop > :not(.ach-back) { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* блик по монете, когда она остановилась */
.coin-face.front { overflow: hidden; }
.coin-face.front::after { content: ''; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%); transform: translateX(-120%); animation: ach-glint 1s ease-in-out 1.8s both; }
@keyframes ach-glint { to { transform: translateX(120%); } }
/* прогресс и следующая цель */
.ach-prog { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ach-prog i { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ach-prog em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--m2), var(--m1)); animation: ach-bar 1.2s ease-out 1s both; transform-origin: left; }
@keyframes ach-bar { from { transform: scaleX(0); } }
.ach-next { font-size: 13px; color: var(--muted); }
.ach-next b { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .ach-pop, .ach-coin, .ach-buddy, .ach-pop-wrap, .ach-holo, .ach-flash, .ach-prog em, .coin-face.front::after { animation: none; } .ach-rain, .ach-flash { display: none; } }

/* Вопрос «Нагадувати на пошту?» на главной и строка в настройках */
.remind-ask { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1.5px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.remind-ask p { margin: 2px 0 0; }
.remind-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--sky); color: var(--primary); }
.remind-btns { display: flex; gap: 8px; margin-left: auto; }
.remind-row { justify-content: space-between; align-items: center; }
.remind-row select { min-height: 36px; width: auto; padding: 0 10px; font-size: 14px; border-radius: 10px; }
.switch-btn { border: none; background: none; padding: 0; cursor: pointer; }
@media (max-width: 560px) { .remind-btns { width: 100%; } .remind-btns .btn { flex: 1; } }

/* ——— Мотив темы (бантик, цветок, снежинка…), theme.js → --orn ———
   1) значок у заголовков разделов и у названия в шапке страницы — чёткий, слегка покачивается;
   2) в шапке справа — три маленьких значка, рассыпанных как конфетти (за текстом) */
:root[data-cover-theme]:not([data-cover-theme=""]) :is(.section-title, .map-title, .hh-title)::after {
  content: ''; display: inline-block; width: 1.15em; height: 1.15em; margin-left: .35em; vertical-align: -.18em;
  background: var(--orn) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); animation: orn-wiggle 4s ease-in-out infinite; transform-origin: 50% 80%; }
:root[data-cover-theme]:not([data-cover-theme=""]) :is(.map-title, .hh-title)::after { width: .9em; height: .9em; }
@keyframes orn-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-1px); } }
:root[data-cover-theme]:not([data-cover-theme=""]) :is(.home-hero, .map-hero, .pd-hero)::before {
  content: ''; position: absolute; inset: 0 0 0 55%; z-index: 0; pointer-events: none; opacity: .5;
  background: var(--orn) 88% 16% / 30px no-repeat, var(--orn) 68% 78% / 18px no-repeat, var(--orn) 97% 88% / 22px no-repeat; }
:root[data-cover-theme]:not([data-cover-theme=""]) .map-hero > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { :root[data-cover-theme] :is(.section-title, .map-title, .hh-title)::after { animation: none; } }
.remind-times { gap: 8px; padding-top: 0; }
.remind-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.remind-pick .pick small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Кнопка «Налаштування» в профиле и отдельный экран настроек */
.settings-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); transition: transform .15s ease; }
.settings-link:hover { transform: translateY(-2px); }
.settings-link b { display: block; font-family: var(--display); font-size: 17px; }
.settings-link small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.settings-link-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--hero-b), var(--hero-c)); box-shadow: var(--shadow); }
.settings-link > svg:last-child { flex: none; color: var(--muted); }
.settings-page { padding-bottom: 24px; }
.set-cover-thumb { position: relative; flex: none; width: 72px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.set-cover-thumb .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Тексты для чтения с репликами: имя говорящего слева, реплика с отступом */
.rd-dialogue { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.rd-line { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: baseline; margin: 0 !important; }
.rd-who { font-weight: 800; font-size: .88em; color: var(--primary); overflow-wrap: anywhere; }
.rd-line + .lat-block { margin: -6px 0 0 86px; }
@media (max-width: 480px) { .rd-line { grid-template-columns: 1fr; gap: 0; } .rd-line + .lat-block { margin-left: 0; } }
/* Карточка «Налаштування» в профиле нужна только на телефоне: на компьютере настройки есть в боковом меню */
@media (min-width: 900px) { .settings-link { display: none; } }
/* Достижения в профиле — на всю ширину под двумя колонками */
.ach-wide .ach-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

/* ——— «Основи»: алфавит и числа (basics.js) ——— */
.basics-ring { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 3px solid var(--tiffany); font-family: var(--display); font-size: 24px; font-weight: 800; color: #fff; flex: none; }
.basics-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.basics-note { margin: 0; line-height: 1.5; background: var(--sky); color: var(--ink); }
.abc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.abc-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; border: 2px solid transparent; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: inherit; cursor: pointer; transition: transform .12s ease; }
.abc-tile:hover { transform: translateY(-2px); }
.abc-tile b { font-family: var(--display); font-size: 24px; line-height: 1.1; }
.abc-tile small { font-size: 11px; color: var(--muted); }
.abc-tile.on { border-color: var(--primary); background: var(--sky); }
.abc-tile.right { border-color: var(--ok); background: var(--ok-bg); }
.abc-tile.wrong { border-color: var(--bad); background: var(--bad-bg); }
.abc-focus { display: flex; align-items: center; gap: 18px; }
.abc-big { flex: none; display: grid; place-items: center; width: 96px; height: 96px; border: none; border-radius: 24px; cursor: pointer;
  background: linear-gradient(135deg, var(--hero-b), var(--hero-c)); color: #fff; font-family: var(--display); font-size: 40px; font-weight: 800; box-shadow: var(--shadow); }
.abc-ex { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 8px 12px; border: none; border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.num-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: none; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.num-tile b { font-family: var(--display); font-size: 20px; color: var(--primary); }
.num-tile small { font-size: 13px; overflow-wrap: anywhere; }
.play-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.play-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.play-card b { font-family: var(--display); font-size: 17px; }
.play-card small { color: var(--muted); }
.play-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--sky); color: var(--primary); }
.play-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.play-listen { align-self: center; }
.play-num input { text-align: center; font-size: 22px; font-weight: 700; }
@media (max-width: 480px) { .abc-focus { flex-direction: column; text-align: center; align-items: center; } .abc-ex { align-self: center; } }

/* Медали в профиле — в цвете редкости */
.ach.on.tier-bronze .ach-medal { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #B8693A; }
.ach.on.tier-silver .ach-medal { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #9AA6B4; }
.ach.on.tier-gold .ach-medal { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #E0A92E; }
.ach.on.tier-diamond .ach-medal { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #59C8DD, 0 0 12px #9FE8F0; }
/* Число по частям: en · og · tyve с подписями 1 · і · 20 */
.num-build { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.num-split { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border: none; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ns-n { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1; }
.ns-parts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.ns-p { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 12px; }
.ns-p b { font-size: 17px; }
.ns-p small { font-size: 12px; font-weight: 800; color: var(--muted); }
.ns-c0 { background: color-mix(in srgb, var(--tiffany) 35%, var(--surface)); }
.ns-c1 { background: color-mix(in srgb, #F2C14E 35%, var(--surface)); }
.ns-c2 { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.ns-and { background: var(--surface-2); font-style: italic; }
.ns-dash { background: none; padding: 6px 0; }
.ns-word { font-size: 13px; color: var(--muted); }
/* Длинные числа (1 000 000) — помельче, и ничего не вылезает за плашку */
.num-tile { min-width: 0; overflow: hidden; }
.num-tile b { max-width: 100%; overflow-wrap: anywhere; }
.num-tile.num-long { grid-column: span 2; } /* миллион — на две ячейки, чтобы поместился целиком */
/* Карточка выбранного числа */
.num-focus { position: relative; display: flex; flex-direction: column; gap: 12px; border: 1.5px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.num-focus-x { position: absolute; top: 10px; right: 10px; }
.num-focus-top { display: flex; align-items: center; gap: 16px; }
.num-focus-n { flex: none; display: grid; place-items: center; min-width: 96px; height: 96px; padding: 0 12px; border-radius: 24px; color: #fff; font-family: var(--display); font-size: 34px; font-weight: 800;
  background: linear-gradient(135deg, var(--hero-b), var(--hero-c)); box-shadow: var(--shadow); }
.num-focus-w { font-family: var(--display); font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; padding-right: 30px; }
.num-focus-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--sky); color: var(--ink); line-height: 1.5; }
.num-tile.on { outline: 2px solid var(--primary); background: var(--sky); }
@media (max-width: 480px) { .num-focus-top { flex-direction: column; align-items: flex-start; } }

/* ——— Идиомы (idioms.js) ——— */
.idiom-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.idiom-filter::-webkit-scrollbar { display: none; }
.idiom-filter .chip { flex: none; }
.idiom-filter .chip.on { background: var(--cta); color: var(--on-cta); border-color: var(--cta); }
.idiom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.idiom { display: flex; flex-direction: column; gap: 8px; }
.idiom-meta { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.idiom-i { font-family: var(--display); font-size: 19px; line-height: 1.25; }
.idiom-lit { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.idiom-mean { margin: 0; font-size: 15px; line-height: 1.45; }
.idiom-eq { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--sky); color: var(--ink); font-size: 14px; }
.idiom-ex summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--primary); }
.idiom-ex p { margin: 6px 0 0; }
.idiom .btn { align-self: flex-start; margin-top: auto; }
.idiom-quiz { border: 1.5px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.idiom-quiz .idiom-i { font-size: 24px; }

/* ——— Обложки «Приключения» ——— */
/* Флаг развевается: крепится к древку слева */
.cover-art .cv-flag { transform-box: fill-box; transform-origin: 0 50%; animation: cv-flag 2.4s ease-in-out infinite alternate; }
@keyframes cv-flag { from { transform: skewY(-5deg) scaleX(.95); } to { transform: skewY(5deg) scaleX(1); } }
/* Луч маяка поворачивается: сжимается к лампе и раскрывается в другую сторону */
.cover-art .cv-beam { transform-box: fill-box; transform-origin: 0 50%; animation: cv-beam 9s linear infinite; }
@keyframes cv-beam { 0%, 100% { transform: scaleX(1); } 12.5% { transform: scaleX(.7); } 25% { transform: scaleX(0); } 37.5% { transform: scaleX(-.7); } 50% { transform: scaleX(-1); } 62.5% { transform: scaleX(-.7); } 75% { transform: scaleX(0); } 87.5% { transform: scaleX(.7); } }
/* Редкая неяркая вспышка молнии */
.cover-art .cv-flash { animation: cv-flash 11s linear infinite; }
@keyframes cv-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: .55; } 88% { opacity: .1; } 89.5% { opacity: .4; } 92% { opacity: 0; } }
/* Искры костра поднимаются и гаснут; --dx — куда их сносит */
.cover-art .cv-spark { animation: cv-spark 3s ease-out infinite; }
@keyframes cv-spark { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx, 0px), -80px); opacity: 0; } }

/* Подсказка произношения «🗣 Звучит как …» (ui.js sayHint) */
.say-hint { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: var(--sky); color: var(--ink); font-size: 13px; }
.say-hint b { font-weight: 800; }
.say-hint.small { font-size: 11.5px; padding: 2px 8px; align-self: flex-start; }
.slow-btn { font-size: 16px; }

/* Выбор языка интерфейса на входе: один блок, раскрывается списком (auth.js) */
.ui-pick { position: relative; }
.ui-pick summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 14px; box-shadow: 0 2px 10px rgb(0 0 0 / .05); }
.ui-pick summary::-webkit-details-marker { display: none; }
.ui-pick-caret { color: var(--muted); font-size: 11px; transition: transform .2s; }
.ui-pick[open] .ui-pick-caret { transform: rotate(180deg); }
.ui-pick-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 180px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 34px rgb(0 0 0 / .14); display: grid; gap: 2px; animation: ui-pick-in .16s ease-out; }
.ui-pick-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ui-pick-menu button:hover, .ui-pick-menu button[aria-selected="true"] { background: var(--sky); }
.ui-pick-ok { margin-left: auto; color: var(--primary); font-weight: 800; }
@keyframes ui-pick-in { from { opacity: 0; transform: translateY(-4px); } }
.auth-top { position: relative; z-index: 40; }
.ui-pick-menu, .ui-pick summary { background: var(--surface); }

/* ——— Экскурсия по сайту (tour.js) ——— */
@property --tour-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.tour { position: fixed; inset: 0; z-index: 200; }
.tour.centered, .tour-ask { display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--primary) 30%, rgb(10 18 30 / .55)), rgb(8 14 24 / .72)); backdrop-filter: blur(6px) saturate(1.2); animation: tour-fade .3s ease-out; }
.tour-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgb(8 14 24 / .66); transition: all .45s cubic-bezier(.25,.9,.3,1.05); pointer-events: none; }
/* Переливающаяся рамка вокруг пункта + мягкое свечение */
.tour-hole::before { content: ''; position: absolute; inset: -4px; border-radius: 19px; padding: 3px; background: conic-gradient(from var(--tour-a), var(--primary), #FFD166, var(--hero-c, #FF7AA2), #5ED3C4, var(--primary)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: tour-spin 3s linear infinite; }
.tour-hole::after { content: ''; position: absolute; inset: -10px; border-radius: 24px; box-shadow: 0 0 34px 6px color-mix(in srgb, var(--primary) 55%, transparent); animation: tour-pulse 1.8s ease-in-out infinite; }
.tour.centered .tour-hole { display: none; }

.tour-card { position: fixed; max-width: 380px; border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / .35), 0 0 0 1px rgb(255 255 255 / .08); transition: left .45s cubic-bezier(.25,.9,.3,1.05), top .45s cubic-bezier(.25,.9,.3,1.05); animation: tour-pop .4s cubic-bezier(.3,1.5,.5,1); }
.tour.centered .tour-card { position: relative; width: min(390px, 100%); }
/* Стрелка-уголок к подсвеченному пункту */
.tour-card.arrow-left::after, .tour-card.arrow-down::after, .tour-card.arrow-up::after { content: ''; position: absolute; width: 16px; height: 16px; background: var(--surface); transform: rotate(45deg); border-radius: 3px; }
.tour-card.arrow-left::after { left: -7px; top: calc(var(--ay) - 8px); }
.tour-card.arrow-down::after { bottom: -7px; left: calc(var(--ax) - 8px); }
.tour-card.arrow-up::after { top: -7px; left: calc(var(--ax) - 8px); background: var(--hero-a, var(--primary)); }

.tour-band { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-radius: 24px 24px 0 0; color: #fff; overflow: hidden; background: linear-gradient(125deg, var(--hero-a, #5B4BDB), var(--hero-b, var(--hero-a, #7C5CFF)) 55%, var(--hero-c, #FF7AA2)); }
.tour-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% -20%, rgb(255 255 255 / .35), transparent 55%), radial-gradient(circle at 0% 120%, rgb(255 255 255 / .18), transparent 50%); pointer-events: none; }
.tour-ic { position: relative; flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; font-size: 26px; background: rgb(255 255 255 / .22); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35), 0 6px 16px rgb(0 0 0 / .15); backdrop-filter: blur(4px); animation: tour-ic .6s cubic-bezier(.3,1.6,.5,1); }
.tour-count { position: relative; display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.tour-title { position: relative; display: block; font-family: var(--display, inherit); font-size: 19px; line-height: 1.2; text-shadow: 0 1px 8px rgb(0 0 0 / .18); }
.tour-mascot { position: relative; flex: none; margin: -6px -4px -10px 0; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .2)); }
.tour-body { padding: 14px 18px 16px; }
.tour-text { margin: 0 0 14px; font-size: 15px; line-height: 1.55; }
.tour-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.tour-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hero-a, var(--primary)), var(--hero-c, var(--primary))); box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 60%, transparent); transition: width .5s cubic-bezier(.3,.9,.3,1); }
.tour-btns { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 4px; }
.tour-skip:hover { color: var(--ink); text-decoration: underline; }
.tour-next { box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 40%, transparent); }

/* Приглашение */
.tour-invite { text-align: center; overflow: hidden; }
.tour-invite-top { position: relative; height: 150px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--hero-a, #5B4BDB), var(--hero-b, #7C5CFF) 50%, var(--hero-c, #FF7AA2)); }
.tour-invite-top::after { content: ''; position: absolute; inset: auto 0 -1px; height: 34px; background: var(--surface); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.tour-invite-art { position: relative; z-index: 1; margin-top: 6px; filter: drop-shadow(0 12px 18px rgb(0 0 0 / .25)); }
.tour-invite-art::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .45), transparent 65%); animation: tour-pulse 2.4s ease-in-out infinite; z-index: -1; }
.tour-orb { position: absolute; border-radius: 50%; background: rgb(255 255 255 / .16); }
.tour-orb.o1 { width: 120px; height: 120px; left: -30px; top: -40px; } .tour-orb.o2 { width: 80px; height: 80px; right: -14px; top: 30px; } .tour-orb.o3 { width: 40px; height: 40px; left: 24%; bottom: 30px; }
.tour-spark { position: absolute; z-index: 1; font-size: 20px; animation: tour-twinkle 2.2s ease-in-out infinite; }
.tour-spark.s1 { left: 22%; top: 22px; } .tour-spark.s2 { right: 24%; top: 16px; animation-delay: .5s; } .tour-spark.s3 { right: 18%; bottom: 44px; animation-delay: 1s; } .tour-spark.s4 { left: 16%; bottom: 52px; font-size: 14px; animation-delay: 1.5s; }
.tour-invite .tour-body { padding: 4px 22px 18px; }
.tour-invite .tour-count { color: var(--primary); opacity: 1; }
.tour-invite .tour-title { font-size: 25px; margin: 4px 0 8px; text-shadow: none; }
.tour-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 16px; }
.tour-chips span { padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--sky); }
.tour-go { width: 100%; padding-block: 13px; font-size: 16px; box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 45%, transparent); animation: tour-glow 2.2s ease-in-out infinite; }
.tour-later { display: block; margin: 8px auto 0; }

/* Конфетти */
.tour-confetti { position: fixed; inset: 0; z-index: 260; pointer-events: none; overflow: hidden; }
.tour-confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: tour-fall linear forwards; }
.tour-confetti i:nth-child(3n) { width: 10px; height: 10px; border-radius: 50%; }

@keyframes tour-fade { from { opacity: 0; } }
@keyframes tour-pop { from { opacity: 0; transform: scale(.9) translateY(12px); } }
@keyframes tour-ic { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
@keyframes tour-spin { to { --tour-a: 360deg; } }
@keyframes tour-pulse { 50% { opacity: .45; transform: scale(1.04); } }
@keyframes tour-twinkle { 50% { transform: scale(1.4) rotate(18deg); opacity: .55; } }
@keyframes tour-glow { 50% { box-shadow: 0 12px 34px color-mix(in srgb, var(--primary) 65%, transparent); } }
@keyframes tour-fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .tour *, .tour { animation: none !important; transition: none !important; } }
.tour-card button { user-select: none; }

/* ——— Телефон: компактнее и без повторов ——— */
@media (max-width: 899px) {
  /* «Практика» на главной повторяет вкладку внизу */
  .home-quick { display: none !important; }
  /* Цифры профиля — 4 маленькие плитки в один ряд */
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stat-tile { align-items: center; text-align: center; gap: 1px; padding: 9px 4px 8px; border-radius: 14px; }
  .stat-tile > svg { width: 17px; height: 17px; }
  /* огонёк — многослойный, его не сжимаем до значка: чуть крупнее и с собственным размером */
  .stat-tile .fire { width: 22px !important; height: 22px !important; margin: -3px 0 -1px; }
  .stat-tile b { font-size: 18px; }
  .stat-tile span { font-size: 10px; line-height: 1.2; }
  /* Достижения: сначала 4, остальные — по кнопке */
  .ach-wide:not(.open) .ach-more { display: none; }
}
.ach-toggle { display: none; }
@media (max-width: 899px) {
  .ach-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px; border: 1px dashed var(--line); border-radius: 14px; background: none; color: var(--primary); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
  .ach-toggle svg { transform: rotate(90deg); transition: transform .2s; }
  .ach-wide.open .ach-toggle svg { transform: rotate(-90deg); }
  .ach-toggle span:nth-child(2), .ach-wide.open .ach-toggle span:first-child { display: none; }
  .ach-wide.open .ach-toggle span:nth-child(2) { display: inline; }
  .profile > [data-logout] { width: 100%; margin-top: 8px; }
}

/* ——— Длина занятия: две карточки со скользящей плашкой (ui.js timePick) ——— */
.tpick { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 5px; border-radius: 20px; isolation: isolate; }
.tpick-thumb { position: absolute; z-index: -1; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 15px; transition: transform .42s cubic-bezier(.3,1.35,.5,1), background .3s; }
.tpick.at-20 .tpick-thumb { transform: translateX(100%); }
.tpick button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; padding: 10px 8px; border: 0; border-radius: 15px; background: none; font: inherit; cursor: pointer; text-align: left; transition: color .25s; }
.tpick-ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; font-size: 18px; transition: transform .35s cubic-bezier(.3,1.6,.5,1), background .25s; }
.tpick button.on .tpick-ic { transform: scale(1.12) rotate(-6deg); }
.tpick-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tpick-t b { font-family: var(--display); font-size: 15px; white-space: nowrap; }
.tpick-t small { font-size: 11.5px; opacity: .75; }
.tpick button:active .tpick-ic { transform: scale(.9); }

/* На тёмном блоке главной — стекло */
.tpick-hero { background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.tpick-hero .tpick-thumb { background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .86)); box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255, 255, 255, .6); }
.tpick-hero button { color: rgba(255, 255, 255, .82); }
.tpick-hero button.on { color: var(--hero-a); }
.tpick-hero .tpick-ic { background: rgba(255, 255, 255, .14); }
.tpick-hero button.on .tpick-ic { background: color-mix(in srgb, var(--hero-c, var(--primary)) 22%, #fff); }

/* На светлой карточке профиля */
.tpick-card { background: var(--surface-2); }
.tpick-card .tpick-thumb { background: linear-gradient(135deg, var(--hero-a, var(--primary)), var(--hero-c, var(--primary))); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent); }
.tpick-card button { color: var(--text); }
.tpick-card button.on { color: #fff; }
.tpick-card .tpick-ic { background: var(--surface); }
.tpick-card button.on .tpick-ic { background: rgba(255, 255, 255, .22); }
.time-card .time-go { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 700; text-decoration: none; }
.hh-actions .tpick { flex: none; min-width: 300px; }
@media (max-width: 899px) { .hh-actions .tpick { align-self: stretch; min-width: 0; } }
@media (prefers-reduced-motion: reduce) { .tpick-thumb, .tpick-ic { transition: none; } }

/* ——— Разговор с ИИ (views/chat.js) ——— */
.chat-ring { font-size: 30px; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.scene { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.scene:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 18%, transparent); }
.scene b { font-size: 15px; }
.scene small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.scene-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-size: 24px; margin-bottom: 4px; background: linear-gradient(135deg, color-mix(in srgb, var(--hero-a, var(--primary)) 18%, var(--surface)), color-mix(in srgb, var(--hero-c, var(--primary)) 22%, var(--surface))); }
.scene-ic.sm { width: 38px; height: 38px; font-size: 20px; margin: 0; flex: none; }

.chat-live { display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - 140px); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: sticky; top: 8px; z-index: 5; }
.chat-head small { display: block; }
.chat-left { min-width: 34px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; background: var(--sky); color: var(--primary); font-weight: 800; font-size: 13px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.cmsg { max-width: 84%; padding: 11px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.45; animation: bubble-in .3s cubic-bezier(.3,1.4,.5,1); }
.cmsg p { margin: 0; }
.cmsg.ai { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.cmsg.me { align-self: flex-end; color: #fff; border-bottom-right-radius: 6px; background: linear-gradient(135deg, var(--hero-a, var(--primary)), var(--hero-c, var(--primary))); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 28%, transparent); }
.cmsg-tools { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cmsg-tools .icon-btn { width: 32px; height: 32px; }
.cmsg-tr-btn { border: 0; background: var(--sky); color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 99px; cursor: pointer; }
.cmsg-tr { margin-top: 6px !important; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); }
.cmsg-fix { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .2); font-size: 13.5px; line-height: 1.35; }
.cmsg-fix span { opacity: .85; }
.cmsg-fix small { display: block; margin-top: 3px; opacity: .85; font-size: 12px; }
.cmsg.typing { display: flex; gap: 5px; padding: 15px 16px; }
.cmsg.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.cmsg.typing i:nth-child(2) { animation-delay: .15s; } .cmsg.typing i:nth-child(3) { animation-delay: .3s; }
.chat-input { position: sticky; bottom: 8px; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 22px; }
.chat-input input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); padding: 8px 6px; outline: none; }
.chat-send { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.chat-mic.rec { color: #fff; background: #E0414F; animation: mic-pulse 1.1s ease-in-out infinite; }
@media (max-width: 899px) { .chat-input { bottom: calc(72px + env(safe-area-inset-bottom)); } .chat-head { top: 4px; } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 9px rgba(224, 65, 79, .18); } }
.scene-own { border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, var(--line)); }
.scene-own .scene-ic { margin: 0; flex: none; }
.chat-head b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .grow { min-width: 0; }
.scene-own input { min-width: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.scene-own input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }

/* ——— Lingly AI: отдельная кнопка в боковом меню и вкладка в центре нижней панели ——— */
@property --ai-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.side-ai { position: relative; display: flex; align-items: center; gap: 11px; margin: 2px 0 12px; padding: 10px 12px; border-radius: 16px; color: var(--text) !important; text-decoration: none;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ai-a), var(--hero-a, #5B4BDB), var(--hero-c, #FF7AA2), #FFD166, #5ED3C4, var(--hero-a, #5B4BDB)) border-box;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--hero-a, var(--primary)) 16%, transparent);
  animation: ai-spin 6s linear infinite; transition: transform .2s, box-shadow .2s; }
.side-ai:hover { transform: translateY(-1px); box-shadow: 0 10px 26px color-mix(in srgb, var(--hero-a, var(--primary)) 26%, transparent); }
.side-ai.active { background: linear-gradient(color-mix(in srgb, var(--hero-a, var(--primary)) 9%, var(--surface)), color-mix(in srgb, var(--hero-a, var(--primary)) 9%, var(--surface))) padding-box, conic-gradient(from var(--ai-a), var(--hero-a, #5B4BDB), var(--hero-c, #FF7AA2), #FFD166, #5ED3C4, var(--hero-a, #5B4BDB)) border-box; }
.ai-orb { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(from var(--ai-a), var(--hero-a, #5B4BDB), var(--hero-c, #FF7AA2), #FFD166, #5ED3C4, var(--hero-a, #5B4BDB));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--hero-c, var(--primary)) 40%, transparent); animation: ai-spin 6s linear infinite; }
.ai-orb::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 55%), color-mix(in srgb, var(--hero-a, #4B3BC9) 80%, #000); }
.ai-orb svg { position: relative; width: 19px; height: 19px; fill: #fff; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .7)); animation: ai-twinkle 2.6s ease-in-out infinite; }
.ai-name { display: block; font-family: var(--display); font-size: 15.5px; line-height: 1.15; background: linear-gradient(90deg, var(--hero-a, var(--primary)), var(--hero-c, var(--primary))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-ai small { display: block; font-size: 11.5px; color: var(--muted); }
.ai-new { flex: none; padding: 3px 7px; border-radius: 99px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: #fff; background: linear-gradient(90deg, var(--hero-a, var(--primary)), var(--hero-c, var(--primary))); }
@keyframes ai-spin { to { --ai-a: 360deg; } }
@keyframes ai-twinkle { 50% { transform: scale(.82) rotate(12deg); opacity: .85; } }
:root[data-theme="dark"] .ai-name { background: linear-gradient(90deg, color-mix(in srgb, var(--hero-a, var(--primary)) 45%, #fff), color-mix(in srgb, var(--hero-c, var(--primary)) 55%, #fff)); -webkit-background-clip: text; background-clip: text; }
@media (prefers-reduced-motion: reduce) { .side-ai, .ai-orb, .ai-orb svg { animation: none; } }
/* Вкладка AI в нижней панели — круглая яркая кнопка */
.bottomnav a.bn-ai { position: relative; }
.bottomnav a.bn-ai svg { box-sizing: content-box; padding: 9px; margin-top: -18px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--hero-a, #4B3BC9), var(--hero-c, #FF7AA2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--hero-a, var(--primary)) 45%, transparent), 0 0 0 4px var(--surface); }
.bottomnav a.bn-ai.active svg { box-shadow: 0 6px 16px color-mix(in srgb, var(--hero-a, var(--primary)) 55%, transparent), 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in srgb, var(--hero-c, var(--primary)) 50%, transparent); }
.scene-study { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: 20px; color: #fff; font: inherit; text-align: left; cursor: pointer; overflow: hidden; background: linear-gradient(120deg, var(--hero-a, #4B3BC9), var(--hero-b, #7C5CFF) 55%, var(--hero-c, #FF7AA2)); box-shadow: 0 10px 26px color-mix(in srgb, var(--hero-a, var(--primary)) 35%, transparent); transition: transform .2s; }
.scene-study:hover { transform: translateY(-2px); }
.scene-study .scene-ic { margin: 0; flex: none; background: rgba(255, 255, 255, .2); }
.scene-study b { display: block; font-family: var(--display); font-size: 17px; }
.scene-study small { display: block; font-size: 12.5px; opacity: .88; line-height: 1.35; margin-top: 2px; }
.side-ai .grow { min-width: 0; } .side-ai small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Кнопка озвучки, пока живой голос готовится */
.speak-load { position: relative; pointer-events: none; }
.speak-load::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid transparent; border-top-color: var(--primary); border-right-color: var(--primary); animation: speak-spin .7s linear infinite; }
@keyframes speak-spin { to { transform: rotate(360deg); } }

/* iPhone (Safari): в прокручиваемом списке обложки сжимались в тонкие полоски — запрещаем сжатие */
.cover-grid { grid-auto-rows: max-content; align-content: start; }
.cover-opt { flex-shrink: 0; min-height: max-content; }
.cover-opt .cover-thumb { flex: none; min-height: 64px; }
/* Safari (iPhone) иногда показывает изнанку сквозь лицевую сторону — рубашка исчезает к середине разворота */
.ach-back { animation: ach-back-hide .9s linear forwards; pointer-events: none; }
@keyframes ach-back-hide { 0%, 32% { opacity: 1; } 42%, 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .ach-back { display: none; } }
/* Safari (iPhone) сплющивает 3D монеты — когда монета остановилась, обратная сторона прячется */
.coin-face.back { animation: coin-back-hide 1.75s step-end forwards; }
@keyframes coin-back-hide { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .coin-face.back { display: none; } }

.cover-opt .cover-thumb img.cover-art { object-fit: cover; }
.cover-opt { isolation: isolate; }
