/* VOICE everyday — учёба, свои слова, чуть игры
   IDEA остров в Эгейском море: белёные ступени, синие двери, солнце — путь по урокам как тропа камней
   PICTURE на главной — тропа уроков: кольца-камни зигзагом, заполняются по мере изучения
   COLOUR белый, глубокий эгейский синий (ведёт), солнечно-жёлтый (кнопки действий), коралл — ошибки, зелёный — верно
   TYPE Commissioner (есть греческий и кириллица) 800 для заголовков, 400–600 для текста
   LAYOUT одна колонка приложения до 720px; на ноутбуке по центру; нижнее меню на телефоне */

:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0b1426);
  --ink: light-dark(#0e1c33, #e8eefa);
  --muted: light-dark(#5a6a82, #9aaac4);
  --line: light-dark(#e3e9f2, #1e2c46);
  --soft: light-dark(#f2f6fc, #121f37);
  --sea: light-dark(#0a4fc4, #4d8dff);
  --sea-deep: light-dark(#083a91, #2b6de0);
  --sea-ink: #ffffff;
  --sun: #ffc83d;
  --sun-ink: #2b1d00;
  --good: light-dark(#13874b, #3ccf82);
  --good-bg: light-dark(#e3f6ea, #10301f);
  --bad: light-dark(#d23b2e, #ff7a6b);
  --bad-bg: light-dark(#fde8e5, #3a1612);
  --warn-bg: light-dark(#fff4d6, #3a2d0a);
  --r: 16px;
  --tabs: 64px;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 'Commissioner', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100svh; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h1 { font-size: clamp(28px, 6vw, 38px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; margin-top: 18px; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { display: grid; place-items: center; min-height: 70svh; text-align: center; padding: 24px; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.huge { width: 96px; height: 96px; stroke-width: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── Кнопки и поля ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0;
  font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: transform 0.06s, filter 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--sea); color: var(--sea-ink); box-shadow: 0 4px 0 var(--sea-deep); }
.btn.sun { background: var(--sun); color: var(--sun-ink); box-shadow: 0 4px 0 #d79f12; }
.btn.danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 70%, #000); }
.btn.ghost { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.link { background: none; color: var(--sea); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; box-shadow: none; }
.btn.wide { width: 100%; }
.btn .ic { width: 20px; height: 20px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.on { color: var(--good); }
.link { background: none; border: 0; padding: 0; color: var(--sea); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row > .btn { flex: 1 1 140px; }
.stack { display: grid; gap: 14px; }
.stack-btns { display: grid; gap: 10px; margin-top: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, .filters input, .filters select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .answer:focus { outline: none; border-color: var(--sea); }
.field input[type='range'] { padding: 0; min-height: 32px; border: 0; accent-color: var(--sea); }
.error { color: var(--bad); min-height: 1.4em; margin: 0; font-size: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }

/* ── Оболочка ── */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lang-chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px 6px 8px; font-weight: 800; cursor: pointer; }
.lang-chip span { font-weight: 600; font-size: 14px; color: var(--muted); }
.top-stats { display: flex; gap: 14px; }
.stat { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.stat small { font-weight: 600; }
.stat.hot { color: #f07b16; }
.stat.goal .ic { color: var(--sun); fill: var(--sun); stroke: #d79f12; }
.demo-note { margin: 10px max(16px, env(safe-area-inset-left, 0px)) 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); font-size: 13px; }
.view { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabs) + 32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 720px; margin: 0 auto;
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
}
.tabs a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabs a.on { color: var(--sea); background: var(--soft); }
.tabs a .ic { width: 24px; height: 24px; }
body.playing .top, body.playing .tabs { display: none; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel { background: var(--soft); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.panel.big p { font-size: 17px; }

/* ── Главная: квест дня ── */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end;
  background: var(--sea); color: var(--sea-ink); border-radius: 22px; padding: 22px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--sun); opacity: 0.95; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin-bottom: 6px; }
.hero p { color: #dbe7ff; margin-bottom: 14px; }
.hero .hello { margin: 0 0 4px; font-weight: 600; color: #fff; opacity: 0.85; }
.hero-num { text-align: right; align-self: start; color: var(--sun-ink); }
.hero-num b { display: block; font-size: 40px; font-weight: 800; line-height: 1; }
.hero-num span { font-size: 12px; font-weight: 700; display: block; max-width: 7em; margin-left: auto; line-height: 1.2; }

/* ── Тропа уроков ── */
.unit { margin-bottom: 26px; }
.unit-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.unit-head h2 { margin: 0; }
.unit-head .btn { margin-left: auto; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0 12px; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.path { list-style: none; margin: 0; padding: 4px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; align-items: start; }
@media (min-width: 560px) { .path { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
.stop { display: grid; justify-items: center; min-width: 0; }
.node { display: grid; grid-template-rows: auto auto auto; justify-items: center; align-content: start; gap: 4px; background: none; border: 0; cursor: pointer; padding: 4px 0; width: 100%; color: inherit; font: inherit; }
.ring {
  width: 68px; height: 68px; border-radius: 50%;
  background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center; transition: transform 0.1s;
}
.ring .ico {
  width: 54px; height: 54px; border-radius: 50%; background: var(--soft); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  display: grid; place-items: center; font-size: 26px; line-height: 1; font-weight: 800; color: var(--muted);
}
.node.go .ring .ico { background: color-mix(in srgb, var(--sea) 22%, var(--soft)); color: var(--ink); }
.node.done .ring .ico { background: color-mix(in srgb, var(--good) 30%, var(--soft)); color: var(--ink); }
.node.next .ring { outline: 4px solid var(--sun); outline-offset: 3px; animation: bob 2.4s ease-in-out infinite; }
.node:active .ring { transform: scale(0.94); }
.lbl { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; hyphens: auto; text-align: center; line-height: 1.2; max-width: 100%; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .node.next .ring { animation: none; } }

/* ── Шторка, тосты ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(5, 12, 28, 0.45); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto;
  background: var(--bg); border-radius: 22px 22px 0 0; max-height: 88svh; overflow: auto;
  padding: 22px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  transform: translateY(100%); transition: transform 0.22s ease-out;
}
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 30; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.kicker { font-size: 13px; font-weight: 700; color: var(--sea); margin: 0 0 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.known { background: var(--good-bg); color: var(--good); }
.pill.learning { background: color-mix(in srgb, var(--sea) 14%, transparent); color: var(--sea); }
.pill.new { background: var(--soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.lang-list { display: grid; gap: 10px; }
.lang-opt { display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; text-align: left; }
.lang-opt b { width: 46px; height: 46px; border-radius: 12px; background: var(--sea); color: #fff; display: grid; place-items: center; font-weight: 800; }
.lang-opt span { display: grid; font-weight: 700; }
.lang-opt small { color: var(--muted); font-weight: 500; }
.lang-opt.on { border-color: var(--sea); }

/* ── Конструктор ── */
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); padding: 4px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 8px; }
.seg button { flex: 1 1 auto; min-height: 40px; padding: 0 12px; border: 0; background: none; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--sea); color: #fff; }
.picks { display: grid; gap: 8px; }
.pick { background: var(--bg); border-radius: 12px; border: 2px solid var(--line); }
.pick summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.pick summary::-webkit-details-marker { display: none; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 2px 10px; padding: 0 12px 12px; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-weight: 600; }
.chk input { width: 20px; height: 20px; accent-color: var(--sea); flex: none; }
.chk small { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; font-weight: 600; font-size: 14px; }
.chip input { accent-color: var(--sea); }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.saved li { display: flex; align-items: center; gap: 10px; }
.saved li .link { flex: 1; }
.sticky-cta { position: sticky; bottom: calc(var(--tabs) + 10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.sticky-cta .btn { flex: 1; }
.sticky-cta .btn.primary { flex: 2; }

/* ── Слова ── */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; margin: 8px 0 12px; }
.wlist { list-style: none; margin: 0; padding: 0; }
.wrow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto auto auto; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.w-term { background: none; border: 0; padding: 0; text-align: left; font-weight: 700; font-size: 17px; cursor: pointer; color: var(--ink); overflow-wrap: anywhere; }
.w-tr { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .wrow { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .w-tr { grid-column: 1; grid-row: 2; font-size: 14px; }
  .wrow .pill { grid-row: 1 / 3; }
  .wrow .icon-btn { grid-row: 1 / 3; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 10px; margin-top: 12px; }
.kpis div { background: var(--bg); border-radius: 12px; padding: 12px 10px; }
.kpis b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpis span { font-size: 13px; color: var(--muted); }

/* ── Квест ── */
.player { display: grid; grid-template-rows: auto 1fr auto; min-height: 100svh; }
.p-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.bar { flex: 1; height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--good); border-radius: 99px; transition: width 0.3s; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.p-count { font-size: 13px; color: var(--muted); font-weight: 700; min-width: 3em; text-align: right; }
.p-body { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }
.p-body .kicker { font-size: 20px; color: var(--ink); font-weight: 800; }
.p-foot { padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); }
.prompt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 26px; font-weight: 700; }
.ru-prompt { font-size: 26px; font-weight: 700; }
.hint-line { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; position: relative; }
.hw { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); border-bottom: 2px dotted var(--muted); cursor: help; }
.hint-pop { position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 4; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 10px; white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; }
.sound { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--sea); color: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--sea-deep); flex: none; }
.sound.big { width: 96px; height: 96px; border-radius: 24px; }
.sound.big .ic { width: 44px; height: 44px; }
.sound.slow { background: var(--soft); color: var(--sea); box-shadow: inset 0 0 0 2px var(--line); }
.listen-row { display: flex; gap: 14px; align-items: end; justify-content: center; padding: 10px 0; }
.options { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 520px) { .options { grid-template-columns: 1fr 1fr; } }
.opt { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); box-shadow: 0 3px 0 var(--line); font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; }
.opt .num { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.opt.sel { border-color: var(--sea); background: color-mix(in srgb, var(--sea) 10%, var(--bg)); box-shadow: 0 3px 0 var(--sea); }
.opt.right { border-color: var(--good); background: var(--good-bg); box-shadow: 0 3px 0 var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 3px 0 var(--bad); }
.card { border: 2px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 4px 0 var(--line); }
.intro-card { border-color: var(--sun); box-shadow: 0 4px 0 #d79f12; background: color-mix(in srgb, var(--sun) 10%, var(--bg)); }
.term-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.term { font-size: clamp(30px, 8vw, 42px); font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tr { font-size: 22px; font-weight: 600; margin: 12px 0 0; }
.tr.small { font-size: 17px; color: var(--muted); margin: 0; }
.alt { color: var(--muted); margin: 6px 0 0; }
.answer { width: 100%; min-height: 60px; font-size: 22px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--soft); color: var(--ink); }
.answer.right { border-color: var(--good); background: var(--good-bg); }
.answer.wrong { border-color: var(--bad); background: var(--bad-bg); }
.pad { display: flex; flex-wrap: wrap; gap: 6px; }
.key { min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); font-size: 18px; cursor: pointer; }
.key.wide { padding: 0 14px; font-size: 15px; font-weight: 700; color: var(--sea); }
.tile-answer { min-height: 64px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 8px 0; }
.tile-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); box-shadow: 0 3px 0 var(--line); font-size: 18px; font-weight: 600; cursor: pointer; }
.tile:disabled { background: var(--line); color: transparent; box-shadow: none; }
.tile.in { border-color: var(--sea); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .col { display: grid; gap: 10px; align-content: start; }
.mt { min-height: 56px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); box-shadow: 0 3px 0 var(--line); font-size: 16px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.mt.sel { border-color: var(--sea); box-shadow: 0 3px 0 var(--sea); }
.mt.done { border-color: var(--good); background: var(--good-bg); color: var(--good); box-shadow: none; opacity: 0.55; }
.mt.bad { border-color: var(--bad); background: var(--bad-bg); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.speak-zone { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 10px 0; }
.mic { width: 110px; height: 110px; border-radius: 50%; border: 0; background: var(--sea); color: #fff; box-shadow: 0 6px 0 var(--sea-deep); cursor: pointer; display: grid; place-items: center; }
.mic .ic { width: 48px; height: 48px; }
.mic.on { background: var(--bad); box-shadow: 0 0 0 10px color-mix(in srgb, var(--bad) 25%, transparent); }
.feedback { border-radius: 16px; padding: 14px 16px 16px; display: grid; gap: 8px; }
.feedback b { font-size: 20px; }
.feedback p { margin: 0; font-weight: 600; }
.feedback.good, .feedback.soft { background: var(--good-bg); color: var(--good); }
.feedback.soft { background: var(--warn-bg); color: var(--ink); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.warn { background: var(--warn-bg); }
.feedback .btn { margin-top: 4px; }

/* ── Итог квеста ── */
.finish { display: grid; justify-items: center; text-align: center; gap: 10px; padding: calc(40px + env(safe-area-inset-top, 0px)) 18px calc(30px + env(safe-area-inset-bottom, 0px)); }
.finish-art { width: 150px; height: 150px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; color: var(--sun-ink); }
.finish-art .ic { fill: #fff; }
.finish-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; margin: 10px 0; }
.finish-stats div { border: 2px solid var(--line); border-radius: 14px; padding: 12px 6px; }
.finish-stats b { display: block; font-size: 26px; font-weight: 800; }
.finish-stats span { font-size: 13px; color: var(--muted); }
.finish-words { list-style: none; padding: 0; margin: 0 0 12px; width: 100%; max-width: 420px; text-align: left; }
.finish-words li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.finish-words span { color: var(--muted); text-align: right; }
.finish .row { width: 100%; max-width: 420px; }

/* ── Вход ── */
.auth { max-width: 420px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top, 0px)) 18px 40px; display: grid; gap: 14px; }
.auth h1 { font-size: 44px; margin: 0; }
.auth-art { display: flex; gap: 10px; }
.auth-art span { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; background: var(--sea); box-shadow: 0 4px 0 var(--sea-deep); }
.auth-art span:nth-child(2) { background: var(--sun); color: var(--sun-ink); box-shadow: 0 4px 0 #d79f12; transform: translateY(8px); }
.auth-art span:nth-child(3) { background: var(--good); }

@media (min-width: 760px) {
  .tabs { border-radius: 18px 18px 0 0; border: 1px solid var(--line); border-bottom: 0; }
}

/* ── Календарь занятий: 18 недель, клетки тянутся по ширине панели ── */
.cal-wrap { margin: 4px 0 10px; }
.cal { display: grid; grid-template-columns: 20px 1fr; gap: 4px 6px; max-width: 460px; }
.cal-months { grid-column: 2; display: grid; grid-template-columns: repeat(18, 1fr); gap: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: 10px; color: var(--muted); align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(18, 1fr); gap: 3px; min-width: 0; }
.cal-col { display: grid; grid-template-rows: repeat(7, auto); gap: 3px; }
.cal i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.cal-legend i { display: block; width: 14px; height: 14px; border-radius: 3px; background: var(--line); }
.cal i.lv1, .cal-legend i.lv1 { background: color-mix(in srgb, var(--good) 35%, var(--line)); }
.cal i.lv2, .cal-legend i.lv2 { background: color-mix(in srgb, var(--good) 65%, var(--line)); }
.cal i.lv3, .cal-legend i.lv3 { background: var(--good); }
.cal i.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cal i.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cal-legend span:first-child { margin-right: 4px; }
.cal-legend span:last-child { margin-left: 4px; }

/* ── Род: ο / η / το ── */
.gender-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gender-opts .opt { flex-direction: column; justify-content: center; gap: 2px; padding: 16px 8px; text-align: center; }
.gender-opts .art { font-size: 30px; font-weight: 800; line-height: 1.1; }
.gender-opts .g { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ── Добавить слова: файл, Quizlet, предпросмотр ── */
.aw-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; margin: 4px 0 6px; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.aw-help { flex: 1 1 200px; min-width: 0; }
.aw-help summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 9px 0; }
.aw-help p { margin: 4px 0 0; color: var(--muted); }
.aw-prev { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 6px 0 12px; }
.aw-head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.aw-prev ul { list-style: none; margin: 6px 0 0; padding: 0; }
.aw-prev li { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; min-width: 0; }
.aw-prev li > * { overflow-wrap: anywhere; }
.aw-prev p { margin: 6px 0 0; }

/* ── Чужой набор по ссылке ── */
.share-list { list-style: none; margin: 8px 0; padding: 0; border: 2px solid var(--line); border-radius: 14px; }
.share-list li { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 15px; min-width: 0; }
.share-list li:first-child { border-top: 0; }
.share-list li > * { overflow-wrap: anywhere; }

/* слово в карточке «Новое слово» — нажимается, чтобы послушать */
.term-say { background: none; border: 0; padding: 0; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.term-say:active { opacity: 0.7; }


/* как читать */
.reading { margin: -4px 0 0; font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
.reading-note { display: block; font-size: 13px; margin-top: 2px; }
.w-read { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

/* ── Новое слово прямо в задании ── */
.badge-new { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; background: var(--sun, #f5c542); color: #1b1b1b; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; vertical-align: 2px; }
.new-term { background: none; border: 0; padding: 0; color: inherit; font-family: inherit; cursor: pointer; text-decoration: underline dotted 2px; text-underline-offset: 6px; text-align: left; }
.reveal { margin: -6px 0 0; font-size: 18px; font-weight: 600; }
.reading-inline { color: var(--muted); font-weight: 500; }

/* ── Собрать слово из букв ── */
.spell-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 14px; font-size: 26px; font-weight: 800; }
.spell-prefix { color: var(--muted); }
.spell-word { display: flex; flex-wrap: wrap; gap: 2px; }
.letter-in { background: none; border: 0; padding: 0 1px; font: inherit; color: inherit; cursor: pointer; }
.spell-ph { color: var(--muted); font-weight: 500; }
.tile-bank.letters { gap: 8px; }
.tile.letter { min-width: 46px; min-height: 48px; font-size: 22px; font-weight: 700; text-align: center; }
[data-undo] { align-self: flex-start; }

/* в квесте подсказки сверху — не закрывают ответ и кнопку внизу */
body.playing #toast { bottom: auto; top: calc(64px + env(safe-area-inset-top, 0px)); }

/* выбор языка интерфейса на экране входа */
.auth-ui { justify-self: end; }
.auth-ui select { width: auto; padding: 6px 10px; font-size: 14px; }

/* ── Греческая клавиатура в приложении ── */
.gkb { display: grid; gap: 6px; user-select: none; -webkit-user-select: none; }
.gk-row { display: flex; gap: 5px; justify-content: center; }
.gk { flex: 1 1 0; min-width: 0; max-width: 48px; height: 46px; border-radius: 9px; border: 0; background: var(--soft); color: var(--ink); box-shadow: 0 2px 0 var(--line); font-size: 21px; font-family: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gk:active { background: var(--line); transform: translateY(1px); }
.gk.acc { font-size: 19px; height: 40px; color: var(--sea); }
.gk.wide { max-width: 64px; flex: 1.4 1 0; font-size: 20px; }
.gk.space { max-width: none; flex: 6 1 0; font-size: 15px; font-weight: 600; color: var(--muted); }
/* телефонная клавиатура включена — свою прячем, кроме ряда с ударениями и переключателя */
.gkb.compact .gk-row:nth-child(n+2):not(:last-child) { display: none; }
.gkb.compact .gk.space { display: none; }
.key { touch-action: manipulation; }

/* без случайного приближения от двойного нажатия; поля ввода от 16px — iPhone не увеличивает страницу при фокусе */
html, body, button, a, input, select, textarea, label { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; cursor: pointer; }
.toggle-row input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--sea); flex: none; }
.toggle-row span { display: grid; gap: 2px; }

/* Курсы: язык → язык переводов */
.lang-chip .chip-base { font-size: 12px; font-weight: 800; color: var(--sea); }
.course { border: 2px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.course.on { border-color: var(--sea); }
.course-head { display: flex; align-items: center; gap: 12px; }
.course-head b { width: 40px; height: 40px; border-radius: 12px; background: var(--sea); color: #fff; display: grid; place-items: center; font-weight: 800; }
.course-head span { display: grid; font-weight: 700; }
.course-head small { color: var(--muted); font-weight: 500; }
.course-bases { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 2px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; color: inherit; }
.chip-btn b { font-weight: 800; }
.chip-btn.on { border-color: var(--sea); background: var(--sea); color: #fff; }

/* Работа над ошибками и предложения — под квестом дня */
.practice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: -6px 0 18px; }
.practice-card { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--bg); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.practice-card b { font-size: 15px; }
.practice-card span { font-size: 13px; color: var(--muted); }
.practice-card.mist { border-color: var(--bad, #e5484d); }
.practice-card.mist b { color: var(--bad, #e5484d); }
.practice-card:active { transform: translateY(2px); border-bottom-width: 2px; }

/* Пропуск в предложении */
.gap-prompt { align-items: center; }
.gap-line { font-size: 22px; font-weight: 700; line-height: 1.5; }
.gap-slot { display: inline-block; min-width: 4em; border-bottom: 3px solid var(--sea); margin: 0 4px; text-align: center; color: var(--sea); }
.gap-slot.filled { color: inherit; }

/* «Стереть букву» и «Не помню» в одну строку */
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-btns .btn { flex: 0 0 auto; }
