/*
  KOTONOHA · дизайн-система.

  Тёмная тема — основная. Светлая (washi) сохранена как альтернатива и
  включается атрибутом data-theme="light" на <html> (переключатель в шапке).
  Все компоненты используют семантические токены, поэтому тема меняется
  целиком, без переопределений «на местах».
*/

/* Токены */
:root {
  color-scheme: dark;

  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface-2: #242434;
  --surface-3: #2e2e42;
  --accent: #e84855;        /* вермильон 朱 — основной акцент */
  --accent-deep: #c9313d;
  --accent-2: #f5a623;      /* золото 金 — достижения и награды */
  --teal: #4ecdc4;
  --violet: #7b6ef6;
  --green: #2f9e6b;
  --green-soft: #1a4a2a;

  --text: #f0f0f8;
  --text-muted: #8888aa;
  --text-dim: #6a6a88;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 6px 20px rgba(232, 72, 85, 0.35);

  /* Шрифты. Латиница и кириллица — вшитые Golos/Cormorant (см. fonts.css),
     Inter и Noto Sans JP подключаются в index.html и подхватываются здесь. */
  --font-ui: "Inter", "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-display: "Cormorant", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --font-num: var(--font-ui);

  --maxw: 1180px;

  /* Движение */
  --dur-1: 150ms;
  --dur-2: 200ms;
  --dur-3: 300ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --z-base: 0;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-toast: 300;
  --z-particles: 400;
}

/* Светлая тема (washi): те же токены, бумажная палитра. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4ece0;
  --surface: #fbf6ec;
  --surface-2: #efe5d6;
  --surface-3: #e5d9c6;
  --accent: #d7382a;
  --accent-deep: #b32a20;
  --accent-2: #c19a4b;
  --teal: #2b8c86;
  --violet: #5a4bd6;
  --green: #5d6a25;
  --green-soft: #e6ebd2;

  --text: #1c1a17;
  --text-muted: #4a443c;
  --text-dim: #6b6357;
  --border: rgba(28, 26, 23, 0.12);
  --border-strong: rgba(28, 26, 23, 0.24);

  --shadow: 0 18px 40px -24px rgba(28, 26, 23, 0.45);
  --shadow-sm: 0 8px 20px -14px rgba(28, 26, 23, 0.5);
  --shadow-accent: 0 6px 20px rgba(215, 56, 42, 0.28);
}

/* Все числовые значения интерфейса — табличными цифрами. */
.num, .kpi strong, .stat-chip strong, .ach-count, .player-count,
.quiz-meta, .lx-meta, .queue-chip b, .ring-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Японские глифы всегда японским шрифтом. */
.jp, .glyph-jp, .flash-glyph, .quiz-glyph, .kana-cell-char, .kanji-hero,
.brand-hanko, .lx-glyph, .tenet-glyph, .hanko-sm, .section-tate {
  font-family: var(--font-jp);
}

/* Сброс / база */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(232, 72, 85, 0.10), transparent 60%),
    radial-gradient(900px 520px at -8% 18%, rgba(123, 110, 246, 0.09), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700; line-height: 1.15; margin: 0;
  letter-spacing: 0.01em; text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::placeholder { color: var(--text-dim); opacity: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Зерно поверх фона — фактура и на тёмном, и на бумаге. */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
:root[data-theme="light"] .grain { mix-blend-mode: multiply; opacity: 0.5; }

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-hanko {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--accent); color: #fff;
  font-size: 22px; border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), var(--shadow-sm);
  transform: rotate(-2deg);
  transition: transform var(--dur-2) var(--ease);
}
.brand:hover .brand-hanko { transform: rotate(2deg) scale(1.05); }
.brand-text {
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  display: flex; flex-direction: column; white-space: nowrap;
}
.brand-text small {
  font-family: var(--font-ui); font-size: 10px; letter-spacing: 0.28em;
  color: var(--text-muted); margin-top: 3px;
}

/* Основной ряд — максимум четыре пункта, остальное в выпадающем меню. */
.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative; padding: 8px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.drop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; font-size: 14px; font-weight: 500;
}
.caret {
  width: 0; height: 0; flex: none; margin-top: 2px;
  border: 4px solid transparent; border-bottom: 0; border-top-color: currentColor;
  opacity: 0.7; transition: transform var(--dur-2) var(--ease);
}
[aria-expanded="true"] > .caret { transform: rotate(180deg); }

/* Выпадающие меню шапки */
.drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 12px); left: 0; z-index: var(--z-overlay);
  display: flex; flex-direction: column; gap: 2px;
  min-width: 278px; padding: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: dropIn var(--dur-2) var(--ease-out) both;
}
.drop-menu[hidden] { display: none; }
.drop-end { left: auto; right: 0; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } }

.drop-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 11px; background: none;
  color: var(--text); font-size: 14px; text-align: left;
  transition: background var(--dur-1) var(--ease);
}
.drop-item:hover, .drop-item:focus-visible { background: var(--surface-2); }
.drop-item.active { color: var(--accent); }
.drop-item.active .drop-glyph { color: var(--accent); }
.drop-item b { display: block; font-weight: 600; line-height: 1.3; }
.drop-item small { display: block; font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.drop-glyph {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 10px; background: var(--surface-2);
  color: var(--accent-2); font-size: 16px;
}
.drop-item.danger, .drop-item.danger .drop-glyph { color: var(--accent); }
.drop-sep { height: 1px; margin: 5px 10px; border: 0; background: var(--border); }

.topbar-side { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text-muted); font-size: 15px;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); color: var(--accent-2); border-color: var(--border-strong); }
.icon-btn:active { transform: translateY(0) scale(0.95); }
/* Переключатель темы: 日は富士に沈む — солнце садится за Фудзи, восходит луна.
   Позиции светила и цвета переключает тема, поэтому JS ничего не анимирует. */
.theme-switch {
  width: 58px; height: 32px; flex: none; padding: 0;
  border: 0; background: none; border-radius: 999px; line-height: 0;
  transition: transform var(--dur-1) var(--ease);
}
.theme-switch:hover { transform: translateY(-2px); }
.theme-switch:active { transform: translateY(0) scale(0.96); }
.theme-switch svg { display: block; width: 58px; height: 32px; overflow: visible; }

.ts-sky { transition: opacity var(--dur-3) var(--ease); }
.ts-ring { fill: none; stroke: var(--border-strong); stroke-width: 1; }

/* Ночь — база темы приложения. */
.ts-day { opacity: 0; }
.ts-night { opacity: 1; }
.ts-stars circle { fill: #fdfbe8; opacity: 0.85; }
.ts-mount { fill: #33335a; }
.ts-snow { fill: #7b7bb0; }
.ts-disc { fill: #f3d99b; }
.ts-crater { fill: #16162a; opacity: 1; }
.ts-orb { transform: translate(44px, 10px); }

/* День — светило слева, 日の丸 над синей горой. */
:root[data-theme="light"] .ts-day { opacity: 1; }
:root[data-theme="light"] .ts-night { opacity: 0; }
:root[data-theme="light"] .ts-stars { opacity: 0; }
:root[data-theme="light"] .ts-mount { fill: #6f6488; }
:root[data-theme="light"] .ts-snow { fill: #fdf8f0; }
:root[data-theme="light"] .ts-disc { fill: #d7382a; }
:root[data-theme="light"] .ts-crater { opacity: 0; }
:root[data-theme="light"] .ts-orb { transform: translate(14px, 11px); }

/* Светило ныряет за гору — потому переход длиннее смены цветов. */
.ts-orb { transition: transform 620ms var(--ease-out); }
.ts-stars, .ts-crater, .ts-mount, .ts-snow, .ts-disc {
  transition: opacity var(--dur-3) var(--ease), fill var(--dur-3) var(--ease);
}

/* Кнопка аккаунта: дух-проводник, имя, уровень и XP — и она же вход в меню. */
.acct {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 11px 4px 4px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.acct:hover, .acct[aria-expanded="true"] {
  background: var(--surface-2); border-color: var(--border-strong);
}
.acct-hanko {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 999px; font-size: 15px;
  background: color-mix(in srgb, var(--accent-2) 22%, transparent); color: var(--accent-2);
}
.acct-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.acct-meta b {
  font-size: 13px; font-weight: 600; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-meta small { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Мобильное меню */
.burger { display: none; }
.burger-ico, .burger-ico::before, .burger-ico::after {
  width: 16px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--dur-2) var(--ease), background var(--dur-1) var(--ease);
}
.burger-ico { position: relative; }
.burger-ico::before, .burger-ico::after { content: ""; position: absolute; left: 0; top: 0; }
.burger-ico::before { transform: translateY(-5px); }
.burger-ico::after { transform: translateY(5px); }
.burger-ico.x { background: transparent; }
.burger-ico.x::before { transform: rotate(45deg); }
.burger-ico.x::after { transform: rotate(-45deg); }

.drawer {
  position: absolute; top: 100%; left: 0; right: 0; z-index: var(--z-overlay);
  display: none; flex-direction: column; gap: 2px;
  padding: 8px clamp(12px, 4vw, 24px) 18px;
  max-height: calc(100dvh - 100%); overflow-y: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  animation: dropIn var(--dur-2) var(--ease-out) both;
}
.drawer[hidden] { display: none; }
.drawer-cap {
  margin: 14px 10px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim);
}
.drawer-cap:first-child { margin-top: 4px; }
.drawer-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 10px; border: 0; border-radius: 12px; background: none;
  font-size: 15px; font-weight: 500; color: var(--text-muted); text-align: left;
}
.drawer-link:hover { background: var(--surface-2); color: var(--text); }
.drawer-link.active {
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.drawer-link .jp { width: 24px; text-align: center; font-size: 16px; color: var(--accent-2); }
.drawer-link.active .jp { color: var(--accent); }
.drawer-link.danger { color: var(--accent); }

/* Уровень JLPT — общий бейдж */
.level-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.level-chip.lv-KANA { --lv: var(--text-muted); }
.level-chip.lv-N5 { --lv: var(--green); }
.level-chip.lv-N4 { --lv: var(--teal); }
.level-chip.lv-N3 { --lv: var(--accent-2); }
.level-chip.lv-N2 { --lv: var(--accent); }
.level-chip.lv-N1 { --lv: var(--violet); }
.level-chip[class*="lv-"] {
  background: color-mix(in srgb, var(--lv) 16%, transparent);
  border-color: color-mix(in srgb, var(--lv) 42%, transparent);
  color: var(--lv);
}

/* App / переходы страниц */
.app {
  position: relative; z-index: var(--z-base);
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(24px, 5vw, 52px) clamp(16px, 4vw, 40px) 80px;
}
.page-content { animation: pageIn var(--dur-3) var(--ease-out) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: none; }
}
.page-content.leaving { animation: pageOut 180ms var(--ease) forwards; }
@keyframes pageOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translate3d(0, -12px, 0); }
}

/* Поверхности */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-2 { background: var(--surface-2); }

/* Карточка, которая приподнимается при наведении. */
.lift {
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: var(--border-strong);
}
:root[data-theme="light"] .lift:hover { box-shadow: 0 12px 34px -18px rgba(28, 26, 23, 0.5); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 13px 24px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; color: var(--text);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
              background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.btn .arrow { transition: transform var(--dur-2) var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.btn:hover .arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3); border-color: var(--border-strong); box-shadow: var(--shadow-sm);
}
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent); box-shadow: none;
}
.btn-lg { padding: 17px 32px; font-size: 17px; }
/* Компактный размер для шапки — вровень с иконками, не крупнее их. */
.btn-sm { padding: 7px 15px; font-size: 13px; line-height: 1.4; gap: 6px; }
.btn.block { display: flex; width: 100%; margin-bottom: 10px; }

.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* Сегмент-контрол */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.seg-btn {
  padding: 9px 16px; border: 0; border-radius: 999px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.seg-btn:hover:not(.active) { color: var(--text); }
.seg-btn.active { background: var(--accent); color: #fff; }
.seg.block { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 22px; }

/* Прогресс-полоса со свечением */
.progress-bar {
  height: 6px; background: var(--surface-2);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  box-shadow: 0 0 10px var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 600ms var(--ease);
}
.progress-bar.flex1 { flex: 1; }
.progress-bar.tall { height: 9px; }

/* Кольцо дневной цели (SVG) */
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-2); }
.ring-value {
  stroke: url(#ringGrad); stroke-linecap: round;
  transition: stroke-dashoffset 900ms var(--ease);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
}
.ring-center {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; line-height: 1.1;
}
.ring-num { font-size: 30px; font-weight: 700; }
.ring-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; }

/* Серия: пульсирующее свечение, пока серия идёт */
.streak-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
  font-weight: 700; color: var(--accent-2);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 166, 35, 0.4); }
  50%      { box-shadow: 0 0 24px rgba(245, 166, 35, 0.8); }
}
.streak-badge.cold { animation: none; color: var(--text-muted); border-color: var(--border);
  background: var(--surface); }
.streak-flame { font-size: 17px; }

/* Секции */
.section { margin-top: clamp(44px, 7vw, 78px); }
.page-content > .section:first-child, .app > .section:first-child { margin-top: 0; }
.section-head {
  display: grid; grid-template-columns: auto 1fr; align-items: stretch;
  column-gap: 24px; margin: 0 0 30px;
}
.section-tate {
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 24px; line-height: 1.1; letter-spacing: 0.14em;
  color: var(--accent); padding: 2px 20px 2px 0;
  border-right: 1px solid var(--border);
  align-self: start; user-select: none;
}
.section-head-body { align-self: center; padding: 4px 0; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.section-desc { color: var(--text-muted); font-size: 14.5px; margin-top: 6px; max-width: 64ch; }
.section-head-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .section-head { grid-template-columns: 1fr; row-gap: 12px; }
  .section-tate {
    writing-mode: horizontal-tb; border-right: 0; padding: 0 0 10px;
    border-bottom: 1px solid var(--border); font-size: 21px;
  }
}

/* Герой лендинга */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 76px);
  background:
    radial-gradient(880px 500px at 92% 4%, rgba(232, 72, 85, 0.30), transparent 62%),
    radial-gradient(700px 460px at -6% 96%, rgba(123, 110, 246, 0.28), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
}
.hero-bg {
  position: absolute; right: -2%; top: -10%; font-family: var(--font-jp);
  font-size: clamp(180px, 32vw, 420px); color: color-mix(in srgb, var(--text) 5%, transparent);
  line-height: 0.8; pointer-events: none; writing-mode: vertical-rl; user-select: none;
  animation: inkDrift 26s ease-in-out infinite alternate;
}
@keyframes inkDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-14px, 10px, 0) scale(1.03); }
}
.hero-inner { position: relative; z-index: 1; max-width: 640px; }
.ink-in { animation: inkIn 800ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes inkIn {
  from { opacity: 0; filter: blur(14px); transform: translate3d(0, 12px, 0) scale(1.03); }
  to   { opacity: 1; filter: blur(0);    transform: none; }
}
.hero-title { font-size: clamp(50px, 9vw, 94px); line-height: 0.94; margin: 0 0 6px; }
.hero-title .glyph { display: inline-block; font-family: var(--font-jp); }
.hero-title .ink { color: var(--accent); }
.hero-sub-jp {
  display: inline-block; font-family: var(--font-ui); font-weight: 700;
  font-size: clamp(15px, 2.2vw, 21px); letter-spacing: 0.34em;
  color: var(--text-muted); margin-top: 10px;
}
.hero-kicker {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-muted); margin-bottom: 22px;
}
.hero-kicker::after {
  content: ""; flex: 1; height: 1px; background: var(--border); max-width: 180px;
}
.hero-lead {
  font-size: clamp(15px, 1.6vw, 17px); color: var(--text-muted);
  max-width: 54ch; margin: 18px 0 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-status {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px;
  padding: 10px 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 12px; font-size: 14px;
}
.hero-status-emoji { font-size: 26px; }

/* Волны сэйгайха */
.seigaiha {
  --wave: var(--accent);
  height: 52px; margin-top: 34px; border-radius: 8px; opacity: 0.35;
  background:
    radial-gradient(circle at 50% 100%, transparent 30%, var(--wave) 31%, var(--wave) 34%, transparent 35%) 0 0 / 56px 28px,
    radial-gradient(circle at 50% 100%, transparent 42%, var(--wave) 43%, var(--wave) 46%, transparent 47%) 0 0 / 56px 28px,
    radial-gradient(circle at 50% 100%, transparent 54%, var(--wave) 55%, var(--wave) 58%, transparent 59%) 0 0 / 56px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: tide 24s linear infinite;
}
@keyframes tide {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 112px 0, 112px 0, 112px 0; }
}
.footer-wave { animation: none; opacity: 0.22; margin: 0; border-radius: 0; height: 40px; }

/* ДАШБОРД */
.dash-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap; margin-bottom: 26px;
}
.dash-greet h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.dash-greet-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }

/* Большой CTA «продолжить урок» */
.continue-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 22px;
  padding: 26px 28px; border-radius: var(--radius);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 26%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.continue-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
  pointer-events: none;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}
.continue-glyph {
  display: grid; place-items: center; flex: none;
  width: 76px; height: 76px; border-radius: 20px;
  font-family: var(--font-jp); font-size: 38px; color: #fff;
  background: var(--accent); box-shadow: var(--shadow-accent);
}
.continue-body { position: relative; z-index: 1; min-width: 0; flex: 1; }
.continue-kicker {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.continue-body h3 { font-size: 23px; margin: 4px 0 4px; }
.continue-meta { font-size: 13px; color: var(--text-muted); }

/* Плитка статистики */
.dash-stats { display: grid; gap: 14px; }
.stat-tile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.stat-tile-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: var(--surface-2); font-size: 18px;
}
.stat-tile strong { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-tile span { font-size: 12px; color: var(--text-muted); }

/* Быстрые действия */
.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.quick-card {
  position: relative; overflow: hidden;
  display: block; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.quick-card .quick-glyph {
  font-family: var(--font-jp); font-size: 34px; line-height: 1;
  color: var(--qc, var(--accent)); margin-bottom: 12px; display: block;
  transition: transform var(--dur-3) var(--ease);
}
.quick-card:hover .quick-glyph { transform: scale(1.12) rotate(-4deg); }
.quick-card h3 { font-size: 18px; margin-bottom: 4px; }
.quick-card p { font-size: 13px; color: var(--text-muted); }
.quick-badge {
  position: absolute; top: 16px; right: 16px;
  min-width: 26px; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center;
}
.quick-badge.zero { background: var(--surface-2); color: var(--text-dim); }

/* Лента активности */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.feed li:last-child { border-bottom: none; }
.feed-type {
  font-weight: 600; font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.feed-detail { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { color: var(--text-dim); font-size: 12px; white-space: nowrap; }

/* ВОПРОСЫ И ВАРИАНТЫ (тест, урок, тренажёр) */
.quiz-wrap { display: grid; place-items: center; min-height: 60vh; }
.quiz-card { width: min(660px, 100%); padding: clamp(22px, 4vw, 38px); }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.hanko-sm {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: var(--accent); color: #fff; border-radius: 9px; transform: rotate(-3deg);
}
.quiz-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  flex: 1; font-size: 13px; color: var(--text-muted);
}
.quiz-glyph {
  position: relative; text-align: center;
  font-size: clamp(66px, 13vw, 114px); margin: 22px 0 6px; line-height: 1;
}
.quiz-glyph.small { font-size: clamp(44px, 9vw, 68px); margin: 8px 0; }
.speak-btn {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 50%;
  width: 38px; height: 38px; font-size: 16px; color: var(--text);
  display: inline-grid; place-items: center;
  transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.speak-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.08); }
.speak-btn:active { transform: scale(0.94); }
.speak-btn.playing { animation: pulse-glow 1.2s ease-in-out infinite; }
.quiz-glyph .speak-btn { position: absolute; top: 50%; transform: translateY(-50%); margin-left: 16px; }
.quiz-prompt { font-size: clamp(18px, 2.4vw, 24px); text-align: center; margin: 14px 0 22px; }

.passage {
  padding: 20px 22px; margin: 6px 0 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  font-family: var(--font-jp); font-size: 17px; line-height: 2; text-align: left;
}

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.options.single { grid-template-columns: 1fr; }
.option {
  position: relative; padding: 16px 40px 16px 42px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  font-size: 16px; color: var(--text); text-align: center;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease), background var(--dur-2) var(--ease);
}
.option:hover:not(:disabled) {
  border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-accent);
}
.option:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.option:disabled { cursor: default; }
/* Номер варианта — он же клавиатурное сокращение. */
.option-key {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--surface-3); color: var(--text-dim);
  font-size: 11px; font-weight: 700;
}
/* Итог ответа кодируется знаком, цветом и весом — цвет не единственный носитель. */
.option.correct, .option.wrong { font-weight: 700; }
.option.correct {
  border-color: var(--green); background: color-mix(in srgb, var(--green) 22%, var(--surface-2));
}
.option.wrong {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}
.option.correct::after, .option.wrong::after {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15px; font-weight: 700;
}
.option.correct::after { content: "✓"; color: var(--green); }
.option.wrong::after { content: "✕"; color: var(--accent); }
.option.dim { opacity: 0.45; }

.kbd-hint {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; font-size: 12px; color: var(--text-dim);
}
.kbd {
  display: inline-grid; place-items: center; min-width: 20px; padding: 1px 6px;
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: var(--surface-2); font-size: 11px; font-weight: 600;
}

/* Скелетоны */
.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg,
    var(--surface), color-mix(in srgb, var(--text) 8%, var(--surface)), var(--surface));
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-stack { display: grid; gap: 12px; }

/* РЕЗУЛЬТАТ ТЕСТА */
.result-wrap { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 30px; align-items: start; }
.omamori {
  position: relative; overflow: hidden; text-align: center; padding: 34px 28px 40px;
  border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--accent-c, var(--accent)) 82%, #000), var(--accent-c, var(--accent)));
  box-shadow: var(--shadow);
  animation: omamoriIn 620ms var(--ease-out) both;
}
@keyframes omamoriIn {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.omamori::before {
  content: ""; position: absolute; inset: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.3); border-radius: 16px; pointer-events: none;
}
.omamori-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.9; }
.omamori-emoji { font-size: 70px; margin: 14px 0 2px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.28)); }
.omamori-kanji { font-family: var(--font-jp); font-size: 58px; line-height: 0.9; }
.omamori-name { font-size: 29px; margin: 10px 0 2px; }
.omamori-levels { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.omamori-levels span {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3);
}
.omamori-motto { font-size: 14.5px; margin: 14px auto 0; max-width: 34ch; font-style: italic; opacity: 0.95; }
.omamori-score { display: flex; justify-content: center; gap: 22px; margin-top: 22px; }
.omamori-score strong {
  display: block; font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}
.omamori-score span { font-size: 11.5px; opacity: 0.9; }
.hanko-stamp {
  position: absolute; right: 18px; bottom: 16px; width: 54px; height: 54px;
  display: grid; place-items: center; line-height: 1;
  font-family: var(--font-jp); font-size: 16px;
  color: rgba(255, 255, 255, 0.92); border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px; transform: rotate(-8deg);
  animation: stampIn 420ms var(--ease-out) 500ms both;
}
@keyframes stampIn {
  from { transform: rotate(-8deg) scale(1.6); opacity: 0; }
  to   { transform: rotate(-8deg) scale(1);   opacity: 1; }
}

.result-side h2 { font-size: 26px; margin-bottom: 8px; }
.advice {
  color: var(--text-muted); margin-bottom: 20px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2); border-radius: var(--radius-sm);
}
.skill-bars { display: grid; gap: 14px; margin-bottom: 26px; }
.sbar-head {
  display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px;
  color: var(--text-muted);
}
.sbar-head span:last-child {
  font-variant-numeric: tabular-nums lining-nums; font-weight: 700; color: var(--text);
}
.sbar-track { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.sbar-track > span {
  display: block; width: 100%; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
  transform-origin: left center;
  animation: grow 900ms var(--ease) both; animation-delay: var(--d, 0ms);
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(var(--p, 0)); } }
.result-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Экран повышения уровня */
.levelup {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  animation: fadeIn var(--dur-3) var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.levelup-card {
  position: relative; text-align: center; width: min(460px, 100%);
  padding: 44px 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: levelupIn 520ms var(--ease-out) both;
}
@keyframes levelupIn {
  from { opacity: 0; transform: scale(0.82) translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.levelup-jp {
  font-family: var(--font-jp); font-size: 15px; letter-spacing: 0.3em;
  color: var(--accent-2); margin-bottom: 8px;
}
.levelup-num {
  font-size: 84px; font-weight: 700; line-height: 1; color: var(--accent);
  font-variant-numeric: tabular-nums lining-nums;
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 60%, transparent);
}
.levelup-label { font-size: 13px; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; }
.levelup-stats { display: flex; justify-content: center; gap: 26px; margin: 24px 0; }
.levelup-stats strong { display: block; font-size: 22px; font-weight: 700; }
.levelup-stats span { font-size: 11.5px; color: var(--text-muted); }

/* КУРС / УРОКИ */
.phase-block { margin-bottom: 36px; }
.phase-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.phase-head h3 { font-size: 20px; }
.phase-count { font-size: 12.5px; color: var(--text-dim); margin-left: auto; }
.unit-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); margin: 18px 0 6px;
}
.lesson-index { list-style: none; margin: 0; padding: 0; }
.lesson-index > li {
  border-bottom: 1px solid var(--border);
  animation: rowIn 480ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes rowIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: none; }
}
.lx-row {
  position: relative; display: grid;
  grid-template-columns: 34px 58px minmax(0, 1fr) auto auto 22px;
  align-items: center; gap: 16px; padding: 16px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.lx-row:hover { background: var(--surface); transform: translateX(4px); }
.lx-num { font-size: 12.5px; color: var(--text-dim); }
.lx-glyph {
  font-size: 34px; line-height: 1; color: var(--accent-c, var(--accent));
  text-align: center; transition: transform var(--dur-3) var(--ease);
}
.lx-row:hover .lx-glyph { transform: scale(1.16) rotate(-4deg); }
.lx-title { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
.lx-sub { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.lx-meta { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.lx-state { font-size: 12.5px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.lx-state.done { color: var(--green); }
.lx-go { color: var(--accent); font-size: 17px; transition: transform var(--dur-2) var(--ease); }
.lx-row:hover .lx-go { transform: translateX(5px); }
@media (max-width: 820px) {
  .lx-row { grid-template-columns: 28px 48px minmax(0, 1fr) 22px; row-gap: 4px; }
  .lx-meta, .lx-state { grid-column: 3; font-size: 12px; }
  .lx-glyph { font-size: 28px; }
}

/* ПЛЕЕР УРОКА */
.lesson-player { max-width: 720px; margin: 0 auto; }
.player-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.player-close {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid var(--border); color: var(--text-muted); font-size: 15px;
  transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
              transform var(--dur-1) var(--ease);
}
.player-close:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.player-count { font-size: 13px; color: var(--text-muted); min-width: 46px; text-align: right; }
.player-stage {
  padding: clamp(24px, 5vw, 46px); min-height: 400px;
  display: grid; place-items: center;
}
.lesson-step { text-align: center; width: 100%; animation: pageIn var(--dur-3) var(--ease-out) both; }
.lesson-step-kanji { font-family: var(--font-jp); font-size: 76px; line-height: 1; margin-bottom: 14px; }
.lesson-step h2 { font-size: 25px; margin-bottom: 12px; }
.lesson-step-text { color: var(--text-muted); max-width: 46ch; margin: 0 auto 24px; }

/* Карточка с 3D-переворотом */
.card-3d {
  position: relative; width: min(440px, 100%); margin: 0 auto 24px;
  perspective: 800px; cursor: pointer; border-radius: var(--radius);
}
.card-inner {
  position: relative; width: 100%; height: 230px;
  transform-style: preserve-3d;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card-inner.flipped { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.card-back { transform: rotateY(180deg); background: var(--surface-3); }
.flash-glyph { font-size: clamp(46px, 10vw, 80px); line-height: 1.1; }
.flash-tap { font-size: 12.5px; color: var(--text-dim); }
.flash-romaji { font-size: 29px; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; }
.flash-hint-in { font-size: 15px; color: var(--text-muted); max-width: 32ch; margin: 0 auto; }
.card-3d .speak-btn { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* Разбор грамматики внутри урока */
.grammar-step { text-align: left; width: 100%; max-width: 560px; margin: 0 auto; }
.grammar-pattern {
  font-family: var(--font-jp); font-size: clamp(22px, 3.6vw, 30px);
  color: var(--accent); margin-bottom: 6px; text-align: center;
}
.grammar-title {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); text-align: center; margin-bottom: 16px;
}
.grammar-text { color: var(--text-muted); margin-bottom: 20px; }
.example {
  display: grid; gap: 3px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-2);
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.example:hover { transform: translateX(4px); background: var(--surface-3); }
.example-jp {
  font-family: var(--font-jp); font-size: 17px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.example-romaji { font-size: 12.5px; color: var(--text-dim); font-style: italic; }
.example-ru { font-size: 14px; color: var(--text-muted); }

.hanko-complete {
  display: grid; place-items: center; width: 94px; height: 94px; margin: 0 auto 18px;
  font-family: var(--font-jp); font-size: 28px; line-height: 1; color: var(--accent);
  border: 3px solid var(--accent); border-radius: 14px; transform: rotate(-5deg);
  animation: stampIn 320ms var(--ease-out) both;
}
.outro-reward {
  font-size: 19px; font-weight: 700; color: var(--green); margin: 6px 0 22px;
  font-variant-numeric: tabular-nums lining-nums;
}

/* МОДУЛЬ КАНЫ */
.kana-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px;
}
.kana-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px;
}
.kana-cell {
  position: relative; display: grid; place-items: center; gap: 2px;
  aspect-ratio: 1; padding: 8px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}
.kana-cell:hover {
  transform: translateY(-3px) scale(1.04); border-color: var(--accent);
  background: var(--surface-2); z-index: 1;
}
.kana-cell:active { transform: translateY(0) scale(0.97); }
.kana-cell-char { font-size: 30px; line-height: 1; }
.kana-cell-romaji { font-size: 11.5px; color: var(--text-dim); }
.kana-cell.known { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.kana-cell.known::after {
  content: "✓"; position: absolute; top: 5px; right: 7px;
  font-size: 10px; color: var(--green); font-weight: 700;
}
.kana-cell.learning { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.kana-cell.learning::after {
  content: "•"; position: absolute; top: 3px; right: 8px; font-size: 14px; color: var(--accent-2);
}

.kana-detail {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px);
  animation: fadeIn var(--dur-2) var(--ease) both;
}
.kana-detail-card {
  position: relative; width: min(400px, 100%); padding: 32px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  animation: levelupIn 380ms var(--ease-out) both;
}
.kana-detail-char { font-family: var(--font-jp); font-size: 110px; line-height: 1; margin-bottom: 6px; }
.kana-detail-romaji { font-size: 26px; font-weight: 700; color: var(--accent); }
.kana-detail-cyr { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.kana-detail-mnemonic {
  font-size: 14.5px; color: var(--text-muted); padding: 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-2); text-align: left; margin-bottom: 16px;
}
.kana-detail-meta {
  display: flex; justify-content: center; gap: 18px; font-size: 12px;
  color: var(--text-dim); margin-bottom: 18px;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); font-size: 14px;
  transition: transform var(--dur-1) var(--ease), color var(--dur-2) var(--ease);
}
.modal-close:hover { color: var(--accent); transform: rotate(90deg); }

/* SRS */
.srs-wrap { max-width: 660px; margin: 0 auto; }
.queue-counts { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.queue-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.queue-chip b { color: var(--text); font-weight: 700; }
.queue-chip.new b { color: var(--teal); }
.queue-chip.learn b { color: var(--accent-2); }
.queue-chip.review b { color: var(--accent); }

.srs-card { padding: clamp(26px, 5vw, 44px); text-align: center; min-height: 320px;
  display: grid; align-content: center; gap: 10px; }
.srs-front { font-family: var(--font-jp); font-size: clamp(42px, 9vw, 72px); line-height: 1.15; }
.srs-reading { font-size: 20px; color: var(--accent); font-weight: 600; }
.srs-meaning { font-size: 24px; font-weight: 600; }
.srs-pos { font-size: 12px; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.srs-example {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); text-align: left;
}
.srs-reveal-hint { font-size: 13px; color: var(--text-dim); margin-top: 12px; }

.srs-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.grade-btn {
  display: grid; gap: 3px; padding: 14px 8px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 14px; font-weight: 600;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.grade-btn small { font-size: 11px; color: var(--text-dim); font-weight: 500; }
.grade-btn:hover { transform: translateY(-3px); border-color: var(--g, var(--accent)); box-shadow: var(--shadow-sm); }
.grade-btn:active { transform: translateY(0) scale(0.96); }
.grade-again { --g: var(--accent); }
.grade-hard  { --g: var(--accent-2); }
.grade-good  { --g: var(--teal); }
.grade-easy  { --g: var(--green); }
@media (max-width: 560px) { .srs-grades { grid-template-columns: 1fr 1fr; } }

/* Итог сеанса */
.session-summary { text-align: center; padding: 40px 28px; }
.summary-ring { margin: 0 auto 20px; }
.summary-stats { display: flex; justify-content: center; gap: 28px; margin: 22px 0 26px; flex-wrap: wrap; }
.summary-stats strong { display: block; font-size: 24px; font-weight: 700; }
.summary-stats span { font-size: 12px; color: var(--text-muted); }

/* КАНДЗИ */
.kanji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.kanji-tile {
  display: grid; place-items: center; gap: 3px; padding: 14px 8px;
  aspect-ratio: 1; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}
.kanji-tile:hover {
  transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-accent);
}
.kanji-tile-char { font-family: var(--font-jp); font-size: 38px; line-height: 1; }
.kanji-tile-meaning {
  font-size: 11px; color: var(--text-dim); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}

.kanji-detail { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 28px; align-items: start; }
.kanji-hero-card {
  padding: 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.kanji-hero {
  font-size: 200px; line-height: 1; margin: 6px 0 12px;
  animation: strokeIn 900ms var(--ease-out) both;
}
@keyframes strokeIn {
  from { opacity: 0; filter: blur(12px); transform: scale(1.08); }
  to   { opacity: 1; filter: blur(0);    transform: none; }
}
.kanji-hero-meta { display: flex; justify-content: center; gap: 16px; font-size: 12.5px; color: var(--text-dim); }
.reading-row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.reading-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
}
.reading-value { font-family: var(--font-jp); font-size: 19px; }
.radical-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.radical {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.radical:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.radical-char { font-family: var(--font-jp); font-size: 22px; color: var(--accent-2); }
.radical-meaning { font-size: 13px; color: var(--text-muted); }
.radical-plus { color: var(--text-dim); font-size: 16px; align-self: center; }
.mnemonic-box {
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-2) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, transparent);
  font-size: 15px; line-height: 1.65;
}
.mnemonic-box textarea {
  width: 100%; min-height: 80px; resize: vertical;
  background: transparent; border: 0; color: inherit; font: inherit; outline: none;
}
.word-list { display: grid; gap: 8px; margin-top: 10px; }
.word-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.word-row:hover { transform: translateX(4px); border-color: var(--accent); }
.word-jp { font-family: var(--font-jp); font-size: 19px; }
.word-reading { font-size: 12.5px; color: var(--text-dim); }
.word-ru { font-size: 14px; color: var(--text-muted); }

/* АУДИРОВАНИЕ */
.audio-player {
  padding: 22px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 22px;
}
.wave-canvas {
  display: block; width: 100%; height: 72px; border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 16px;
}
.audio-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play-btn {
  display: grid; place-items: center; width: 54px; height: 54px; flex: none;
  border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 20px;
  box-shadow: var(--shadow-accent);
  transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease);
}
.play-btn:hover { transform: scale(1.07); background: var(--accent-deep); }
.play-btn:active { transform: scale(0.94); }
.speed-group { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); }
.speed-btn {
  padding: 6px 12px; border: 0; border-radius: 999px; background: transparent;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.speed-btn.active { background: var(--accent); color: #fff; }
.transcript {
  margin-top: 16px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px dashed var(--border);
  font-family: var(--font-jp); font-size: 17px; line-height: 1.9;
}

/* РЕЖИМ ЧТЕНИЯ (фуригана + разбор слов) */
.read-input {
  width: 100%; min-height: 130px; padding: 16px; resize: vertical;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: var(--font-jp); font-size: 16px; line-height: 1.9; outline: none;
  transition: border-color var(--dur-2) var(--ease);
}
.read-input:focus { border-color: var(--accent); }
.read-output {
  padding: 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-jp); font-size: 22px; line-height: 2.6;
}
.read-output ruby rt { font-size: 0.5em; color: var(--accent-2); font-weight: 500; }
.read-token {
  border-radius: 4px; padding: 0 1px; cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.read-token:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.read-token.known { border-bottom: 2px solid color-mix(in srgb, var(--teal) 60%, transparent); }
.lookup-pop {
  position: fixed; z-index: var(--z-tooltip, 400);
  min-width: 200px; max-width: 300px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--surface-3);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-family: var(--font-ui); font-size: 14px;
  animation: pageIn 160ms var(--ease-out) both;
}
.lookup-jp { font-family: var(--font-jp); font-size: 22px; margin-bottom: 2px; }
.lookup-reading { font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.lookup-meaning { color: var(--text-muted); }

/* ГРАММАТИКА (справочник) */
.grammar-list { display: grid; gap: 12px; }
.grammar-card { padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.grammar-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grammar-card-pattern { font-family: var(--font-jp); font-size: 22px; color: var(--accent); }
.grammar-card h3 { font-size: 17px; }
.grammar-card-meaning { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.grammar-card-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.formation {
  display: inline-block; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
  background: var(--surface-2); font-family: var(--font-jp);
  font-size: 13px; color: var(--text-muted);
}

/* ТРЕНАЖЁР */
.trainer { max-width: 740px; margin-left: auto; margin-right: auto; }
.trainer-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 22px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.stat-chip { text-align: center; padding: 14px 8px; background: var(--surface); }
.stat-icon { font-size: 16px; opacity: 0.85; display: inline-block; }
.stat-chip.hot .stat-icon { opacity: 1; animation: emberPulse 1.6s var(--ease) infinite; }
.stat-chip.hot strong { color: var(--accent); }
@keyframes emberPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}
.stat-chip strong { display: block; font-size: 24px; font-weight: 700; margin: 2px 0; }
.stat-label { font-size: 11.5px; color: var(--text-dim); }
.trainer-card { padding: clamp(24px, 4vw, 40px); text-align: center; }
.trainer-tag {
  display: inline-block; font-size: 12px; padding: 5px 14px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-muted); font-weight: 600; margin-bottom: 16px;
}
.trainer-q { font-size: clamp(19px, 3vw, 26px); margin-bottom: 24px; }
.trainer-feedback {
  min-height: 22px; margin-top: 16px; font-weight: 600; font-size: 14px;
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.trainer-feedback.ok { color: var(--green); opacity: 1; }
.trainer-feedback.no { color: var(--accent); opacity: 1; }
.trainer-hint { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 16px; }

/* КАБИНЕТ */
.profile-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap; margin-bottom: 28px;
}
.profile-id { display: flex; align-items: center; gap: 18px; }
.profile-avatar {
  position: relative; display: grid; place-items: center; width: 82px; height: 82px; flex: none;
  font-size: 38px; border-radius: 22px; color: #fff;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--accent-c, var(--accent)) 82%, #000), var(--accent-c, var(--accent)));
  box-shadow: var(--shadow-sm);
}
.avatar-kanji {
  position: absolute; bottom: -8px; right: -8px; width: 32px; height: 32px;
  display: grid; place-items: center; font-family: var(--font-jp); font-size: 16px;
  background: var(--surface-3); color: var(--accent-2); border-radius: 9px;
  border: 1px solid var(--border);
}
.profile-id h2 { font-size: 27px; }
.profile-level { color: var(--text-muted); font-size: 14px; }
.profile-kpis { display: flex; flex-wrap: wrap; gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpi { text-align: center; padding: 14px 22px; background: var(--surface); }
.kpi strong { display: block; font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.kpi span { font-size: 12px; color: var(--text-dim); }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.chart-card { padding: 22px; }
.chart-card h3 { font-size: 17px; }
.chart-sub { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 10px; }
.chart { width: 100%; height: auto; display: block; margin: 0 auto; max-width: 320px; }
.chart text { font-family: var(--font-ui); font-variant-numeric: tabular-nums lining-nums; }
.rad-label { font-size: 12px; fill: var(--text-dim); }
.ring-pct { font-size: 17px; font-weight: 600; fill: var(--text-muted); }
.ring-sub { font-size: 12px; fill: var(--text-dim); letter-spacing: 0.06em; }
.bar-val { font-size: 11px; fill: var(--text-dim); }
.bar-lab { font-size: 12px; fill: var(--text-dim); }

.profile-bottom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.history, .profile-actions { padding: 22px; }
.history h3, .profile-actions h3 { font-size: 17px; margin-bottom: 12px; }
.reset-note { font-size: 11.5px; color: var(--text-dim); margin-top: 8px; text-align: center; }

/* Достижения */
.ach-section { margin-top: 16px; }
.ach-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ach-count { font-size: 20px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.ach-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  column-gap: 28px; margin-top: 8px;
}
.ach-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 2px; border-top: 1px solid var(--border);
  animation: rowIn 440ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}
.ach-row.earned .ach-medal { transition: transform var(--dur-2) var(--ease); }
.ach-row.earned:hover .ach-medal { transform: rotate(-8deg) scale(1.1); }
.ach-row.locked { opacity: 0.55; }
.ach-medal {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 50%; font-family: var(--font-jp); font-size: 20px; color: #fff;
  background: var(--accent-c, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.ach-row.locked .ach-medal {
  background: transparent; color: var(--text-dim); font-size: 15px;
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.ach-info { min-width: 0; }
.ach-info h4 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.ach-info p { font-size: 12.5px; color: var(--text-dim); margin: 1px 0 3px; }
.ach-status { font-size: 11.5px; font-weight: 600; color: var(--green); }
.ach-row.locked .ach-status { color: var(--text-dim); font-weight: 500; }

.ach-popup {
  position: fixed; top: 80px; right: 24px; z-index: var(--z-toast);
  display: flex; gap: 14px; align-items: center; max-width: 340px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); cursor: pointer;
  animation: achIn var(--dur-3) var(--ease-out) both;
}
@keyframes achIn {
  from { opacity: 0; transform: translate3d(24px, 0, 0) scale(0.95); }
  to   { opacity: 1; transform: none; }
}
.ach-pop-medal {
  width: 50px; height: 50px; flex: none; display: grid; place-items: center;
  border-radius: 12px; font-family: var(--font-jp); font-size: 24px; color: #fff;
  background: var(--accent-c, var(--accent)); transform: rotate(-3deg);
}
.ach-pop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ach-pop-title { font-size: 12.5px; color: var(--accent-2); font-weight: 700; }
.ach-pop-body strong { font-family: var(--font-display); font-size: 17px; }
.ach-pop-desc { font-size: 12.5px; color: var(--text-dim); }
@media (max-width: 600px) { .ach-popup { left: 16px; right: 16px; top: 70px; max-width: none; } }

/* Формы */
.form-field { margin-bottom: 14px; }
.form-field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
}
.form-field input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 15px; outline: none;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth-card { padding: clamp(24px, 4vw, 36px); }
.form-error {
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--accent); font-size: 13.5px;
}

/* Пустое состояние */
.empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-glyph { font-family: var(--font-jp); font-size: 56px; color: var(--text-dim); margin-bottom: 12px; }

/* Подвал */
.footer { position: relative; z-index: 1; margin-top: 56px; border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 40px) 40px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.footer-jp { font-family: var(--font-jp); font-size: 24px; color: var(--accent); }
.footer-inner p { font-size: 13px; color: var(--text-dim); }

/* Тост */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: var(--z-toast); padding: 14px 22px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; max-width: 90vw;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease-out);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Адаптив */
@media (max-width: 980px) {
  .dash-top { grid-template-columns: 1fr; }
  .result-wrap { grid-template-columns: 1fr; }
  .kanji-detail { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .profile-bottom { grid-template-columns: 1fr; }
}
/* Верхний ряд не помещается — уводим разделы в бургер, а не в скрытый скролл. */
@media (max-width: 860px) {
  .topbar { gap: 10px; }
  .nav { display: none; }
  .burger { display: grid; }
  .drawer { display: flex; }
  .hide-sm { display: none; }
  .acct { padding: 4px; }
  .acct-meta, .acct .caret { display: none; }
}
@media (max-width: 340px) {
  .brand-text { display: none; }
}

@media (max-width: 680px) {
  .options { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .trainer-stats { grid-template-columns: 1fr 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .continue-card { flex-direction: column; text-align: center; }
  .kanji-hero { font-size: 140px; }
  .hero-bg { opacity: 0.5; }
}

/* Уважение к prefers-reduced-motion. Гасим и ЗАДЕРЖКИ: иначе элементы
   с animation-delay и fill:both останутся невидимыми на время задержки. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .hero-bg, .seigaiha, .stat-chip.hot .stat-icon,
  .streak-badge, .continue-card::after { animation: none !important; }
}
