/* Review screen elevation (2026-11-07): branded session HUD, elevated flashcard, tactile rating
 * feedback, combo streak and a celebratory finish for #reviewView. Layers on top of
 * lib/nightline/learning-compact.css; every selector here either narrows that file's own classes
 * or targets nodes review-elevate.js adds. Gold = reward/brand only. Blue accent = interactive.
 * Red stays destructive-only (unused here). Textbook gender colours (der/die/das) are untouched —
 * they already come from lib/lesson.js + ui-layout.css and need no change. */
#reviewView{--rx-gold:var(--gold-text);--rx-glow:#f3bb6526;--rx-ease:cubic-bezier(.2,.8,.2,1)}
html[data-theme="hell"] #reviewView{--rx-glow:#f3bb6533}

/* ---- Session HUD ("This practice") ---- */
.learning-study-context.rx-hud{position:relative;border:1px solid var(--line-ui);border-radius:20px;background:linear-gradient(170deg,var(--surface-raised),var(--surface) 65%);padding:22px 22px 20px;box-shadow:var(--shadow-raised)}
.learning-study-context.rx-hud::before{content:"";position:absolute;inset:0 0 auto;height:3px;border-radius:20px 20px 0 0;background:linear-gradient(90deg,var(--rx-gold),var(--accent) 60%,transparent)}
.learning-study-context.rx-hud .learning-context-title{margin:0 0 4px;font-size:21px}
/* The brain memory-map duplicated the step route + segmented track below with no new information
   and pushed the live numbers under the fold — hidden rather than deleted so nothing that reads
   its data-phase attribute breaks. */
.learning-study-context.rx-hud .learning-memory-map{display:none}

.rx-combo{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:5px 12px 5px 8px;border-radius:999px;background:color-mix(in srgb,var(--rx-gold) 14%,transparent);color:var(--rx-gold);font:700 13px/1 var(--font);font-variant-numeric:tabular-nums}
.rx-combo[hidden]{display:none}
.rx-combo-flame{display:grid;place-items:center;width:16px;height:16px}
.rx-combo-flame svg{width:16px;height:16px}
.rx-combo-l{font-weight:600;opacity:.85}

.learning-session-stats.rx-hud,.learning-session-stats{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-bottom:18px}
.rx-hud .learning-session-stat,.learning-context-collection .learning-context-stat{position:relative;padding:14px 14px 12px;border:1px solid var(--line-ui);border-radius:14px;background:linear-gradient(160deg,var(--surface-raised),var(--surface));gap:6px}
.rx-tile-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:color-mix(in srgb,var(--text) 8%,transparent);color:var(--text-muted);margin-bottom:2px}
.rx-tile-icon svg{width:16px;height:16px}
.learning-session-stat[data-rx-icon="check"] .rx-tile-icon{background:color-mix(in srgb,var(--accent) 16%,transparent);color:var(--accent)}
.learning-context-stat[data-rx-icon="book"] .rx-tile-icon{background:color-mix(in srgb,var(--rx-gold) 16%,transparent);color:var(--rx-gold)}

/* Segmented progress track replaces the plain fill bar; the native <progress> stays for a11y. */
.rx-sr-progress{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;clip:rect(0,0,0,0);white-space:nowrap}
.rx-track{display:flex;gap:4px;width:100%;margin:0 0 14px}
.rx-seg{flex:1 1 0;height:7px;border-radius:4px;background:var(--line-ui);min-width:3px;transition:background 220ms var(--rx-ease),transform 220ms var(--rx-ease)}
.rx-seg-filled{background:linear-gradient(90deg,var(--accent),var(--rx-gold))}
.rx-seg-current{background:var(--accent)}

.learning-last-answer{border:1px solid var(--line-ui);background:var(--accent-wash)!important}
.learning-context-collection{border-top:1px solid var(--line-ui);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.learning-context-collection .learning-context-stat strong{font-size:22px;font-weight:650;font-family:var(--serif)}
.learning-study-note{font-size:13px}

/* ---- Flashcard ---- */
#reviewBody .review-card{box-shadow:0 1px 2px rgb(0 0 0 / .06),0 18px 40px -16px rgb(0 0 0 / .22);border-color:color-mix(in srgb,var(--rx-gold) 18%,var(--line-ui));transition:box-shadow 160ms var(--rx-ease),transform 160ms var(--rx-ease)}
html[data-theme="hell"] #reviewBody .review-card{box-shadow:0 2px 6px rgb(20 20 10 / .08),0 18px 36px -18px rgb(20 20 10 / .18)}
/* A CSS-only lift on hover (no JS pointer-tracking): a mouse-tracked tilt was tried and reverted
   because continuously rewriting the card's transform on pointermove kept its bounding box from
   settling, which made Playwright's — and potentially a real user's — click land unreliably. */
@media(hover:hover) and (pointer:fine){
  #reviewBody .review-flip:not(.is-dragging):not(.is-flung):hover .review-face--front{transform:translateY(-3px);box-shadow:0 1px 2px rgb(0 0 0 / .08),0 26px 52px -18px rgb(0 0 0 / .3)}
}
#reviewBody .review-face--back .lesson-gender{box-shadow:0 0 0 2px color-mix(in srgb,currentColor 30%,transparent)}
.learning-show-label{box-shadow:0 10px 24px -10px color-mix(in srgb,var(--nightline-primary) 60%,transparent);transition:transform 140ms var(--rx-ease),background 140ms}
#reviewBody .review-face--front:hover .learning-show-label{transform:translateY(-1px)}

/* ---- Rating buttons: tactile press + a glow pulse fired on every activation. ---- */
.review-rate-btn{position:relative;overflow:hidden;transition:transform 120ms var(--rx-ease),box-shadow 160ms,background 140ms,border-color 140ms}
.review-rate-btn:active{transform:scale(.95)}
.review-rate-btn::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 color-mix(in srgb,currentColor 55%,transparent);opacity:0;pointer-events:none}
.review-rate--good.rx-rate-pulse::after,.review-rate--easy.rx-rate-pulse::after{animation:rx-glow 480ms var(--rx-ease)}
.review-rate--again.rx-rate-pulse::after{animation:rx-glow-muted 420ms var(--rx-ease)}

/* ---- Finish state ---- */
.review-done{gap:18px}
.rx-finish-emblem{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:linear-gradient(145deg,var(--surface-raised),var(--surface));border:1px solid color-mix(in srgb,var(--rx-gold) 45%,var(--line-ui));box-shadow:0 0 0 6px color-mix(in srgb,var(--rx-gold) 8%,transparent),0 0 44px 10px var(--rx-glow);color:var(--rx-gold)}
.rx-finish-emblem svg{width:30px;height:30px}
.rx-finish-stat{margin:0;font-size:14px;color:var(--text-muted);font-variant-numeric:tabular-nums}

/* ---- Staged entrance on arrival; current-segment pulse is the one allowed looping motion. ---- */
@keyframes rx-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes rx-pop{0%{transform:scale(.4);opacity:0}70%{transform:scale(1.18)}100%{transform:scale(1);opacity:1}}
@keyframes rx-emblem{0%{transform:scale(.6) rotate(-6deg);opacity:0}60%{transform:scale(1.08) rotate(2deg);opacity:1}100%{transform:none}}
@keyframes rx-seg-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent)}50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent)}}
@keyframes rx-glow{0%{opacity:.9;box-shadow:0 0 0 0 color-mix(in srgb,currentColor 55%,transparent)}100%{opacity:0;box-shadow:0 0 0 10px color-mix(in srgb,currentColor 0%,transparent)}}
@keyframes rx-glow-muted{0%{opacity:.5;box-shadow:0 0 0 0 color-mix(in srgb,currentColor 35%,transparent)}100%{opacity:0;box-shadow:0 0 0 7px color-mix(in srgb,currentColor 0%,transparent)}}
@media(prefers-reduced-motion:no-preference){
  .app[data-section="wiederholen"] .learning-study-context.rx-hud{animation:rx-rise 420ms var(--rx-ease) both}
  .app[data-section="wiederholen"] .rx-track{animation:rx-rise 420ms var(--rx-ease) 60ms both}
  .app[data-section="wiederholen"] .rx-hud .learning-session-stat:nth-child(1){animation:rx-rise 420ms var(--rx-ease) 100ms both}
  .app[data-section="wiederholen"] .rx-hud .learning-session-stat:nth-child(2){animation:rx-rise 420ms var(--rx-ease) 160ms both}
  .rx-combo.rx-combo-pop .rx-combo-flame{animation:rx-pop 360ms var(--rx-ease) both}
  .rx-combo.rx-combo-pop .rx-combo-n{animation:rx-pop 320ms var(--rx-ease) both}
  .rx-seg-current{animation:rx-seg-pulse 1.6s ease-in-out infinite}
  .rx-finish-emblem{animation:rx-emblem 520ms var(--rx-ease) both}
  .rx-finish-stat{animation:rx-rise 360ms var(--rx-ease) 120ms both}
}

@media(max-width:1023px){
  .learning-study-context.rx-hud{padding:18px 18px 16px}
}
@media(max-width:800px){
  .learning-study-context.rx-hud{border-radius:16px;padding:16px}
  .learning-study-context.rx-hud::before{border-radius:16px 16px 0 0}
  .rx-combo{margin-bottom:12px}
}
@media(max-width:520px){
  .rx-hud .learning-session-stat,.learning-context-collection .learning-context-stat{padding:11px 11px 10px;border-radius:12px}
  .rx-tile-icon{width:24px;height:24px}
  .rx-tile-icon svg{width:14px;height:14px}
  .rx-finish-emblem{width:52px;height:52px;border-radius:16px}
  .rx-finish-emblem svg{width:24px;height:24px}
}
@media(prefers-reduced-motion:reduce){
  #reviewBody .review-flip{transition:none}
  .rx-seg{transition:none}
}
.rx-hud .learning-session-stat,.learning-context-collection .learning-context-stat{min-width:0;overflow-wrap:anywhere}
