:root {
  --purple: #8e4daf;
  --purple-dark: #572263;
  --pink: #d93f91;
  --pink-dark: #a62668;
  --orange: #ffa53d;
  --yellow: #ffd23d;
  --green: #22c58b;
  --green-dark: #159467;
  --blue: #3dc8ff;
  --blue-dark: #1fa8de;
  --red: #ff5c5c;
  --red-dark: #d1453b;

  --bg-top: #fff3fa;
  --bg-bottom: #f1e7f8;
  --card-bg: #fffafd;
  --text: #3f2948;
  --muted: #78637f;
  --border: #e7cfe5;
  --surface-soft: #fae9f4;
  --surface-strong: #edd4ea;
  --surface-input: #fffafd;
  --shadow: rgba(87, 34, 99, 0.12);

  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --font-heading: "Baloo 2", "Segoe UI", Verdana, sans-serif;
  --font-body: "Nunito", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 10px;
  background: white;
  color: var(--purple-dark);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  background-image: radial-gradient(circle at 12% 16%, rgba(217,63,145,.10) 0 3px, transparent 4px), radial-gradient(circle at 88% 32%, rgba(142,77,175,.10) 0 4px, transparent 5px), linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  background-size: 54px 54px, 74px 74px, auto;
}

.icon { width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: -.2em; transition: transform .18s ease; }
.icon-invert { filter: brightness(0) invert(1); }
.heading-icon { color: var(--pink-dark); font-size: .9em; }

/* Interactive icon pop: any icon inside a clickable control bounces on hover/tap. */
.nav-pill:hover .icon, .button:not(:disabled):hover .icon, .theme-toggle:hover .icon,
a:hover > .icon, button:not(:disabled):hover > .icon { transform: scale(1.18) rotate(-6deg); }
.nav-pill:active .icon, .button:not(:disabled):active .icon, .theme-toggle:active .icon,
a:active > .icon, button:not(:disabled):active > .icon { transform: scale(0.86) rotate(0deg); transition-duration: .08s; }

h1, h2, .brand, .login-title {
  font-family: var(--font-heading);
}

.site-header {
  background: linear-gradient(120deg, #54205f 0%, #8b2979 55%, #c83887 100%);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 5px 20px rgba(87, 34, 99, 0.28);
  position: relative;
  z-index: 1;
}

.brand {
  color: white;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-brand { width: 34px; height: 34px; stroke-width: 2.2; filter: brightness(0) invert(1); opacity: .92; }
.icon-brand-friend { width: 29px; height: 29px; opacity: .75; stroke-width: 2.2; filter: brightness(0) invert(1); }

.header-nav {
  display: flex;
  gap: 10px;
}

.nav-pill {
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.theme-toggle { border: 1px solid rgba(255,255,255,.32); font-family: var(--font-body); cursor: pointer; }
.theme-toggle-icon { font-size: 17px; line-height: 1; }

.nav-pill:hover { background: rgba(255, 255, 255, 0.32); transform: translateY(-1px); }
.nav-pill-active { background: rgba(255, 255, 255, 0.4); }
.reward-pill { cursor: default; }
.reward-divider { opacity: 0.6; }

.next-up-card {
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
  box-shadow: 0 10px 28px rgba(87, 34, 99, 0.24);
}
.next-up-eyebrow { font-family: var(--font-heading); font-weight: 800; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85; }
.next-up-body { display: flex; align-items: center; gap: 16px; margin: 10px 0 18px; }
.next-up-icon { font-size: 46px; line-height: 1; }
.next-up-text h2 { margin: 0 0 6px; color: white; font-size: 25px; }
.next-up-text p { margin: 0; opacity: 0.92; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.next-up-button { background: white; color: #572263; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); margin: 0; }
.next-up-button:hover { transform: translateY(-2px); filter: none; }

.reward-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 20px; }
.reward-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); font-size: 15px; }
.reward-chip strong { color: var(--purple-dark); font-family: var(--font-heading); font-size: 17px; }
.reward-chip-icon { width: 20px; height: 20px; object-fit: contain; }

.disclosure-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 16px;
  margin: 6px 0;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 2px solid var(--border);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--purple-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.disclosure-summary::-webkit-details-marker,
.disclosure-summary::marker { display: none; content: ""; }
.disclosure-summary:hover { background: var(--surface-strong); border-color: var(--purple); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(87, 34, 99, 0.12); }
.disclosure-summary:active { transform: translateY(0); }
.disclosure-icon { font-size: 19px; line-height: 1; }
.disclosure-label { flex-grow: 1; }
.disclosure-count { background: var(--purple); color: white; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-pill); }
.disclosure-chevron { font-size: 12px; color: var(--muted); transition: transform 0.2s ease; }
details[open] > .disclosure-summary .disclosure-chevron { transform: rotate(90deg); }
details[open] > .disclosure-summary { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

.badge-details { flex-basis: 100%; }
.badge-shelf { display: flex; gap: 9px; overflow-x: auto; padding: 10px 1px 5px; }
.achievement-badge { min-width: 84px; text-align: center; padding: 9px 7px; border-radius: 14px; background: white; border: 2px solid #dfa8d2; }
.achievement-badge span { display: block; font-size: 27px; }
.achievement-badge small { display: block; font-weight: 800; line-height: 1.15; margin-top: 3px; }
.achievement-badge-locked { filter: grayscale(1); opacity: 0.55; border-color: var(--border); }
.reward-nudge { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

.up-next-details { margin: 20px 0; }
.mini-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 2px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mini-row:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(45, 38, 64, 0.1); }
.mini-row-icon { font-size: 22px; }
.mini-row-text { flex-grow: 1; font-weight: 700; }
.mini-row-text small { display: block; font-weight: 600; color: var(--muted); }
.lesson-reward-hint, .quiz-reward-label { color: var(--purple-dark); background: #f8d9eb; border: 1px solid #e4afd1; border-radius: var(--radius-pill); padding: 5px 10px; font-weight: 800; font-size: 13px; }
.lesson-reward-hint { display: inline-block; margin-bottom: 6px; }
.quiz-reward-label { float: right; }
.stars-earned { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin: 16px 0; border-radius: var(--radius); background: linear-gradient(135deg, #f9d7eb, #f3e2f8); border: 2px solid #d993c2; animation: pop-in 0.35s ease; }
.stars-earned > span { font-size: 42px; }
.stars-earned strong { display: block; font-family: var(--font-heading); color: var(--pink-dark); font-size: 25px; }
.stars-earned small { display: block; color: var(--muted); font-weight: 700; }

.header-subnav {
  background: var(--purple-dark);
  padding: 10px 24px;
  justify-content: flex-end;
}

.gate-card { text-align: center; }

.gate-mascot {
  font-size: 44px;
  animation: gate-bob 2s ease-in-out infinite;
}

@keyframes gate-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.gate-shake { animation: gate-shake 0.6s; }

@keyframes gate-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* Connect-the-dots puzzle */
.dot-board {
  position: relative;
  height: 300px;
  margin: 20px 0;
  background: linear-gradient(180deg, #faf7ff, #eef6ff);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.dot-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dot-line { stroke: var(--purple); stroke-width: 3; stroke-linecap: round; }

.dot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 96px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.dot-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--purple-dark);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dot:hover .dot-circle { transform: scale(1.08); }

.dot.dot-done .dot-circle {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-color: var(--green-dark);
  color: white;
}

.dot-label {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 2px 4px;
}

.unlock-btn {
  width: 100%;
  text-align: center;
}

.unlock-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 72px;
  transition: max-width 0.2s ease;
}

@media (min-width: 820px) {
  .container { max-width: 820px; }
}

h1 { font-size: 32px; margin-bottom: 4px; color: var(--purple-dark); }
h2 { font-size: 22px; line-height: 1.35; }
.subtitle { color: var(--muted); font-size: 17px; margin-top: 0; }
.note { color: var(--muted); font-size: 14px; margin-top: 12px; }

.card p { font-size: 17px; line-height: 1.5; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  margin: 16px 0;
  box-shadow: 0 7px 22px rgba(87, 34, 99, 0.10);
  border: 2px solid rgba(231,207,229,.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-correct { border-color: var(--green); }
.card-incorrect { border-color: var(--red); }

.button {
  display: inline-block;
  padding: 15px 26px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin: 6px 8px 6px 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
  min-height: 44px;
}

.button-primary {
  background: linear-gradient(135deg, #6f287f, var(--pink));
  color: white;
  box-shadow: 0 5px 0 var(--purple-dark);
}

.button-primary:hover { filter: brightness(1.06); }
.button-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--purple-dark); }

.button-secondary {
  background: white;
  color: var(--purple-dark);
  border: 2px solid var(--purple);
  box-shadow: 0 4px 0 var(--border);
}

.button-secondary:hover { background: #f4f0ff; }
.button-secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border); }

.button-small {
  padding: 8px 14px;
  font-size: 13px;
  min-height: 32px;
  box-shadow: 0 3px 0 var(--border);
}

.button-small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.choice-button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: white;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
  width: 100%;
}

.choice-button:hover { border-color: var(--purple); background: var(--surface-soft); transform: translateY(-2px); }
.choice-button:active { transform: translateY(0); }

.radio-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-choice:hover { border-color: var(--purple); background: var(--surface-soft); }
.radio-choice input { transform: scale(1.3); accent-color: var(--purple); }

.choice-letter {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-heading);
  font-size: 16px;
}

.choice-letter-a { background: var(--blue); }
.choice-letter-b { background: var(--green); }
.choice-letter-c { background: var(--orange); }
.choice-letter-d { background: var(--pink); }

.quiz-progress { font-family: var(--font-heading); color: var(--purple-dark); font-weight: 700; font-size: 15px; margin: 0 0 6px; }

.radio-choice.choice-correct { border-color: var(--green); background: rgba(34, 197, 139, 0.12); }
.radio-choice.choice-incorrect { border-color: var(--red); background: rgba(255, 92, 92, 0.12); }

.choice-list-locked .radio-choice { cursor: default; pointer-events: none; }

.quiz-feedback { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.quiz-feedback p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.quiz-feedback-correct { color: var(--green-dark); }
.quiz-feedback-incorrect { color: var(--red-dark); }

.quiz-nav { display: flex; }

.passage-box {
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.visual-stimulus {
  text-align: center;
  font-size: 56px;
  line-height: 1.3;
  letter-spacing: 4px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 14px;
}

.tts-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.tts-button {
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid var(--blue-dark);
  background: #e6f8ff;
  color: var(--blue-dark);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 44px;
}
.tts-button::before { content: ""; display: inline-block; width: 20px; height: 20px; margin-right: 7px; vertical-align: -4px; background: currentColor; -webkit-mask: url('/static/icons/speaker.svg') center / contain no-repeat; mask: url('/static/icons/speaker.svg') center / contain no-repeat; }

.tts-button:hover:not(:disabled) { background: var(--blue); color: white; transform: translateY(-1px); }
.tts-button:disabled { opacity: 0.7; cursor: default; }

.tts-word-active {
  background: var(--yellow);
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--yellow);
}

.choice-button.tts-segment-active,
.radio-choice.tts-segment-active,
.unsure-button.tts-segment-active {
  border-color: var(--orange);
  background: #fff3dc;
  box-shadow: 0 0 0 3px rgba(255, 165, 61, 0.35);
}

.tts-error {
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 700;
}

.progress-wrap { margin-bottom: 18px; }

.progress-label {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 15px;
}

.progress-bar {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width 0.3s ease;
}

.flash-list { margin-bottom: 16px; }

.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-weight: 700;
  animation: pop-in 0.2s ease;
}

.flash-success { background: #eadcf4; color: #54205f; border-left: 5px solid var(--purple); }
.flash-error { background: #f9dce9; color: #842052; border-left: 5px solid var(--pink-dark); }
.flash-info { background: #f1e2f6; color: var(--purple-dark); border-left: 5px solid var(--purple); }

.unsure-button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  background: #faf9fd;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.unsure-button:hover { border-color: var(--purple); color: var(--purple-dark); background: #f7f4ff; }

@keyframes pop-in {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.plan-list,
.subject-overview-list { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }

@media (min-width: 760px) {
  .plan-list,
  .subject-overview-list,
  .planner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    align-items: start;
  }
}

.plan-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(45, 38, 64, 0.08);
  border-left: 8px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plan-item:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(45, 38, 64, 0.13); }

/* Fluid entrance animation for cards and plan items -- staggered per position so lists
   feel like they settle into place rather than popping in all at once. */
.card,
.plan-item {
  animation: rise-in 0.35s ease both;
}

.plan-list > *:nth-child(1),
.subject-overview-list > *:nth-child(1) { animation-delay: 0.02s; }
.plan-list > *:nth-child(2),
.subject-overview-list > *:nth-child(2) { animation-delay: 0.07s; }
.plan-list > *:nth-child(3),
.subject-overview-list > *:nth-child(3) { animation-delay: 0.12s; }
.plan-list > *:nth-child(4),
.subject-overview-list > *:nth-child(4) { animation-delay: 0.17s; }
.plan-list > *:nth-child(5),
.subject-overview-list > *:nth-child(5) { animation-delay: 0.22s; }
.plan-list > *:nth-child(n+6),
.subject-overview-list > *:nth-child(n+6) { animation-delay: 0.26s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 620px) {
  .site-header { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .brand { align-self: flex-start; min-height: 44px; }
  .header-nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .header-nav .nav-pill { flex: 1 1 auto; justify-content: center; padding-inline: 10px; }
  .header-subnav { padding: 10px 16px; }
  .container { padding: 20px 12px 56px; }
  h1 { font-size: 28px; line-height: 1.2; }
  .card, .plan-item, .next-up-card { padding: 18px 16px; }
  .next-up-icon { font-size: 36px; }
  .next-up-text h2 { font-size: 21px; }
  .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile-card-form, .profile-card { width: 100%; }
  .profile-manage-row-item { align-items: flex-start; flex-wrap: wrap; }
  .profile-manage-row-item .profile-name { min-width: 45%; }
  .profile-switch-pill { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quiz-reward-label { float: none; display: inline-block; margin-top: 6px; }
}

.planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.planner-actions form { margin: 0; }

.ai-generate-button.is-loading {
  opacity: 0.75;
  cursor: wait;
}

.answer-key-correct {
  border-color: var(--green);
  background: #f0fbf6;
}

.answer-key-text { flex-grow: 1; }

.plan-item-needs_practice { border-left-color: var(--red); }
.plan-item-reinforce { border-left-color: var(--orange); }
.plan-item-challenge { border-left-color: var(--green); }

.plan-item-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-item-header h2 { margin: 0; flex-grow: 1; }

.badge {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.badge-needs { background: #ffecec; color: var(--red-dark); }
.badge-reinforce { background: #fff3dc; color: #92620a; }
.badge-challenge { background: #e3fbf1; color: var(--green-dark); }
.badge-done { background: #ece6ff; color: var(--purple-dark); }
.badge-progress { background: #eef1f7; color: var(--muted); }

.section-title { margin-top: 28px; }

/* Parent dashboard */
.subject-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.subject-overview-head h2 { margin: 0; }

.stat-tile { text-align: right; }
.stat-tile-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-tile-value { display: block; font-family: var(--font-heading); font-size: 22px; color: var(--purple-dark); }

.needs-practice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.trend-chart { margin: 22px 0 6px; }

.trend-bars {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 32px;
}

.trend-track {
  position: relative;
  width: 20px;
  height: 70px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.trend-value-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--purple-dark);
  font-weight: 700;
  white-space: nowrap;
}

.trend-bar {
  width: 20px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--purple), var(--pink));
}

.trend-axis-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.topic-trend-list { margin: 18px 0 4px; }

.topic-trend-heading {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.topic-trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.topic-trend-label {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.mini-trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  flex-shrink: 0;
}

.mini-trend-bar {
  width: 6px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--purple), var(--pink));
}

.field-label {
  display: block;
  font-weight: 700;
  margin: 16px 0 6px;
  font-family: var(--font-heading);
}

input[type="password"],
input[type="text"],
select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface-input);
  color: var(--text);
}

input[type="password"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--purple);
}

.option-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.settings-actions { margin-top: 20px; }

/* Login page */
.login-body {
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.18) 0 4px, transparent 5px), linear-gradient(135deg, #54205f 0%, #9b2d7f 55%, #db569b 100%);
  background-size: 64px 64px, auto;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrap { width: 100%; padding: 24px; }

.login-card {
  max-width: 380px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-mascot { display: flex; justify-content: center; align-items: end; gap: 7px; margin-bottom: 10px; color: var(--purple-dark); }
.mascot-icon { width: 58px; height: 58px; object-fit: contain; }
.mascot-book { width: 38px; height: 38px; }
.login-title { font-size: 32px; color: var(--purple-dark); margin: 0 0 4px; }
.login-subtitle { color: var(--muted); margin-top: 0; margin-bottom: 20px; }
.login-card form { text-align: left; }
.login-button { width: 100%; text-align: center; margin-top: 20px; }

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  z-index: 9999;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0.85; }
}

/* First-question tutorial (lightbox control walkthrough) */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
}

.tutorial-backdrop {
  position: fixed;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(40, 10, 54, 0.72);
  pointer-events: none;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.tutorial-tooltip {
  position: fixed;
  max-width: 320px;
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--radius);
  border: 2px solid var(--purple);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 18px 20px;
  transition: top 0.25s ease, left 0.25s ease;
}

.tutorial-tooltip-centered {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
}

.tutorial-step-count {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tutorial-tooltip-title {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--purple-dark);
}

.tutorial-tooltip-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.tutorial-tooltip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tutorial-tooltip-actions .button {
  margin: 0;
  padding: 10px 18px;
  font-size: 15px;
  min-height: auto;
}

/* Profiles */
.profile-switch-pill { display: flex; align-items: center; }

.profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}

.profile-card-form { margin: 0; }

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 140px;
  padding: 22px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(45, 38, 64, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.profile-card:hover { transform: translateY(-3px); border-color: var(--purple); }
.profile-card-active { border-color: var(--purple); background: #f4f0ff; }

.profile-avatar { font-size: 40px; line-height: 1; }
.profile-name { font-family: var(--font-heading); font-weight: 700; font-size: 17px; }

/* Parent dashboard: per-profile at-a-glance summary cards + drill-down modal */
.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.profile-summary-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: left;
  font-family: var(--font-body);
  background: var(--card-bg);
  border: 2px solid rgba(231,207,229,.7);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  box-shadow: 0 7px 22px rgba(87, 34, 99, 0.10);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.profile-summary-card:hover,
.profile-summary-card:focus-visible { transform: translateY(-3px); border-color: var(--purple); }
.profile-summary-card-active { border-color: var(--purple); background: #f4f0ff; }

.profile-summary-head { display: flex; align-items: center; gap: 10px; }
.profile-summary-head .profile-avatar { font-size: 32px; }
.profile-summary-head .profile-name { font-family: var(--font-heading); font-weight: 700; font-size: 18px; flex: 1; }

.profile-summary-stat { display: flex; align-items: baseline; gap: 6px; }
.profile-summary-stat .stat-tile-value { font-family: var(--font-heading); font-size: 20px; color: var(--purple-dark); }
.profile-summary-stat .stat-tile-label { color: var(--muted); font-size: 13px; font-weight: 700; }

.profile-summary-cta { color: var(--purple-dark); font-weight: 700; font-size: 14px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(30, 12, 36, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--bg-bottom, #fff);
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(20, 8, 26, 0.35);
  animation: pop-in 0.2s ease;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.modal-head h2 { margin: 0; }

.modal-close {
  border: none;
  background: var(--surface-soft, #f4f0ff);
  color: var(--purple-dark);
  border-radius: var(--radius-pill);
  width: 40px;
  height: 40px;
  min-height: 40px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close:hover { filter: brightness(0.96); }

.modal-body .card:first-child { margin-top: 0; }

body.modal-open { overflow: hidden; }

.profile-manage-row { margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.profile-manage-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.profile-manage-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-manage-row-item .profile-avatar { font-size: 26px; }
.profile-manage-row-item .profile-name { flex: 1; }
.profile-manage-row-item form { margin: 0; }

/* Course-overview hero banner: one illustrative image per learning path. */
.path-hero-img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 20px;
  border: 3px solid var(--border);
  margin: 4px 0 10px;
  box-shadow: 0 6px 16px var(--shadow);
}

/* Reading path: the ordered stage map on the kid dashboard. */
.reading-path { display: flex; flex-direction: column; gap: 0; margin: 18px 0 26px; }
.path-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--card-bg);
  border: 3px solid var(--border);
  box-shadow: 0 6px 16px var(--shadow);
}
.path-stage-icon { font-size: 34px; line-height: 1; flex-shrink: 0; width: 48px; text-align: center; }
.path-stage-thumb { flex-shrink: 0; width: 56px; height: 56px; object-fit: cover; border-radius: 14px; border: 2px solid var(--border); }
.path-stage-body { flex-grow: 1; }
.path-stage-body h3 { margin: 0 0 4px; font-family: var(--font-heading); font-size: 20px; }
.path-stage-body p { margin: 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.path-stage-current { border-color: var(--purple); box-shadow: 0 8px 20px rgba(142, 77, 175, 0.25); }
.path-stage-completed { background: var(--surface-soft); }
.path-stage-locked { opacity: 0.6; }
.path-connector { width: 4px; height: 20px; margin: 0 0 0 43px; background: var(--border); border-radius: 2px; }

/* Lesson page hero: the same stage illustration, shown larger above the practice questions. */
.lesson-hero-img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 20px;
  border: 3px solid var(--border);
  margin: 4px 0 14px;
  box-shadow: 0 6px 16px var(--shadow);
}

@media (max-width: 620px) {
  .path-stage { padding: 14px; gap: 10px; }
  .path-stage-icon { font-size: 26px; width: 36px; }
  .path-stage-thumb { width: 44px; height: 44px; border-radius: 11px; }
  .path-stage-body h3 { font-size: 17px; }
  .path-connector { margin-left: 31px; }
  .path-hero-img, .lesson-hero-img { max-height: 120px; }
}
/* Mini-games hub: unlockable game cards, similar in weight to a path-stage row. */
.game-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  margin: 16px 0;
  border-radius: 22px;
  background: var(--card-bg);
  border: 3px solid var(--border);
  box-shadow: 0 6px 16px var(--shadow);
}
.game-card-icon { font-size: 40px; line-height: 1; flex-shrink: 0; width: 52px; text-align: center; }
.game-card-body { flex-grow: 1; }
.game-card-body h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-card-locked { opacity: 0.75; }
.game-card-coming-soon { opacity: 0.55; }
.game-progress-track {
  width: 100%;
  max-width: 320px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 2px solid var(--border);
  overflow: hidden;
  margin: 10px 0 4px;
}
.game-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Penguin Parachute Drop: arcade math game. Penguins parachute toward a central ice
   floe; tap the one with the right number before it lands or the floe cracks. */
.ice-float-game { margin: 16px 0; }
.ice-float-hud {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 4px;
}
.ice-float-progress { margin: 0 0 6px; font-weight: 800; color: var(--muted); font-size: 14px; }
.ice-float-prompt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ice-float-prompt { font-family: var(--font-heading); font-size: 24px; color: var(--purple-dark); }
.ice-float-bar-row { display: flex; align-items: center; gap: 8px; }
.ice-float-bar-label { font-size: 20px; }
.ice-float-health-track {
  flex-grow: 1;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 2px solid var(--border);
  overflow: hidden;
}
.ice-float-health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue-dark), var(--green));
  border-radius: var(--radius-pill);
  transition: width 0.5s ease, background 0.3s ease;
}
.ice-float-health-fill.ice-float-health-low { background: linear-gradient(90deg, var(--red-dark), var(--red)); }
.ice-float-timer-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  margin-top: 10px;
  overflow: hidden;
}
.ice-float-timer-fill { height: 100%; width: 100%; background: var(--orange); }

.ice-float-stage {
  position: relative;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #cdeeff 0%, #8fd3f4 55%, #4fb3e8 100%);
  border: 3px solid var(--border);
  box-shadow: 0 8px 20px var(--shadow);
}
html[data-theme="dark"] .ice-float-stage { background: linear-gradient(180deg, #274a63 0%, #1c3a54 55%, #14283c 100%); }

.ice-float-water {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22%;
  background: rgba(23, 108, 158, 0.55);
  transition: height 0.5s ease;
}

.ice-float-raft {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 150px;
  height: 84px;
  background: linear-gradient(180deg, #ffffff, #dceefc);
  border-radius: 45% 45% 40% 40% / 60% 60% 40% 40%;
  border: 3px solid #bfe1f6;
  box-shadow: 0 6px 14px rgba(20, 60, 90, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, 0);
  transition: transform 0.5s ease;
  z-index: 2;
  overflow: hidden;
}
.ice-float-penguin { font-size: 34px; transform: translateY(-6px); }
.ice-float-raft-cracks {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  background:
    linear-gradient(105deg, transparent 47%, rgba(90, 110, 130, 0.55) 48.5%, transparent 50%),
    linear-gradient(15deg, transparent 44%, rgba(90, 110, 130, 0.5) 45.5%, transparent 47%),
    linear-gradient(200deg, transparent 60%, rgba(90, 110, 130, 0.5) 61.5%, transparent 63%);
}

.ice-float-target {
  position: absolute;
  transform: translate(-50%, -8px);
  width: 64px;
  height: 78px;
  padding: 0;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  z-index: 1;
  animation-name: chute-sway;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.ice-float-chute { font-size: 30px; line-height: 1; }
.ice-float-target-penguin { font-size: 26px; line-height: 1; margin-top: -4px; }
.ice-float-target-num {
  margin-top: 2px;
  min-width: 30px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #ffffff, #d7ecfb);
  border: 2px solid #a9d8f2;
  box-shadow: 0 3px 8px rgba(20, 60, 90, 0.25);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  color: var(--purple-dark);
  text-align: center;
}
.ice-float-target:hover .ice-float-target-num { filter: brightness(1.06); }
.ice-float-target:disabled { cursor: default; }
.ice-float-target-correct .ice-float-target-num { border-color: var(--green); background: linear-gradient(180deg, #eafff5, #cdf6e3); }
.ice-float-target-wrong .ice-float-target-num { border-color: var(--red); background: linear-gradient(180deg, #ffecec, #ffd2d2); }

@keyframes chute-sway {
  0% { transform: translate(calc(-50% - 6px), -8px) rotate(-4deg); }
  100% { transform: translate(calc(-50% + 6px), -8px) rotate(4deg); }
}

.ice-float-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 40, 60, 0.55);
  z-index: 3;
}
.ice-float-overlay-text {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 20px 28px;
  margin: 0;
}

@media (max-width: 620px) {
  .ice-float-stage { height: 320px; }
  .ice-float-target { width: 50px; height: 64px; }
  .ice-float-chute { font-size: 24px; }
  .ice-float-target-penguin { font-size: 20px; }
  .ice-float-target-num { font-size: 15px; }
  .ice-float-raft { width: 120px; height: 70px; }
  .ice-float-prompt { font-size: 20px; }
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.avatar-option {
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 24px;
  line-height: 1;
}

.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option:has(input:checked) { border-color: var(--purple); background: #f4f0ff; }

/* Royal night mode: deep plum surfaces retain the pink-purple identity throughout. */
html[data-theme="dark"] {
  color-scheme: dark;
  --purple: #bf78e2;
  --purple-dark: #e1b3f5;
  --pink: #f052a5;
  --pink-dark: #ff91c9;
  --bg-top: #170d1d;
  --bg-bottom: #2b1030;
  --card-bg: #2d1735;
  --text: #fff0fb;
  --muted: #d2b7d7;
  --border: #67406f;
  --surface-soft: #3a1c42;
  --surface-strong: #4b2554;
  --surface-input: #211228;
  --shadow: rgba(7, 2, 10, .42);
}

html[data-theme="dark"] body {
  background-image: radial-gradient(circle at 12% 16%, rgba(240,82,165,.18) 0 3px, transparent 4px), radial-gradient(circle at 88% 32%, rgba(191,120,226,.18) 0 4px, transparent 5px), linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
html[data-theme="dark"] .site-header { background: linear-gradient(120deg, #24102d, #5b1b62 52%, #a42371); box-shadow: 0 6px 24px rgba(5,0,8,.55); }
html[data-theme="dark"] .header-subnav { background: #1c0d23; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .plan-item,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .profile-summary-card { box-shadow: 0 8px 24px var(--shadow); border-color: var(--border); }
html[data-theme="dark"] .profile-summary-card-active { background: var(--surface-strong); }
html[data-theme="dark"] .modal-close { background: var(--surface-strong); color: var(--text); }
html[data-theme="dark"] .reward-dashboard { background: linear-gradient(135deg, #3e1c44, #2b1533 48%, #4b2046); border-color: #8f4c87; }
html[data-theme="dark"] .achievement-badge,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .choice-button,
html[data-theme="dark"] .radio-choice { background: #32183a; color: var(--text); }
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .choice-button:hover,
html[data-theme="dark"] .radio-choice:hover,
html[data-theme="dark"] .unsure-button:hover { background: #47204b; }
html[data-theme="dark"] .lesson-reward-hint,
html[data-theme="dark"] .quiz-reward-label { background: #4d2043; color: #ffb4da; border-color: #853867; }
html[data-theme="dark"] .quiz-feedback { background: var(--surface-soft); }
html[data-theme="dark"] .quiz-feedback-correct { color: #6be3b4; }
html[data-theme="dark"] .quiz-feedback-incorrect { color: #ff9a9a; }
html[data-theme="dark"] .radio-choice.choice-correct { background: rgba(34, 197, 139, 0.18); }
html[data-theme="dark"] .radio-choice.choice-incorrect { background: rgba(255, 92, 92, 0.18); }
html[data-theme="dark"] .stars-earned { background: linear-gradient(135deg, #4d2043, #382047); border-color: #9e4c82; }
html[data-theme="dark"] .flash-success { background: #352044; color: #e1b3f5; }
html[data-theme="dark"] .flash-error { background: #4a1935; color: #ffadd5; }
html[data-theme="dark"] .flash-info { background: #342044; color: #e1b3f5; }
html[data-theme="dark"] .badge-needs { background: #4d1d3b; color: #ffacd2; }
html[data-theme="dark"] .badge-reinforce { background: #44204d; color: #e7baf6; }
html[data-theme="dark"] .badge-challenge { background: #35224d; color: #d8b6ff; }
html[data-theme="dark"] .badge-done { background: #482052; color: #f2c8ff; }
html[data-theme="dark"] .badge-progress { background: #35203d; color: var(--muted); }
html[data-theme="dark"] .dot-board { background: linear-gradient(180deg, #27132e, #34183c); }
html[data-theme="dark"] .dot-circle,
html[data-theme="dark"] .dot-label { background: #25122c; color: var(--text); }
html[data-theme="dark"] .icon:not(.icon-invert),
html[data-theme="dark"] .reward-score-icon { filter: brightness(0) saturate(100%) invert(73%) sepia(20%) saturate(1494%) hue-rotate(235deg) brightness(98%); }
