/* ===== Tokens ===== */
/* ---- PAGE WIDTH ----
 * The page is capped so the board stays readable on a laptop. On a large display
 * that cap would leave a narrow column in the middle of the screen, so it steps up
 * with the viewport. Widen these values if you want the board to grow faster.
 */
@media (min-width: 1900px) { .container { max-width: 1900px; } }
@media (min-width: 2400px) { .container { max-width: 2400px; } }
@media (min-width: 3000px) { .container { max-width: 3000px; } }

:root {
  /* ---- RAIL HEIGHT KNOB ----
   * The left rail is this tall, and its Bank / Apply / End turn buttons sit at the
   * bottom of it, so they stay put when you switch tabs.
   *
   * To make the rail shorter or taller, change ONLY the value below. 100dvh is the
   * full viewport height; --app-chrome is everything above the rail (header plus
   * page padding), which is what the rail has to subtract.
   *
   * Shorter rail:  --app-chrome: 12rem;   (or any larger value)
   * Taller rail:   --app-chrome: 8rem;
   */
  --app-chrome: 10rem;

  --bg: #101118;
  --surface: #191b26;
  --surface-raised: #202331;
  --border: #303344;
  --ink: #f4f3f8;
  --ink-soft: #aaaabd;
  --accent: #c6f36b;
  --accent-soft: #2a331a;
  --on-accent: #151711;
  --gold-glow: rgba(255, 203, 31, 0.6);
  /* Card selection. A vivid yellow chosen to be unmistakable next to every route
     colour; the old --accent was amber in light mode and sat on top of the
     Live Project Brief orange. */
  /* Selection is a neutral, not a colour: white at night. Any hue here reads as
     one of the five route colours. */
  --select: var(--ink);
  --select-soft: color-mix(in srgb, var(--ink), transparent 88%);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.15);
  --bad: #f08080;
  --bad-soft: rgba(240, 128, 128, 0.15);
  --white: #f4f3f8;
  --white-10: rgba(244, 243, 248, 0.1);
  --white-15: rgba(244, 243, 248, 0.15);
  --white-40: rgba(244, 243, 248, 0.4);
  --white-50: rgba(244, 243, 248, 0.5);
  --black-05: rgba(0, 0, 0, 0.05);
  --black-15: rgba(0, 0, 0, 0.15);
  --black-20: rgba(0, 0, 0, 0.2);
  --black-25: rgba(0, 0, 0, 0.25);
  --black-30: rgba(0, 0, 0, 0.3);
  --black-35: rgba(0, 0, 0, 0.35);
  --black-50: rgba(0, 0, 0, 0.5);
  --black-80: rgba(0, 0, 0, 0.8);
  --accent-soft: #2a331a;
  --badge-pass: #4ade80;
  --badge-pass-light: #22c55e;
  --badge-pass-dark: #16a34a;
  --badge-pass-darker: #15803d;
  --badge-review-low: #f87171;
  --badge-review-low-dark: #ef4444;
  --badge-review-low-darker: #dc2626;
  --badge-review-mid: #fbbf24;
  --badge-review-mid-mid: #f59e0b;
  --badge-review-mid-dark: #d97706;
  --badge-review-high: #fef08a;
  --badge-review-high-mid: #fde047;
  --badge-review-high-dark: #eab308;
  --overlay: rgba(16, 17, 24, 0.7);
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px var(--black-20);
  --shadow-md: 0 3px 10px var(--black-30);
  --shadow-inset-light: inset 0 2px 4px var(--black-15), 0 1px 2px var(--black-05);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-pill: 999px;
  --transition-fast: all 0.15s ease;
  --transition-fast-colors: border-color 0.15s ease, background 0.15s ease;
  --transition-fast-transform: transform 0.15s ease, border-color 0.15s ease;
  --transition-medium: background 0.2s ease, color 0.2s ease;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', 'SFMono-Regular', monospace;
}

html[data-theme="light"] {
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E1E1EE;
  --ink: #1E2340;
  --ink-soft: #5B5F7A;
  --accent: #B5792A;
  --accent-soft: #FEF3E2;
  --on-accent: #1A1200;
  --select: #000;
  --select-soft: color-mix(in srgb, #000, transparent 88%);
  --good: #3E8E5B;
  --bad: #C64B4B;
  --overlay: rgba(18, 20, 43, 0.5);
  /* Card category colours. These live with the other tokens so there is a single
     light-theme block; they were previously split across both stylesheets. */
  --cyan: #35C4D6;
  --pink: #E15B9E;
  --gold: #D6A62B;
  --lime: #6FCB4D;
  --orange: #e67935;
}

/* Dark theme (default — matches Race to the Role prototype) */
html[data-theme="dark"] {
  --bg: #101118;
  --surface: #191b26;
  --surface-raised: #202331;
  --border: #303344;
  --ink: #f4f3f8;
  --ink-soft: #aaaabd;
  --accent: #c6f36b;
  --accent-soft: #1a2a10;
  --on-accent: #151711;
  --good: #4ade80;
  --bad: #f08080;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -20%, #29293e 0, transparent 48%), var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  /* Widened from 1320px: the right rail is now a drawer, so the board is only
     two columns and had room to grow on a wide screen. */
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 28px 28px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* ===== Header ===== */
.header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "eyebrow tools" "title timer";
  align-items: center;
  gap: 6px 24px;
  margin-bottom: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 13px;
  font-size: 23px;
  box-shadow: 0 5px 25px rgba(198, 243, 107, 0.22);
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.1;
  margin: 2px 0 0;
  letter-spacing: -0.03em;
}

.header .eyebrow {
  grid-area: eyebrow;
  color: var(--accent);
}

.header-top {
  display: contents;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.header-actions {
  grid-area: tools;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.icon-btn {
  background: var(--surface);
  color: var(--gold-glow);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn .menu-icon,
.icon-btn i {
  color: var(--accent);
  font-size: inherit;
  line-height: 1;
}

.icon-btn:hover i,
.icon-btn:hover .menu-icon {
  color: var(--ink);
}

html[data-theme="light"] .icon-btn i {
  color: var(--accent);
}

html[data-theme="light"] .icon-btn:hover i {
  color: var(--ink);
}

/* Hide emoji fallback spans (not used when Font Awesome loads) */
.menu-icon {
  display: none;
}

html[data-theme="light"] .icon-btn:hover {
  background: var(--black-15);
}

html[data-theme="dark"] .icon-btn:hover {
  background: var(--white-15);
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  margin: 0.1rem 0 0;
  letter-spacing: -0.01em;
}

.quiz-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  min-width: 0;
  margin-top: 0.25rem;
}

.header-title-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}



.quiz-title .logo {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
}

html[data-theme="light"] .quiz-title .logo-light {
  display: none;
}

html[data-theme="dark"] .quiz-title .logo-dark {
  display: none;
}

/* ===== Overall Progress ===== */
.overall-progress {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideDown 0.5s ease;
}

.overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.overall-progress-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.overall-progress-score {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.overall-progress-bar {
  height: 14px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 2px 4px var(--black-15), 0 1px 2px var(--black-05);
  position: relative;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--good));
  border-radius: 999px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.overall-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg,
      transparent,
      transparent 6px,
      var(--white-15) 6px,
      var(--white-15) 12px);
  animation: stripeMove 1.5s linear infinite;
}

@keyframes stripeMove {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 24px 0;
  }
}

.overall-progress-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0;
  font-style: italic;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgePop {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.2) rotate(10deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  75% {
    transform: translateX(3px);
  }
}

@keyframes badge3D {
  0% {
    transform: rotateY(0deg) rotateX(0deg) scale(0);
    opacity: 0;
  }

  30% {
    transform: rotateY(180deg) rotateX(45deg) scale(1.3);
    opacity: 1;
  }

  60% {
    transform: rotateY(360deg) rotateX(0deg) scale(0.95);
  }

  80% {
    transform: rotateY(400deg) rotateX(-10deg) scale(1.05);
  }

  100% {
    transform: rotateY(360deg) rotateX(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes badgeGlow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--good-glow-50), 0 0 10px var(--good-glow-30);
  }

  50% {
    box-shadow: 0 0 20px var(--good-glow-80), 0 0 30px var(--good-glow-50), 0 0 40px var(--good-glow-30);
  }
}

@keyframes badgeShine {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes starPulse {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.2);
  }
}

.completion-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: badgePop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
  flex-shrink: 0;
  animation-delay: 0.8s;
}

.completion-badge.passed {
  background: radial-gradient(circle at 35% 35%, var(--badge-pass) 0%, var(--badge-pass-light) 30%, var(--badge-pass-dark) 70%, var(--badge-pass-darker) 100%);
  color: var(--white);
  border: 3.5px solid var(--white-50);
  box-shadow:
    inset -0.6rem -0.6rem 0 var(--black-25),
    inset 0.3rem 0.3rem 0 var(--white-15),
    0 8px 24px var(--good-glow-50),
    0 2px 8px var(--black-20);
  animation: badgeUnlock 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, badgeFloat 3s ease-in-out infinite, badgeGlow 2.5s ease-in-out infinite;
  animation-delay: 0.6s, 1.5s, 2s;
}

.completion-badge.passed .badge-star {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  animation: starShine 2s ease-in-out infinite;
  text-shadow:
    0 0 12px var(--white-95),
    0 0 24px var(--gold-glow),
    0 2px 4px var(--black-30);
  z-index: 2;
  line-height: 1;
}

.completion-badge.passed svg {
  width: 80px;
  height: 80px;
  opacity: 1;
  animation: none;
  filter: drop-shadow(0 2px 3px var(--black-20));
}

.completion-badge.passed .progress-circle {
  stroke: var(--white);
  opacity: 0.9;
}

.completion-badge.review-low {
  background: radial-gradient(circle at 35% 35%, var(--badge-review-low) 0%, var(--badge-review-low-dark) 50%, var(--badge-review-low-darker) 100%);
  color: var(--white);
  border: 3px solid var(--white-40);
  box-shadow:
    inset -0.5rem -0.5rem 0 var(--black-20),
    inset 0.2rem 0.2rem 0 var(--white-10),
    0 6px 20px var(--bad-glow-40),
    0 2px 6px var(--black-15);
  animation: badgeUnlock 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.6s;
}

.completion-badge.review-mid {
  background: radial-gradient(circle at 35% 35%, var(--badge-review-mid) 0%, var(--badge-review-mid-mid) 50%, var(--badge-review-mid-dark) 100%);
  color: var(--white);
  border: 3px solid var(--white-40);
  box-shadow:
    inset -0.5rem -0.5rem 0 var(--black-20),
    inset 0.2rem 0.2rem 0 var(--white-10),
    0 6px 20px var(--bad-glow-40),
    0 2px 6px var(--black-15);
  animation: badgeUnlock 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.6s;
}

.completion-badge.review-high {
  background: radial-gradient(circle at 35% 35%, var(--badge-review-high) 0%, var(--badge-review-high-mid) 50%, var(--badge-review-high-dark) 100%);
  color: var(--white);
  border: 3px solid var(--white-40);
  box-shadow:
    inset -0.5rem -0.5rem 0 var(--black-15),
    inset 0.2rem 0.2rem 0 var(--white-15),
    0 6px 20px var(--high-glow-40),
    0 2px 6px var(--black-15);
  animation: badgeUnlock 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.6s;
}

.completion-badge.review-high .progress-circle {
  stroke: var(--white);
  animation: none;
}

.completion-badge.review-high svg text {
  fill: var(--white);
  font-weight: 800;
  text-shadow: 0 1px 2px var(--black-30);
}

.completion-badge.review-high svg {
  width: 80px;
  height: 80px;
  opacity: 1;
  animation: none;
  filter: drop-shadow(0 2px 3px var(--black-25));
}

.section-card {
  position: relative;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 1rem;
}

/* ===== Tutorial ===== */
.tutorial-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.tutorial-title {
  margin: 0 0 0.35rem;
}

.tutorial-lede {
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tutorial-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.tutorial-step p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.tutorial-step strong {
  color: var(--ink);
}

.tutorial-actions {
  display: flex;
  justify-content: center;
}

/* ===== Start / Intake ===== */
.level-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.level-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow);
}

.level-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.level-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.level-card.selected .level-card-mark {
  color: var(--accent);
}

.level-card-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}

.level-card-blurb {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.level-card-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.level-card-disabled:hover {
  transform: none;
  border-color: var(--border);
}

.settings-input,
input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-input:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#startContinue:disabled {
  background: var(--border);
  color: var(--ink-soft);
  cursor: not-allowed;
  transform: none;
}

html[data-theme="dark"] #startContinue:disabled {
  background: var(--surface-raised);
  color: var(--ink-soft);
}

/* ===== Visual (canvas) questions ===== */
.visual-sequence {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.shape-box {
  width: 84px;
  height: 84px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shape-box.placeholder {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--ink-soft);
}

.shape-canvas {
  display: block;
}

.visual-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.shape-option {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  cursor: pointer;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.shape-option:hover {
  border-color: var(--accent);
}

.shape-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.shape-option-letter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  align-self: flex-start;
}

.review-thumbs {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.review-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.review-thumb .shape-canvas {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.level-group-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 1.5rem 0 0.75rem;
}

/* ===== Section cards ===== */
.section-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}

.section-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 5rem 1.25rem 1.1rem;
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.section-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.learn-badge {
  display: none;
  align-items: center;
  width: fit-content;
  min-width: 50%;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}

.learn-badge.in-progress {
  display: inline-flex;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.learn-badge.done {
  display: inline-flex;
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good);
}

.section-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.section-card>p {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ===== Learn screen ===== */
.learn-header {
  margin-bottom: 1.5rem;
}

.learn-header h2 {
  margin: 0 0 0.35rem;
}

.learn-progress {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0;
}

/* The step body. It used to be a card inside a scrolling panel; now the panel is
   the frame, so this is just the scrolling region between the fixed header and
   footer. */
.learn-content {
  padding: 1.1rem 0.2rem 1.1rem 0;
}

.learn-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.learn-content p {
  margin: 0 0 1.25rem;
  line-height: 1.6;
  color: var(--ink);
}

.learn-output {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--good);
  background: var(--good-soft);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0 0;
}

/* ===== Exercises ===== */
.exercise-container {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow);
}

.exercise-prompt {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 1rem;
  color: var(--ink);
}

.exercise-option {
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.exercise-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.exercise-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.exercise-option.correct {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--good);
}

.exercise-option.correct::before {
  content: '\2713';
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: inline-block;
  margin-right: 0.35rem;
  font-weight: 700;
}

.exercise-option.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.exercise-option.wrong::before {
  content: '\2717';
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: inline-block;
  margin-right: 0.35rem;
  font-weight: 700;
}

.exercise-feedback {
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-align: center;
  animation: feedbackPulse 0.4s ease;
}

.exercise-feedback.correct {
  color: var(--good);
  background: var(--good-soft);
  border: 2px solid var(--good);
}

.exercise-feedback.wrong {
  color: var(--bad);
  background: var(--bad-soft);
  border: 2px solid var(--bad);
}

.exercise-check-btn {
  margin-top: 0.75rem;
}

.exercise-code-line {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.exercise-blank {
  display: inline-block;
  min-width: 80px;
  min-height: 1.5em;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin: 0 0.2rem;
  vertical-align: middle;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.exercise-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.exercise-editor {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.exercise-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}

@keyframes feedbackPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.learn-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 0 0 0.75rem;
  overflow-x: auto;
}

/* ===== Quiz ===== */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.25s ease;
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.question-prompt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 1.35rem;
  line-height: 1.4;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover {
  border-color: var(--accent);
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-marker {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.option.selected .option-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.option-text {
  font-size: 0.95rem;
}

.multi-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.6rem;
  background: var(--accent-soft);
  border-radius: 6px;
  display: inline-block;
}

.navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 0.75rem;
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  border: none;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

html[data-theme="dark"] .btn {
  background: var(--accent);
  color: var(--on-accent);
}

#nextBtn {
  background: var(--accent);
  color: var(--surface);
}

html[data-theme="dark"] #nextBtn {
  background: var(--accent);
  color: var(--surface);
}

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

html[data-theme="dark"] .btn-secondary {
  background: var(--ink);
  color: var(--surface);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--bad);
  color: var(--white);
  border: 1px solid var(--bad);
}

.btn-danger:hover {
  background: var(--bad-hover);
  border-color: var(--bad-hover);
}

html[data-theme="dark"] .btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: var(--on-accent);
}

html[data-theme="dark"] .btn-danger:hover {
  background: var(--bad-hover-dark);
  border-color: var(--bad-hover-dark);
}

.learn-btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

.quiz-btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--surface);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-shrink: 0;
}

.modal-head h2 {
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.modal-body {
  overflow-y: auto;
  padding: 0 1.5rem;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--ink-soft);
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.settings-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: 0.5rem 0;
  padding: 1rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.settings-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#timerMinutes {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  margin: 0.5rem 0 0.75rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.settings-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#timerMinutesValue {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ===== Results ===== */
.results-hero {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.results-score {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.25rem 0;
}

.results-sub {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.9rem;
}

.pass-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--good);
  color: var(--white);
  margin-bottom: 0.5rem;
  animation: feedbackPulse 0.4s ease;
}

.review-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--bad);
  color: var(--white);
  margin-bottom: 0.5rem;
  animation: feedbackPulse 0.4s ease;
}

.trait-row {
  margin-bottom: 0.9rem;
}

.trait-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.trait-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.trait-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.75rem;
}

.review-item p {
  margin: 0.25rem 0;
  font-size: 0.88rem;
}

.review-item .review-prompt {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.4rem;
}

.tag.good {
  background: var(--good-soft);
  color: var(--good);
  padding-left: 1.1rem;
  position: relative;
}

.tag.good::before {
  content: '\2713';
  position: absolute;
  left: 0.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
}

.tag.bad {
  background: var(--bad-soft);
  color: var(--bad);
  padding-left: 1.1rem;
  position: relative;
}

.tag.bad::before {
  content: '\2717';
  position: absolute;
  left: 0.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.download-cert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}

.download-cert-btn .fa-stack {
  font-size: 0.9rem;
}

.download-cert-btn .fa-stack .fa-certificate {
  color: var(--accent);
}

.download-cert-btn .fa-stack .fa-download {
  color: inherit;
}

footer {
  text-align: center;
  padding: 1.5rem 1rem;
}

footer p {
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin: 0;
}

/* ===== Number pyramids ===== */
.pyramid-container {
  margin-top: 0.5rem;
}

.pyramid-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.pyramid-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.pyramid-cell {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: default;
  user-select: none;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.pyramid-cell.filled {
  background: var(--bg);
  border-color: var(--border);
  color: var(--ink-soft);
  cursor: default;
}

.pyramid-cell.empty {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
}

.pyramid-cell.empty:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pyramid-cell.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pyramid-cell.filled-user {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--ink);
  cursor: pointer;
}

.pyramid-cell.filled-user:hover {
  border-color: var(--bad);
}

.pyramid-cell.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.pyramid-cell.locked.empty {
  cursor: not-allowed;
  border-color: var(--border);
}

.pyramid-cell.correct {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--good);
}

.pyramid-cell.incorrect {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.pyramid-tiles-wrap {
  margin-top: 1rem;
}

.pyramid-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pyramid-tile {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: grab;
  transition: var(--transition-fast);
  user-select: none;
  box-shadow: var(--shadow);
}

.pyramid-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.pyramid-tile:active {
  transform: translateY(0);
}

.pyramid-tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.pyramid-tile.used {
  opacity: 0.4;
  cursor: not-allowed;
}

.pyramid-tile.dragging {
  opacity: 0.5;
}

.pyramid-tile.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.pyramid-hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.pyramid-check-btn {
  margin: 0.5rem auto 0;
  display: block;
}

.pyramid-msg {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem auto 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  max-width: 400px;
}

.correct-msg {
  color: var(--good);
  background: var(--good-soft);
}

.wrong-msg {
  color: var(--bad);
  background: var(--bad-soft);
}

/* ===== Review (results) pyramids ===== */
.review-pyramid-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.review-pyramid-cell {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  user-select: none;
}

.review-pyramid-cell.filled {
  background: var(--bg);
  border-color: var(--border);
  color: var(--ink-soft);
}

.review-pyramid-cell.filled-user {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--ink);
}

.review-pyramid-cell.correct {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--good);
}

.review-pyramid-cell.incorrect {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.review-pyramid-cell.skipped {
  border-color: var(--border);
  background: var(--bg);
  color: var(--ink-soft);
}

/* ===== Cluster missing-number ===== */
.cluster-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cluster-instr {
  color: var(--ink-soft);
  text-align: center;
  margin: 0;
}

.cluster-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cluster-top {
  width: 56px;
  height: 56px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--ink);
}

.cluster-missing-top {
  border-style: dashed;
  color: var(--ink-soft);
}

.cluster-bottom {
  display: flex;
  gap: 0.3rem;
}

.cluster-bottom-num {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--ink);
}

.cluster-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 300px;
}

.cluster-opt {
  padding: 0.8rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cluster-opt:hover {
  border-color: var(--accent);
}

.cluster-opt.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ===== Matrix 3x3 ===== */
.matrix-3x3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.matrix-instr {
  color: var(--ink-soft);
  text-align: center;
  margin: 0;
}

.matrix-grid {
  display: flex;
  flex-direction: column;
}

.matrix-cell {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.matrix-cell canvas {
  display: block;
}

.matrix-empty {
  border-style: dashed;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.matrix-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.matrix-opt {
  width: 64px;
  height: 64px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.matrix-opt:hover {
  border-color: var(--accent);
}

.matrix-opt.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.matrix-opt canvas {
  display: block;
}

/* ===== Matrix review ===== */
.matrix-review {
  margin-top: 0.5rem;
}

.matrix-cell-correct {
  border: 2px solid var(--good);
}

.matrix-cell-incorrect {
  border: 2px solid var(--bad);
}

/* ===== Typing questions ===== */
.typing-input {
  width: 100%;
  max-width: 320px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.typing-template {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
}

/* ===== Insert questions ===== */
.insert-template {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
}

.insert-slot {
  display: inline-block;
  min-width: 80px;
  min-height: 1.5em;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin: 0 0.2rem;
  vertical-align: middle;
  background: var(--surface);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.insert-slot:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.insert-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dragorder-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dragorder-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dragorder-item:active {
  cursor: grabbing;
}

/* ===== Code runner questions ===== */
.coderunner-editor {
  width: 100%;
  min-height: 160px;
  padding: 0.75rem;
  border: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  tab-size: 4;
}

.coderunner-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
}

/* ===== Execution Player ===== */
.execution-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}

.execution-line {
  transition: background 0.2s ease;
}

.execution-line.active {
  background: var(--accent-soft);
  font-weight: 600;
}

.execution-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.variable-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.variable-content {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.execution-description {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

/* ===== Flow Diagram ===== */
.flow-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.flow-node {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  min-width: 120px;
  transition: transform 0.15s ease;
}

.flow-node:hover {
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    margin-bottom: 18px;
  }

  /* The timer now shares the title row, which squeezes the wordmark on narrow
     screens. Give it its own row again and let it sit under the menu. */
  .header {
    grid-template-areas: "eyebrow tools" "title title" "timer timer";
  }

  .header-timer {
    margin-left: 0;
  }

  .header .eyebrow {
    width: auto;
    text-align: left;
    white-space: nowrap;
    font-size: 0.6rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .header-title-row {
    width: 100%;
    margin: 0;
    justify-content: flex-start;
  }

  .quiz-title {
    gap: 0.45rem;
    font-size: clamp(1.15rem, 5vw, 1.6rem);
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }

  .quiz-title .logo {
    width: 1.8rem;
    height: 1.8rem;
  }

  .results-score {
    font-size: 2.4rem;
  }

  .icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .header-actions .icon-btn {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
  }

  .header .eyebrow {
    font-size: 0.48rem;
    letter-spacing: 0.08em;
  }

  .quiz-title {
    font-size: clamp(1rem, 4.8vw, 1.35rem);
  }
}

/* ===== Accessibility Modal ===== */

.a11y-modal-content {
  max-width: 460px;
}

.a11y-subtitle {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.a11y-section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 1.25rem 0 0.625rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}

.a11y-section-title:first-child {
  margin-top: 0;
}

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.a11y-row:last-child {
  border-bottom: none;
}

.a11y-row-info {
  flex: 1;
  min-width: 0;
}

.a11y-row-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.a11y-row-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  line-height: 1.4;
}

.a11y-icon {
  font-size: 1rem;
  color: var(--accent);
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

/* ── Toggle switch (iOS-style pill) ──────────────────── */

.toggle-btn {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-btn::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px var(--black-20);
  transition: transform 0.2s ease;
}

.toggle-btn[aria-checked="true"],
.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-btn[aria-checked="true"]::after,
.toggle-btn.active::after {
  transform: translateX(20px);
}

.toggle-btn:hover {
  border-color: var(--ink-soft);
}

.toggle-btn[aria-checked="true"]:hover,
.toggle-btn.active:hover {
  border-color: var(--accent);
  filter: brightness(1.08);
}

.toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── High-contrast body mode ─────────────────────────── */

body.high-contrast {
  --border: #888;
  --ink-soft: var(--ink);
  --accent: #fff;
}

html[data-theme="dark"] body.high-contrast {
  --border: #999;
  --ink-soft: #f4f3f8;
  --accent: #ffff00;
}

/* ── Reduce-motion body mode ─────────────────────────── */

body.reduce-motion,
body.reduce-motion * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

/* ── Simple-language body mode ────────────────────────── */

body.simple-mode {
  line-height: 1.85;
}

body.simple-mode .tutorial-lede,
body.simple-mode .tutorial-step p,
body.simple-mode .learn-content p,
body.simple-mode .learn-slide-content,
body.simple-mode .question-prompt,
body.simple-mode .option-text,
body.simple-mode .results-sub,
body.simple-mode .review-prompt,
body.simple-mode .a11y-row-desc,
body.simple-mode .settings-hint {
  font-size: 1.08em;
  line-height: 1.8;
  max-width: 60ch;
}

.history {
  margin-top: 0.25rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.history-header {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.history-empty {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.completed-role {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.completed-role:last-child {
  border-bottom: none;
}

.completed-role-art {
  font-size: 1.2rem;
}

.completed-role-info {
  flex: 1;
  min-width: 0;
}

.completed-role-info strong {
  font-size: 0.85rem;
  color: var(--ink);
}

.completed-role-info small {
  display: block;
  font-size: 0.62rem;
  color: var(--ink-soft);
  margin-top: 0.12rem;
}

.completed-role-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.hall-of-fame {
  max-width: 680px;
  margin: 2rem auto;
  padding: 1.5rem;
}

.hof-header h2 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
}

.hof-subtitle {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 0 0 1.5rem;
}

.hof-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.hof-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.hof-entry {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised, var(--surface));
}

.hof-entry.recent {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent), transparent 60%);
}

.hof-rank {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  width: 2.2rem;
  text-align: center;
}

.hof-art {
  font-size: 1.2rem;
}

.hof-info {
  flex: 1;
  min-width: 0;
}

.hof-role {
  font-size: 0.9rem;
  color: var(--ink);
}

.hof-date {
  display: block;
  font-size: 0.62rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

.hof-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.hof-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.55rem;
  font-family: var(--font-mono);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hof-badges {
  margin-top: 0.2rem;
}

.hof-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* The list can run to a dozen entries, so cap it and scroll inside itself
   rather than letting it push the rail's own scrollbar past the action bar. */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  /* No max-height or overflow here on purpose: .rail-body is the single scroll area
     for every tab. A second scroller on this list gave nested scrollbars and made
     the tab heights inconsistent with the CV and Routes tabs. */
  padding-right: 0.35rem;
}





.skill-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}

.skill-item.needed {
  border: 1px solid color-mix(in srgb, var(--gold), transparent 40%);
  background: color-mix(in srgb, var(--gold), transparent 85%);
}

.skill-item.owned {
  border: 1px solid color-mix(in srgb, var(--good), transparent 40%);
  background: color-mix(in srgb, var(--good), transparent 85%);
  color: var(--good);
  font-weight: 600;
}

.skill-check {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.skill-name {
  font-weight: 600;
}

.all-skills {
  margin-top: 0.4rem;
  border-top: 1px solid var(--border);
  padding-top: 0.3rem;
}

.all-skills small {
  color: var(--ink-soft);
  font-size: 0.6rem;
  line-height: 1.4;
}

.skill-item.required {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 85%);
}

.skill-item.required .skill-name {
  color: var(--accent);
  font-weight: 700;
}

.required-tag {
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--accent-soft);
  border-radius: 2px;
  padding: 0.1rem 0.3rem;
  margin-left: 0.3rem;
}

/* The header toggle now switches the tooltip layer rather than hiding board
   sections, so there are no helper-hidden rules any more. The guide banner and
   the status bar still gate themselves, because they carry live information. */
/* Skills rows are tooltip targets, so they need a positioning context. */
.skill-item {
  position: relative;
}

.skill-name {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.helper-content {
  display: block;
}

.guide.hidden {
  display: none !important;
}

.set-builder-status:empty {
  display: none;
}

/* Header hint toggle: lit while helper hints are shown */
.icon-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* How to Play: an overlay above the current panel, not a panel swap */
.learn-screen {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.learn-screen[hidden] {
  display: none;
}

.learn-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

/* Fixed frame: the panel itself never scrolls, so the title, the step counter and
   the Previous/Next buttons stay on screen. Only the step body scrolls between
   them. Previously the whole panel scrolled and the navigation vanished. */
.learn-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(0, 0, 0, 0.45));
  padding: 1.5rem 1.6rem 1.3rem;
}

.learn-panel .learn-header {
  flex: 0 0 auto;
  padding-right: 1.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.learn-panel .learn-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.4rem;
}

/* Footer block: the tutorial replay and the step navigation stay put. */
.learn-panel .learn-replay,
.learn-panel .navigation {
  flex: 0 0 auto;
}
.learn-panel .learn-replay {
  padding-top: 0.9rem;
  margin-top: 0;
  border-top: 1px solid var(--border);
}
.learn-panel .navigation {
  padding-top: 0.9rem;
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.learn-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  z-index: 2;
}

body.modal-open {
  overflow: hidden;
}

/* Return zone: the instruction now lives in a tooltip, so this is a slim target. */
.return-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.3rem 0.6rem;
}

.return-drop-zone .drop-zone-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Tooltips globally off */
html.tooltips-off .rttr-tooltip {
  display: none !important;
}

/* ===== Site Footer ===== */
.site-footer {
  margin-top: auto;
  padding: 1rem 1rem 0.5rem 1rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
/* ===== Inline explanations =====
 * Tooltips are off by default, so the guidance for CV stats and skills is always
 * visible text. These sit under their value rather than in a hover layer.
 */

/* --- CV rows: a compact line with an info toggle for the detail --- */
.cv-row {
  display: grid;
  /* label, value, info button. The note spans all three on a row of its own below. */
  grid-template-columns: 1fr auto auto;
  justify-items: start;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 45%);
}
.cv-row:last-child { border-bottom: none; }
.cv-row strong { text-align: right; font-variant-numeric: tabular-nums; }
/* Shared info toggle, used by the CV rows and the Skills accordion. One style so the
   two never drift; .cv-info and .skill-toggle remain as the JS hooks. */
.info-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.2rem;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 0.6;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.info-btn:hover { color: var(--accent); opacity: 1; }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.info-btn.is-open,
.info-btn[aria-expanded="true"] {
  color: var(--accent);
  opacity: 1;
  background: color-mix(in srgb, var(--accent), transparent 88%);
}
.cv-note {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0.4rem;
  font-size: 0.62rem;
  line-height: 1.45;
  color: var(--ink-soft);
  padding-left: 0.5rem;
  border-left: 2px solid color-mix(in srgb, var(--accent), transparent 55%);
}
.cv-note[hidden] { display: none; }

/* --- Skill rows --- */
.skills-list { gap: 0.5rem; }
.skill-item {
  display: block;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.skill-item.needed { border-color: color-mix(in srgb, var(--border), var(--ink) 25%); }
.skill-item.owned { border-color: color-mix(in srgb, var(--good), transparent 45%); }
.skill-item.required { border-color: var(--accent); border-width: 2px; }
.skill-line {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.skill-name { display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.skill-detail {
  margin: 0.3rem 0 0.1rem;
  font-size: 0.62rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.skill-detail.is-collected { color: color-mix(in srgb, var(--good), var(--ink) 30%); }
.skill-detail.is-impossible { color: var(--bad); }
.skill-detail-head {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.skill-routes {
  margin: 0;
  padding-left: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.62rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.skill-routes b { color: var(--ink); }
.skill-hint { color: color-mix(in srgb, var(--ink-soft), transparent 15%); }
.skill-fit {
  display: inline-block;
  padding: 0 0.2rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.skill-detail-more { margin: 0.25rem 0 0; font-size: 0.6rem; color: var(--ink-soft); }

/* --- Skills accordion ---
 * One skill's route breakdown open at a time. The detail is hidden by default,
 * so the tab is a short scannable list until the player asks for detail. */
.skills-list .skill-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.skills-list .skill-line .skill-name { flex: 1; min-width: 0; }
.skill-detail-wrap { margin-top: 0.35rem; }
.skill-detail-wrap[hidden] { display: none; }
.skills-list .skill-item.is-open { border-color: var(--accent); }
.skills-list .skill-item.is-open .skill-detail-wrap {
  border-left: 2px solid color-mix(in srgb, var(--accent), transparent 55%);
  padding-left: 0.5rem;
}
