/* ============================================================
   SUMMER BRAIN CAMP — Stylesheet
   Aesthetic: Bright, energetic, rewarding — like a great game
   Fonts: Fredoka One (headings), Nunito (body)
   ============================================================ */

:root {
  --purple:  #6C63FF;
  --green:   #00C896;
  --red:     #FF6B6B;
  --orange:  #FFB347;
  --blue:    #4FACFE;
  --yellow:  #FFE066;
  --dark:    #1A1A2E;
  --dark2:   #16213E;
  --surface: #0F3460;
  --card:    rgba(255,255,255,0.07);
  --card-border: rgba(255,255,255,0.12);
  --text:    #F0F4FF;
  --muted:   rgba(240,244,255,0.6);
  --radius:  16px;
  --radius-sm: 10px;
  --shadow:  0 8px 32px rgba(0,0,0,0.35);
  --subject-color: var(--purple);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Stars background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,200,150,0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 80%, rgba(255,107,107,0.1) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
  font-family: 'Fredoka One', cursive;
  line-height: 1.2;
}
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 800;
  padding: 14px 32px;
  border-radius: 50px;
  border: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(108,99,255,0.45);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.55); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1.5px solid var(--card-border);
  color: var(--text);
  font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 700;
  padding: 12px 28px; border-radius: 50px;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-ghost {
  background: transparent; border: 1.5px solid var(--card-border);
  color: var(--muted); font-family: 'Nunito', sans-serif;
  font-size: .9rem; font-weight: 700;
  padding: 8px 18px; border-radius: 50px;
  text-decoration: none; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.4); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }

.btn-submit {
  display: inline-flex; align-items: center;
  background: var(--green);
  color: var(--dark); font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 800;
  padding: 12px 28px; border-radius: 50px; border: none;
  cursor: pointer; transition: transform .15s, opacity .15s;
  box-shadow: 0 4px 16px rgba(0,200,150,0.4);
}
.btn-submit:hover   { transform: translateY(-2px); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-nudge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,224,102,0.15); border: 1.5px solid var(--yellow);
  color: var(--yellow); font-family: 'Nunito', sans-serif;
  font-size: .95rem; font-weight: 700;
  padding: 10px 22px; border-radius: 50px; cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.btn-nudge:hover    { background: rgba(255,224,102,0.25); }
.btn-nudge:disabled { opacity: .4; cursor: not-allowed; }

/* ===== INPUTS ===== */
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid var(--card-border);
  color: var(--text);
  font-family: 'Nunito', sans-serif; font-size: 1rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  background: rgba(108,99,255,0.12);
}
input::placeholder, textarea::placeholder { color: rgba(240,244,255,0.35); }
select option { background: var(--dark2); color: var(--text); }

.q-textarea {
  min-height: 140px; resize: vertical;
  line-height: 1.7; font-size: 1.05rem;
}
.q-short-input { font-size: 1.1rem; }

/* ===== CARD / SURFACE ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ===== MODALS ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(6px);
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--dark2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-wide { max-width: 520px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-box h2 { margin-bottom: 20px; }
.modal-avatar { font-size: 3.5rem; text-align: center; margin-bottom: 8px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .9rem; color: var(--muted); }

/* Avatar picker */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.av-option { cursor: pointer; }
.av-option input[type="radio"] { display: none; }
.av-option span {
  display: block; font-size: 2rem; padding: 8px;
  border: 2px solid transparent; border-radius: 12px;
  transition: border-color .15s, transform .1s;
}
.av-option input:checked + span { border-color: var(--purple); transform: scale(1.15); }
.av-option:hover span { transform: scale(1.1); }

/* Pin input */
.pin-inputs { margin: 16px 0; }
.pin-input {
  font-size: 2rem; text-align: center; letter-spacing: .4rem;
  padding: 16px;
}

/* ===== LOGIN PAGE ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap {
  width: 100%; max-width: 860px; margin: 24px;
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; align-items: start;
}
@media (max-width: 680px) {
  .login-wrap { grid-template-columns: 1fr; }
}
.login-hero { padding: 20px 0; }
.hero-title { margin-bottom: 24px; }
.hero-title .sun-icon { font-size: 3.5rem; display: block; margin-bottom: 8px; }
.hero-title h1 { color: var(--yellow); }
.hero-title p  { color: var(--muted); font-size: 1.1rem; font-weight: 600; }
.subject-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  padding: 8px 18px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid var(--c, var(--purple));
  color: var(--c, var(--purple));
  border-radius: 50px; font-weight: 700; font-size: .9rem;
}
.login-panel { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 32px; }
.login-panel h2 { margin-bottom: 20px; }

.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.child-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center; cursor: pointer;
  transition: background .15s, transform .15s, border-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.child-card:hover { background: rgba(108,99,255,0.12); border-color: var(--purple); transform: translateY(-2px); }
.child-avatar { font-size: 2.8rem; line-height: 1; }
.av-add { font-size: 1.8rem; opacity: .5; }
.child-name { font-weight: 800; font-size: .95rem; }
.child-grade { font-size: .8rem; color: var(--muted); }
.child-xp { font-size: .8rem; color: var(--yellow); font-weight: 700; }

.child-add .child-name { color: var(--muted); }
.child-add:hover .av-add { opacity: .9; }

.empty-state { text-align: center; padding: 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 12px; }
.empty-state p { color: var(--muted); margin: 8px 0 20px; }

/* ===== ALERT ===== */
.alert-error {
  background: rgba(255,107,107,0.15); border: 1px solid var(--red);
  color: var(--red); padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-weight: 700;
}

/* ===== PLACEMENT PAGE ===== */
.placement-page { padding: 24px; }
.placement-wrap { max-width: 700px; margin: 0 auto; }
.placement-header { text-align: center; margin-bottom: 32px; }
.placement-header h1 { margin-bottom: 8px; }
.placement-subtitle { color: var(--muted); font-size: 1.05rem; }
.placement-progress { display: flex; justify-content: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.prog-step { text-align: center; opacity: .4; transition: opacity .3s; }
.prog-step.active  { opacity: 1; }
.prog-step.done    { opacity: .7; }
.prog-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin: 0 auto 6px;
}
.prog-step.active  .prog-icon { border-color: var(--purple); background: rgba(108,99,255,0.2); }
.prog-step.done    .prog-icon { border-color: var(--green);  background: rgba(0,200,150,0.2); color: var(--green); }
.prog-label { font-size: .8rem; font-weight: 700; color: var(--muted); }

.placement-arena { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 32px; min-height: 300px; }
.placement-result { text-align: center; }
.result-big-icon { font-size: 4rem; margin-bottom: 12px; }
.result-level-badge {
  display: inline-block; margin: 12px auto;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; padding: 10px 28px; border-radius: 50px;
  font-family: 'Fredoka One', cursive; font-size: 1.3rem;
}
.placement-result p { color: var(--muted); margin: 12px 0 24px; }

/* ===== DASHBOARD ===== */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: var(--card); border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.dash-header-left { display: flex; align-items: center; gap: 14px; }
.dash-avatar { font-size: 2.2rem; }
.dash-name { font-family: 'Fredoka One', cursive; font-size: 1.2rem; }
.dash-grade { font-size: .85rem; color: var(--muted); }
.dash-header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dash-stat { display: flex; flex-direction: column; align-items: center; }
.stat-val { font-weight: 800; font-size: .95rem; }
.stat-lbl { font-size: .7rem; color: var(--muted); }

.dash-main { padding: 24px; max-width: 1000px; margin: 0 auto; }

/* XP bar */
.xp-bar-wrap { margin-bottom: 28px; }
.xp-bar-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; gap: 4px; }
.xp-bar-track {
  height: 16px; background: rgba(255,255,255,0.08);
  border-radius: 50px; overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 50px;
  transition: width 1s ease;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 4px;
  position: relative;
}
.xp-bar-rocket { font-size: .9rem; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); }

.section-title { font-size: 1.3rem; margin-bottom: 6px; }
.section-sub { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }

/* Subject grid */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.subject-card {
  background: var(--card); border: 1.5px solid var(--card-border);
  border-radius: var(--radius); padding: 24px 20px;
  text-decoration: none; color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.subject-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent, var(--purple));
}
.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, var(--purple));
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.sc-icon { font-size: 2.4rem; }
.sc-name { font-family: 'Fredoka One', cursive; font-size: 1.3rem; }
.sc-level-badge {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.08); border-radius: 50px;
  padding: 3px 12px; font-size: .8rem; font-weight: 700;
  color: var(--accent, var(--purple));
}
.sc-stats { display: flex; gap: 12px; font-size: .82rem; color: var(--muted); }
.sc-level-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 50px; overflow: hidden; }
.sc-level-fill { height: 100%; background: var(--accent, var(--purple)); border-radius: 50px; }
.sc-cta { font-size: .85rem; font-weight: 800; color: var(--accent, var(--purple)); margin-top: 4px; }

/* Recent sessions */
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.rc-icon { font-size: 1.6rem; }
.rc-info { flex: 1; }
.rc-subject { font-weight: 700; }
.rc-date { font-size: .8rem; color: var(--muted); }
.rc-score { font-weight: 800; font-size: 1.1rem; }
.rc-grade { font-family: 'Fredoka One', cursive; font-size: 1.5rem; min-width: 32px; text-align: center; }
.rc-xp { font-size: .85rem; color: var(--yellow); font-weight: 700; }

/* ===== SESSION PAGE ===== */
.session-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--card); border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 100;
}
.session-subject { font-family: 'Fredoka One', cursive; font-size: 1.2rem; }
.session-meta-right { display: flex; align-items: center; gap: 12px; }
.q-counter  { font-size: .9rem; color: var(--muted); font-weight: 700; }
.score-live { font-weight: 800; color: var(--green); }
.level-badge {
  background: linear-gradient(135deg, var(--subject-color, var(--purple)), var(--blue));
  color: #fff; padding: 4px 14px; border-radius: 50px;
  font-weight: 800; font-size: .85rem;
}
.back-btn { color: var(--muted); }

/* Session progress bar */
.session-progress { height: 4px; background: rgba(255,255,255,0.08); }
.session-prog-fill { height: 100%; background: var(--subject-color, var(--purple)); transition: width .5s ease; }

.session-main { padding: 16px; max-width: 720px; margin: 0 auto; }
.session-arena { min-height: 300px; }

/* Question card */
.q-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.q-level-strip {
  display: inline-flex; align-items: center;
  padding: 4px 14px; border-radius: 50px;
  font-size: .8rem; font-weight: 800;
  color: var(--dark); align-self: flex-start;
}
.q-meta { font-size: .85rem; color: var(--muted); }
.q-text { font-size: 1.15rem; font-weight: 700; line-height: 1.6; }
.q-progress-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 50px; overflow: hidden; }
.q-progress-fill { height: 100%; background: var(--purple); transition: width .4s; }

/* MCQ Options */
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.05); border: 1.5px solid var(--card-border);
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 600;
  padding: 14px 18px; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s, transform .1s;
}
.q-option:hover:not(:disabled) { background: rgba(108,99,255,0.12); border-color: var(--purple); }
.q-option.selected { border-color: var(--purple); background: rgba(108,99,255,0.18); }
.q-option:disabled { cursor: not-allowed; opacity: .7; }
.opt-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-weight: 800; font-size: .85rem; flex-shrink: 0;
}

/* Writing */
.writing-prompt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,107,107,0.15); border: 1.5px solid var(--red);
  color: var(--red); padding: 4px 14px; border-radius: 50px;
  font-size: .85rem; font-weight: 800; align-self: flex-start;
}
.writing-toolbar { display: flex; align-items: center; justify-content: space-between; }
.word-count { font-size: .85rem; color: var(--muted); }

/* Answer feedback */
.answer-feedback {
  margin-top: 16px; padding: 18px 20px;
  border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 10px;
}
.fb-correct { background: rgba(0,200,150,0.12); border: 1.5px solid var(--green); }
.fb-wrong   { background: rgba(255,107,107,0.12); border: 1.5px solid var(--red); }
.fb-row     { display: flex; align-items: center; gap: 10px; }
.fb-icon    { font-size: 1.5rem; flex-shrink: 0; }
.fb-msg     { font-weight: 700; font-size: 1rem; }
.fb-score   { font-size: .9rem; color: var(--muted); }
.fb-explain { font-size: .92rem; line-height: 1.6; color: var(--text); opacity: .85; }
.fb-next-btn {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: .95rem; padding: 10px 24px; border-radius: 50px; border: none;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(108,99,255,0.4); margin-top: 4px;
}
.fb-next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,99,255,0.5); }

/* Reading passage */
.reading-passage {
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 18px;
  font-size: 1rem; line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
}
.q-question-label {
  margin-top: 4px;
  font-size: 1.05rem;
}

/* Result flash */
.result-flash {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 50px;
  font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow); z-index: 500;
  animation: fadeSlide .3s ease;
  max-width: calc(100vw - 32px); text-align: center;
  white-space: nowrap;
}
.result-flash.correct { background: var(--green); color: var(--dark); }
.result-flash.wrong   { background: var(--red); color: #fff; }
.flash-icon { font-size: 1.4rem; }

/* Level up toast */
.levelup-toast {
  position: fixed; top: 80px; right: 24px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: var(--dark); padding: 16px 28px; border-radius: var(--radius);
  font-weight: 800; font-size: 1rem;
  box-shadow: 0 8px 30px rgba(255,179,71,0.45); z-index: 600;
  animation: slideInRight .4s ease, fadeOut .4s 3s ease forwards;
}

/* Generic toast */
.toast-msg {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--dark2); border: 1px solid var(--card-border);
  color: var(--text); padding: 12px 24px; border-radius: 50px;
  font-weight: 700; font-size: .95rem; z-index: 700;
  animation: fadeSlide .25s ease;
}

/* Nudge panel */
.nudge-panel {
  max-width: 720px; margin: 16px auto 0;
  background: rgba(255,224,102,0.08); border: 1.5px solid rgba(255,224,102,0.3);
  border-radius: var(--radius); padding: 20px;
}
.nudge-panel.hidden { display: none; }
.nudge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; color: var(--yellow); }
.nudge-display { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.nudge-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,224,102,0.08); padding: 12px 14px;
  border-radius: var(--radius-sm); font-size: .95rem;
}
.nudge-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--yellow); color: var(--dark);
  font-weight: 800; font-size: .8rem; flex-shrink: 0;
}

/* ===== GRADE PAGE ===== */
.grade-page { padding: 24px; min-height: 100vh; }
.grade-wrap { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

.grade-header { text-align: center; padding: 20px 0; }
.grade-avatar { font-size: 3.5rem; margin-bottom: 12px; }
.grade-subject {
  display: inline-block; margin-top: 12px;
  background: rgba(255,255,255,0.08); padding: 6px 20px;
  border-radius: 50px; font-weight: 700;
}

.grade-big-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 32px; text-align: center;
}
.grade-letter {
  font-family: 'Fredoka One', cursive; font-size: 6rem;
  line-height: 1; margin-bottom: 4px;
}
.grade-pct { font-size: 1.5rem; font-weight: 800; color: var(--muted); margin-bottom: 16px; }
.grade-breakdown { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; font-weight: 700; margin-bottom: 16px; }
.level-up-banner {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 50px; padding: 10px 24px;
  display: inline-block; font-weight: 700; margin-top: 4px;
}
.level-steady { color: var(--muted); font-size: .9rem; }

.feedback-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 28px;
}
.feedback-card h2 { margin-bottom: 14px; }
.feedback-main { font-size: 1.05rem; line-height: 1.8; margin-bottom: 16px; }
.feedback-block { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.fb-label { display: block; font-weight: 800; font-size: .85rem; margin-bottom: 6px; }
.strength { background: rgba(0,200,150,0.1); border-left: 3px solid var(--green); }
.strength .fb-label { color: var(--green); }
.improve  { background: rgba(79,172,254,0.1); border-left: 3px solid var(--blue); }
.improve  .fb-label { color: var(--blue); }
.next     { background: rgba(255,179,71,0.1); border-left: 3px solid var(--orange); }
.next     .fb-label { color: var(--orange); }

/* Review section */
.review-section { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; }
.review-toggle {
  width: 100%; padding: 18px 24px; background: none; border: none;
  color: var(--text); font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 700;
  cursor: pointer; text-align: left;
}
.review-toggle:hover { background: rgba(255,255,255,0.04); }
.review-list { border-top: 1px solid var(--card-border); }
.review-list.hidden { display: none; }
.review-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; border-bottom: 1px solid var(--card-border);
}
.review-item:last-child { border-bottom: none; }
.rv-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
  background: rgba(255,255,255,0.08);
}
.rv-correct .rv-num { background: rgba(0,200,150,0.2); color: var(--green); }
.rv-wrong   .rv-num { background: rgba(255,107,107,0.2); color: var(--red); }
.rv-body { flex: 1; }
.rv-q { font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.rv-answer { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--muted); }
.rv-correct-ans strong { color: var(--green); }
.rv-icon { font-size: 1.3rem; }

.grade-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.motive-msg {
  text-align: center; color: var(--muted);
  font-size: 1rem; font-weight: 700; padding: 8px;
}

/* ===== LOADING / SPINNER ===== */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 200px; color: var(--muted); }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--purple);
  animation: spin .7s linear infinite;
}
.error-card { background: rgba(255,107,107,0.1); border: 1px solid var(--red); border-radius: var(--radius-sm); padding: 20px; display: flex; align-items: center; gap: 14px; }

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.animate-in { animation: fadeSlide .35s ease forwards; }

/* ===== RESPONSIVE ===== */

/* ── 768px — tablet ───────────────────────────────── */
@media (max-width: 768px) {
  /* Dashboard header: hide some stats on smaller screens */
  .dash-header { padding: 12px 16px; }
  .dash-main   { padding: 16px; }

  /* Subject grid: 2 columns on tablet */
  .subject-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Session / question */
  .session-main  { padding: 16px; }
  .q-card        { padding: 20px; gap: 16px; }
  .q-text        { font-size: 1.05rem; }

  /* Grade page */
  .grade-page    { padding: 16px; }
  .grade-wrap    { gap: 16px; }
}

/* ── 480px — mobile ───────────────────────────────── */
@media (max-width: 480px) {
  /* Dashboard header: collapse to 2-row on very small */
  .dash-header         { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .dash-header-left    { flex: 1; min-width: 0; }
  .dash-header-right   { width: 100%; justify-content: space-between; gap: 6px; }
  .dash-stat           { flex-direction: row; gap: 4px; align-items: baseline; }
  .stat-lbl            { font-size: .65rem; }
  .dash-main           { padding: 14px; }

  /* Subject grid: single column on mobile */
  .subject-grid { grid-template-columns: 1fr; }

  /* Session header: tighter on mobile */
  .session-header      { flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
  .session-subject     { font-size: 1rem; }
  .session-meta-right  { gap: 8px; }
  .q-counter           { font-size: .8rem; }
  .level-badge         { font-size: .78rem; padding: 3px 10px; }

  /* Question card */
  .q-card        { padding: 16px; gap: 14px; }
  .q-text        { font-size: 1rem; }
  .q-option      { padding: 12px 14px; font-size: .95rem; gap: 10px; }
  .opt-letter    { width: 26px; height: 26px; font-size: .8rem; }
  .q-short-input { font-size: 1rem; }

  /* Grade page */
  .grade-page    { padding: 14px; }
  .grade-letter  { font-size: 4.5rem; }
  .grade-pct     { font-size: 1.2rem; }
  .grade-breakdown { gap: 12px; font-size: .9rem; }
  .grade-actions { flex-direction: column; align-items: stretch; }
  .feedback-card { padding: 18px; }
  .review-item   { padding: 12px 14px; gap: 10px; }
  .rc-tabs       { flex-wrap: wrap; }
  .rc-tab        { padding: 8px 14px; font-size: .85rem; }

  /* Score ring on grade page */
  .score-ring-wrap { flex-direction: column; gap: 16px; }

  /* Login card */
  .login-card    { padding: 24px 20px; border-radius: 12px; }

  /* Nudge panel */
  .nudge-panel   { padding: 14px; }

  /* FB next button: full width on mobile */
  .fb-next-btn   { align-self: stretch; text-align: center; }

  /* Result flash: smaller on mobile */
  .result-flash  { font-size: .9rem; padding: 10px 16px; top: 72px; }
  .levelup-toast { right: 14px; left: 14px; font-size: .9rem; padding: 12px 18px; }
}

/* ── 380px — very small phones ────────────────────── */
@media (max-width: 380px) {
  .pin-key       { padding: 12px; font-size: 1.3rem; }
  .pin-keypad    { gap: 8px; }
  .pin-dots      { gap: 10px; }
  .pin-dot       { width: 15px; height: 15px; }
  .q-option      { padding: 10px 12px; }
  .session-meta-right { gap: 6px; }
  .level-badge   { display: none; } /* hide level badge on tiny screens */
  .score-live    { font-size: .85rem; }
}

/* =====================================================
   SHARED HEADER & FOOTER — public + app modes
   ===================================================== */

/* ── GLOBAL UTILITY ─────────────────────────────────── */
.hidden { display: none !important; }

/* ── PUBLIC PAGE BODY OVERRIDE ───────────────────────── */
/* Public pages (about, privacy, terms, login) use white bg */
body.public-body {
  background: #ffffff;
  color: #111827;
}
body.public-body::before { display: none; } /* remove dark gradient overlay */

/* ── PUBLIC HEADER ──────────────────────────────────── */
.public-header {
  background: #0D1B3E;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky; top: 0; z-index: 200;
}
.public-header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 16px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.public-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand-sun  { font-size: 1.5rem; line-height: 1; }
.brand-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem; color: #ffffff;
}
.brand-name em { font-style: italic; color: #818cf8; }

.public-nav {
  display: flex; align-items: center; gap: 4px;
}
.public-nav a {
  font-family: 'Nunito', sans-serif;
  font-size: .88rem; font-weight: 700;
  color: rgba(255,255,255,0.65); text-decoration: none;
  padding: 6px 14px; border-radius: 8px;
  transition: color .15s, background .15s;
  border-bottom: 2px solid transparent;
}
.public-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.public-nav a[style*="border-bottom: 2px solid"] { color: #fff; }
.public-nav-cta {
  background: #6C63FF !important;
  color: #fff !important;
  padding: 8px 20px !important; border-radius: 50px !important;
  font-weight: 800 !important; font-size: .88rem !important;
  box-shadow: 0 3px 12px rgba(108,99,255,0.45);
  margin-left: 6px;
  border-bottom: none !important;
}
.public-nav-cta:hover {
  background: #7c74ff !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(108,99,255,0.55);
}

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none; background: none; border: none;
  color: rgba(255,255,255,0.6); font-size: 1.4rem; cursor: pointer; padding: 4px;
}

/* Mobile nav — hidden by default, shown when .hidden is removed */
.mobile-nav {
  display: flex; flex-direction: column;
  background: #0D1B3E; border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 24px 20px; gap: 4px;
}
.mobile-nav.hidden { display: none !important; }
.mobile-nav a {
  font-weight: 700; color: rgba(255,255,255,0.65); text-decoration: none;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 1rem;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav-cta { color: #818cf8 !important; font-weight: 800 !important; }

@media (max-width: 640px) {
  .public-nav { display: none; }
  .mobile-menu-btn { display: block; }
}

/* ── APP FOOTER (minimal) ───────────────────────────── */
.app-footer {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px; padding: 20px 24px; margin-top: 48px;
  border-top: 1px solid var(--card-border);
  font-size: .8rem; color: var(--muted);
}
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--text); }
.app-footer span { opacity: .4; }

/* ── PUBLIC FOOTER ──────────────────────────────────── */
.public-footer {
  background: #0D1B3E;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 64px;
}
.public-footer-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 48px 24px 36px;
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 800px) {
  .public-footer-inner { grid-template-columns: 1fr 1fr; padding: 32px 20px 24px; gap: 24px; }
}
@media (max-width: 520px) {
  .public-footer-inner { grid-template-columns: 1fr; padding: 28px 20px 20px; gap: 20px; }
  .pf-bottom { flex-direction: column; gap: 6px; text-align: center; }
}
.pf-brand .brand-name { font-size: 1.1rem; display: block; margin-bottom: 10px; }
.pf-brand p { font-size: .88rem; color: rgba(255,255,255,0.45); line-height: 1.65; margin: 0; }
.pf-col { display: flex; flex-direction: column; gap: 10px; }
.pf-col-head {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,0.4); margin-bottom: 4px;
}
.pf-col a {
  font-size: .88rem; color: rgba(255,255,255,0.55);
  text-decoration: none; transition: color .15s;
}
.pf-col a:hover { color: #fff; }
.pf-bottom {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 8px; font-size: .78rem; color: rgba(255,255,255,0.35);
}
.pf-bottom a { color: rgba(255,255,255,0.45); text-decoration: none; }
.pf-bottom a:hover { color: #fff; }

/* ── BRAND LOGO in app header ───────────────────────── */
.brand-logo { font-size: 1.4rem; line-height: 1; }

/* ── PUBLIC PAGE BASE ───────────────────────────────── */
.public-page { min-height: 100vh; }
.public-wrap {
  max-width: 900px; margin: 0 auto;
  padding: 32px 20px;
}
@media (max-width: 480px) {
  .public-wrap { padding: 24px 16px; }
}

/* ── PUBLIC PROSE (white background version) ────────── */
.public-prose h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem; color: #111827;
  margin-top: 2.5rem; margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #e5e7eb;
}
.public-prose h3 {
  font-size: 1rem; font-weight: 800; color: #4f46e5;
  margin-top: 1.5rem; margin-bottom: .4rem;
}
.public-prose p {
  color: #374151; line-height: 1.8;
  margin-bottom: .9rem; font-size: .97rem;
}
.public-prose ul {
  list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem;
}
.public-prose ul li {
  color: #374151; margin-bottom: .35rem;
  font-size: .97rem; line-height: 1.7;
}
.public-prose a { color: #4f46e5; text-decoration: underline; }
.public-prose strong { color: #111827; }

/* callout boxes — light theme */
.prose-callout {
  background: #eff6ff;
  border-left: 3px solid #4f46e5;
  border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 1.2rem 0;
}
.prose-callout p { margin: 0; color: #1e3a8a; font-weight: 600; font-size: .95rem; }
.prose-callout.green { background: #f0fdf4; border-left-color: #16a34a; }
.prose-callout.green p { color: #14532d; }
.prose-callout.amber { background: #fffbeb; border-left-color: #d97706; }
.prose-callout.amber p { color: #78350f; }

/* check / x lists */
.check-list { list-style: none !important; padding-left: 0 !important; }
.check-list li { padding-left: 1.8rem; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 900; }
.x-list { list-style: none !important; padding-left: 0 !important; }
.x-list li { padding-left: 1.8rem; position: relative; }
.x-list li::before { content: "✗"; position: absolute; left: 0; color: #dc2626; font-weight: 900; }

/* hero text on about page */
.public-hero-text { color: #111827 !important; }
.public-hero-muted { color: #6b7280 !important; }

/* subject cards on about page — light theme */
.subject-card-light {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 18px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.subject-card-light:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); transition: all .2s; }

/* standard badge table — light theme */
.standards-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .85rem; }
.standards-table th {
  background: #f9fafb; color: #6b7280;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 10px 14px; text-align: left;
  border-bottom: 2px solid #e5e7eb;
}
.standards-table td {
  padding: 12px 14px; border-bottom: 1px solid #f3f4f6;
  font-size: .9rem; color: #374151; vertical-align: top;
}
.standards-table tr:last-child td { border-bottom: none; }
.standards-table tr:hover td { background: #fafafa; }
.std-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 50px; font-size: .72rem; font-weight: 800;
  white-space: nowrap;
}
.std-yes      { background: #dcfce7; color: #15803d; }
.std-partial  { background: #fef9c3; color: #a16207; }
.std-roadmap  { background: #dbeafe; color: #1d4ed8; }

/* =====================================================
   PUBLIC BODY OVERRIDES
   Force readable colors on all white-background pages.
   Overrides any dark-theme CSS variable leakage.
   ===================================================== */
body.public-body {
  background: #f8faff;
  color: #111827;
}
body.public-body::before { display: none; }

/* Typography */
body.public-body h1,
body.public-body h2,
body.public-body h3 { color: #111827; }

/* All inputs on white bg */
body.public-body input[type="text"],
body.public-body input[type="password"],
body.public-body select,
body.public-body textarea {
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  color: #111827;
}
body.public-body input:focus,
body.public-body select:focus,
body.public-body textarea:focus {
  border-color: #6C63FF;
  background: #fafaff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
body.public-body input::placeholder,
body.public-body textarea::placeholder { color: #9ca3af; }

/* Cards / surfaces */
body.public-body .login-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* Text utility classes */
body.public-body .sub          { color: #6b7280; }
body.public-body .child-name   { color: #111827; }
body.public-body .child-grade  { color: #6b7280; }
body.public-body .child-xp     { color: #7c3aed; }

/* Child cards on login */
body.public-body .child-card {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  color: #111827;
}
body.public-body .child-card:hover {
  background: #ede9fe;
  border-color: #6C63FF;
}
body.public-body .child-add .child-name { color: #6b7280; }

/* Profile peek on PIN step */
body.public-body .profile-peek {
  background: #f3f4f6;
}
body.public-body .peek-name  { color: #111827; }
body.public-body .peek-grade { color: #6b7280; }

/* PIN keypad */
body.public-body .pin-dot {
  border-color: #d1d5db;
}
body.public-body .pin-dot.filled {
  background: #6C63FF;
  border-color: #6C63FF;
}
body.public-body .pin-key {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}
body.public-body .pin-key:hover  { background: #ede9fe; border-color: #6C63FF; }
body.public-body .pin-key:active { background: #ddd6fe; }
body.public-body .pin-key.del    { color: #9ca3af; }

/* OR divider line */
body.public-body .or-line       { color: #9ca3af; }
body.public-body .or-line::before,
body.public-body .or-line::after { background: #e5e7eb; }

/* Secondary button */
body.public-body .btn-secondary {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}
body.public-body .btn-secondary:hover { background: #e5e7eb; }

/* Alert error */
body.public-body .alert-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Form group labels */
body.public-body .form-group label { color: #374151; }

/* Avatar picker */
body.public-body .av-option span {
  border-color: transparent;
}
body.public-body .av-option input:checked + span {
  border-color: #6C63FF;
}

/* Subject pills on login */
body.public-body .pill {
  background: #fff;
  border: 1.5px solid var(--c);
}

/* Loading text */
body.public-body #name-loading { color: #6b7280; }

/* Modal on login */
body.public-body .modal-box {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
}
body.public-body .modal-close { color: #9ca3af; }
body.public-body .modal-close:hover { color: #374151; }

/* Empty state */
body.public-body .empty-state p { color: #6b7280; }

/* Peek change button */
body.public-body .peek-change { color: #6C63FF; }

/* =====================================================
   MOBILE — dashboard activity feed + coach banner
   ===================================================== */
@media (max-width: 480px) {
  /* Activity feed: hide XP and "View" on tiny screens */
  .af-xp     { display: none; }
  .af-review { font-size: .75rem; }
  .af-right  { gap: 8px; }
  .af-grade  { font-size: 1.2rem; }

  /* Coach banner */
  .coach-banner  { padding: 14px 16px; }
  .coach-icon    { font-size: 1.8rem; }
  .coach-subject { font-size: 1.1rem; }

  /* Subject cards on dashboard */
  .subject-card  { padding: 18px 16px; }
  .sc-icon       { font-size: 2rem; }
  .sc-name       { font-size: 1.15rem; }

  /* Section titles */
  .section-title { font-size: 1.1rem; }

  /* Public prose headings */
  .public-prose h2 { font-size: 1.25rem; }
  .public-prose p  { font-size: .92rem; }

  /* Standards table: smaller on mobile */
  .standards-table th,
  .standards-table td { padding: 8px 10px; font-size: .82rem; }
  .std-badge { font-size: .68rem; padding: 2px 8px; }
}

/* =====================================================
   WORKING NOTES
   ===================================================== */
.working-notes {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.notes-toggle {
  width: 100%; padding: 12px 16px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: 'Nunito', sans-serif;
  font-size: .88rem; font-weight: 700;
  text-align: left; display: flex; justify-content: space-between;
  align-items: center;
  transition: background .15s;
}
.notes-toggle:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.notes-chevron { font-size: .75rem; }
.notes-body { border-top: 1px solid var(--card-border); }
.notes-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--card-border);
}
.ntab {
  background: none; border: 1.5px solid var(--card-border);
  color: var(--muted); font-family: 'Nunito', sans-serif;
  font-size: .8rem; font-weight: 700;
  padding: 4px 14px; border-radius: 50px; cursor: pointer;
  transition: background .12s, color .12s;
}
.ntab.active { background: rgba(108,99,255,0.15); border-color: var(--purple); color: var(--purple); }
.ntab:hover:not(.active) { background: rgba(255,255,255,0.06); }
.notes-clear {
  margin-left: auto; background: none; border: none;
  color: var(--muted); font-size: .78rem; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-weight: 700;
  padding: 4px 8px;
}
.notes-clear:hover { color: var(--red); }
.notes-draw-wrap { padding: 0; background: #fff; }
.notes-canvas {
  display: block; width: 100%; height: 180px;
  cursor: crosshair; touch-action: none;
}
.notes-textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: none; border-top: 1px solid var(--card-border);
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: .95rem; resize: vertical; min-height: 100px;
  outline: none;
}
.notes-textarea:focus { background: rgba(108,99,255,0.06); }

/* =====================================================
   FEEDBACK BUTTON (floating)
   ===================================================== */
.feedback-fab {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--purple);
  color: #fff; font-family: 'Nunito', sans-serif;
  font-size: .82rem; font-weight: 800;
  padding: 10px 18px; border-radius: 50px; border: none;
  cursor: pointer; z-index: 800;
  box-shadow: 0 4px 18px rgba(108,99,255,0.45);
  display: flex; align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s;
}
.feedback-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(108,99,255,0.6); }
@media (max-width: 480px) {
  .feedback-fab { bottom: 14px; right: 14px; padding: 9px 14px; font-size: .78rem; }
}

/* =====================================================
   INLINE FEEDBACK (inside question card)
   ===================================================== */
.inline-feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  animation: fadeSlide .25s ease;
}
.ifb-correct {
  background: rgba(0,200,150,0.12);
  border-left: 3px solid var(--green);
}
.ifb-wrong {
  background: rgba(255,107,107,0.12);
  border-left: 3px solid var(--red);
}
.ifb-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.ifb-icon  { font-size: 1.2rem; flex-shrink: 0; }
.ifb-title { font-weight: 800; font-size: 1rem; color: var(--text); }
.ifb-score { font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.ifb-explain {
  font-size: .92rem; color: rgba(240,244,255,0.75);
  line-height: 1.6; margin-top: 6px;
}

/* =====================================================
   FIXED NEXT BAR (always visible at bottom)
   ===================================================== */
.next-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 20px;
  background: var(--dark2);
  border-top: 1px solid var(--card-border);
  display: flex; justify-content: center;
  z-index: 600;
  animation: slideUp .22s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.next-bar-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem; font-weight: 400;
  padding: 14px 48px;
  border-radius: 50px; border: none; cursor: pointer;
  width: 100%; max-width: 420px;
  transition: transform .12s, box-shadow .12s;
  letter-spacing: .02em;
}
.next-correct {
  background: linear-gradient(135deg, var(--green), #00dfa8);
  color: #0a2e1e;
  box-shadow: 0 4px 20px rgba(0,200,150,0.4);
}
.next-wrong {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.next-bar-btn:hover  { transform: translateY(-2px); }
.next-bar-btn:active { transform: scale(.97); }

/* Push session-main content up from the fixed bar when it's showing */
.session-main { padding-bottom: 100px; }

/* On mobile the bar is full width already */
@media (max-width: 480px) {
  .next-bar { padding: 10px 16px; }
  .next-bar-btn { font-size: 1rem; padding: 13px 24px; }
}
