/* ══════════════════════════════════════════════════
   Gaoshou Galaxy — Full UI
   Theme: Deep space, gold stars, playful & fun
   ══════════════════════════════════════════════════ */

:root {
  --navy:        #0f1535;
  --navy2:       #1a2150;
  --navy3:       #232d6a;
  --card:        #1e2757;
  --card2:       #263070;
  --gold:        #ffd700;
  --gold2:       #ffb800;
  --gold-soft:   rgba(255,215,0,0.15);
  --coral:       #ff6b6b;
  --coral-soft:  rgba(255,107,107,0.2);
  --mint:        #4ecdc4;
  --mint-soft:   rgba(78,205,196,0.15);
  --purple:      #a78bfa;
  --purple-soft: rgba(167,139,250,0.15);
  --white:       #ffffff;
  --white2:      rgba(255,255,255,0.85);
  --white3:      rgba(255,255,255,0.5);
  --white4:      rgba(255,255,255,0.12);
  --green:       #51cf66;
  --green-soft:  rgba(81,207,102,0.2);
  --red:         #ff6b6b;
  --red-soft:    rgba(255,107,107,0.2);
  --amber:       #ffa94d;
  --amber-soft:  rgba(255,169,77,0.2);
  --r:           20px;
  --r-sm:        12px;
  --r-lg:        28px;
  --shadow:      0 8px 32px rgba(0,0,0,0.3);
  --shadow-gold: 0 4px 20px rgba(255,215,0,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: 'Nunito', 'Noto Sans TC', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Stars background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 60%, rgba(255,215,0,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 70%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 90%, rgba(255,215,0,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 65% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 50%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 85%, rgba(255,215,0,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 15%, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.screen {
  position: fixed;
  inset: 0;
  background: transparent;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}
.screen.active { display: flex; }

/* Auth */
.auth-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 48px 24px 40px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  justify-content: center;
}
.brand-char {
  font-family: 'Noto Serif TC', serif;
  font-size: 56px;
  font-weight: 700;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  border-radius: 20px;
  color: var(--navy);
  box-shadow: var(--shadow-gold);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.brand-text { text-align: left; }
.brand-text h1 { font-family: 'Noto Serif TC', serif; font-size: 28px; font-weight: 700; color: var(--gold); letter-spacing: -0.02em; }
.brand-text p { font-size: 13px; color: var(--white3); font-weight: 600; }

.auth-tabs { display: flex; gap: 8px; background: var(--card); border-radius: var(--r-sm); padding: 4px; }
.auth-tab {
  flex: 1; background: none; border: none; padding: 10px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--white3); cursor: pointer; border-radius: 8px; transition: all 0.2s;
}
.auth-tab.active { background: var(--gold); color: var(--navy); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--white3); }
.field input {
  padding: 14px 16px;
  border: 2px solid var(--white4);
  border-radius: var(--r-sm);
  background: var(--card);
  font-family: 'Nunito', sans-serif;
  font-size: 16px; color: var(--white);
  outline: none; transition: border-color 0.2s;
}
.field input::placeholder { color: var(--white3); }
.field input:focus { border-color: var(--gold); }
.form-error { font-size: 13px; color: var(--coral); min-height: 16px; font-weight: 600; }
.auth-note { font-size: 12px; color: var(--white3); text-align: center; line-height: 1.5; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color: var(--navy); border: none; border-radius: var(--r-sm);
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-gold); text-align: center; width: 100%;
}
.btn-primary:active { transform: scale(0.96); box-shadow: none; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,215,0,0.4); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  background: var(--white4); color: var(--white2);
  border: 2px solid var(--white4); border-radius: var(--r-sm);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.15s; width: 100%;
}
.btn-ghost:hover { background: var(--card2); border-color: var(--white3); }

.icon-btn {
  width: 42px; height: 42px; background: var(--white4); border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s; color: var(--white);
}
.icon-btn:hover { background: var(--card2); transform: scale(1.05); }

/* Header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15,21,53,0.95);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--white4);
}
.header-brand { font-family: 'Noto Serif TC', serif; font-size: 22px; font-weight: 700; color: var(--gold); }
.header-title { font-size: 16px; font-weight: 800; color: var(--white); }
.header-actions { display: flex; gap: 6px; }

/* Home */
.home-content { padding: 24px 20px; display: flex; flex-direction: column; gap: 20px; max-width: 560px; margin: 0 auto; width: 100%; }
.home-greeting { text-align: center; padding: 8px 0; }
.greeting-sub { font-size: 14px; color: var(--white3); font-weight: 600; }
.home-greeting h2 { font-size: 26px; font-weight: 900; color: var(--gold); margin-top: 4px; }

.card { background: var(--card); border: 2px solid var(--white4); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-label { font-size: 11px; font-weight: 800; color: var(--white3); text-transform: uppercase; letter-spacing: 0.1em; }

.child-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.child-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 10px 18px; border-radius: 999px;
  background: var(--card2); border: 2px solid var(--white4);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; color: var(--white2);
}
.child-chip.selected { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: var(--navy); border-color: var(--gold); box-shadow: var(--shadow-gold); }
.child-chip-remove {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.2); border: none; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: inherit; padding: 0; transition: background 0.15s; font-weight: 900;
}
.child-chip-remove:hover { background: rgba(0,0,0,0.4); }

.upload-card {
  background: linear-gradient(135deg, var(--navy3), var(--card2));
  border: 2px dashed var(--gold2); border-radius: var(--r);
  padding: 32px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 14px; text-align: center; transition: border-color 0.2s;
}
.upload-card:hover { border-color: var(--gold); }
.upload-icon { font-size: 48px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.upload-text h3 { font-size: 20px; font-weight: 800; color: var(--white); }
.upload-text p { font-size: 14px; color: var(--white3); margin-top: 4px; font-weight: 600; }
.upload-label { cursor: pointer; max-width: 280px; }
.section-heading { font-size: 12px; font-weight: 800; color: var(--white3); text-transform: uppercase; letter-spacing: 0.08em; }

.worksheet-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--card); border: 2px solid var(--white4);
  border-radius: var(--r-sm); margin-bottom: 10px; cursor: pointer; transition: all 0.2s;
}
.worksheet-item:hover { background: var(--card2); border-color: var(--gold); transform: translateX(4px); }
.wi-title { font-size: 15px; font-weight: 700; }
.wi-meta { font-size: 12px; color: var(--white3); margin-top: 2px; font-weight: 600; }
.wi-arrow { color: var(--gold); font-size: 18px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(4px);
}
.modal {
  background: var(--card); border: 2px solid var(--white4);
  border-radius: var(--r) var(--r) 0 0;
  padding: 28px 24px 40px; width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 20px;
}
.modal h3 { font-size: 20px; font-weight: 800; color: var(--gold); }
.modal-actions { display: flex; gap: 10px; }

/* Processing */
.processing-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 28px; min-height: 100vh; padding: 40px; text-align: center;
}
.processing-anim { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.proc-char {
  font-family: 'Noto Serif TC', serif; font-size: 80px; font-weight: 700; color: var(--gold);
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.6));
  animation: spin-glow 2s ease-in-out infinite;
}
@keyframes spin-glow {
  0%,100% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 20px rgba(255,215,0,0.6)); }
  50% { transform: scale(1.1) rotate(3deg); filter: drop-shadow(0 0 40px rgba(255,215,0,0.9)); }
}
.proc-bar { width: 220px; height: 8px; background: var(--white4); border-radius: 999px; overflow: hidden; }
.proc-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold));
  border-radius: 999px; animation: shimmer 1.5s ease-in-out infinite; width: 40%;
}
@keyframes shimmer { 0%{transform:translateX(-200%)} 100%{transform:translateX(400%)} }
.processing-wrap h2 { font-size: 22px; font-weight: 800; color: var(--white); }
.processing-wrap p { color: var(--white3); font-size: 15px; font-weight: 600; }

/* Preview */
.preview-content { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; width: 100%; }
.section-tabs { display: flex; gap: 8px; }
.sec-tab {
  flex: 1; padding: 12px; background: var(--card); border: 2px solid var(--white4);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 700; color: var(--white3);
  cursor: pointer; transition: all 0.2s; font-family: 'Noto Sans TC', 'Nunito', sans-serif;
}
.sec-tab.active { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: var(--navy); border-color: var(--gold); }
.q-preview-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--card); border-radius: var(--r-sm); border: 2px solid var(--white4);
  margin-bottom: 10px; transition: border-color 0.2s;
}
.q-preview-item:hover { border-color: var(--gold2); }
.q-num { font-size: 12px; color: var(--white3); font-weight: 700; min-width: 22px; padding-top: 4px; }
.q-preview-char { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 48px; }
.q-preview-char .q-chinese { font-family: 'Noto Serif TC', serif; font-size: 24px; font-weight: 700; color: var(--white); }
.q-preview-char .q-pinyin-below { font-size: 11px; color: var(--mint); text-align: center; font-weight: 700; }
.q-pinyin { font-size: 13px; color: var(--mint); font-weight: 700; margin-bottom: 2px; }
.q-meaning-small { font-size: 12px; color: var(--white3); font-weight: 600; }
.preview-actions { display: flex; gap: 10px; padding-top: 8px; }

/* Test */
.test-progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.test-progress-bar { flex: 1; height: 10px; background: var(--white4); border-radius: 999px; overflow: visible; position: relative; }
#test-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold));
  border-radius: 999px; transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1); width: 0%; position: relative;
}
#test-progress-fill::after {
  content: '🚀'; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  font-size: 20px; filter: drop-shadow(0 0 6px rgba(255,215,0,0.8));
}
#test-progress-label { font-size: 12px; color: var(--white3); font-weight: 800; white-space: nowrap; padding-right: 4px; }

.test-content {
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  max-width: 560px; margin: 0 auto; width: 100%; flex: 1;
  height: calc(100vh - 66px);
}
.question-card { background: var(--card); border: 2px solid var(--white4); border-radius: var(--r); padding: 16px 18px; flex-shrink: 0; }
.q-meta { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; }
.badge { padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-pinyin { background: var(--mint-soft); color: var(--mint); border: 1px solid var(--mint); }
.badge-dictation { background: var(--purple-soft); color: var(--purple); border: 1px solid var(--purple); }
#q-number { font-size: 12px; color: var(--white3); font-weight: 700; }

.play-btn-sm {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: var(--white4); border: 2px solid var(--white4);
  border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; color: var(--white); font-family: 'Nunito', sans-serif;
}
.play-btn-sm:hover { background: var(--card2); border-color: var(--white3); }
.play-btn-sm.playing { border-color: var(--mint); color: var(--mint); background: var(--mint-soft); }
.help-btn { background: var(--amber-soft) !important; border-color: var(--amber) !important; color: var(--amber) !important; }

.q-pinyin-display { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; }
.q-chinese-big {
  font-family: 'Noto Serif TC', serif; font-size: 60px; font-weight: 700;
  line-height: 1.1; color: var(--gold); filter: drop-shadow(0 0 12px rgba(255,215,0,0.4));
}
.q-meaning-small-test { font-size: 14px; color: var(--white3); font-weight: 600; }
.q-dictation-display { display: flex; align-items: center; justify-content: center; padding: 10px 0 4px; }
.q-meaning { font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--white); text-align: center; }

/* Scratchpad */
.scratchpad-section { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.scratchpad-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--white3); font-weight: 700; }
.clear-btn {
  background: var(--white4); border: none; font-size: 12px; color: var(--white3);
  cursor: pointer; padding: 6px 14px; border-radius: 999px; transition: background 0.15s;
  font-family: 'Nunito', sans-serif; font-weight: 700;
}
.clear-btn:hover { background: var(--card2); color: var(--white); }
#scratchpad {
  width: 100%; flex: 1; min-height: 0; background: #ffffff;
  border: 3px solid var(--gold2); border-radius: var(--r-sm);
  touch-action: none; cursor: crosshair; display: block;
  box-shadow: 0 0 20px rgba(255,184,0,0.2);
}
.btn-submit { flex-shrink: 0; }

/* Result Card */
.result-card-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 40px 24px; max-width: 500px; margin: 0 auto; width: 100%;
  min-height: 100vh; justify-content: center;
}
.result-emoji { font-size: 72px; animation: pop 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pop { 0%{transform:scale(0) rotate(-20deg)} 100%{transform:scale(1) rotate(0)} }
.result-card-wrap h2 { font-size: 30px; font-weight: 900; text-align: center; }
.result-feedback { font-size: 15px; color: var(--white3); text-align: center; line-height: 1.6; font-weight: 600; }

.answer-reveal { width: 100%; background: var(--card); border: 2px solid var(--white4); border-radius: var(--r); overflow: hidden; }
.reveal-row { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--white4); gap: 12px; }
.reveal-row:last-child { border-bottom: none; }
.reveal-label { font-size: 12px; color: var(--white3); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; min-width: 60px; }
.reveal-val { font-size: 20px; font-family: 'Noto Serif TC', serif; font-weight: 700; text-align: right; color: var(--gold); }
#reveal-pinyin { font-family: 'Nunito', monospace; font-size: 17px; font-weight: 700; color: var(--mint); }
#reveal-meaning { font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 600; color: var(--white2); }

.stroke-anim-wrap { width: 100%; }
.stroke-label { font-size: 12px; color: var(--white3); text-align: center; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.stroke-imgs { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.stroke-gif { width: 90px; height: 90px; border: 2px solid var(--gold2); border-radius: var(--r-sm); background: #fff; box-shadow: 0 0 12px rgba(255,215,0,0.2); }

/* Final Score */
.final-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 40px 24px; max-width: 500px; margin: 0 auto; width: 100%;
  min-height: 100vh; justify-content: center;
}
.final-score-ring { position: relative; width: 180px; height: 180px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--white4); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: var(--gold); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4,0,0.2,1);
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.6));
}
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-score { font-size: 38px; font-weight: 900; line-height: 1; color: var(--gold); }
.ring-total { font-size: 14px; color: var(--white3); font-weight: 700; }
.final-wrap h2 { font-size: 26px; font-weight: 900; text-align: center; color: var(--white); }
#final-grade-sub { font-size: 15px; color: var(--white3); text-align: center; font-weight: 600; }

.hints-summary {
  width: 100%; background: var(--amber-soft); border: 2px solid var(--amber);
  border-radius: var(--r-sm); padding: 14px 18px; font-size: 15px; font-weight: 700;
  color: var(--amber); text-align: center;
}

.final-breakdown { width: 100%; background: var(--card); border: 2px solid var(--white4); border-radius: var(--r); overflow: hidden; max-height: 260px; overflow-y: auto; }
.breakdown-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--white4); font-size: 14px; }
.breakdown-row:last-child { border-bottom: none; }
.bd-chinese { font-family: 'Noto Serif TC', serif; font-size: 20px; font-weight: 700; flex: 1; color: var(--gold); }
.bd-hint { font-size: 14px; width: 20px; text-align: center; }
.bd-result { font-size: 18px; }
.final-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* Confetti + animations */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.star-burst { position: fixed; pointer-events: none; z-index: 60; font-size: 32px; animation: star-fly 1s ease-out forwards; }
@keyframes star-fly {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%,-120%) scale(1.4); opacity: 1; }
  100% { transform: translate(-50%,-200%) scale(0.8); opacity: 0; }
}
.shake { animation: shake 0.5s ease-in-out; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px) rotate(-2deg)}
  40%{transform:translateX(10px) rotate(2deg)} 60%{transform:translateX(-8px) rotate(-1deg)}
  80%{transform:translateX(8px) rotate(1deg)}
}

/* History */
.history-content { padding: 20px; max-width: 560px; margin: 0 auto; width: 100%; }
.history-item {
  background: var(--card); border: 2px solid var(--white4); border-radius: var(--r-sm);
  padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--gold2); }
.hi-score-bubble {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color: var(--navy); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0; box-shadow: var(--shadow-gold);
}
.hi-info { flex: 1; }
.hi-title { font-size: 15px; font-weight: 700; }
.hi-date { font-size: 12px; color: var(--white3); margin-top: 2px; font-weight: 600; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 2px solid var(--gold2); color: var(--white);
  padding: 14px 24px; border-radius: 999px; font-size: 14px; font-weight: 700;
  z-index: 200; pointer-events: none;
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-gold); white-space: nowrap;
}
@keyframes toast-in {
  from { opacity:0; transform:translateX(-50%) translateY(12px) scale(0.9); }
  to { opacity:1; transform:translateX(-50%) translateY(0) scale(1); }
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy2); }
::-webkit-scrollbar-thumb { background: var(--white4); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--white3); }

/* ── Brand logo SVG ────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; justify-content: center; }
.brand-logo {
  width: 280px;
  height: auto;
  animation: float 3s ease-in-out infinite;
}

/* ── Worksheet count badge ─────────────────────────── */
.ws-count {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--white4);
  color: var(--white3);
}
.ws-count-full {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
}

/* ── Worksheet delete button ───────────────────────── */
.ws-delete-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ws-delete-btn:hover {
  opacity: 1;
  background: var(--red-soft);
}

/* ── Exit divider ──────────────────────────────────── */
.exit-divider {
  width: 100%;
  height: 1px;
  background: var(--white4);
  margin: 4px 0;
}

/* ── Exit & logout button ──────────────────────────── */
.btn-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--red-soft);
  color: var(--coral);
  border: 2px solid var(--coral);
  border-radius: var(--r-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.btn-exit:hover { background: rgba(255,107,107,0.3); }

/* ── Dashboard summary table ───────────────────────── */
.dashboard-section {
  margin-bottom: 24px;
}
.dashboard-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--white3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.summary-table {
  background: var(--card);
  border: 2px solid var(--white4);
  border-radius: var(--r);
  overflow: hidden;
}
.summary-header {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1.5fr;
  padding: 10px 16px;
  background: var(--card2);
  font-size: 11px;
  font-weight: 800;
  color: var(--white3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--white4);
}
.summary-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1.5fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--white4);
  align-items: center;
  font-size: 14px;
  transition: background 0.15s;
}
.summary-row:last-child { border-bottom: none; }
.summary-row:hover { background: var(--card2); }
.sr-name { font-weight: 700; color: var(--gold); }
.sr-val { color: var(--white2); font-weight: 600; }
.sr-avg { font-weight: 800; color: var(--mint); }

/* ── Dashboard ─────────────────────────────────────── */
.dashboard-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-card {
  background: var(--card);
  border: 2px solid var(--white4);
  border-radius: var(--r);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s;
}
.dashboard-card:hover { border-color: var(--gold2); }

.dc-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dc-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900;
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
}
.dc-info { flex: 1; }
.dc-name { font-size: 17px; font-weight: 800; color: var(--white); }
.dc-school { font-size: 12px; color: var(--white3); font-weight: 600; margin-top: 2px; }

.dc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dc-stat {
  background: var(--card2);
  border-radius: var(--r-sm);
  padding: 10px 8px;
  text-align: center;
}
.dc-stat-val { font-size: 18px; font-weight: 800; color: var(--gold); }
.dc-stat-label { font-size: 11px; color: var(--white3); font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

.dc-last {
  font-size: 12px;
  color: var(--white3);
  font-weight: 600;
  padding-top: 4px;
  border-top: 1px solid var(--white4);
}


