/* ============================================================
   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: .85rem; color: var(--muted); margin-bottom: 8px; }
.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: 24px; max-width: 720px; margin: 0 auto; }
.session-arena { min-height: 400px; }

/* 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: 14px 28px; border-radius: 50px;
  font-weight: 800; font-size: 1.1rem;
  box-shadow: var(--shadow); z-index: 500;
  animation: fadeSlide .3s ease;
}
.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 ===== */
@media (max-width: 600px) {
  .dash-header { flex-wrap: wrap; gap: 12px; }
  .dash-header-right { gap: 10px; }
  .grade-actions { flex-direction: column; align-items: stretch; }
  .session-header { flex-wrap: wrap; gap: 8px; }
  .q-card { padding: 20px; }
}
