/* Шрифты лежат в проекте, чтобы работать без интернета */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/golos-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/golos-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/golos-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/unbounded-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/unbounded-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/unbounded-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== Темы. Тема меняется одним атрибутом: <html data-theme="alps|innsbruck|large|soft"> ===== */
:root, :root[data-theme="alps"], :root[data-theme="large"] {
  --hdr-a: #0c3a35;          /* шапка: верх */
  --hdr-b: #10564d;          /* шапка: низ */
  --hdr-text: #ffffff;
  --hdr-soft: rgba(255, 255, 255, .16);
  --bg: #f2f6f4;
  --surface: #ffffff;
  --surface-2: #e8f0ed;
  --text: #13241f;
  --muted: #55665f;
  --line: #dde7e3;
  --accent: #0f6b5e;          /* кнопки */
  --accent-text: #ffffff;
  --accent-soft: #dcefeb;
  --accent-2: #2fb3a0;        /* бирюза: полосы прогресса */
  --good: #17845a;
  --good-soft: #dff3e9;
  --bad: #a35a00;
  --bad-soft: #fcefd6;
  --at: #6b3fb0;
  --at-soft: #ece4fa;
  --fab: #17322d;
  --fab-text: #ffffff;
  --shadow: 0 1px 2px rgba(12, 58, 53, .05), 0 6px 18px rgba(12, 58, 53, .07);
  --scale: 1;
  color-scheme: light;
}
:root[data-theme="large"] { --scale: 1.2; }
:root[data-theme="innsbruck"] {
  --hdr-a: #143b78;
  --hdr-b: #1f5fbf;
  --hdr-text: #ffffff;
  --hdr-soft: rgba(255, 255, 255, .16);
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-2: #e7eef9;
  --text: #13213a;
  --muted: #56667f;
  --line: #d9e2ef;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --accent-soft: #dce8fb;
  --accent-2: #4f95f5;
  --good: #187a4b;
  --good-soft: #dcf3e6;
  --bad: #a35a00;
  --bad-soft: #fdecd3;
  --at: #6b3fb0;
  --at-soft: #ece4fa;
  --fab: #1b2d4a;
  --fab-text: #ffffff;
  --shadow: 0 1px 2px rgba(20, 59, 120, .05), 0 6px 18px rgba(20, 59, 120, .07);
  --scale: 1;
  color-scheme: light;
}
:root[data-theme="soft"] {
  --hdr-a: #5d7d68;
  --hdr-b: #7c9a84;
  --hdr-text: #fffdf8;
  --hdr-soft: rgba(255, 253, 248, .2);
  --bg: #f8f2e8;
  --surface: #fffcf6;
  --surface-2: #efe8db;
  --text: #2f2b25;
  --muted: #6e665a;
  --line: #e6ddcd;
  --accent: #4f7a5e;
  --accent-text: #fffdf8;
  --accent-soft: #e3ecdf;
  --accent-2: #8bb28f;
  --good: #3f7d55;
  --good-soft: #e1eedd;
  --bad: #9a5a14;
  --bad-soft: #f6e7cf;
  --at: #7a5a9a;
  --at-soft: #eee6f3;
  --fab: #3b4a3f;
  --fab-text: #fffdf8;
  --shadow: 0 1px 2px rgba(80, 64, 40, .05), 0 6px 18px rgba(80, 64, 40, .07);
  --scale: 1;
  color-scheme: light;
}
/* Тёмный режим системы: Альпы, Крупный, Инсбрук темнеют; Мягкий остаётся светлым */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="soft"]):not([data-theme="innsbruck"]) {
    --hdr-a: #0a2723; --hdr-b: #0e4039;
    --bg: #0d1c19; --surface: #142a25; --surface-2: #1c3832;
    --text: #e6f1ed; --muted: #9db6ae; --line: #25443d;
    --accent: #3cc2ae; --accent-text: #06201b; --accent-soft: #173f38; --accent-2: #3cc2ae;
    --good: #5fd39a; --good-soft: #143a2a; --bad: #ffb85c; --bad-soft: #3d2c12;
    --at: #c4a6ff; --at-soft: #2c2348; --fab: #244a43; --shadow: none; color-scheme: dark;
  }
  :root[data-theme="innsbruck"] {
    --hdr-a: #0d2448; --hdr-b: #163f7f;
    --bg: #0d1726; --surface: #15233a; --surface-2: #1c2d48;
    --text: #e8eef8; --muted: #9fb0c9; --line: #2a3d5c;
    --accent: #6aa6ff; --accent-text: #08121f; --accent-soft: #1d3a66; --accent-2: #6aa6ff;
    --good: #5fd39a; --good-soft: #143a2a; --bad: #ffb85c; --bad-soft: #3d2c12;
    --at: #c4a6ff; --at-soft: #2c2348; --fab: #24406b; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: calc(19px * var(--scale)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-family: "Unbounded", "Golos Text", sans-serif; font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .9em; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ===== Верхняя полоса ===== */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--hdr-a); color: var(--hdr-text);
}
.brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: "Unbounded", sans-serif; font-weight: 600; color: var(--hdr-text); text-decoration: none; font-size: 15px; letter-spacing: -.01em; }
@media (max-width: 420px) { .brand { font-size: 13px; } .topbar-link { font-size: 15px; padding: 6px 10px; } }
.topbar-link { flex: 0 0 auto; font-size: 16px; text-decoration: none; padding: 6px 12px; color: var(--hdr-text); background: var(--hdr-soft); border-radius: 99px; }

/* ===== Шапка с картинкой и фразой дня ===== */
.hdr {
  position: relative;
  background: linear-gradient(180deg, var(--hdr-a) 0%, var(--hdr-b) 100%);
  color: var(--hdr-text);
  padding: 6px 16px 58px;
}
.hdr::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 30px; background: var(--bg); border-radius: 28px 28px 0 0; }
.hdr-in { max-width: 720px; margin: 0 auto; text-align: center; }
.hdr-kicker { font-size: .8rem; opacity: .85; letter-spacing: .02em; }
.art { height: 128px; display: flex; align-items: center; justify-content: center; margin: 4px 0 6px; }
.art svg { width: 176px; height: 121px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pd-de { font-family: "Unbounded", "Golos Text", sans-serif; font-weight: 700; font-size: 1.45rem; line-height: 1.22; letter-spacing: -.01em; }
.pd-ru { margin-top: 6px; font-size: 1rem; opacity: .88; }
.pd-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pd-count { font-size: .9rem; opacity: .85; min-width: 52px; font-variant-numeric: tabular-nums; }
.hdr .play { background: var(--hdr-text); color: var(--hdr-a); }
.more {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border-radius: 99px; border: 1.5px solid rgba(255, 255, 255, .7); background: transparent; color: var(--hdr-text);
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fade { transition: opacity .28s ease, transform .28s ease; }
.fade.out { opacity: 0; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .fade { transition: none; } .fade.out { transform: none; } }
.sheet { padding-top: 0; }

/* ===== Карточки ===== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.big-num { font-family: "Unbounded", sans-serif; font-size: 2.3rem; font-weight: 700; line-height: 1; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat .big-num { color: var(--accent); }
.stat .lbl { font-size: .85rem; color: var(--muted); margin-top: 4px; }

.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.bar.thin { height: 6px; }
.day .bar, .part .bar { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: calc(52px * var(--scale)); padding: 12px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent; box-shadow: var(--shadow);
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { cursor: default; }
.btns { display: grid; gap: 10px; margin-top: 12px; }
.btns.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .btns.stack { grid-template-columns: 1fr; } }

/* ===== Список дней ===== */
.daylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 900px) { .daylist { grid-template-columns: 1fr 1fr; } .wrap.wide { max-width: 1040px; } }
.day {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); height: 100%;
}
.day.today { border: 2px solid var(--accent-2); }
.day .num {
  flex: 0 0 calc(46px * var(--scale)); height: calc(46px * var(--scale)); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 1rem;
}
.day .t { font-weight: 650; display: block; }
.day .d { font-size: .82rem; color: var(--muted); display: block; margin-bottom: 6px; }
.check { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--good); color: #ffffff; display: inline-flex; align-items: center; justify-content: center; }
.check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.week-h { margin: 24px 0 10px; font-size: .82rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.tag {
  display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); vertical-align: middle; white-space: nowrap;
}
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.at { background: var(--at-soft); color: var(--at); }
.tag.now { background: var(--accent-soft); color: var(--accent); }

/* ===== Части дня ===== */
.part { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text); }
.part .step {
  flex: 0 0 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-family: "Unbounded", sans-serif; font-weight: 700;
}
.part.done .step { background: var(--good); color: #ffffff; }
.part.done .step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.part .bar { margin-top: 10px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; color: var(--text); text-decoration: none; min-height: 48px; }

.back { display: inline-block; margin: 0 0 12px; text-decoration: none; font-size: .95rem; padding: 6px 0; font-weight: 600; }
.text p { font-size: 1.02rem; }

/* ===== Фразы и диалог ===== */
.phrase { display: flex; gap: 12px; align-items: flex-start; }
.phrase + .phrase { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.de { font-size: 1.2rem; font-weight: 650; }
.pron { color: var(--muted); font-size: .95rem; }
.ru { font-size: 1rem; }
.note { font-size: .85rem; color: var(--at); }

.play {
  flex: 0 0 calc(48px * var(--scale)); width: calc(48px * var(--scale)); height: calc(48px * var(--scale)); border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 3px; }

.line { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.line + .line { border-top: 1px solid var(--line); }
.who { font-size: .78rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.line.me .who { color: var(--good); }
.line.active { background: var(--accent-soft); border-radius: 12px; padding-left: 8px; padding-right: 8px; }

.flash { text-align: center; padding: 26px 16px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; }
.flash .front { font-size: 1.45rem; font-weight: 700; }
.flash .answer { font-size: 1.35rem; font-weight: 700; color: var(--accent); }

/* ===== Вопросы ===== */
.q { font-size: 1.15rem; font-weight: 650; margin-bottom: 12px; }
.opt { justify-content: flex-start; text-align: left; font-weight: 500; box-shadow: none; background: var(--surface-2); border-color: transparent; }
.opt.right { background: var(--good-soft); border-color: var(--good); color: var(--good); font-weight: 700; }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 14px; }
.feedback.ok { background: var(--good-soft); color: var(--good); }
.feedback.no { background: var(--bad-soft); color: var(--bad); }
.feedback .de { color: var(--text); }
input.answer {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
}
input.answer:focus { outline: none; border-color: var(--accent); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 16px; }
.seg button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

/* ===== Результат ===== */
.result { text-align: center; }
.score {
  width: 168px; height: 168px; margin: 8px auto 12px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), var(--surface-2) 0);
  position: relative;
}
.score::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.score > * { position: relative; }
.score .big-num { font-size: 3rem; color: var(--sc); }
.score .of { font-size: .85rem; color: var(--muted); }
.result.pass { --sc: var(--good); }
.result.fail { --sc: var(--bad); }
.verdict { font-weight: 700; font-size: 1.1rem; color: var(--sc); }
.ex { padding: 8px 0; }
.ex + .ex { border-top: 1px solid var(--line); }

/* ===== Кнопка оформлений ===== */
.theme-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px;
  border-radius: 99px; border: 0; background: var(--fab); color: var(--fab-text);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px rgba(10, 30, 28, .28);
}
.theme-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-menu {
  position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 21;
  width: 248px; padding: 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(10, 30, 28, .2);
}
.theme-menu[hidden] { display: none; }
.theme-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px;
  border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; font-size: .95rem; text-align: left; cursor: pointer;
}
.theme-menu button.on { background: var(--accent-soft); font-weight: 700; }
.sw { flex: 0 0 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); }
.theme-menu small { display: block; color: var(--muted); font-size: .75rem; }
