/* ============================================================
   Question Everything — Practice Mode
   Self-paced, auto-graded exercises. Static, no build step.
   Sits beside site.css; reuses its variables and bilingual rule.
   ============================================================ */

/* ---- practice home: unit map ---- */
.practice-hero {
  background:
    radial-gradient(800px 360px at 85% -10%, #ffedd5 0%, transparent 70%),
    radial-gradient(640px 320px at 0% 10%, #e0e7ff 0%, transparent 65%);
  padding: 56px 0 44px;
}
.practice-hero h1 { margin: 0 0 10px; font-size: 2.1rem; }
.practice-hero p  { color: var(--ink-soft); max-width: 560px; margin: 0; }

/* streak / xp strip */
.stat-strip {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px;
}
.stat-chip {
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px;
  font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.stat-chip .big { font-size: 1.25rem; }
.stat-chip .lbl { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }

/* unit cards on the map */
.unit-map { display: grid; gap: 16px; margin-top: 26px; }
@media (min-width: 640px) { .unit-map { grid-template-columns: 1fr 1fr; } }

.unit-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line);
  border-left: 6px solid var(--a-accent);
  border-radius: var(--radius); padding: 20px 22px;
}
.unit-card.b      { border-left-color: var(--b-accent); }
.unit-card:hover  { box-shadow: var(--shadow); }
.unit-card.locked { opacity: .55; pointer-events: none; }
.unit-card .ucap {
  font-size: .74rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-soft);
}
.unit-card h3 { margin: 6px 0 4px; font-size: 1.15rem; }
.unit-card .uskill { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.unit-card .ustars { margin-top: 12px; font-size: 1.05rem; letter-spacing: 2px; }
.unit-card .ustars .on  { color: var(--a-accent); }
.unit-card.b .ustars .on { color: var(--b-accent); }
.unit-card .ustars .off { color: var(--line); }
.unit-card .ugo {
  margin-top: 12px; font-weight: 800; font-size: .9rem; color: var(--brand);
}

/* ============================================================
   The unit player
   ============================================================ */
.player-top {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); z-index: 30;
}
.player-top .row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
}
.player-top .quit {
  text-decoration: none; font-weight: 800; color: var(--ink-soft);
  font-size: 1.4rem; line-height: 1;
}
/* progress bar */
.pbar {
  flex: 1; height: 14px; background: var(--bg-soft);
  border-radius: 999px; overflow: hidden;
}
.pbar > i {
  display: block; height: 100%; width: 0%;
  background: var(--a-accent); transition: width .3s ease;
}
.pbar.b > i { background: var(--b-accent); }
.player-top .hearts { font-weight: 800; white-space: nowrap; }

.player-stage { max-width: 640px; margin: 0 auto; padding: 30px 22px 140px; }

.ex-count {
  font-size: .78rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px;
}
.ex-prompt { font-size: 1.4rem; font-weight: 700; line-height: 1.35; margin: 0 0 22px; }
@media (max-width: 480px) { .ex-prompt { font-size: 1.18rem; } }

/* ---- choice / truefalse options ---- */
.opts { display: grid; gap: 12px; }
.opt {
  text-align: left; width: 100%; cursor: pointer;
  background: #fff; border: 2px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
  font-family: inherit;
}
.opt:hover:not(:disabled)   { border-color: var(--brand); }
.opt.chosen                 { border-color: var(--brand); background: #eef2ff; }
.opt.correct  { border-color: #15803d; background: #dcfce7; }
.opt.wrong    { border-color: #b91c1c; background: #fee2e2; }
.opt:disabled { cursor: default; }
.opt .tick { float: right; font-weight: 900; }

/* truefalse: two big buttons side by side */
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-row .opt { text-align: center; font-size: 1.15rem; }

/* ---- tap: tap a word in a passage ---- */
.tap-passage {
  font-size: 1.3rem; line-height: 2; border: 2px solid var(--line);
  border-radius: 14px; padding: 18px 20px; background: var(--bg-soft);
}
.tap-w {
  cursor: pointer; border-radius: 6px; padding: 1px 3px;
  border: 0;
  border-bottom: 2px dashed transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
}
.tap-w:hover:not(:disabled) { background: #eef2ff; }
.tap-w.picked          { background: #eef2ff; border-bottom-color: var(--brand); }
.tap-w.hit             { background: #dcfce7; border-bottom-color: #15803d; }
.tap-w.miss            { background: #fee2e2; border-bottom-color: #b91c1c; }
.tap-w.missed-target   { background: #fef9c3; border-bottom-color: #ca8a04; }
.tap-w:disabled        { cursor: default; opacity: 1; }

/* the tapped words are the only way to answer this question type, so the
   keyboard focus ring has to be clearly visible */
:where(.opt, .tap-w, .player-btn):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.tap-hint { color: var(--ink-soft); font-size: .9rem; margin-top: 12px; }

/* ============================================================
   Feedback bar — slides up from the bottom
   ============================================================ */
.feedback {
  position: fixed; left: 0; right: 0; bottom: 0;
  border-top: 3px solid var(--line); background: #fff;
  transform: translateY(100%); transition: transform .25s ease;
  z-index: 40;
}
.feedback.show { transform: translateY(0); }
.feedback.good { border-top-color: #15803d; background: #f0fdf4; }
.feedback.bad  { border-top-color: #b91c1c; background: #fef2f2; }
.feedback .fb-in {
  max-width: 640px; margin: 0 auto; padding: 18px 22px 22px;
}
.feedback .fb-head {
  font-weight: 900; font-size: 1.15rem; display: flex;
  align-items: center; gap: 8px;
}
.feedback.good .fb-head { color: #15803d; }
.feedback.bad  .fb-head { color: #b91c1c; }
.feedback .fb-why { color: var(--ink); margin: 8px 0 14px; }

/* the action button in the player (check / continue) */
.player-btn {
  width: 100%; cursor: pointer; font-family: inherit;
  font-weight: 800; font-size: 1.05rem; padding: 15px 22px;
  border-radius: 999px; border: 2px solid transparent;
  background: var(--brand); color: #fff;
}
.player-btn:hover:not(:disabled) { background: var(--brand-dark); }
.player-btn:disabled { background: var(--line); color: #94a3b8; cursor: default; }
.player-btn.go-on { background: #15803d; }
.player-btn.go-on:hover { background: #166534; }

/* the check button sits fixed when no feedback is showing */
.check-dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  border-top: 1px solid var(--line); background: #fff; z-index: 35;
}
.check-dock .cd-in { max-width: 640px; margin: 0 auto; padding: 16px 22px; }

/* ============================================================
   Unit-complete screen
   ============================================================ */
.done-screen { max-width: 520px; margin: 0 auto; padding: 60px 22px; text-align: center; }
.done-screen .burst { font-size: 3.4rem; }
.done-screen h1 { font-size: 1.9rem; margin: 10px 0 6px; }
.done-stars { font-size: 2rem; letter-spacing: 6px; margin: 14px 0; }
.done-stars .on  { color: var(--a-accent); }
.done-stars .off { color: var(--line); }
.done-grid { display: flex; gap: 14px; justify-content: center; margin: 22px 0; }
.done-grid .box {
  background: var(--bg-soft); border-radius: 14px; padding: 14px 22px;
}
.done-grid .box .n   { font-size: 1.6rem; font-weight: 900; }
.done-grid .box .l   { color: var(--ink-soft); font-size: .82rem; font-weight: 700; }

/* the ungraded "in real life" card */
.reallife {
  border-left: 5px solid var(--a-accent); background: #fff7ed;
  border-radius: 0 14px 14px 0; padding: 18px 20px; margin: 22px 0;
  text-align: left;
}
.reallife .rl-cap {
  font-size: .74rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #c2410c;
}
.reallife p { margin: 6px 0 0; }

/* a quiet honesty / system note */
.q-note {
  font-size: .85rem; color: var(--ink-soft); text-align: center;
  margin-top: 18px;
}

/* fallback message when opened over file:// */
.serve-msg {
  max-width: 520px; margin: 60px auto; padding: 26px;
  border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius);
}
.serve-msg code {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: .9em;
}
