/* ============================================================
   APP / PLAYER — интерактив и анимации
   ============================================================ */

/* ---------- course rail (прогресс всех тем) ---------- */
.rail { display: flex; gap: 5px; align-items: center; }
.rail .seg { height: 5px; flex: 1; border-radius: 4px; background: #2a2e3b;
  transition: background .3s, box-shadow .3s, transform .2s; cursor: pointer; }
.rail .seg:hover { transform: scaleY(1.6); }
.rail .seg.base  { background: var(--base); }
.rail .seg.verb  { background: var(--verb); }
.rail .seg.frage { background: var(--frage); }
.rail .seg.genus { background: var(--genus); }
.rail .seg.kasus { background: var(--kasus); }
.rail .seg.pron  { background: var(--pron); }
.rail .seg.dim { opacity: .28; }
.rail .seg.here { box-shadow: 0 0 12px -1px currentColor; transform: scaleY(1.8); }

/* ---------- player shell ---------- */
.player { max-width: 860px; margin: 0 auto; padding: var(--s-6) 0 var(--s-8); }
.player-top { display: flex; align-items: center; gap: 16px; margin-bottom: var(--s-6); }
.back-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline);
  display: grid; place-items: center; color: var(--text-soft); background: var(--bg-1);
  transition: .18s; flex: none; cursor: pointer; }
.back-btn:hover { background: var(--bg-2); color: var(--text); transform: translateX(-2px); }

/* lesson title block */
.deck-head { text-align: center; margin-bottom: var(--s-5); }
.deck-head .pill { margin-bottom: 16px; }
.deck-head h1 { font-size: clamp(30px, 4.4vw, 50px); margin: 0 0 8px; animation: rise .5s ease both; }
.deck-head .lesson-sub { animation: rise .5s .05s ease both; font-size: 20px; font-weight: 600; }
.sub-base{color:var(--base)} .sub-verb{color:var(--verb)} .sub-frage{color:var(--frage)}
.sub-genus{color:var(--genus)} .sub-kasus{color:var(--kasus)} .sub-pron{color:var(--pron)}

/* ---------- card stage ---------- */
.stage { position: relative; min-height: 440px; display: flex; align-items: center; justify-content: center; }
.step { width: 100%; }
.step.in  { animation: cardIn .45s cubic-bezier(.2,.7,.2,1) both; }
.step.back.in { animation-name: cardInBack; }
@keyframes cardIn  { from { opacity: 0; transform: translateX(36px) } to { opacity: 1; transform: none } }
@keyframes cardInBack { from { opacity: 0; transform: translateX(-36px) } to { opacity: 1; transform: none } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }

.step .lead { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.step .lead.base{color:var(--base)} .step .lead.verb{color:var(--verb)} .step .lead.frage{color:var(--frage)}
.step .lead.genus{color:var(--genus)} .step .lead.kasus{color:var(--kasus)} .step .lead.pron{color:var(--pron)}
.step .body { font-size: 18px; color: var(--text-soft); max-width: 60ch; }
.step .body b { color: var(--text); }
.step .stitle { text-align: center; }

.fade-seq > * { animation: rise .5s ease both; }
.fade-seq > *:nth-child(1){ animation-delay:.05s } .fade-seq > *:nth-child(2){ animation-delay:.12s }
.fade-seq > *:nth-child(3){ animation-delay:.19s } .fade-seq > *:nth-child(4){ animation-delay:.26s }
.fade-seq > *:nth-child(5){ animation-delay:.33s } .fade-seq > *:nth-child(6){ animation-delay:.40s }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 16px; margin-top: var(--s-6); }
.nav-btn { flex: 1; padding: 15px 20px; border-radius: var(--r-md); border: 1px solid var(--hairline);
  background: var(--bg-1); color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .16s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.nav-btn:hover:not(:disabled) { background: var(--bg-2); border-color: var(--hairline-2); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.nav-btn.primary { background: var(--accent); border-color: transparent; color: #06070c; }
.nav-btn.primary:hover { filter: brightness(1.08); }

/* step progress dots */
.step-dots { display: flex; gap: 7px; justify-content: center; margin-top: 22px; }
.step-dots i { width: 22px; height: 4px; border-radius: 3px; background: var(--bg-3); cursor: pointer; transition: .25s; }
.step-dots i.on  { background: var(--accent); }
.step-dots i.done{ background: color-mix(in oklab, var(--accent) 55%, var(--bg-3)); }

/* ---------- tabs ---------- */
.tabbar { display: inline-flex; gap: 6px; background: var(--bg-1); padding: 5px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); margin-bottom: 18px; }
.tabbar button { font-family: var(--font-mono); font-size: 16px; min-width: 46px; padding: 8px 16px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-dim); border-radius: var(--r-pill); transition: .18s; font-weight: 600; }
.tabbar button.active { background: var(--accent); color: #06070c; }
.tab-panel { animation: rise .3s ease both; }
.tab-panel .de { font-family: var(--font-mono); font-size: clamp(20px,2.6vw,26px); color: var(--text); }
.tab-panel .de b { color: var(--accent); font-weight: 700; }
.tab-panel .ru { color: var(--text-dim); font-style: italic; margin-top: 10px; }

/* ---------- reveal example (tap to show RU) ---------- */
.rev { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 22px 24px; cursor: pointer; transition: border-color .2s; text-align: center; }
.rev:hover { border-color: var(--hairline-2); }
.rev .de { font-family: var(--font-mono); font-size: clamp(19px,2.4vw,26px); color: var(--text-soft); }
.rev .de u { color: var(--accent); text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; font-weight: 600; }
.rev .de b { color: var(--text); font-weight: 600; }
.rev .ru { color: var(--text-dim); font-style: italic; font-size: 16px;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s ease, opacity .35s ease, margin .35s; }
.rev.open .ru { max-height: 90px; opacity: 1; margin-top: 12px; }
.rev .tap { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing:.1em; margin-top: 10px; }
.rev.open .tap { display: none; }

/* ---------- quiz ---------- */
.quiz .q { font-family: var(--font-mono); font-size: clamp(19px,2.4vw,24px); color: var(--text); margin-bottom: 18px; text-align:center; }
.quiz .opts { display: grid; gap: 10px; max-width: 520px; margin: 0 auto; }
.quiz .opt { font-family: var(--font-mono); font-size: 17px; padding: 15px 20px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-2); background: var(--bg-1); color: var(--text); cursor: pointer;
  transition: .16s; text-align: left; }
.quiz .opt:hover:not(:disabled) { border-color: var(--text-dim); background: var(--bg-2); }
.quiz .opt.correct { border-color: var(--good); background: #35d48818; color: var(--good); animation: goodpop .4s ease; }
.quiz .opt.wrong   { border-color: var(--bad);  background: #ff6b6b14; color: var(--bad); }
.quiz .opt:disabled { cursor: default; }
@keyframes goodpop { 0%{transform:scale(1)} 40%{transform:scale(1.03)} 100%{transform:scale(1)} }
.quiz .explain { max-width: 520px; margin: 16px auto 0; text-align: center; color: var(--text-soft); font-size: 15px;
  opacity: 0; transform: translateY(6px); transition: .3s; }
.quiz .explain.show { opacity: 1; transform: none; }
.quiz .explain .ru { color: var(--text-dim); font-style: italic; display:block; margin-top: 4px; }

/* build — соберём предложение из слов (клик по слову) */
.build .q { font-family: var(--font-mono); font-size: 18px; color: var(--text-dim); text-align:center; margin-bottom: 6px; }
.build .prompt-ru { text-align:center; color: var(--text); font-size: clamp(19px,2.4vw,24px); font-weight:600; margin-bottom: 20px; }
.build .slots { min-height: 54px; display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-items:center;
  border-bottom: 1px dashed var(--hairline-2); padding-bottom: 16px; margin-bottom: 18px; }
.build .bank { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.build .word { font-family: var(--font-mono); font-size: 17px; padding: 10px 16px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-2); background: var(--bg-1); color: var(--text); cursor: pointer; transition: .14s; }
.build .word:hover { border-color: var(--text-dim); background: var(--bg-2); }
.build .slots .word { background: var(--bg-3); }
.build .word.used { opacity: .25; pointer-events: none; }
.build .check-btn { margin: 20px auto 0; display:block; }
.build .result { text-align:center; margin-top: 16px; font-size: 15px; min-height: 22px; }
.build .result.ok  { color: var(--good); }
.build .result.no  { color: var(--bad); }
.build .result .ru { color: var(--text-dim); font-style: italic; display:block; margin-top:4px; }

/* home cards clickable pointer */
.card { cursor: pointer; }
.check { color: var(--good); }
.khint { text-align:center; font-family:var(--font-mono); font-size:11px; color:var(--text-faint); margin-top:18px; letter-spacing:.05em; }

@media (max-width: 900px) {
  .player { padding: var(--s-5) 0; }
  .stage { min-height: 380px; }
}
