/* Algebra II Student Hub - shared stylesheet
   Student-friendly, not textbook-academic: color, rounded shapes, a little
   personality. Still zero external dependencies (system fonts only) so it
   loads instantly and works offline.

   Track color identity (On-Level vs. Honors) is NOT set here - this file
   only reads --primary/--primary-dark/--primary-bg/--primary-light as
   variables. Each page loads this file, THEN theme-on-level.css or
   theme-honors.css, which sets those four variables to the track's colors.
   Load order matters: theme file must come after this one. */

:root {
  --bg: #f3f4fd;
  --surface: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  /* fallback brand colors if a page forgets to load a theme file -
     matches on-level so nothing looks broken, but every real page should
     load theme-on-level.css or theme-honors.css to override these. */
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-bg: #eef2ff;
  --primary-light: #8b5cf6;

  --green: #10b981;
  --green-bg: #d1fae5;
  --green-text: #065f46;

  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --amber-text: #92400e;

  /* "Not posted yet" on a unit page - deliberately a cleaner, more lemon
     yellow than --amber (which already means "in progress" elsewhere on
     this site, e.g. the sidebar's partial-coverage tag) so the two don't
     read as the same status next to each other. */
  --pending: #ca8a04;
  --pending-bg: #fef9c3;

  /* "On deck this week" / "not covered in class yet" tags (added 2026-08-16
     alongside the release-log redesign) - a cool neutral blue reads as
     "coming up", distinct from green (covered) and amber (in progress). */
  --blue: #3b82f6;
  --blue-bg: #dbeafe;
  --blue-text: #1e40af;

  /* "Skipped - not graded" (added 2026-08-23) - a lesson the class ended up
     not covering at all. Red is deliberately the loudest status on the site:
     it is the one case where a student could otherwise assume a posted lesson
     counts for a grade when it does not. See CLAUDE.md's "mark a lesson
     skipped / not graded" workflow. */
  --red: #dc2626;
  --red-bg: #fee2e2;
  --red-text: #991b1b;

  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

/* Author rules like ".fc-controls { display: flex }" otherwise beat the UA
   stylesheet's [hidden] rule at equal specificity - this keeps native hidden
   toggling reliable everywhere it's used (vocab game screens/controls, etc.). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- header ---- */

header.site {
  background: linear-gradient(120deg, var(--primary), var(--primary-light));
  color: #fff;
}

header.site .wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

header.site .site-title {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 800;
}

header.site .site-title a { color: #fff; }

/* On-Level / Honors track switcher - the primary visual "which track am I
   on" signal, alongside the whole page's color scheme. */
.track-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.track-switch a {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.track-switch a:hover { color: #fff; text-decoration: none; }

.track-switch a.active {
  background: #fff;
  color: var(--primary-dark);
}

.track-switch a.active:hover { color: var(--primary-dark); }

nav.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
}

nav.site-nav a { color: rgba(255,255,255,0.9); }
nav.site-nav a:hover { color: #fff; text-decoration: none; }
nav.site-nav a.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 3px; }

/* ---- page layout: sidebar + content ---- */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* ---- sidebar: unit/lesson progress checklist ----
   Two states, toggled by the hamburger at the top - matches a standard
   app-nav pattern (hamburger + icon rows that expand to icon+label+chevron):
   - expanded (default): full rows, icon + label + chevron per unit, each
     unit independently expandable (its own chevron) to show its lessons.
   - collapsed: icon-only rail - just the hamburger and one icon per unit,
     no labels, no checklists. Clicking a unit's icon while collapsed
     re-expands the whole sidebar rather than toggling that unit. */

.sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.sidebar-hamburger {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  cursor: pointer;
}

.sidebar-hamburger .bars { font-size: 1.25rem; line-height: 1; color: var(--primary); }
.sidebar-hamburger:hover .bars { color: var(--primary-dark); }

.sidebar-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-progress .prog-sub {
  display: block;
  font-weight: 500;
  color: var(--amber-text);
  font-size: 0.78rem;
  margin-top: 2px;
}

details.unit-group { border-bottom: 1px solid var(--border); }

/* A unit with zero taught-log rows yet - not just an individual lesson -
   dims the whole row so "nothing here has started" reads at a glance
   before a student even expands it. */
details.unit-group.locked-unit > .unit-row .unit-icon,
details.unit-group.locked-unit > .unit-row .unit-label { opacity: 0.6; }

.unit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 0.95rem;
}

.unit-row::-webkit-details-marker { display: none; }
.unit-row:hover { background: var(--primary-bg); }

.unit-icon { font-size: 1.1rem; flex-shrink: 0; }
.unit-label { flex: 1; }

.unit-chevron {
  color: var(--primary);
  transition: transform 0.15s ease;
  font-size: 0.85em;
}

details.unit-group[open] > .unit-row .unit-chevron { transform: rotate(180deg); }

.current-unit-badge {
  font-size: 0.6rem;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
  text-transform: uppercase;
}

.locked-badge {
  font-size: 0.6rem;
  background: var(--pending-bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
  text-transform: uppercase;
}

ul.lesson-checklist {
  list-style: none;
  margin: 0;
  padding: 2px 10px 10px;
  font-size: 0.86rem;
}

ul.lesson-checklist li a,
ul.lesson-checklist li .lock-label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
}

ul.lesson-checklist li a:hover { background: var(--primary-bg); text-decoration: none; }

ul.lesson-checklist li.todo a { color: var(--text-muted); }

/* Matches the unit page's ol.lesson-list li.graded treatment - a graded
   lesson stands out in the sidebar checklist too, not just on its own page. */
ul.lesson-checklist li.graded a { background: var(--blue-bg); color: var(--blue-text); font-weight: 700; }

/* Matches the unit page's ol.lesson-list li.skipped treatment - a skipped
   lesson reads as skipped from the sidebar too, without opening the unit. */
ul.lesson-checklist li.skipped a { background: var(--red-bg); color: var(--red-text); font-weight: 700; }

/* Locked lessons are a real access gate, not just the muted "todo" color -
   a plain non-clickable label instead of a link into the unit page. */
ul.lesson-checklist li.locked .lock-label { color: var(--text-muted); cursor: default; }

ul.lesson-checklist li.current a {
  background: var(--primary-bg);
  font-weight: 700;
  color: var(--primary-dark);
}

.here-badge {
  display: inline-block;
  margin-left: auto;
  font-size: 0.62rem;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 12px 18px 14px;
}

/* ---- collapsed: icon-only rail ---- */

body.sidebar-collapsed .page { grid-template-columns: 64px 1fr; }

body.sidebar-collapsed .sidebar-progress,
body.sidebar-collapsed .unit-label,
body.sidebar-collapsed .unit-chevron,
body.sidebar-collapsed .current-unit-badge,
body.sidebar-collapsed .sidebar-note,
body.sidebar-collapsed ul.lesson-checklist {
  display: none;
}

body.sidebar-collapsed .sidebar-hamburger { justify-content: center; }
body.sidebar-collapsed .unit-row { justify-content: center; padding: 14px 8px; }

/* ---- main content ---- */

.content { min-width: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin: 0 0 6px;
}

h1.page-title { font-size: 2rem; margin: 0 0 8px; }
h2.section-title { font-size: 1.3rem; margin: 36px 0 14px; }

.lede { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 8px; }

/* ---- recent activity list ---- */

ul.activity-list { list-style: none; margin: 0; padding: 0; }

ul.activity-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.activity-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

.activity-topic { font-weight: 800; font-size: 1.02rem; }

.activity-note { color: var(--text-muted); margin-top: 2px; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green-text);
  margin-left: 8px;
  vertical-align: middle;
}

.tag.in-progress { background: var(--amber-bg); color: var(--amber-text); }
.tag.preview { background: var(--blue-bg); color: var(--blue-text); }

/* ---- quick link cards ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 8px 0 0;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
  text-decoration: none;
}

.card .card-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--text); font-weight: 800; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---- unit page ---- */

.unit-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 24px;
  font-weight: 600;
}

.download-box {
  border: 1px solid var(--border);
  background: var(--surface);
  border-left: 5px solid var(--green);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 8px;
}

.download-box .label { font-weight: 800; }
.download-box .sub { color: var(--text-muted); font-size: 0.88rem; }

/* The combined whole-unit PDF is a bigger spoiler than any one lesson link,
   so it gets its own locked look (amber accent instead of green) rather
   than reusing the per-lesson soon/locked button style alone. */
.download-box.locked { border-left-color: var(--pending); opacity: 0.85; }

/* Teacher's live OneNote notes - always unlocked (see Build-UnitPage), so it
   gets the track's own accent color rather than the green "ready download"
   or amber "locked" treatment used by the combined-PDF box above/below it. */
.download-box.notebook { border-left-color: var(--primary); }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.btn:hover { background: var(--primary-dark); text-decoration: none; }

ol.lesson-list {
  padding-left: 0;
  list-style: none;
  counter-reset: lesson;
}

ol.lesson-list li {
  counter-increment: lesson;
  padding: 12px 16px 12px 44px;
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 8px;
}

.lesson-title { display: block; font-weight: 700; padding-top: 2px; margin-bottom: 10px; }

/* Buttons sit on their own row below the title, separated by a hairline so
   they read as one clearly-bounded action bar instead of crowding the
   title on one wrapping line. rgba black works as a divider/separator
   color on top of every status background (white/green/yellow/amber)
   without needing a different value per status. */
.lesson-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-sep { width: 1px; height: 14px; flex: 0 0 auto; background: rgba(0, 0, 0, 0.14); margin: 0 2px; }

.lesson-link {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-bg);
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.lesson-link:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Not-yet-available buttons (warm-up/practice not posted, practice online
   not built) recede instead of competing for attention with real links -
   outline only, no fill, so the eye lands on the live buttons first. */
.lesson-link.soon {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  cursor: default;
}

.lesson-link.soon:hover { background: transparent; color: var(--text-muted); }

ol.lesson-list li::before {
  content: counter(lesson);
  position: absolute;
  left: 10px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.lesson-list li:target { box-shadow: 0 0 0 3px var(--primary) inset; scroll-margin-top: 20px; }

/* Every not-yet-taught lesson gets its own highlight now too (not just
   done/partial) so the whole list reads by color at a glance: yellow =
   haven't gotten there, amber = partially covered, green = fully covered. */
ol.lesson-list li.todo { background: var(--pending-bg); border-color: var(--pending); }
ol.lesson-list li.done { background: var(--green-bg); border-color: var(--green); }
ol.lesson-list li.done::before { background: var(--green); color: #fff; content: "✓"; }
ol.lesson-list li.partial { background: var(--amber-bg); border-color: var(--amber); }
ol.lesson-list li.partial::before { background: var(--amber); color: #fff; }

/* Online practice currently a graded assignment overrides the normal
   covered/in-progress color with light blue while the grading window is
   open - see CLAUDE.md's "mark/unmark graded online practice" workflow.
   Reuses --blue (already used for the homepage's "on deck this week" tag)
   rather than adding a third blue - the two never appear in the same list
   together, so there's no on-page ambiguity about what blue means here. */
ol.lesson-list li.graded { background: var(--blue-bg); border-color: var(--blue); }
ol.lesson-list li.graded::before { background: var(--blue); color: #fff; content: "G"; }

/* Small pill next to the lesson title itself, per the teacher's ask for a
   note "in the heading" - on top of the row turning blue, not instead of it. */
.graded-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--blue-text);
  background: #fff;
  border: 1px solid var(--blue);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

/* The Practice Online button itself also flips to solid blue when graded -
   that's the actual link a student is about to click into, not just the
   row it sits in. */
.lesson-link.graded { background: var(--blue); color: #fff; border-color: var(--blue); }
.lesson-link.graded:hover { background: var(--blue-text); }

/* A lesson the class skipped entirely (Coverage: Skipped in the taught log,
   added 2026-08-23). Red outranks every other row color, including the blue
   graded state - the two are mutually exclusive by definition, since a
   skipped lesson is never graded. The row stays fully clickable: skipping a
   lesson removes the grade, not the reference copy. */
ol.lesson-list li.skipped { background: var(--red-bg); border-color: var(--red); }
ol.lesson-list li.skipped::before { background: var(--red); color: #fff; content: "\2715"; }

/* Same pill treatment as .graded-badge, in red - students need the words
   "Not Graded" spelled out, not just a color they have to decode. */
.skipped-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--red-text);
  background: #fff;
  border: 1px solid var(--red);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Homepage "This Week in Class" and Study Hall card tags. */
.tag.skipped { background: var(--red-bg); color: var(--red-text); }

/* Graded-practice due date (added 2026-08-23). Solid blue rather than the
   pale .tag.preview blue it often sits beside - a deadline should be the
   loudest thing on the card after the topic itself. */
.tag.due { background: var(--blue); color: #fff; }

.back-link { display: inline-block; margin-top: 8px; font-size: 0.92rem; font-weight: 600; }

/* ---- study hall ---- */

.study-intro {
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  color: var(--primary-dark);
  font-size: 0.92rem;
}

.study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.study-meta { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.study-topic { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.study-note { color: var(--text-muted); margin-bottom: 14px; }

.copy-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-prompt-btn:hover { background: var(--primary-dark); }
.copy-prompt-btn.copied { background: var(--green); }

/* ---- placeholder / coming soon ---- */

.coming-soon {
  border: 2px dashed #c7d2fe;
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--primary-dark);
  margin-top: 16px;
  font-weight: 600;
}

.coming-soon .card-icon { font-size: 2.2rem; display: block; margin-bottom: 12px; }

/* ---- landing page (site root track picker) ----
   Standalone page, not built from the shared head/header/sidebar/footer -
   no track is known yet, so both track colors appear hardcoded here rather
   than through the --primary variable (which only theme-on-level.css /
   theme-honors.css set, and this page loads neither). */

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef2ff 0%, #f3f4fd 50%, #ccfbf1 100%);
}

.landing-emoji { font-size: 3rem; margin: 0 0 4px; }

.landing h1 { font-size: 2.2rem; margin: 0 0 10px; }

.landing-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 0 32px;
}

.landing-picks {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 20px 36px;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.landing-pick:hover {
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.22);
}

.landing-pick.on-level { background: linear-gradient(120deg, #6366f1, #8b5cf6); }
.landing-pick.honors { background: linear-gradient(120deg, #0d9488, #0891b2); }

.landing-pick-arrow { font-size: 1.1rem; }

.landing-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 36px;
}

@media (max-width: 480px) {
  .landing-picks { flex-direction: column; width: 100%; max-width: 280px; }
  .landing-pick { justify-content: center; }
}

/* ---- vocabulary game ---- */

.vocab-back {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.vocab-play-nav { margin-bottom: 16px; }

/* -- game picker (screen 1) -- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.game-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
}

.game-card-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.game-card h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--text); font-weight: 800; }
.game-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* -- unit multi-select (screen 2) -- */

.unit-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 20px;
}

.unit-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.95rem;
}

.unit-check-row:hover { background: var(--primary-bg); }
.unit-check-row input { width: 18px; height: 18px; flex-shrink: 0; }
.unit-check-row span:nth-of-type(1) { flex: 1; font-weight: 600; }
.unit-check-count { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; }
.unit-check-all { font-weight: 800; background: var(--primary-bg); border-color: var(--primary); }

.vocab-empty-note { color: var(--text-muted); font-style: italic; }

#vocabNoneWarning { color: var(--red, #b91c1c); font-weight: 600; margin-top: 10px; }

/* -- shared: end-of-round summary card -- */

.vocab-summary {
  border: 1px solid var(--border);
  border-left: 5px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px 24px;
  text-align: center;
  margin-top: 8px;
}

.vocab-summary-btns { display: flex; gap: 12px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

.btn-secondary {
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

.btn-secondary:hover { background: var(--primary-bg); color: var(--primary-dark); }

/* -- flashcards -- */

.fc-progress { text-align: center; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }

.fc-wrap { display: flex; justify-content: center; margin: 8px 0 16px; perspective: 1200px; }

.fc-card {
  width: 100%;
  max-width: 460px;
  height: 240px;
  cursor: pointer;
}

.fc-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s;
  transform-style: preserve-3d;
}

.fc-card-inner.flipped { transform: rotateY(180deg); }

.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.12);
}

.fc-face-front { background: linear-gradient(120deg, var(--primary), var(--primary-light)); color: #fff; }
.fc-face-back { background: var(--surface); color: var(--text); border: 2px solid var(--primary); transform: rotateY(180deg); font-size: 1.05rem; font-weight: 600; }

.fc-hint { text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.fc-controls { display: flex; gap: 14px; justify-content: center; margin-top: 4px; }

.fc-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.fc-btn-study { background: var(--amber-bg); color: var(--amber-text); }
.fc-btn-study:hover { background: var(--amber); color: #fff; }
.fc-btn-know { background: var(--green-bg); color: var(--green-text); }
.fc-btn-know:hover { background: var(--green); color: #fff; }

/* -- matching -- */

.match-meta { text-align: center; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }

.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.match-tile {
  appearance: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 90px;
  padding: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.match-tile:hover:not(:disabled) { border-color: var(--primary); }
.match-tile.flipped { background: var(--primary-bg); border-color: var(--primary); }
.match-tile.matched { background: var(--green-bg); border-color: var(--green); color: var(--green-text); cursor: default; }
.match-tile-back { font-size: 1.4rem; color: var(--primary); }

@media (max-width: 640px) {
  .match-grid { grid-template-columns: repeat(3, 1fr); }
}

/* -- quick quiz -- */

.quiz-meta { text-align: center; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }

.quiz-term {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.quiz-choice {
  appearance: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.quiz-choice:hover { border-color: var(--primary); background: var(--primary-bg); }
.quiz-choice.correct { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }
.quiz-choice.wrong { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-text); }

@media (max-width: 640px) {
  .quiz-choices { grid-template-columns: 1fr; }
  .quiz-term { font-size: 1.25rem; }
}

/* -- term typer -- */

.typer-meta { text-align: center; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }

.typer-def {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.typer-input-row { display: flex; gap: 10px; }

.typer-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
}

.typer-input:focus { outline: none; border-color: var(--primary); }

.typer-hint { color: var(--text-muted); margin-top: 10px; min-height: 1.2em; }
.typer-correct { text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--green-text); padding: 40px 0; }
.typer-missed { text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--amber-text); padding: 40px 0; }

/* -- vocab blitz (arcade) -- */

.blitz-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; gap: 10px; }
.blitz-lives { font-size: 1.2rem; letter-spacing: 2px; }
.blitz-round { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.blitz-score { color: var(--primary-dark); }

.blitz-zone-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-bg);
  padding: 0 20px;
}

.blitz-sky {
  position: relative;
  height: 260px;
  background: linear-gradient(180deg, var(--primary-bg), var(--surface));
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.blitz-falling {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(31, 41, 55, 0.2);
}

.blitz-falling.blitz-caught { background: none; box-shadow: none; font-size: 2rem; top: 50% !important; transform: translate(-50%, -50%); }

.blitz-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.blitz-bucket {
  appearance: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.blitz-bucket:hover { border-color: var(--primary); background: var(--primary-bg); }
.blitz-bucket.wrong-flash { background: var(--amber-bg); border-color: var(--amber); }

/* ---- footer ---- */

footer.site {
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- responsive: tablet ---- */

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  /* collapsed rail becomes a horizontal row of icons on mobile, not a
     vertical column - the sidebar is stacked full-width above the content
     here, not beside it. */
  body.sidebar-collapsed .page { grid-template-columns: 1fr; }
  body.sidebar-collapsed .sidebar-hamburger { justify-content: flex-start; }
  body.sidebar-collapsed details.unit-group { display: inline-block; border-bottom: none; }
  body.sidebar-collapsed .unit-row { padding: 10px 14px; }
}

/* ---- responsive: phone ---- */

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  h1.page-title { font-size: 1.6rem; }
  header.site .site-title { font-size: 1.15rem; }
  .track-switch a { padding: 5px 12px; font-size: 0.78rem; }
  nav.site-nav { gap: 12px; font-size: 0.88rem; }
  .page { padding-left: 16px; padding-right: 16px; }
  .download-box { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  header.site .site-title span.emoji { display: none; }
}
