/* ─────────────────────────────────────────────────────────────
   Ελληνικά — мини-приложение. Палитра: эгейский синий, песок,
   олива для «верно», коралл для «неверно». Тема берётся из Telegram.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: var(--tg-theme-bg-color, #f4f6fb);
  --card: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #14213d);
  --hint: var(--tg-theme-hint-color, #7a869a);
  /* Первая строка — запасная: color-mix понимают не все WebView на Android,
     а без --line пропали бы все разделители и рамки. */
  --line: rgba(122, 134, 154, .28);
  --line: color-mix(in srgb, var(--text) 10%, transparent);

  --blue: #1f5fbf;
  --blue-deep: #173f80;
  --blue-soft: rgba(31, 95, 191, .12);
  --sand: #f2c572;
  --sand-deep: #d9a43f;
  --olive: #4caf6d;
  --olive-soft: rgba(76, 175, 109, .16);
  --coral: #e5645a;
  --coral-soft: rgba(229, 100, 90, .16);

  /* Акценты на бледной подложке — отдельно от цвета кнопок: в тёмной теме
     насыщенный синий кнопки на своей же бледной подложке не читается. */
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  --fire-fg: #7a5205;
  --fire-bg: rgba(242, 197, 114, .28);
  --ok-fg: #256b3d;
  --bad-fg: #a5352c;
  --xp-fg: #8a6410;

  /* Мелкие подписи: цвет подсказки от Telegram местами слишком блёклый. */
  --hint-strong: var(--hint);
  --hint-strong: color-mix(in srgb, var(--text) 72%, var(--bg));

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(20, 33, 61, .08);
  --bar-h: 88px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Тёмная тема Telegram: акценты светлее, иначе синее по тёмному не видно. */
:root[data-theme="dark"] {
  --accent: #8fb6f5;
  --accent-soft: rgba(122, 169, 240, .18);
  --fire-fg: #f2c572;
  --fire-bg: rgba(242, 197, 114, .16);
  --ok-fg: #7fd6a0;
  --bad-fg: #ff9a91;
  --xp-fg: #f2c572;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }

.app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
}

.screen {
  padding: 16px 18px calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
  animation: rise .28s cubic-bezier(.2, .8, .2, 1);
}
.screen.no-bar { padding-bottom: 32px; }
.screen.center {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ── типографика ─────────────────────────────────────────── */

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.hint { color: var(--hint-strong); font-size: 14px; }
.muted { color: var(--hint); }
.greek { font-size: 34px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.greek.small { font-size: 22px; }
.translit { color: var(--hint-strong); font-style: italic; font-size: 16px; margin-top: 4px; }
.center-text { text-align: center; }

/* ── карточки и кнопки ───────────────────────────────────── */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  /* В тёмных темах Telegram фон карточки почти совпадает с фоном экрана
     (на iOS это #000 на #1c1c1d), а тень на тёмном не видна вовсе.
     Рамка отделяет карточку в любой теме. */
  border: 1px solid var(--line);
}
.card + .card { margin-top: 12px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 17px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 0 var(--blue-deep);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  user-select: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-deep); }
.btn:disabled { filter: grayscale(.6) opacity(.55); box-shadow: none; transform: none; cursor: default; }
/* Белый текст на светлой оливе давал 2.7:1 — берём тёмные оттенки. */
.btn.ok { background: #2f7d4c; box-shadow: 0 6px 0 #23603a; }
.btn.ok:active { box-shadow: 0 2px 0 #23603a; }
.btn.bad { background: #c23b31; box-shadow: 0 6px 0 #942d25; }
.btn.bad:active { box-shadow: 0 2px 0 #942d25; }
.btn.ghost {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--line); transform: scale(.98); }
.btn.sand { background: var(--sand); color: #3a2a05; box-shadow: 0 6px 0 var(--sand-deep); }
.btn.sand:active { box-shadow: 0 2px 0 var(--sand-deep); }

.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.chip.fire { background: var(--fire-bg); color: var(--fire-fg); }

/* ── главный экран ───────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 18px;
}
.ring { position: relative; width: 108px; height: 108px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--olive); transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring .label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; line-height: 1;
}
.ring .label small { font-size: 11px; color: var(--hint); font-weight: 600; margin-top: 3px; }

.tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
  min-height: 92px;
  transition: transform .1s;
}
.tile:active { transform: scale(.97); }
.tile .ico { font-size: 24px; }
.tile .t { font-weight: 700; }
.tile .s { font-size: 13px; color: var(--hint-strong); }

.board .who {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.board .who + .who { border-top: 1px solid var(--line); }
.board .name { flex: 1; font-weight: 700; }
.board .who.me .name { color: var(--accent); }
.board .together { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--hint-strong); }
.board .xp { font-weight: 800; }
.board .st { color: var(--hint-strong); font-size: 13px; }

/* ── трудные слова ───────────────────────────────────────── */

.hardbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--fire-bg);
  color: var(--fire-fg);
  font-weight: 700;
  text-align: left;
  border: 1px solid var(--line);
  transition: transform .1s;
}
.hardbar:active { transform: scale(.98); }
.hardbar span { font-weight: 600; opacity: .8; white-space: nowrap; }

.speaker.sm { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
.list.hard .item { align-items: center; }
.list .item .meter { height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.list .item .meter i { display: block; height: 100%; background: var(--olive); border-radius: 2px; }
.chip.bad { background: var(--coral-soft); color: var(--bad-fg); }
.x-small {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  color: var(--hint);
  font-size: 18px;
  display: grid; place-items: center;
}
.x-small:active { background: var(--coral-soft); color: var(--bad-fg); }
.linkbtn.inline { display: inline-block; width: auto; min-height: 40px; padding: 0 8px; }

/* ── урок ────────────────────────────────────────────────── */

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar .x { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: var(--hint); }
.progress { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--olive); border-radius: 999px; transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.topbar .xp { font-weight: 800; color: var(--xp-fg); min-width: 48px; text-align: right; }

.prompt { color: var(--hint); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }

.stim {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.stim .word { flex: 1; }
.speaker {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  display: grid; place-items: center;
  transition: transform .1s;
}
.speaker:active { transform: scale(.92); }
.speaker.big { width: 100%; height: 120px; font-size: 44px; border-radius: var(--radius); }
.speaker.playing { animation: pulse .9s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.options { display: grid; gap: 10px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  padding: 16px 14px;
  min-height: 58px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line), 0 2px 0 var(--line);
  font-weight: 600;
  font-size: 17px;
  text-align: left;
  transition: transform .08s, box-shadow .12s, background .12s;
}
.opt.gr { font-size: 20px; font-weight: 700; text-align: center; }
/* Длинные слова вроде «σαββατοκύριακο» в двух колонках вылезали за экран. */
.opt { overflow-wrap: anywhere; }
.options.two .opt { font-size: 18px; padding: 14px 10px; }
.opt:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line); }
.opt.selected { box-shadow: inset 0 0 0 2.5px var(--blue), 0 2px 0 var(--blue); background: var(--blue-soft); }
.opt.right { box-shadow: inset 0 0 0 2.5px var(--olive), 0 2px 0 var(--olive); background: var(--olive-soft); }
.opt.wrong { box-shadow: inset 0 0 0 2.5px var(--coral), 0 2px 0 var(--coral); background: var(--coral-soft); animation: shake .35s; }
.opt.dim { opacity: .45; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.typebox {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 0;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
  font-size: 24px;
  font-weight: 700;
  outline: none;
}
.typebox:focus { box-shadow: inset 0 0 0 2.5px var(--blue); }
.typebox.right { box-shadow: inset 0 0 0 2.5px var(--olive); background: var(--olive-soft); }
.typebox.wrong { box-shadow: inset 0 0 0 2.5px var(--coral); background: var(--coral-soft); }

/* ── сборка слова из букв ────────────────────────────────── */

.slots {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 60px;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
  margin-bottom: 20px;
}
.slots.right { box-shadow: inset 0 0 0 2.5px var(--olive); background: var(--olive-soft); }
.slots.wrong { box-shadow: inset 0 0 0 2.5px var(--coral); background: var(--coral-soft); animation: shake .35s; }
.slot {
  width: 34px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  border-bottom: 2px solid var(--line);
}
.slot.filled { background: var(--accent-soft); color: var(--accent); border-bottom-color: transparent; }

.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bank .tile {
  min-width: 46px; height: 52px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line), 0 2px 0 var(--line);
  font-size: 22px; font-weight: 700;
  transition: transform .08s, opacity .15s;
}
.bank .tile:active { transform: translateY(2px); }
.bank .tile.used { opacity: .25; pointer-events: none; }

.linkbtn {
  display: block;
  width: 100%;
  min-height: 44px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── фраза с пропуском ───────────────────────────────────── */

.sentence { font-size: 21px; font-weight: 700; line-height: 1.5; }
.sentence .gap {
  display: inline-block;
  min-width: 62px;
  padding: 0 8px;
  margin: 0 2px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
}
.sentence .gap.filled { background: var(--accent-soft); }
.sentence .gap.right { background: var(--olive-soft); color: var(--ok-fg); }
.sentence .gap.wrong { background: var(--coral-soft); color: var(--bad-fg); }

.intro {
  text-align: center;
  padding: 28px 18px;
  cursor: pointer;
  transition: transform .1s;
}
.intro:active { transform: scale(.99); }
.intro .badge { display: inline-block; margin-bottom: 14px; }
.intro .ru { font-size: 22px; font-weight: 600; margin-top: 14px; }
.intro .ex { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--hint); font-size: 15px; }
.intro .ex b { color: var(--text); font-weight: 600; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .opt { min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; }
.match .opt.done { opacity: .35; pointer-events: none; box-shadow: inset 0 0 0 2px var(--olive); background: var(--olive-soft); }

/* ── нижняя панель ───────────────────────────────────────── */

.bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--line);
  /* --kb выставляет app.js по высоте экранной клавиатуры. */
  transform: translateY(calc(-1 * var(--kb, 0px)));
  transition: transform .15s ease;
}
.bar .inner { max-width: 540px; margin: 0 auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  transform: translateY(110%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  z-index: 10;
}
.sheet.show { transform: none; }
/* Уехавшую вниз панель нельзя задеть пальцем: иначе «Продолжить» ловит
   второй тап уже после того, как экран сменился. */
.sheet:not(.show) { pointer-events: none; }
/* Фон панели обязан быть непрозрачным: под ней остаётся нижняя кнопка,
   и полупрозрачная заливка просвечивала её сквозь текст ответа. */
.sheet.ok { background-color: var(--bg); background-image: linear-gradient(var(--olive-soft), var(--olive-soft)); box-shadow: 0 -10px 30px rgba(20, 33, 61, .10); }
.sheet.bad { background-color: var(--bg); background-image: linear-gradient(var(--coral-soft), var(--coral-soft)); box-shadow: 0 -10px 30px rgba(20, 33, 61, .10); }
.sheet .inner { max-width: 540px; margin: 0 auto; }
.sheet .title { font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.sheet.ok .title { color: var(--ok-fg); }
.sheet.bad .title { color: var(--bad-fg); }
.sheet .answer-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet .answer { font-size: 17px; flex: 1; min-width: 0; }
.sheet .answer b { font-size: 20px; }
/* Кнопка «переслушать» прямо в панели с ответом: момент сразу после
   ответа — лучший, чтобы ещё раз связать звучание с написанием. */
.sheet .speaker { width: 46px; height: 46px; font-size: 20px; border-radius: 14px; }
.sheet.ok .speaker { background: rgba(76, 175, 109, .22); color: #2e7a49; }
.sheet.bad .speaker { background: rgba(229, 100, 90, .22); color: #b3423a; }
.sheet .say-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sheet .chip.say { min-height: 40px; font-weight: 700; }
.sheet .due { font-size: 13px; color: var(--hint); margin-top: -8px; margin-bottom: 14px; }

/* ── финал ───────────────────────────────────────────────── */

.hint.warn { color: var(--coral); font-weight: 600; }

.finish { text-align: center; padding: 40px 18px 20px; }
.finish .bonuses { margin-bottom: 16px; color: var(--xp-fg); font-weight: 700; font-size: 15px; }
.finish .bonuses div + div { margin-top: 2px; }
.finish .big { font-size: 64px; line-height: 1; margin-bottom: 12px; animation: pop .5s cubic-bezier(.2, 1.4, .3, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.stats3 .st { background: var(--card); border-radius: 16px; padding: 14px 8px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stats3 .v { font-size: 24px; font-weight: 800; }
.stats3 .k { font-size: 12px; color: var(--hint); margin-top: 2px; }

/* ── прогресс ────────────────────────────────────────────── */

.bars { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Зона под столбик фиксированная: раньше столбик был flex-элементом, ужимался
   вместе с подписями, и 75% с 100% рисовались одной высоты — график врал. */
.bars .col { width: 100%; height: 84px; display: flex; align-items: flex-end; }
.bars .b i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; background: var(--accent-soft); min-height: 4px; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bars .b.goal i { background: var(--olive); }
.bars .b.today i { background: var(--blue); }
.bars .b small { font-size: 11px; color: var(--hint); }
.bars .b .n { font-size: 12px; font-weight: 700; }

.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.list button.item { width: 100%; text-align: left; }
.list .item + .item { border-top: 1px solid var(--line); }
.list .item .num {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.lvl-group + .lvl-group { margin-top: 20px; }
.lvl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-left: 2px; }
.list .item .main { flex: 1; }
.list .item .sub { color: var(--hint-strong); font-size: 14px; }
.list .item .arrow { color: var(--hint); }
.lvl { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }

/* ── грамматика ──────────────────────────────────────────── */

.article { font-size: 16.5px; line-height: 1.55; }
.article pre {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.5;
  margin: 10px 0;
}
.article b { font-weight: 700; }

table.conj { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.conj td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
table.conj td:first-child { color: var(--hint); font-size: 14px; width: 42%; }
table.conj td:last-child { padding: 0; }
table.conj .form {
  width: 100%;
  min-height: 44px;
  padding: 10px 6px;
  text-align: left;
  font-weight: 700;
  font-size: 18px;
  border-radius: 10px;
  transition: background .12s;
}
table.conj .form:active { background: var(--accent-soft); }
table.conj .form.playing { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 6px; background: var(--line); padding: 4px; border-radius: 12px; margin-bottom: 8px; }
.tabs button { flex: 1; min-height: 44px; padding: 8px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--hint); }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ── настройки ───────────────────────────────────────────── */

.seg { display: flex; gap: 6px; background: var(--line); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 800; color: var(--hint); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.stepper { display: flex; align-items: center; gap: 16px; justify-content: center; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 24px; font-weight: 800; }
.stepper .v { font-size: 28px; font-weight: 800; min-width: 60px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* min-height 44px — палец не попадает по кнопке ниже этого. */
.chips button {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 600;
}
.chips button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ── прочее ──────────────────────────────────────────────── */

.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 20px; }
.empty .ico { font-size: 56px; margin-bottom: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  max-width: 88%;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(20, 33, 61, .93);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: rise .3s ease; }
.mt { margin-top: 14px; }
.mt-l { margin-top: 24px; }

/* Кому-то анимации мешают или вызывают тошноту — системную настройку уважаем. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .speaker.playing { animation: none; outline: 2px solid var(--accent); }
}
