:root {
  --bg: #0d0c11;
  --bg2: #15131b;
  --card: rgba(255, 255, 255, .045);
  --card2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --text: #f4efe4;
  --muted: #9b94a8;
  --dim: #6c6678;
  --accent: #f4b545;
  --accent-ink: #1a1306;
  --violet: #7b5cff;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", -apple-system, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.glow {
  position: fixed; inset: -20vh -30vw auto; height: 90vh; z-index: 0; pointer-events: none;
  background:
    radial-gradient(45% 40% at 50% 30%, rgba(244, 181, 69, .16), transparent 70%),
    radial-gradient(40% 35% at 85% 70%, rgba(123, 92, 255, .12), transparent 70%);
  filter: blur(10px);
}
body.playing .glow { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(1.06); } }

.top, main { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font: 600 19px/1.1 var(--serif); letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: 12.5px; }
.mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2a2233, #17141d); border: 1px solid var(--line);
  color: var(--accent); font: 600 21px/1 var(--serif);
}
.stat { font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 6px 11px; border-radius: 99px; white-space: nowrap; }

/* ---------- сейчас играет */
.now {
  position: relative; margin-top: 10px; padding: 18px 18px 16px;
  border-radius: 26px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}
.now-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.tag { color: var(--accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }

.phrase { min-height: 168px; display: flex; flex-direction: column; justify-content: center; padding: 18px 0 8px; }
.ru { margin: 0 0 10px; color: var(--muted); font-size: 17px; transition: color .3s; }
.de {
  margin: 0; font: 600 clamp(30px, 8.6vw, 44px)/1.1 var(--serif); letter-spacing: -.01em;
  text-wrap: balance; overflow-wrap: anywhere; transition: filter .35s, opacity .35s, color .3s;
}
.now[data-phase="ru"] .ru, .now[data-phase="ding"] .ru { color: var(--text); }
.now[data-phase="ru"] .de, .now[data-phase="ding"] .de, .now[data-phase="think"] .de { opacity: .55; }
.now.quiz[data-phase="ru"] .de, .now.quiz[data-phase="ding"] .de, .now.quiz[data-phase="think"] .de,
.now.review[data-phase="ru"] .de, .now.review[data-phase="ding"] .de, .now.review[data-phase="think"] .de { filter: blur(11px); opacity: .5; }
.now[data-phase="say"] .de { color: #fff6e0; }

.pips { display: flex; gap: 8px; margin: 12px 0 6px; }
.pips i {
  position: relative; width: 100%; max-width: 46px; height: 6px; border-radius: 6px;
  background: rgba(255,255,255,.1); transition: background .25s;
}
.pips i.on { background: var(--accent); }
.pips i.cur { background: var(--accent); box-shadow: 0 0 14px rgba(244,181,69,.7); }
.pips i.slow::after { content: "медл."; position: absolute; top: 9px; left: 0; font-size: 10px; color: var(--dim); }
.phase { margin: 14px 0 10px; min-height: 22px; font-size: 14.5px; color: var(--muted); }
.now[data-phase="you"] .phase { color: var(--accent); font-weight: 600; }

.seek input { width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; --p: 0%; }
.seek input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--p), rgba(255,255,255,.12) var(--p));
}
.seek input::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); }
.seek input::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; }
.seek input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: -2px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin: 10px 0 14px; }
.ctl { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; transition: background .2s, transform .15s; }
.ctl:active { background: var(--card2); transform: scale(.94); }
.ctl svg { width: 26px; height: 26px; fill: var(--text); }
.play {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); box-shadow: 0 12px 34px -10px rgba(244,181,69,.65), inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform .15s;
}
.play:active { transform: scale(.95); }
.play svg { width: 34px; height: 34px; fill: var(--accent-ink); }
.play .i-pause, body.playing .play .i-play { display: none; }
body.playing .play .i-pause { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-size: 13.5px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); transition: background .2s, border-color .2s;
}
.chip[aria-pressed="true"] { border-color: rgba(244,181,69,.6); color: var(--accent); background: rgba(244,181,69,.08); }

/* ---------- вкладки и списки */
.total { margin: 22px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.grp { margin: 16px 4px 2px; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.grp:first-child { margin-top: 0; }
#lessons .grp { margin: 18px 4px 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
#lessons .grp:first-child { margin-top: 2px; }
.tabs { display: flex; gap: 4px; margin: 10px 0 10px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 9px 0; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--card2); color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lesson, .ph {
  width: 100%; text-align: left; display: grid; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid transparent;
  position: relative; overflow: hidden; transition: background .2s, border-color .2s;
}
.lesson { grid-template-columns: 42px 1fr auto; }
.lesson:active, .ph:active { background: var(--card2); }
.lesson .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: rgba(255,255,255,.06); }
.lesson b { display: block; font-weight: 600; font-size: 15.5px; }
.lesson i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.lesson .st { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lesson .st.done { color: var(--accent); }
.lesson .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p, 0%); background: var(--accent); opacity: .7; }
.lesson.rv { padding: 8px 14px; background: transparent; border: 1px dashed var(--line); }
.lesson.rv .ic { width: 42px; height: 30px; background: transparent; font-size: 17px; }
.lesson.rv b { font-size: 14px; font-weight: 600; color: var(--muted); }
.now.review .pips { visibility: hidden; }
.lesson.cur, .ph.cur { border-color: rgba(244,181,69,.45); background: rgba(244,181,69,.07); }

.eq { display: none; gap: 2px; align-items: end; height: 14px; }
.lesson.cur .eq { display: inline-flex; }
.lesson.cur .st .pct { display: none; }
.eq span { width: 3px; height: 4px; border-radius: 2px; background: var(--accent); }
body.playing .eq span { animation: eq .9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: .2s !important; }
.eq span:nth-child(3) { animation-delay: .4s !important; }
@keyframes eq { 50% { height: 14px; } }

.ph { grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 14px; }
.ph .n { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ph b { display: block; font: 500 17.5px/1.25 var(--serif); }
.ph i { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 2px; }

.tip { margin: 18px 0 0; padding: 14px 16px; border-radius: 18px; background: rgba(123,92,255,.1); border: 1px solid rgba(123,92,255,.3); }
.tip b { font-size: 14.5px; }
.tip p { margin: 6px 0 12px; font-size: 13.5px; color: #cfc9da; }

.foot { margin: 26px 0 34px; text-align: center; font-size: 12.5px; color: var(--dim); }

@media (min-width: 600px) {
  .now { padding: 24px 26px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body.playing .glow, body.playing .eq span { animation: none; }
}
