@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-cyr.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-04FF, U+0500-052F;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-lat.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #0d0f14;
  --bg2: #141821;
  --card: #1a1f2b;
  --card2: #212736;
  --line: #2a3143;
  --text: #eef1f6;
  --muted: #8b94a7;
  --dim: #5d6577;
  --accent: #6ea8fe;
  --accent2: #7c7cf0;
  --green: #4ecb8d;
  --amber: #f2c265;
  --red: #f28b82;
  --yaros: #6ea8fe;
  --angel: #f28bc1;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #171c28 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#app { max-width: 720px; margin: 0 auto; padding: 22px 18px 60px; min-height: 100vh; }

/* ---- типографика / утилиты ---- */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.center { text-align: center; }
.row { display: flex; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.spacer { height: 14px; }
.wrap { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- кнопки ---- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card2);
  color: var(--text); font: inherit; font-weight: 600; font-size: 16px;
  padding: 14px 18px; border-radius: 14px; cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: #3a445c; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #0b0d12; font-weight: 800; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.big { padding: 18px 22px; font-size: 18px; width: 100%; }
.btn.green { background: rgba(78,203,141,.14); border-color: rgba(78,203,141,.4); color: #b7f0d3; }
.btn.red { background: rgba(242,139,130,.13); border-color: rgba(242,139,130,.38); color: #f6c1bc; }
.btn.sm { padding: 9px 13px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---- карточки / панели ---- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.brand .logo b { background: linear-gradient(135deg, var(--accent), var(--angel)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { font-size: 12px; color: var(--dim); }

/* профили на главной */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who .p { border-radius: 16px; padding: 16px; border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; }
.who .p .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.who .p.yaros { box-shadow: inset 0 0 0 1px rgba(110,168,254,.25); }
.who .p.angel { box-shadow: inset 0 0 0 1px rgba(242,139,193,.25); }
.who .p .name { font-weight: 700; font-size: 16px; }
.who .p .lvl { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.who .p .streak { font-size: 12.5px; margin-top: 10px; color: var(--amber); }
.who .p .need { font-size: 12px; color: var(--red); margin-top: 8px; }

/* прогресс-бары уровней */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.bars-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; font-size: 15px; }
.bars-head .bh-right { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .lab { width: 30px; font-weight: 700; font-size: 13px; color: var(--muted); }
.track { flex: 1; height: 9px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s ease; }
.track > i.yaros { background: linear-gradient(90deg, #4a7fd6, var(--yaros)); }
.track > i.angel { background: linear-gradient(90deg, #d66a9e, var(--angel)); }
.bar-row .val { width: 96px; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---- карточка слова в сессии ---- */
.stage { display: flex; flex-direction: column; gap: 16px; }
.progressline { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.progressline > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--angel)); transition: width .3s ease; }
.session-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.score { display: flex; gap: 14px; }
.score .s { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.score .s.y { color: var(--yaros); }
.score .s.a { color: var(--angel); }

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 22px; padding: 34px 24px;
  min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; box-shadow: var(--shadow); position: relative;
}
.card .pos-badge { position: absolute; top: 14px; left: 16px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.card .lvl-badge { position: absolute; top: 14px; right: 16px; font-size: 11px; color: var(--dim); font-weight: 700; }
.card .article { font-size: 17px; color: var(--muted); font-weight: 600; }
.card .word { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.card .word .g-f { color: var(--angel); }
.card .word .g-m { color: var(--accent); }
.card .translit { font-size: 15px; color: var(--dim); font-style: italic; }
.card .speak { font-size: 22px; background: var(--bg2); border: 1px solid var(--line); width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.card .speak:active { transform: scale(.9); }

.reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reveal .ru { font-size: 24px; font-weight: 700; }
.reveal .ex { font-size: 15px; color: var(--text); background: var(--bg2); border-radius: 12px; padding: 11px 14px; line-height: 1.4; }
.reveal .ex .exru { color: var(--muted); font-size: 13.5px; display: block; margin-top: 4px; }
.reveal .note { font-size: 13px; color: var(--amber); background: rgba(242,194,101,.08); padding: 8px 12px; border-radius: 10px; }
.reveal .conj-toggle { font-size: 13.5px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.conj-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.conj-table th { text-align: left; color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; }
.conj-table td { padding: 7px 8px; border-top: 1px solid var(--line); }
.conj-table td.p { color: var(--muted); width: 42%; }
.conj-table td.v { font-weight: 700; }
.tense-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 6px; }
.tense-tabs .t { font-size: 12px; padding: 5px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; color: var(--muted); }
.tense-tabs .t.on { background: var(--accent); color: #0b0d12; border-color: transparent; font-weight: 700; }

/* ответные кнопки дуо */
.duo-grades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo-grades .btn { padding: 15px 12px; font-size: 15px; }
.grade-both { grid-column: 1 / -1; }

/* мини-игра: варианты */
.choices { display: grid; gap: 10px; }
.choice { text-align: left; justify-content: flex-start; padding: 15px 18px; font-size: 16px; }
.choice.correct { background: rgba(78,203,141,.16); border-color: var(--green); color: #cdf5e2; }
.choice.wrong { background: rgba(242,139,130,.16); border-color: var(--red); color: #f8cdc9; }
.minigame-label { font-size: 12px; color: var(--accent2); text-transform: uppercase; letter-spacing: .1em; text-align: center; font-weight: 700; }

/* пары */
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-col { display: flex; flex-direction: column; gap: 8px; }
.pair-item { padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; text-align: center; font-size: 15px; transition: all .12s; }
.pair-item.sel { border-color: var(--accent); background: rgba(110,168,254,.14); }
.pair-item.done { opacity: .35; pointer-events: none; border-style: dashed; }
.pair-item.bad { animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* el/la */
.gender-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gender-btns .btn { font-size: 22px; font-weight: 800; padding: 22px; }

/* результат сессии */
.result { text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.result .big { font-size: 46px; }
.result .sc { display: flex; gap: 28px; justify-content: center; }
.result .sc .s { display: flex; flex-direction: column; gap: 2px; }
.result .sc .s b { font-size: 30px; }
.result .sc .s span { font-size: 12.5px; color: var(--muted); }

/* login */
.login { max-width: 340px; margin: 14vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.login .logo { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.login .logo b { background: linear-gradient(135deg, var(--accent), var(--angel)); -webkit-background-clip: text; background-clip: text; color: transparent; }
input.field { width: 100%; padding: 15px 16px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 16px; text-align: center; }
input.field:focus { outline: none; border-color: var(--accent); }
.err { color: var(--red); font-size: 14px; min-height: 18px; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; margin: 6px 2px; }
.inv-btn { margin-top: 12px; width: 100%; color: var(--muted); }
.link { color: var(--accent); cursor: pointer; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }

/* выбор учебного маршрута */
.level-picker { display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; }
.level-picker > .muted { line-height: 1.55; }
.level-options { display: grid; gap: 11px; margin: 8px 0 4px; }
.level-option {
  width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 17px; padding: 17px; font: inherit; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 14px;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.level-option:hover { border-color: #43506b; background: var(--card2); }
.level-option:active { transform: scale(.985); }
.level-option .level-code {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  background: var(--bg2); font-size: 19px; font-weight: 800; color: var(--accent);
}
.level-option.a2 .level-code { color: var(--angel); }
.level-option.mix .level-code { color: var(--green); }
.level-option b { display: block; font-size: 16px; margin-bottom: 4px; }
.level-option small { display: block; color: var(--muted); line-height: 1.45; font-size: 12.5px; }

@media (max-width: 480px) {
  .card .word { font-size: 34px; }
  #app { padding: 16px 13px 50px; }
  .bars-head { align-items: flex-start; flex-wrap: wrap; }
  .bars-head .bh-right { width: 100%; margin-left: 19px; }
  .level-option { grid-template-columns: 50px 1fr; padding: 14px; }
  .level-option .level-code { width: 46px; height: 46px; border-radius: 13px; }
}
