﻿/* ==========================================================================
   ОРФО-ТАП — неоновая аркада.
   Тёмное стекло, кислотно-зелёный / бирюзовый неон, золото для монет.
   Вся графика нарисована CSS: ни эмодзи, ни внешних шрифтов, ни картинок.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Глубина фона */
  --bg: #04060d;

  /* Тёмное стекло панелей */
  --panel: rgba(13, 21, 38, 0.74);

  /* Тонкая светящаяся линия */
  --line-soft: rgba(160, 200, 240, 0.12);

  /* Текст */
  --ink: #eaf2ff;
  --ink-dim: #b9cbe4;
  --muted: #93a9c6;

  /* Акценты */
  --neon: #7ef97e;
  --teal: #39e6c3;
  --violet: #8b7cf6;
  --red: #ff6b6b;
  --gold: #ffcf5c;

  --radius-xl: clamp(24px, 3vw, 38px);
  --vh: 1vh;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1150px 760px at 6% -12%, rgba(57, 230, 195, 0.17), rgba(57, 230, 195, 0) 62%),
    radial-gradient(980px 720px at 104% 108%, rgba(139, 124, 246, 0.2), rgba(139, 124, 246, 0) 60%),
    radial-gradient(760px 520px at 50% 112%, rgba(126, 249, 126, 0.08), rgba(126, 249, 126, 0) 70%),
    linear-gradient(180deg, #060a15 0%, #04060d 58%, #05070f 100%);
  background-repeat: no-repeat;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Лёгкая сетка + виньетка: только фон, контент лежит выше. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(57, 230, 195, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(57, 230, 195, 0.055) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(125% 105% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.6) 52%, transparent 88%);
  mask-image: radial-gradient(125% 105% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.6) 52%, transparent 88%);
  opacity: 0.85;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 42%, rgba(2, 4, 9, 0) 32%, rgba(2, 4, 9, 0.55) 78%, rgba(2, 4, 9, 0.86) 100%);
}

/* Фон «полёт сквозь звёзды»: декоративный canvas под всем интерфейсом.
   z-index 0 и pointer-events: none — звёзды не перекрывают окна и не ловят
   клики; лёгкая радиальная маска приглушает поток у краёв экрана. */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(125% 108% at 50% 46%, #000 40%, rgba(0, 0, 0, 0.62) 82%, rgba(0, 0, 0, 0.34) 100%);
  mask-image: radial-gradient(125% 108% at 50% 46%, #000 40%, rgba(0, 0, 0, 0.62) 82%, rgba(0, 0, 0, 0.34) 100%);
}

/* На телефоне интерфейс занимает больше места — фон чуть тише. */
@media (max-width: 640px) {
  .starfield { opacity: 0.52; }
}

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid rgba(126, 249, 126, 0.85);
  outline-offset: 3px;
}

::selection {
  background: rgba(57, 230, 195, 0.35);
  color: #04140c;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  height: calc(var(--vh, 1vh) * 100);
  margin: 0 auto;
  padding: clamp(8px, 1.6vw, 18px) clamp(10px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vw, 12px);
}

/* ==========================================================================
   Верхняя панель
   ========================================================================== */

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.hud-left,
.hud-right { display: flex; align-items: center; gap: 10px; }

.coin-pill,
.combo-pill,
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.coin-pill { border-color: rgba(255, 207, 92, 0.3); }

.coin-value {
  color: var(--gold);
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 207, 92, 0.5);
}

.coin-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff6d8 0%, var(--gold) 48%, #d99b16 100%);
  box-shadow:
    0 0 10px rgba(255, 207, 92, 0.65),
    0 0 24px rgba(255, 207, 92, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.coin-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(120, 72, 0, 0.45);
}

.combo-pill {
  border-color: rgba(126, 249, 126, 0.35);
  background:
    radial-gradient(120% 150% at 18% 0%, rgba(126, 249, 126, 0.16), rgba(13, 21, 38, 0.84) 66%);
}

.combo-label,
.best-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.combo-pill b {
  color: var(--neon);
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: comboPulse 2.6s ease-in-out infinite;
}

.combo-pill.bump { animation: bump 0.26s ease-out; }

.hud-right {
  padding: 6px 18px;
  border-color: rgba(57, 230, 195, 0.2);
}

.hud-right b {
  color: var(--teal);
  font-size: clamp(16px, 1.9vw, 22px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(57, 230, 195, 0.45);
}

/* ==========================================================================
   Полоса мастерства
   ========================================================================== */

.mastery {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mastery-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(57, 230, 195, 0.16);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.mastery-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon) 0%, var(--teal) 58%, var(--violet) 100%);
  box-shadow: 0 0 12px rgba(126, 249, 126, 0.6), 0 0 26px rgba(57, 230, 195, 0.35);
  transition: width 0.4s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.mastery-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ==========================================================================
   Сцена и карточка задания
   ========================================================================== */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.task-card {
  --card-shadow:
    0 26px 70px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(126, 249, 126, 0.08),
    0 0 48px rgba(57, 230, 195, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);

  width: min(100%, 860px);
  max-width: 100%;
  max-height: 100%;
  padding: clamp(16px, 2.6vw, 32px);
  border: 1px solid rgba(126, 249, 126, 0.24);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 50% -12%, rgba(57, 230, 195, 0.14), rgba(57, 230, 195, 0) 58%),
    linear-gradient(165deg, rgba(19, 31, 54, 0.92) 0%, rgba(9, 15, 27, 0.96) 58%, rgba(7, 12, 23, 0.97) 100%);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8vw, 20px);
  overflow: hidden;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(126, 249, 126, 0), var(--neon) 22%, var(--teal) 52%, var(--violet) 80%, rgba(139, 124, 246, 0));
  box-shadow: 0 0 18px rgba(126, 249, 126, 0.65);
  opacity: 0.95;
}

.task-card.is-enter { animation: cardIn 0.24s ease-out; }

.task-card.is-correct {
  border-color: rgba(126, 249, 126, 0.62);
  animation: cardFlash 0.42s ease-out;
}

.task-card.is-wrong {
  border-color: rgba(255, 107, 107, 0.55);
  background:
    radial-gradient(120% 90% at 50% -12%, rgba(255, 107, 107, 0.14), rgba(255, 107, 107, 0) 58%),
    linear-gradient(165deg, rgba(44, 18, 30, 0.92) 0%, rgba(15, 10, 20, 0.95) 60%, rgba(8, 8, 16, 0.97) 100%);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(255, 107, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.task-card.shake { animation: shake 0.34s ease-in-out; }

.task-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.task-chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(139, 124, 246, 0.14);
  border: 1px solid rgba(139, 124, 246, 0.4);
  color: #d9d3ff;
  font-size: clamp(10px, 1.2vw, 12.5px);
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 0 16px rgba(139, 124, 246, 0.22), inset 0 0 12px rgba(139, 124, 246, 0.1);
}

.task-prompt {
  margin: 0;
  color: var(--ink-dim);
  font-size: clamp(13px, 1.6vw, 17px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.task-body {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 22px);
  min-height: 0;
}

.empty-note {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: #ffc9c9;
  font-size: 16px;
  line-height: 1.5;
}

/* ==========================================================================
   Выбор из двух карточек
   ========================================================================== */

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2vw, 22px);
}

.choice-btn {
  min-height: clamp(96px, 17vh, 170px);
  padding: clamp(12px, 2vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px solid rgba(57, 230, 195, 0.22);
  border-radius: clamp(18px, 2.4vw, 28px);
  background:
    radial-gradient(110% 130% at 50% 0%, rgba(57, 230, 195, 0.1), rgba(57, 230, 195, 0) 62%),
    linear-gradient(170deg, rgba(20, 33, 56, 0.78) 0%, rgba(9, 15, 27, 0.9) 100%);
  color: var(--ink);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 12px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.choice-btn:hover {
  border-color: rgba(126, 249, 126, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 34px rgba(0, 0, 0, 0.4),
    0 0 26px rgba(126, 249, 126, 0.28),
    0 0 60px rgba(57, 230, 195, 0.14);
  transform: translateY(-2px);
}

.choice-btn:active { transform: scale(0.975); }

.choice-word {
  color: var(--ink);
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-shadow: 0 0 22px rgba(57, 230, 195, 0.18);
}

/* ==========================================================================
   Пропуск буквы
   ========================================================================== */

.gap-word {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  font-size: clamp(34px, 6vw, 66px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-shadow: 0 0 28px rgba(57, 230, 195, 0.2);
}

.gap-char { color: var(--ink); }

.gap-slot {
  color: var(--neon);
  border-bottom: 6px solid var(--teal);
  margin: 0 4px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(126, 249, 126, 0.75), 0 0 36px rgba(57, 230, 195, 0.45);
  filter: drop-shadow(0 6px 10px rgba(57, 230, 195, 0.32));
}

.letters {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 4vw, 34px);
}

.letter-btn {
  width: clamp(68px, 9vw, 92px);
  height: clamp(68px, 9vw, 92px);
  border-radius: 50%;
  border: 2px solid rgba(139, 124, 246, 0.45);
  background:
    radial-gradient(circle at 50% 16%, rgba(139, 124, 246, 0.2), rgba(10, 16, 30, 0.94) 72%);
  color: var(--ink);
  font-size: clamp(28px, 3.8vw, 40px);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 18px rgba(139, 124, 246, 0.16);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.letter-btn:hover {
  border-color: rgba(139, 124, 246, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 26px rgba(139, 124, 246, 0.42),
    0 0 54px rgba(139, 124, 246, 0.2);
  transform: translateY(-2px);
}

.letter-btn:active { transform: scale(0.94); }

/* ==========================================================================
   Верно / с ошибкой
   ========================================================================== */

.verdict-word {
  padding: 8px 0;
  text-align: center;
  color: var(--ink);
  font-size: clamp(32px, 5.2vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-shadow: 0 0 28px rgba(57, 230, 195, 0.2);
}

.verdict-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2vw, 18px);
}

.verdict-btn {
  min-height: clamp(60px, 9vh, 84px);
  border: 2px solid transparent;
  border-radius: clamp(18px, 2vw, 24px);
  font-size: clamp(18px, 2.3vw, 26px);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.verdict-btn.is-true {
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.18), rgba(57, 230, 195, 0.08));
  border-color: rgba(126, 249, 126, 0.42);
  color: #d7ffdd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(126, 249, 126, 0.16);
}

.verdict-btn.is-true:hover {
  border-color: rgba(126, 249, 126, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 28px rgba(126, 249, 126, 0.4);
  transform: translateY(-1px);
}

.verdict-btn.is-false {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.18), rgba(255, 107, 107, 0.06));
  border-color: rgba(255, 107, 107, 0.42);
  color: #ffd9d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 107, 107, 0.14);
}

.verdict-btn.is-false:hover {
  border-color: rgba(255, 107, 107, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 28px rgba(255, 107, 107, 0.38);
  transform: translateY(-1px);
}

.verdict-btn:active { transform: scale(0.975); }

/* ==========================================================================
   Состояния ответа и подсказки (навешивает game.js)
   ========================================================================== */

.choice-btn.is-right,
.letter-btn.is-right,
.verdict-btn.is-right {
  border-color: var(--neon) !important;
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.24), rgba(57, 230, 195, 0.1)) !important;
  color: #f1fff4 !important;
  box-shadow:
    0 0 0 1px rgba(126, 249, 126, 0.55),
    0 0 26px rgba(126, 249, 126, 0.45),
    0 0 62px rgba(126, 249, 126, 0.2) !important;
  animation: answerPop 0.22s ease-out;
}

.choice-btn.is-wrong,
.letter-btn.is-wrong,
.verdict-btn.is-wrong {
  border-color: var(--red) !important;
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.22), rgba(255, 107, 107, 0.08)) !important;
  color: #ffe8e8 !important;
  box-shadow:
    0 0 0 1px rgba(255, 107, 107, 0.5),
    0 0 26px rgba(255, 107, 107, 0.42),
    0 0 62px rgba(255, 107, 107, 0.16) !important;
}

.choice-btn.is-hint,
.letter-btn.is-hint,
.verdict-btn.is-hint {
  border-color: rgba(255, 207, 92, 0.9) !important;
  animation: hintPulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Плашка с правилом и нижняя подсказка
   ========================================================================== */

.feedback {
  position: fixed;
  left: 50%;
  bottom: clamp(92px, 14vh, 132px);
  transform: translateX(-50%);
  z-index: 25;
  width: min(92vw, 760px);
  margin: 0;
  padding: 14px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: linear-gradient(180deg, rgba(38, 18, 28, 0.96), rgba(12, 8, 16, 0.97));
  color: var(--ink);
  text-align: center;
  font-size: clamp(13px, 1.7vw, 18px);
  line-height: 1.4;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.58),
    0 0 28px rgba(255, 107, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
}

.feedback.show { animation: plateIn 0.2s ease-out; }
.feedback { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.feedback-pause {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 180, 84, 0.5);
  border-radius: 12px;
  background: rgba(255, 180, 84, 0.11);
  color: #ffd79a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}
.feedback-pause:hover { background: rgba(255, 180, 84, 0.2); }
.feedback-pause.is-paused {
  border-color: rgba(57, 230, 195, 0.55);
  background: rgba(57, 230, 195, 0.12);
  color: #c9fff3;
}

.hint-line {
  margin: 0;
  color: var(--muted);
  font-size: clamp(10px, 1.3vw, 13px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* ==========================================================================
   Нижний док
   ========================================================================== */

.dock {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  padding-bottom: max(2px, env(safe-area-inset-bottom));
}

.dock-btn {
  min-width: clamp(62px, 9vw, 108px);
  min-height: 62px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(57, 230, 195, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 36, 60, 0.72), rgba(10, 16, 28, 0.82));
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.dock-btn:hover {
  border-color: rgba(57, 230, 195, 0.62);
  background: linear-gradient(180deg, rgba(26, 44, 72, 0.8), rgba(12, 20, 34, 0.86));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(57, 230, 195, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.dock-btn:active { transform: scale(0.96); }

.dock-label {
  color: var(--ink-dim);
  font-size: clamp(10px, 1.1vw, 13px);
  font-weight: 600;
  white-space: nowrap;
}

.dock-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  color: var(--teal);
}

.ico-up { color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 207, 92, 0.55)); }
.ico-herb { color: var(--neon); filter: drop-shadow(0 0 8px rgba(126, 249, 126, 0.5)); }
.ico-sound { color: var(--teal); filter: drop-shadow(0 0 8px rgba(57, 230, 195, 0.55)); }
.ico-set { color: var(--violet); filter: drop-shadow(0 0 8px rgba(139, 124, 246, 0.55)); }

.ico-up::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.ico-herb::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 0 14px 0 14px;
  background: currentColor;
  transform: rotate(-45deg);
}

.ico-herb::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
  transform: rotate(45deg);
}

.ico-sound::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.ico-sound::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: currentColor;
  border-left-width: 0;
}

.ico-set::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid currentColor;
}

.ico-set::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dock-btn.is-off .dock-icon { color: rgba(147, 169, 198, 0.55); filter: none; }
.dock-btn.is-off .dock-label { color: rgba(147, 169, 198, 0.82); }
.dock-btn.is-off { border-color: rgba(147, 169, 198, 0.16); }
.dock-btn.is-off:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05); }

/* ==========================================================================
   Оверлеи и шиты
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(900px 640px at 50% 16%, rgba(14, 26, 46, 0.72), rgba(3, 5, 10, 0.88));
  backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease-out;
}

.sheet {
  width: min(94vw, 640px);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid rgba(57, 230, 195, 0.28);
  border-radius: clamp(22px, 2.6vw, 32px);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(57, 230, 195, 0.1), rgba(57, 230, 195, 0) 60%),
    linear-gradient(165deg, rgba(19, 30, 52, 0.95) 0%, rgba(9, 15, 28, 0.97) 55%, rgba(7, 12, 23, 0.98) 100%);
  color: var(--ink);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.62),
    0 0 44px rgba(57, 230, 195, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: sheetUp 0.22s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 230, 195, 0.5) rgba(255, 255, 255, 0.04);
}

.sheet::-webkit-scrollbar { width: 10px; }
.sheet::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  margin: 14px 0;
}
.sheet::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.65), rgba(57, 230, 195, 0.55));
  border: 2px solid rgba(7, 12, 23, 0.9);
  border-radius: 999px;
}
.sheet::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.9), rgba(57, 230, 195, 0.8));
}

.sheet-wide { width: min(96vw, 800px); }
.sheet-small { width: min(94vw, 460px); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(21px, 2.8vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: 0 0 24px rgba(57, 230, 195, 0.35);
}

.sheet-sub {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.sheet-sub b {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 207, 92, 0.45);
}

.close-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(160, 200, 240, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.close-btn:hover {
  border-color: rgba(255, 107, 107, 0.7);
  background: rgba(255, 107, 107, 0.14);
  color: #ffdcdc;
  box-shadow: 0 0 22px rgba(255, 107, 107, 0.32);
}

/* ==========================================================================
   Апгрейды
   ========================================================================== */

.up-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.up-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(57, 230, 195, 0.16);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.up-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 18px);
}

.up-main p {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.pips {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 3px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 207, 92, 0.5);
}

.up-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.up-buy button {
  min-width: 92px;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid rgba(126, 249, 126, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.16), rgba(57, 230, 195, 0.1));
  color: #c9ffd1;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(126, 249, 126, 0.14);
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.18s ease, background 0.16s ease;
}

.up-buy button:hover:not(:disabled) {
  border-color: rgba(126, 249, 126, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 28px rgba(126, 249, 126, 0.42);
  transform: translateY(-1px);
}

.up-buy button:active:not(:disabled) { transform: scale(0.96); }

.up-buy button:disabled {
  border-color: rgba(147, 169, 198, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(185, 203, 228, 0.68);
  box-shadow: none;
  cursor: default;
}

.up-buy button.is-max {
  border-color: rgba(255, 207, 92, 0.4);
  background: rgba(255, 207, 92, 0.1);
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(255, 207, 92, 0.16);
}

/* ==========================================================================
   Гербарий
   ========================================================================== */

.herb-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.herb-group {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.herb-group-title {
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: clamp(14px, 1.6vw, 16.5px);
  line-height: 1.3;
}

.herb-group-stat {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(57, 230, 195, 0.4);
}

.herb-rule {
  padding: 10px 0;
  border-top: 1px dashed rgba(147, 169, 198, 0.2);
}

.herb-rule:first-of-type {
  padding-top: 2px;
  border-top: 0;
}

.herb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.herb-name {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.herb-done {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid rgba(126, 249, 126, 0.45);
  border-radius: 999px;
  background: rgba(126, 249, 126, 0.14);
  color: var(--neon);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(126, 249, 126, 0.25);
}

.herb-bar {
  height: 7px;
  margin: 8px 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(57, 230, 195, 0.12);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.herb-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon) 0%, var(--teal) 62%, var(--violet) 100%);
  box-shadow: 0 0 10px rgba(126, 249, 126, 0.45);
  transition: width 0.35s ease;
}

.herb-meta {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.review-title {
  margin: 22px 0 10px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.review-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 107, 107, 0.24);
  border-radius: 14px;
  background: rgba(255, 107, 107, 0.08);
}

.review-word {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}

.review-rule {
  color: var(--muted);
  font-size: 10.5px;
}

.review-empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
   Настройки
   ========================================================================== */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(147, 169, 198, 0.14);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.settings-row:last-of-type { border-bottom: 0; }

.switch-btn,
.danger-btn {
  min-width: 118px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.switch-btn {
  border-color: rgba(57, 230, 195, 0.4);
  background: rgba(57, 230, 195, 0.12);
  color: #b8fff3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 18px rgba(57, 230, 195, 0.16);
}

.switch-btn:hover {
  border-color: rgba(57, 230, 195, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 26px rgba(57, 230, 195, 0.34);
}

.danger-btn {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.1);
  color: #ffc9c9;
}

.danger-btn:hover {
  border-color: rgba(255, 107, 107, 0.8);
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.32);
}

.danger-btn.is-armed {
  border-color: rgba(255, 107, 107, 0.9);
  background: linear-gradient(180deg, #ff8080, #e04a4a);
  color: #2b0606;
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.52);
}

.settings-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Аккаунт: вход через Google и статус синхронизации. */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  max-width: 170px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(57, 230, 195, 0.38);
  background: rgba(57, 230, 195, 0.1);
  color: #c9fff3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(57, 230, 195, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.account-chip::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(57, 230, 195, 0.8);
}

.account-chip:hover,
.account-chip:focus-visible {
  border-color: rgba(126, 249, 126, 0.65);
  background: rgba(57, 230, 195, 0.17);
  transform: translateY(-1px);
}

.account-chip.is-signed {
  border-color: rgba(126, 249, 126, 0.45);
  color: #eaffea;
}

.account-chip.is-signed::before { background: var(--lime, #7ef97e); }

.account-block {
  margin: 10px 0 2px;
  padding: 14px 0 10px;
  border-top: 1px solid rgba(147, 169, 198, 0.14);
  border-bottom: 1px solid rgba(147, 169, 198, 0.14);
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.account-status {
  padding: 5px 10px;
  border: 1px solid rgba(147, 169, 198, 0.3);
  border-radius: 999px;
  background: rgba(147, 169, 198, 0.1);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.account-status.is-cloud {
  border-color: rgba(57, 230, 195, 0.45);
  background: rgba(57, 230, 195, 0.12);
  color: #b8fff3;
}

.account-status.is-offline {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
  color: #ffc9c9;
}

.account-note { margin: 10px 0 12px; }

.account-login {
  min-height: 54px;
  font-size: 16px;
}

.account-name {
  margin: 12px 0 2px;
  color: var(--ink-dim);
  font-size: 14px;
}

.account-name b {
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.account-mail {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-sync {
  margin: 8px 0 12px;
}

.account-sync.is-ok { color: #b8fff3; }

.account-sync.is-error { color: #ffc9c9; }

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-actions .account-btn {
  flex: 1 1 140px;
  margin-top: 0;
}

.account-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ==========================================================================
   Дневной бонус
   ========================================================================== */

.daily-sheet {
  width: min(90vw, 420px);
  text-align: center;
}

.daily-coin {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff7dd 0%, var(--gold) 50%, #cf8f10 100%);
  box-shadow:
    0 0 26px rgba(255, 207, 92, 0.55),
    0 0 62px rgba(255, 207, 92, 0.25),
    inset 0 0 0 3px rgba(255, 255, 255, 0.45);
  animation: coinFloat 3.6s ease-in-out infinite;
}

.daily-coin::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 3px solid rgba(120, 72, 0, 0.4);
  border-radius: 50%;
}

.daily-sheet h2 { text-shadow: 0 0 26px rgba(255, 207, 92, 0.35); }

.daily-text {
  margin: 6px 0 20px;
  color: var(--ink-dim);
  font-size: clamp(17px, 2.3vw, 22px);
  font-weight: 700;
}

.primary-btn {
  width: 100%;
  min-height: 60px;
  border: 1px solid rgba(126, 249, 126, 0.6);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--neon) 0%, var(--teal) 100%);
  color: #04140c;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(57, 230, 195, 0.3),
    0 0 32px rgba(126, 249, 126, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.16s ease;
}

.primary-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 34px rgba(57, 230, 195, 0.4),
    0 0 42px rgba(126, 249, 126, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-btn:active { transform: scale(0.985); }

.ghost-btn {
  width: 100%;
  min-height: 56px;
  margin-top: 10px;
  border: 1px solid rgba(147, 169, 198, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ghost-btn:hover {
  border-color: rgba(147, 169, 198, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

/* ==========================================================================
   Тосты и эффекты
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 80;
  padding: 11px 20px;
  border: 1px solid rgba(57, 230, 195, 0.45);
  border-radius: 999px;
  background: rgba(9, 16, 30, 0.96);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(57, 230, 195, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  animation: toastIn 0.2s ease-out;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.gain-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, 0);
  color: var(--neon);
  font-size: clamp(32px, 4.8vw, 52px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 12px rgba(126, 249, 126, 0.9),
    0 0 34px rgba(57, 230, 195, 0.55),
    0 0 70px rgba(126, 249, 126, 0.35);
  animation: gainUp 0.85s ease-out forwards;
}

.spark {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, var(--spark-color, var(--neon)) 52%, rgba(255, 255, 255, 0) 72%);
  box-shadow:
    0 0 10px var(--spark-color, var(--neon)),
    0 0 24px var(--spark-color, var(--neon));
  animation: sparkFly 0.72s ease-out forwards;
}

/* ==========================================================================
   Анимации
   ========================================================================== */

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFlash {
  0% { box-shadow: var(--card-shadow); }
  32% {
    box-shadow:
      0 26px 70px rgba(0, 0, 0, 0.5),
      0 0 0 2px rgba(126, 249, 126, 0.55),
      0 0 90px rgba(126, 249, 126, 0.45),
      inset 0 0 70px rgba(126, 249, 126, 0.16);
  }
  100% { box-shadow: var(--card-shadow); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-3px); }
  36% { transform: translateX(3px); }
  54% { transform: translateX(-2px); }
  72% { transform: translateX(1px); }
}

@keyframes answerPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes hintPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 207, 92, 0.42), 0 0 18px rgba(255, 207, 92, 0.28);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 207, 92, 0.05), 0 0 34px rgba(255, 207, 92, 0.55);
  }
}

@keyframes comboPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(126, 249, 126, 0.45), 0 0 26px rgba(57, 230, 195, 0.22); }
  50% { text-shadow: 0 0 16px rgba(126, 249, 126, 0.85), 0 0 42px rgba(57, 230, 195, 0.45); }
}

@keyframes coinFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes plateIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes gainUp {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.8); }
  24% { opacity: 1; transform: translate(-50%, -4px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -96px) scale(1); }
}

@keyframes sparkFly {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.18);
  }
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(16px) scale(0.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Узкие и низкие экраны
   ========================================================================== */

@media (max-width: 640px) {
  .app { padding: 8px 10px; gap: 6px; }
  .choices { grid-template-columns: 1fr; }
  .choice-btn { min-height: clamp(72px, 12vh, 108px); }
  .choice-word { font-size: clamp(19px, 5.6vw, 29px); }
  .task-card { padding: 14px 16px; gap: 10px; }
  .task-body { gap: 12px; }
  .gap-word { font-size: clamp(26px, 7.4vw, 44px); }
  .letter-btn { width: 64px; height: 64px; font-size: 28px; }
  .verdict-word { font-size: clamp(24px, 6.4vw, 40px); }
  .verdict-btn { min-height: 58px; font-size: 17px; }
  .dock-label { font-size: 9px; }
  .dock-btn { min-width: 58px; min-height: 58px; padding: 6px; }
  .dock { gap: 5px; }
  .feedback { bottom: 84px; padding: 11px 14px; font-size: 12.5px; }
  .up-row { align-items: flex-start; gap: 8px; padding: 10px; }
  .up-main p { font-size: 11px; }
  .up-buy button { min-width: 76px; min-height: 52px; }
  .sheet { padding: 16px; border-radius: 22px; }
  .herb-group { padding: 12px; }
}

@media (max-height: 660px) {
  .task-card { padding: 12px 18px; gap: 8px; }
  .task-head { gap: 3px; }
  .task-chip { padding: 2px 9px; }
  .choice-btn { min-height: 80px; }
  .choice-word { font-size: clamp(18px, 2.6vw, 30px); }
  .gap-word { font-size: clamp(26px, 4.6vw, 44px); }
  .letter-btn { width: 58px; height: 58px; font-size: 26px; }
  .verdict-word { font-size: clamp(24px, 4vw, 40px); }
  .verdict-btn { min-height: 52px; }
  .dock-btn { min-height: 54px; }
  .dock-icon { width: 20px; height: 20px; }
  .coin-pill, .combo-pill, .hud-right { min-height: 38px; padding: 4px 12px; }
}

@media (max-width: 420px) {
  .coin-pill, .combo-pill { padding: 6px 12px; gap: 6px; }
  .hud-right { padding: 6px 12px; }
  .coin-icon { width: 20px; height: 20px; }
  .coin-icon::after { inset: 5px; }
  .hud-left { gap: 8px; }
}

/* ==========================================================================
   Соревновательный слой: статус, режимы, лидерборд, итог, ник, дуэль.
   Все новые элементы нарисованы CSS: без картинок, эмодзи и внешних шрифтов.
   ========================================================================== */

/* HUD: дивизион + рекорд. Раньше .hud-right был одной пилюлей — теперь это
   контейнер для двух компактных плашек. */
.hud-right {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  gap: 8px;
}

.best-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(57, 230, 195, 0.2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.best-pill b {
  color: var(--teal);
  font-size: clamp(16px, 1.9vw, 22px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(57, 230, 195, 0.45);
}

.division-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: min(42vw, 260px);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(139, 124, 246, 0.38);
  background:
    radial-gradient(130% 160% at 12% 0%, rgba(139, 124, 246, 0.22), rgba(13, 21, 38, 0.86) 68%);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(139, 124, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
}

.division-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ddd7ff;
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.division-rating {
  flex: 0 0 auto;
  color: #f1edff;
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(139, 124, 246, 0.55);
}

/* Строка статуса: режимная плашка + полоса до следующего дивизиона. */
.status-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 27px;
}

.mode-plate {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid rgba(57, 230, 195, 0.28);
  background: rgba(11, 19, 34, 0.82);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mode-plate.is-sprint { border-color: rgba(139, 124, 246, 0.5); }
.mode-plate.is-survival { border-color: rgba(255, 207, 92, 0.44); }
.mode-plate.is-daily { border-color: rgba(57, 230, 195, 0.5); }
.mode-plate.is-duel { border-color: rgba(255, 123, 172, 0.48); }

.mode-title {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-plate.is-sprint .mode-title { color: #c9c2ff; }
.mode-plate.is-survival .mode-title { color: var(--gold); }
.mode-plate.is-duel .mode-title { color: #ffb6d2; }

.mode-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-dim);
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.division-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  margin-left: auto;
}

.division-track {
  width: clamp(72px, 12vw, 150px);
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(139, 124, 246, 0.24);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.division-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet) 0%, var(--teal) 62%, var(--neon) 100%);
  box-shadow: 0 0 10px rgba(139, 124, 246, 0.65);
  transition: width 0.4s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.division-left,
.division-weekly {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.division-weekly { color: rgba(147, 169, 198, 0.72); }

/* Кнопка «Режимы» в доке. */
.ico-modes { color: var(--violet); filter: drop-shadow(0 0 8px rgba(139, 124, 246, 0.55)); }

.ico-modes::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 10px 0 0 currentColor, 0 10px 0 currentColor, 10px 10px 0 currentColor;
}

/* ==========================================================================
   Дуэль-баннер
   ========================================================================== */

.duel-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 207, 92, 0.45);
  border-radius: 16px;
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(255, 207, 92, 0.16), rgba(139, 124, 246, 0.08) 62%),
    rgba(9, 15, 27, 0.9);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.36),
    0 0 26px rgba(255, 207, 92, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: duelIn 0.2s ease-out;
}

.duel-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.duel-kicker {
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.duel-banner-text {
  margin: 0;
  color: var(--ink);
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 700;
  line-height: 1.25;
}

.duel-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.duel-accept,
.duel-decline {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.duel-accept {
  border: 1px solid rgba(255, 207, 92, 0.75);
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.3), rgba(255, 207, 92, 0.12));
  color: #fff4d6;
  box-shadow: 0 0 22px rgba(255, 207, 92, 0.26);
}

.duel-accept:hover {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 207, 92, 0.42);
  transform: translateY(-1px);
}

.duel-decline {
  border: 1px solid rgba(147, 169, 198, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
}

.duel-decline:hover { border-color: rgba(147, 169, 198, 0.5); color: var(--ink); }
.duel-accept:active,
.duel-decline:active { transform: scale(0.97); }

/* ==========================================================================
   Шит «Режимы»
   ========================================================================== */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid rgba(57, 230, 195, 0.18);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mode-card.mode-sprint { border-color: rgba(139, 124, 246, 0.3); }
.mode-card.mode-survival { border-color: rgba(255, 207, 92, 0.26); }
.mode-card.mode-daily { border-color: rgba(57, 230, 195, 0.34); }
.mode-card.mode-duel { border-color: rgba(255, 123, 172, 0.26); }

.mode-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.2;
}

.mode-card p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.42;
}

.mode-stat {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mode-card.mode-daily .mode-stat:first-of-type { color: var(--gold); }
.mode-card.mode-duel .mode-stat { color: #ffb6d2; }

.mode-play {
  min-height: 56px;
  margin-top: 2px;
  border: 1px solid rgba(126, 249, 126, 0.46);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.18), rgba(57, 230, 195, 0.1));
  color: #d7ffdd;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(126, 249, 126, 0.14);
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.mode-play:hover {
  border-color: rgba(126, 249, 126, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 28px rgba(126, 249, 126, 0.42);
  transform: translateY(-1px);
}

.mode-play:active { transform: scale(0.97); }

.mode-card.mode-sprint .mode-play { border-color: rgba(139, 124, 246, 0.55); color: #e3ddff; box-shadow: 0 0 18px rgba(139, 124, 246, 0.16); }
.mode-card.mode-sprint .mode-play:hover { border-color: rgba(139, 124, 246, 0.95); box-shadow: 0 0 28px rgba(139, 124, 246, 0.4); }
.mode-card.mode-survival .mode-play { border-color: rgba(255, 207, 92, 0.55); color: #fff0c9; box-shadow: 0 0 18px rgba(255, 207, 92, 0.14); }
.mode-card.mode-survival .mode-play:hover { border-color: rgba(255, 207, 92, 0.95); box-shadow: 0 0 28px rgba(255, 207, 92, 0.34); }
.mode-card.mode-duel .mode-play { border-color: rgba(255, 123, 172, 0.55); color: #ffd7e6; box-shadow: 0 0 18px rgba(255, 123, 172, 0.14); }
.mode-card.mode-duel .mode-play:hover { border-color: rgba(255, 123, 172, 0.95); box-shadow: 0 0 28px rgba(255, 123, 172, 0.34); }

.mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.mode-actions .ghost-btn {
  flex: 1 1 190px;
  width: auto;
  margin-top: 0;
}

/* ==========================================================================
   Лидерборд
   ========================================================================== */

.lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.lb-tab {
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(57, 230, 195, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.lb-tab:hover { border-color: rgba(57, 230, 195, 0.55); color: var(--ink); }

.lb-tab.is-active {
  border-color: rgba(126, 249, 126, 0.7);
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.2), rgba(57, 230, 195, 0.08));
  color: #eaffef;
  box-shadow: 0 0 20px rgba(126, 249, 126, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lb-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(38vh, 320px);
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.lb-row:first-child {
  border-color: rgba(255, 207, 92, 0.35);
  background: linear-gradient(90deg, rgba(255, 207, 92, 0.1), rgba(255, 255, 255, 0.02));
}

.lb-rank {
  flex: 0 0 22px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.lb-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }

.lb-nick {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
}

.lb-extra { color: var(--muted); font-size: 10.5px; }

.lb-score {
  flex: 0 0 auto;
  color: var(--neon);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(126, 249, 126, 0.35);
}

.lb-local-title {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.local-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin-bottom: 14px;
}

.local-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(147, 169, 198, 0.16);
  font-size: 12px;
}

.local-label { color: var(--muted); white-space: nowrap; }
.local-value { color: var(--ink); text-align: right; }

.local-note {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: var(--gold);
  font-size: 11.5px;
  line-height: 1.4;
}

/* ==========================================================================
   Итоговый экран
   ========================================================================== */

.result-sheet { width: min(94vw, 560px); }

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(126, 249, 126, 0.28);
  border-radius: 20px;
  background: radial-gradient(130% 180% at 50% 0%, rgba(126, 249, 126, 0.13), rgba(9, 15, 27, 0.6) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 26px rgba(126, 249, 126, 0.1);
}

.result-score b {
  color: var(--neon);
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 22px rgba(126, 249, 126, 0.55), 0 0 52px rgba(57, 230, 195, 0.25);
}

.result-accuracy { color: var(--muted); font-size: 12px; font-weight: 600; }

.result-rows { display: flex; flex-direction: column; margin-bottom: 12px; }

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(147, 169, 198, 0.16);
  color: var(--muted);
  font-size: 13px;
}

.result-row:last-child { border-bottom: 0; }
.result-row b { color: var(--ink); text-align: right; font-weight: 700; }

.result-duel {
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 207, 92, 0.3);
  border-radius: 14px;
  background: rgba(255, 207, 92, 0.08);
  color: #ffe6b0;
  font-size: 12.5px;
  line-height: 1.45;
}

.result-sheet .primary-btn { margin-top: 4px; }
.result-sheet #result-share,
.result-sheet #result-menu { margin-top: 9px; }

/* ==========================================================================
   Ник
   ========================================================================== */

.nick-input {
  width: 100%;
  min-height: 56px;
  margin: 4px 0 12px;
  padding: 0 16px;
  border: 1px solid rgba(57, 230, 195, 0.35);
  border-radius: 16px;
  background: rgba(4, 10, 20, 0.72);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.16s ease, box-shadow 0.18s ease;
}

.nick-input::placeholder { color: rgba(147, 169, 198, 0.6); font-weight: 500; }

.nick-input:focus {
  border-color: rgba(126, 249, 126, 0.85);
  box-shadow: 0 0 0 3px rgba(126, 249, 126, 0.14), 0 0 24px rgba(126, 249, 126, 0.2);
}

.nick-error {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}

/* ==========================================================================
   Анимации соревновательного слоя
   ========================================================================== */

@keyframes duelIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Адаптивность нового слоя
   ========================================================================== */

@media (max-width: 720px) {
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .local-records { grid-template-columns: 1fr; }
  .mode-actions .ghost-btn { flex: 1 1 100%; }
  .division-pill { max-width: 52vw; }
}

@media (max-width: 640px) {
  .best-pill { display: none; }
  .status-row { flex-wrap: wrap; gap: 6px; }
  .division-meter { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
  .division-track { width: 100%; max-width: 150px; }
  .division-weekly { margin-left: auto; }
  .duel-banner { flex-direction: column; align-items: stretch; gap: 8px; }
  .duel-actions { justify-content: flex-end; }
  .mode-card { padding: 12px; }
  .mode-card p { font-size: 11.5px; }
  .mode-play { min-height: 54px; }
  .lb-tab { min-height: 52px; padding: 0 12px; font-size: 11.5px; }
  .lb-list { max-height: 34vh; }
  .result-score { gap: 8px; padding: 12px; }
  .dock-btn { min-width: 52px; padding: 6px 4px; }
  .dock { gap: 4px; }
}

@media (max-width: 420px) {
  .division-pill { max-width: 42vw; padding: 5px 10px; }
  .division-rating { font-size: 15px; }
  .mode-meta { font-size: 10px; }
  .division-left { display: none; }
  .division-weekly { font-size: 9.5px; }
  .duel-accept, .duel-decline { min-height: 52px; padding: 0 12px; }
}

@media (max-width: 380px) {
  .coin-pill, .combo-pill { padding: 6px 9px; gap: 6px; }
  .combo-label { display: none; }
  .division-pill { max-width: 38vw; padding: 5px 8px; gap: 6px; }
  .division-name { font-size: 8.5px; }
}

@media (max-height: 660px) {
  .best-pill, .division-pill { min-height: 38px; padding: 4px 12px; }
  .status-row { min-height: 24px; }
  .mode-plate { padding: 3px 10px; }
  .duel-banner { padding: 6px 10px; }
  .duel-accept, .duel-decline { min-height: 46px; }
  .mode-card { padding: 10px 12px; gap: 6px; }
  .mode-play { min-height: 50px; }
  .result-score { padding: 10px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Режим «Сложный»: неоновая карточка, плашка и крупные тап-зоны
   ========================================================================== */

.mode-card.mode-hard {
  border-color: rgba(255, 92, 122, 0.4);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 92, 122, 0.16), rgba(255, 92, 122, 0) 58%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 26px rgba(255, 92, 122, 0.12);
}

.mode-card.mode-hard h3 { color: #ffd7df; }

.mode-card.mode-hard .mode-stat { color: #ff9fb3; }

.mode-card.mode-hard .mode-play {
  min-height: 60px;
  border-color: rgba(255, 92, 122, 0.6);
  background: linear-gradient(180deg, rgba(255, 92, 122, 0.24), rgba(255, 92, 122, 0.08));
  color: #ffe3e9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 22px rgba(255, 92, 122, 0.24);
}

.mode-card.mode-hard .mode-play:hover {
  border-color: rgba(255, 92, 122, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 34px rgba(255, 92, 122, 0.48);
}

.mode-plate.is-hard {
  border-color: rgba(255, 92, 122, 0.55);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(255, 92, 122, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mode-plate.is-hard .mode-title { color: #ffb3c1; }

@media (max-width: 420px) {
  .mode-card.mode-hard .mode-play { min-height: 58px; }
}

@media (max-height: 660px) {
  .mode-card.mode-hard .mode-play { min-height: 52px; }
}

/* ==========================================================================
   Выбор темы: HUD-плашка, шит «Что тренируем» и choice-задания 4–5
   ========================================================================== */

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 27px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 124, 246, 0.38);
  background: rgba(11, 19, 34, 0.82);
  color: #d9d3ff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-picker {
  margin: 4px 0 16px;
  padding: 14px 15px;
  border: 1px solid rgba(139, 124, 246, 0.24);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(139, 124, 246, 0.13), rgba(139, 124, 246, 0) 62%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.theme-picker-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 19px);
}

.theme-current {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 207, 92, 0.45);
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.theme-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(57, 230, 195, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.theme-chip:hover {
  border-color: rgba(57, 230, 195, 0.62);
  color: var(--ink);
}

.theme-chip.is-active {
  border-color: rgba(126, 249, 126, 0.85);
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.22), rgba(57, 230, 195, 0.1));
  color: #eaffef;
  box-shadow: 0 0 20px rgba(126, 249, 126, 0.24);
}

/* Частично выбранный раздел: часть номеров уже в мультивыборе. */
.theme-chip.is-partial {
  border-color: rgba(139, 124, 246, 0.72);
  background: linear-gradient(180deg, rgba(139, 124, 246, 0.2), rgba(57, 230, 195, 0.07));
  color: #e7e2ff;
  box-shadow: inset 0 0 0 1px rgba(139, 124, 246, 0.28), 0 0 14px rgba(139, 124, 246, 0.16);
}

.theme-chip.is-partial::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px rgba(139, 124, 246, 0.8);
  vertical-align: middle;
}

.theme-chip.is-partial:hover {
  border-color: rgba(139, 124, 246, 0.95);
  color: #f1edff;
}

.theme-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.theme-num {
  width: 44px;
  min-height: 44px;
  border: 1px solid rgba(57, 230, 195, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.theme-num:hover {
  border-color: rgba(57, 230, 195, 0.65);
  color: var(--ink);
}

.theme-num.is-active {
  border-color: rgba(126, 249, 126, 0.85);
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.22), rgba(57, 230, 195, 0.1));
  color: #eaffef;
  box-shadow: 0 0 18px rgba(126, 249, 126, 0.22);
}

.theme-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

/* Задания 4/5: длинные формулировки и слова с ударением. */
.choices-choice { margin-top: 2px; }

.choices-choice .choice-btn { min-height: clamp(96px, 16vh, 150px); }

.choices-choice .choice-word { font-size: clamp(20px, 3vw, 38px); }

.choices-choice.is-long .choice-word { font-size: clamp(17px, 2.4vw, 30px); }

.choices-choice.is-xlong .choice-word { font-size: clamp(15px, 2vw, 26px); }

.choice-option .choice-word {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.task-prompt.is-choice {
  max-width: 94%;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(18px, 2.3vw, 27px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.task-prompt.is-choice.is-long {
  font-size: clamp(16px, 1.9vw, 23px);
  line-height: 1.34;
}

/* «Сложный» недоступен для темы без hard-заданий. */
.mode-card.is-unavailable { opacity: 0.84; }

.mode-card.mode-hard .mode-play:disabled,
.mode-card.mode-hard .mode-play:disabled:hover {
  border-color: rgba(255, 92, 122, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #ffb3c1;
  cursor: not-allowed;
  opacity: 0.68;
  font-size: 12.5px;
  line-height: 1.22;
  padding: 4px 8px;
  box-shadow: none;
  transform: none;
}

@media (max-width: 720px) {
  .theme-num { width: 40px; min-height: 40px; }
}

@media (max-width: 640px) {
  .status-left { flex: 1 1 100%; }
  .theme-pill { font-size: 10px; }
  .theme-chip { min-height: 46px; font-size: 12px; }
  .choices-choice .choice-btn { min-height: clamp(78px, 13vh, 112px); }
  .choices-choice .choice-word { font-size: clamp(18px, 5vw, 28px); }
  .choices-choice.is-long .choice-word { font-size: clamp(16px, 4.4vw, 24px); }
  .choices-choice.is-xlong .choice-word { font-size: clamp(14px, 3.8vw, 21px); }
  .task-prompt.is-choice { font-size: clamp(17px, 4.5vw, 24px); }
  .task-prompt.is-choice.is-long { font-size: clamp(15px, 4vw, 21px); }
}

@media (max-width: 420px) {
  .theme-picker { padding: 12px; }
  .theme-chip { flex: 1 1 calc(50% - 7px); }
  .theme-num { width: 11.5%; min-width: 38px; }
}

@media (max-height: 660px) {
  .theme-picker { margin-bottom: 12px; padding: 10px 12px; }
  .theme-chip { min-height: 40px; }
  .theme-num { min-height: 40px; }
  .choices-choice .choice-btn { min-height: 78px; }
}

/* ==========================================================================
   Отработка ошибок: карточка режима и плашка
   ========================================================================== */

.mode-card.mode-mistakes {
  border-color: rgba(126, 249, 126, 0.4);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(126, 249, 126, 0.14), rgba(126, 249, 126, 0) 58%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 26px rgba(126, 249, 126, 0.1);
}

.mode-card.mode-mistakes h3 { color: #dcffdf; }

.mode-card.mode-mistakes .mode-stat { color: var(--neon); }

.mode-card.mode-mistakes .mode-play {
  border-color: rgba(126, 249, 126, 0.62);
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.22), rgba(57, 230, 195, 0.1));
  color: #eaffef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 22px rgba(126, 249, 126, 0.2);
}

.mode-card.mode-mistakes .mode-play:hover:not(:disabled) {
  border-color: rgba(126, 249, 126, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 32px rgba(126, 249, 126, 0.42);
}

.mode-card.mode-mistakes .mode-play:disabled,
.mode-card.mode-mistakes .mode-play:disabled:hover {
  border-color: rgba(147, 169, 198, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(185, 203, 228, 0.72);
  cursor: not-allowed;
  font-size: 12.5px;
  line-height: 1.24;
  padding: 4px 10px;
  box-shadow: none;
  transform: none;
}

.mode-plate.is-mistakes {
  border-color: rgba(126, 249, 126, 0.55);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(126, 249, 126, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mode-plate.is-mistakes .mode-title { color: #b9ffc0; }

/* ==========================================================================
   Статистика: неоновый оверлей
   ========================================================================== */

.stats-sheet {
  width: min(97vw, 900px);
  max-height: 90vh;
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 20px;
}

.stats-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid rgba(57, 230, 195, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(57, 230, 195, 0.1), rgba(57, 230, 195, 0) 64%),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
}

.stats-kpi span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.stats-kpi b {
  color: var(--ink);
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-kpi.is-accent {
  border-color: rgba(126, 249, 126, 0.4);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(126, 249, 126, 0.16), rgba(126, 249, 126, 0) 64%),
    rgba(255, 255, 255, 0.04);
}

.stats-kpi.is-accent b {
  color: var(--neon);
  text-shadow: 0 0 18px rgba(126, 249, 126, 0.5);
}

.stats-block { margin-top: 20px; }

.stats-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.stats-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(57, 230, 195, 0.8);
  vertical-align: 1px;
}

.stats-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-align: left;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stats-row.is-clickable {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.stats-row.is-clickable:hover {
  border-color: rgba(57, 230, 195, 0.55);
  background: rgba(57, 230, 195, 0.08);
  box-shadow: 0 0 18px rgba(57, 230, 195, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.stats-row.is-clickable:active { transform: scale(0.99); }

.stats-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.stats-row-name {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-row-meta {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.stats-row-acc {
  color: var(--neon);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(126, 249, 126, 0.35);
  white-space: nowrap;
}

.stats-row-bar {
  display: block;
  width: 86px;
  height: 5px;
  border-radius: 999px;
  background: rgba(147, 169, 198, 0.16);
  overflow: hidden;
}

.stats-row-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--neon));
  box-shadow: 0 0 10px rgba(126, 249, 126, 0.55);
  transition: width 0.3s ease;
}

.stats-rows-compact .stats-row { padding: 8px 12px; }
.stats-rows-compact .stats-row-name { font-size: 12px; }

.stats-tops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-top-col {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 107, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 107, 107, 0.08), rgba(255, 107, 107, 0) 64%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stats-top-col h4 {
  margin: 0 0 8px;
  color: #ffc4c4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stats-errors { display: flex; flex-direction: column; }

.stats-error-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px dashed rgba(147, 169, 198, 0.16);
}

.stats-error-row:first-child { border-top: 0; padding-top: 0; }

.stats-error-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stats-error-name {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stats-error-rule {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.stats-error-count {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(255, 107, 107, 0.35);
}

.stats-note {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.stats-practice { margin-top: 12px; }

.stats-empty {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(126, 249, 126, 0.35);
  border-radius: 14px;
  background: rgba(126, 249, 126, 0.08);
  color: #d9ffdd;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 18px rgba(126, 249, 126, 0.1);
}

.stats-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stats-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.stats-recent-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stats-recent-word {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-recent-meta {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-recent-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.stats-recent-empty {
  padding: 12px 14px;
  border: 1px dashed rgba(147, 169, 198, 0.22);
  border-radius: 14px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.stats-week {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 12px 14px;
  border: 1px solid rgba(57, 230, 195, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 50% 100%, rgba(57, 230, 195, 0.12), rgba(57, 230, 195, 0) 66%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stats-week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
  min-width: 0;
  flex: 1 1 0;
}

.stats-week-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.stats-week-bar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 34px;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 8px;
  background: rgba(147, 169, 198, 0.12);
  overflow: hidden;
}

.stats-week-fill {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--neon), var(--teal));
  box-shadow: 0 0 14px rgba(126, 249, 126, 0.4);
  transition: height 0.3s ease;
}

.stats-week-day {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.stats-week-col.is-today .stats-week-day {
  color: var(--neon);
  text-shadow: 0 0 12px rgba(126, 249, 126, 0.55);
}

.stats-week-col.is-today .stats-week-count { color: var(--neon); }

.stats-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.stats-actions .primary-btn,
.stats-actions .ghost-btn,
.stats-actions .danger-btn {
  flex: 1 1 220px;
  width: auto;
  min-height: 56px;
  margin-top: 0;
  padding: 0 16px;
  font-size: 14px;
}

.stats-actions .ghost-btn { font-weight: 700; }

@media (max-width: 900px) {
  .stats-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .stats-sheet { width: min(96vw, 900px); }
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stats-kpi { min-height: 64px; padding: 8px 10px; }
  .stats-kpi b { font-size: 18px; }
  .stats-tops { grid-template-columns: 1fr; }
  .stats-row { padding: 9px 11px; gap: 9px; }
  .stats-row-bar { width: 64px; }
  .stats-row-name { font-size: 12px; }
  .stats-task-row { align-items: flex-start; }
  .stats-task-row .stats-row-name,
  .stats-task-row .stats-row-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .stats-task-row .stats-row-side { padding-top: 1px; }
  .stats-week { height: 126px; gap: 5px; padding: 10px 10px; }
  .stats-week-bar { max-width: 26px; }
  .stats-actions .primary-btn,
  .stats-actions .ghost-btn,
  .stats-actions .danger-btn { flex: 1 1 100%; }
}

@media (max-width: 420px) {
  .stats-kpi span { font-size: 9px; }
  .stats-kpi b { font-size: 16.5px; }
  .stats-row-meta { font-size: 10px; }
  .stats-row-bar { width: 52px; }
  .stats-week { height: 112px; }
  .stats-week-count { font-size: 9px; }
  .stats-recent-time { font-size: 9px; }
}

@media (max-height: 660px) {
  .stats-kpi { min-height: 58px; }
  .stats-block { margin-top: 15px; }
  .stats-week { height: 112px; }
}

/* ==========================================================================
   Серия дней: HUD, мини-оверлей, блок статистики и рейтинг серий
   ========================================================================== */

.streak-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 167, 74, 0.4);
  background:
    radial-gradient(130% 160% at 12% 0%, rgba(255, 167, 74, 0.2), rgba(13, 21, 38, 0.86) 68%);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(255, 167, 74, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
}

.streak-pill::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #ffe9a8 0%, #ffb347 52%, #ff7a4d 100%);
  box-shadow: 0 0 10px rgba(255, 167, 74, 0.7), 0 0 20px rgba(255, 122, 77, 0.28);
}

.streak-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.streak-pill b {
  color: #ffd9a3;
  font-size: clamp(16px, 1.9vw, 22px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 167, 74, 0.55);
}

/* Мини-оверлей нового дня */
.streak-sheet {
  width: min(92vw, 440px);
  text-align: center;
}

.streak-flame {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 4px auto 16px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #fff3c4 0%, #ffb347 48%, #ff5b5b 100%);
  box-shadow:
    0 0 28px rgba(255, 167, 74, 0.55),
    0 0 64px rgba(255, 91, 91, 0.24),
    inset 0 0 0 3px rgba(255, 255, 255, 0.35);
  animation: streakPulse 2.6s ease-in-out infinite;
}

.streak-flame::after {
  content: "";
  position: absolute;
  inset: 22px 24px 20px 20px;
  border-radius: 50% 50% 50% 0;
  background: radial-gradient(circle at 38% 34%, #fffdf0 0%, #ffe08a 52%, rgba(255, 224, 138, 0) 72%);
  filter: blur(0.4px);
}

.streak-kicker {
  margin: 0 0 6px;
  color: #ffbf80;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.streak-sheet h2 {
  color: #fff1d6;
  text-shadow: 0 0 26px rgba(255, 167, 74, 0.4);
}

.streak-text {
  margin: 12px 0 4px;
  color: var(--gold);
  font-size: clamp(17px, 2.3vw, 22px);
  font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 207, 92, 0.42);
}

.streak-note {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@keyframes streakPulse {
  0%, 100% { transform: rotate(-45deg) scale(1); filter: brightness(1); }
  50% { transform: rotate(-45deg) scale(1.045); filter: brightness(1.08); }
}

/* Блок «Серия дней» в статистике */
.streak-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.streak-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 167, 74, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 167, 74, 0.1), rgba(255, 167, 74, 0) 64%),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.streak-stat span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.streak-stat b {
  color: #ffe0b0;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 7px;
  border: 1px solid rgba(147, 169, 198, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.streak-day-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(147, 169, 198, 0.2);
  box-shadow: inset 0 0 0 1px rgba(147, 169, 198, 0.24);
}

.streak-day.is-active .streak-day-dot {
  background: linear-gradient(135deg, #ffe9a8, #ff9f45);
  box-shadow: 0 0 10px rgba(255, 167, 74, 0.7);
}

.streak-day-num {
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.streak-day.is-active .streak-day-num { color: #ffe3b8; }
.streak-day.is-active { border-color: rgba(255, 167, 74, 0.4); }

.streak-day.is-today {
  border-color: rgba(126, 249, 126, 0.65);
  background: rgba(126, 249, 126, 0.06);
  box-shadow: 0 0 16px rgba(126, 249, 126, 0.12);
}

.streak-day-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.streak-day.is-today .streak-day-label { color: var(--neon); }

/* Рейтинг серий */
.lb-row.is-me {
  border-color: rgba(126, 249, 126, 0.62);
  background: linear-gradient(90deg, rgba(126, 249, 126, 0.14), rgba(57, 230, 195, 0.04));
  box-shadow: 0 0 20px rgba(126, 249, 126, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lb-nick.is-me {
  color: var(--neon);
  text-shadow: 0 0 12px rgba(126, 249, 126, 0.45);
}

.lb-row-streak .lb-score {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 207, 92, 0.35);
}

/* Узкие и низкие экраны */
@media (max-width: 720px) {
  .streak-pill { padding: 5px 11px; gap: 6px; }
}

@media (max-width: 640px) {
  .streak-pill { min-height: 38px; padding: 4px 10px; }
  .streak-label { font-size: 9px; letter-spacing: 0.1em; }
  .streak-stats { gap: 6px; }
  .streak-stat { padding: 9px 10px; }
  .streak-stat b { font-size: 18px; }
  .streak-calendar { gap: 4px; }
  .streak-day { padding: 7px 2px 6px; border-radius: 11px; }
  .streak-day-num { font-size: 11px; }
  .streak-day-label { font-size: 8.5px; }
  .streak-flame { width: 64px; height: 64px; margin-bottom: 12px; }
  .streak-text { margin-top: 9px; }
}

@media (max-width: 420px) {
  .streak-pill { padding: 5px 9px; gap: 5px; }
  .streak-label { display: none; }
  .streak-pill b { font-size: 15px; }
  .streak-flame { width: 54px; height: 54px; margin-bottom: 10px; }
  .streak-flame::after { inset: 15px 17px 14px 14px; }
  .streak-stat span { font-size: 8.5px; }
  .streak-stat b { font-size: 16px; }
  .streak-day { padding: 6px 1px 5px; }
  .streak-day-label { font-size: 8px; }
  .streak-day-num { font-size: 10px; }
  .streak-day-dot { width: 7px; height: 7px; }
}

@media (max-height: 660px) {
  .streak-pill { min-height: 38px; padding: 4px 11px; }
  .streak-flame { width: 56px; height: 56px; margin-bottom: 10px; }
  .streak-note { margin-bottom: 14px; }
  .streak-stat { padding: 8px 11px; }
}

/* ==========================================================================
   Мобильная версия (<= 430px), PWA-баннер
   ========================================================================== */

html, body { -webkit-text-size-adjust: 100%; }

.install-banner {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(57, 230, 195, 0.4);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 28, 46, 0.98), rgba(8, 14, 26, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 26px rgba(57, 230, 195, 0.14);
  backdrop-filter: blur(10px);
}

.install-banner[hidden] { display: none !important; }

.install-banner-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.35;
}

.install-banner-text b { color: var(--ink); }

.install-banner-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(126, 249, 126, 0.7);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.22), rgba(57, 230, 195, 0.1));
  color: #eaffef;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.install-banner-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* Кнопка установки в настройках: длинная подпись должна переноситься. */
.install-btn {
  max-width: 64%;
  min-height: 56px;
  padding: 8px 12px;
  line-height: 1.2;
  text-align: center;
}

.install-btn:disabled,
.install-btn[disabled] {
  border-color: rgba(126, 249, 126, 0.45);
  background: rgba(126, 249, 126, 0.1);
  color: #c9ffd3;
  cursor: default;
  opacity: 1;
}

.settings-install-note { margin: -2px 0 12px; }

@media (max-width: 430px) {
  html, body { overflow-x: hidden; }

  .app {
    padding: 6px 10px calc(76px + env(safe-area-inset-bottom));
    gap: 6px;
    height: calc(var(--vh, 1vh) * 100);
  }

  .feedback { bottom: calc(82px + env(safe-area-inset-bottom)); }
  body.has-install-banner .feedback { bottom: calc(146px + env(safe-area-inset-bottom)); }

  .hud { flex-wrap: wrap; row-gap: 6px; column-gap: 8px; align-items: center; }
  .hud-left { flex: 0 1 auto; gap: 6px; min-width: 0; }
  .hud-right { flex: 1 1 auto; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }

  .coin-pill, .combo-pill, .division-pill, .streak-pill, .best-pill {
    min-height: 40px;
    padding: 4px 10px;
  }
  .coin-value { font-size: 16px; }
  .combo-pill b { font-size: 15px; }
  .combo-label { display: none; }
  .division-name { display: none; }
  .division-pill { max-width: none; }
  .division-rating { font-size: 14px; }
  .streak-label, .best-label { display: none; }
  .streak-pill b { font-size: 15px; }
  .best-pill { display: flex; }

  .status-row { flex-wrap: wrap; row-gap: 4px; }
  .division-meter { display: none; }
  .mode-plate { max-width: 100%; }
  .mode-title, .mode-meta { font-size: 11px; }
  .theme-pill { font-size: 10px; padding: 4px 10px; }
  .mastery-text { font-size: 10px; }

  .task-card { padding: 14px 12px; border-radius: 20px; overflow-y: auto; overscroll-behavior: contain; }
  .task-prompt, .task-chip { font-size: 12px; }
  .task-body { overflow-wrap: anywhere; }
  .choices { gap: 8px; }
  .choice-btn { min-height: 64px; padding: 12px 10px; }
  .choices-choice .choice-btn { min-height: 76px; }
  .choice-word { font-size: clamp(19px, 5.6vw, 28px); overflow-wrap: anywhere; }
  .options-grid { grid-template-columns: 1fr !important; }
  .gap-word, .gap-text, .verdict-word { overflow-wrap: anywhere; word-break: break-word; }

  .overlay { padding: 8px; align-items: center; overflow: hidden; }
  .sheet {
    width: calc(100vw - 16px);
    max-height: 92vh;
    max-height: min(92dvh, 92vh);
    margin: 0;
    padding: 16px;
    border-radius: 20px;
  }
  .sheet-wide, .sheet-small, .stats-sheet, .result-sheet, .streak-sheet, .daily-sheet {
    width: calc(100vw - 16px);
  }
  .sheet-head h2 { font-size: 20px; }
  .sheet-sub { font-size: 12px; }

  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { padding: 14px; }
  .mode-play { min-height: 48px; }
  .theme-chips, .theme-numbers { gap: 6px; }
  .theme-chip { min-height: 44px; padding: 6px 12px; font-size: 12px; }
  .theme-num { flex: 1 1 44px; width: auto; min-width: 44px; min-height: 44px; padding: 6px 8px; font-size: 12px; }
  .theme-note { font-size: 11px; }

  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .stats-kpi { min-height: 64px; padding: 8px 10px; }
  .stats-kpi b { font-size: 17px; }
  .stats-tops { grid-template-columns: 1fr; }
  .stats-week { gap: 4px; }
  .stats-week-col { min-width: 0; }
  .stats-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .stats-row-bar { grid-column: 1 / -1; }

  .lb-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .lb-tab { flex: 0 0 auto; min-height: 44px; padding: 0 12px; font-size: 12px; }
  .lb-list { max-height: 42vh; }

  .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(6, 10, 18, 0.92), rgba(4, 6, 13, 0.98));
    border-top: 1px solid rgba(57, 230, 195, 0.18);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
  }
  .dock-btn { width: 100%; min-width: 0; min-height: 52px; padding: 4px; border-radius: 14px; gap: 3px; }
  .dock-label { font-size: 9.5px; }
  .dock-icon { width: 20px; height: 20px; }

  .streak-sheet { padding: 18px; }
  .streak-title { font-size: 24px; }
}

@media (max-width: 360px) {
  .dock-label { font-size: 9px; }
  .theme-chip, .theme-num { padding: 6px 9px; font-size: 11px; }
  .stats-kpi b { font-size: 15px; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .app { padding: 4px 8px calc(68px + env(safe-area-inset-bottom)); gap: 4px; }
  .hud { flex-wrap: nowrap; }
  .status-row, .mastery { display: none; }
  .task-card { padding: 10px; }
  .choice-btn { min-height: 52px; }
  .install-banner { display: none !important; }
  .feedback { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
  body.has-install-banner .feedback { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
  .dock-btn { min-height: 48px; }
  .overlay { align-items: center; overflow: hidden; }
  .sheet { max-height: 92vh; max-height: min(92dvh, 92vh); }
}

@media (max-width: 520px) {
  .account-chip { max-width: 128px; min-height: 28px; padding: 4px 9px; font-size: 10px; }
}



/* Контекст задания из сборника ошибок учеников. */
.choice-context {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 8, 18, 0.35);
  color: var(--ink-soft);
  font-size: clamp(12px, 1.5vw, 14px);
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Ник в шапке шита режимов — понятная точка смены имени. */
#modes-nick {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
#modes-nick:hover { color: var(--accent); }

/* «Показать все задания» в статистике: не вываливаем 25 строк сразу. */
.stats-tasks-more {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.stats-tasks-more:hover { color: var(--text); border-color: var(--gold); }
