/* ================================================================
   style.css  —  QuestList Classroom Edition
   Fonts  : Cinzel Decorative (headings) + Exo 2 (UI)
   Theme  : Deep navy cosmos · arcane purple · gold accents
   ================================================================ */

/* ────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
──────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:         #07071a;
  --bg-2:       #0d0d28;
  --panel:      #10102a;
  --card:       #161636;
  --card-2:     #1c1c42;

  /* Borders */
  --border:     #252550;
  --border-2:   #34346a;

  /* Brand */
  --purple:     #6d28d9;
  --purple-2:   #a855f7;
  --purple-3:   #c084fc;
  --glow:       rgba(109, 40, 217, .35);

  /* Accents */
  --gold:       #f59e0b;
  --gold-2:     #fbbf24;
  --gold-glow:  rgba(245, 158, 11, .35);
  --green:      #10b981;
  --green-2:    #34d399;
  --red:        #ef4444;
  --blue:       #60a5fa;

  /* Text */
  --text:       #e8e6f0;
  --text-2:     #b0aec8;
  --muted:      #6b6890;
  --muted-2:    #4a4870;

  /* Radii */
  --r-sm:  8px;
  --r-md:  13px;
  --r-lg:  20px;
  --r-xl:  26px;

  /* Typography */
  --font-title: 'Cinzel Decorative', Georgia, serif;
  --font-ui:    'Exo 2', 'Segoe UI', sans-serif;

  /* Transitions */
  --t: .22s cubic-bezier(.4, 0, .2, 1);
}

/* ────────────────────────────────────────────────────────────────
   2. RESET & BASE
──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--font-ui); cursor: pointer; }
input  { font-family: var(--font-ui); }

/* ────────────────────────────────────────────────────────────────
   3. STARFIELD BACKGROUND
──────────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* glow at top */
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(109, 40, 217, .20), transparent),
    /* stars */
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.55) 0%, transparent 100%),
    radial-gradient(1px   1px   at 82% 14%, rgba(255,255,255,.40) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 44% 68%, rgba(255,255,255,.60) 0%, transparent 100%),
    radial-gradient(1px   1px   at 90% 42%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1px   1px   at 22% 78%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 67% 87%, rgba(255,255,255,.50) 0%, transparent 100%),
    radial-gradient(1px   1px   at 55% 12%, rgba(255,255,255,.30) 0%, transparent 100%),
    radial-gradient(1px   1px   at  5% 55%, rgba(255,255,255,.40) 0%, transparent 100%),
    /* purple nebula dots */
    radial-gradient(2px 2px at 34% 38%, rgba(167, 139, 250, .40) 0%, transparent 100%),
    radial-gradient(2px 2px at 74% 62%, rgba(168, 85,  247, .30) 0%, transparent 100%);
}

/* ────────────────────────────────────────────────────────────────
   4. LAYOUT
──────────────────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* ────────────────────────────────────────────────────────────────
   5. HEADER
──────────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 28px 0 14px;
}
.header::after {
  content: '';
  display: block;
  height: 1px;
  margin: 16px auto 0;
  width: 55%;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}

.header h1 {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 900;
  letter-spacing: .04em;
  background: linear-gradient(100deg, #c084fc, #a855f7, #fbbf24, #a855f7, #c084fc);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShimmer 6s linear infinite;
}

.tagline {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 6px;
  letter-spacing: .6px;
  font-weight: 500;
}

@keyframes titleShimmer {
  0%   { background-position: 0% }
  100% { background-position: 300% }
}

/* ────────────────────────────────────────────────────────────────
   6. PLAYER CARD
──────────────────────────────────────────────────────────────── */
.player-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  margin: 14px 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(109, 40, 217, .12),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}
/* Purple glow top-right */
.player-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(109,40,217,.22), transparent 65%);
  pointer-events: none;
}
/* Gold glow bottom-left */
.player-card::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -50px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(245,158,11,.10), transparent 65%);
  pointer-events: none;
}

/* ─── Avatar ─── */
.player-top { display: flex; align-items: center; gap: 16px; }

.avatar {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2e1065, #6d28d9, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem;
  flex-shrink: 0;
  border: 2px solid rgba(168, 85, 247, .55);
  box-shadow: 0 0 22px var(--glow), inset 0 1px 0 rgba(255,255,255,.1);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  user-select: none;
}
.avatar:hover {
  transform: scale(1.09) rotate(-4deg);
  box-shadow: 0 0 32px rgba(168, 85, 247, .65);
}

/* Spinning gradient ring */
.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(#a855f7, #f59e0b, #34d399, #a855f7);
  -webkit-mask:
    radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  mask:
    radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  animation: spinRing 5s linear infinite;
  opacity: .7;
}
@keyframes spinRing { to { transform: rotate(360deg); } }

/* ─── Player info ─── */
.player-info { flex: 1; min-width: 0; }

.name-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.player-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .02em;
}
.level-badge {
  background: linear-gradient(90deg, var(--gold), #f97316);
  color: #1a0900;
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: .07em;
  box-shadow: 0 2px 10px var(--gold-glow);
  white-space: nowrap;
}
.player-title {
  font-size: .8rem;
  color: var(--purple-3);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ─── XP Bar ─── */
.xp-section { margin-top: 18px; }

.xp-label-row {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  margin-bottom: 7px;
}
.xp-label {
  color: var(--purple-3);
  font-weight: 700;
  letter-spacing: .04em;
}
.xp-numbers { color: var(--muted); }

.xp-track {
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  height: 13px;
  border: 1px solid rgba(109,40,217,.25);
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #4c1d95, #7c3aed, #c084fc);
  transition: width .75s cubic-bezier(.34, 1.56, .64, 1);
  position: relative;
  overflow: hidden;
}
.xp-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer 2.4s infinite;
}
@keyframes shimmer { 0%{left:-60%} 100%{left:130%} }

.xp-hint {
  font-size: .73rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

/* ─── Stats row ─── */
.stats-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.stat-box {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 6px;
  text-align: center;
  transition: border-color var(--t), background var(--t);
}
.stat-box:hover {
  border-color: rgba(109,40,217,.45);
  background: rgba(109,40,217,.08);
}
.stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.stat-lbl {
  font-size: .64rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ────────────────────────────────────────────────────────────────
   7. TABS
──────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
  margin: 0 0 18px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  transition: all var(--t);
  user-select: none;
  letter-spacing: .03em;
}
.tab.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  box-shadow: 0 2px 16px var(--glow);
}
.tab:not(.active):hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

/* ────────────────────────────────────────────────────────────────
   8. PANELS
──────────────────────────────────────────────────────────────── */
.panel         { display: none; }
.panel.visible { display: block; }

/* ────────────────────────────────────────────────────────────────
   9. SECTION TITLE
──────────────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-title);
  font-size: .85rem;
  color: var(--purple-3);
  letter-spacing: .1em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-2), transparent);
}

/* ────────────────────────────────────────────────────────────────
   10. TASK CARDS
──────────────────────────────────────────────────────────────── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: opacity .35s, border-color var(--t);
}
.task-card:hover { border-color: var(--border-2); }
.task-card.done  { opacity: .45; }
.task-card.done .task-name { text-decoration: line-through; color: var(--muted); }

/* Left colour stripe by type */
.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
}
.task-card.performance::before { background: linear-gradient(180deg, #a855f7, #6d28d9); }
.task-card.activity::before    { background: linear-gradient(180deg, #60a5fa, #1d4ed8); }

/* Check circle */
.check-btn {
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  color: transparent;
  transition: all var(--t);
}
.check-btn:hover {
  border-color: var(--green);
  background: rgba(16,185,129,.12);
  transform: scale(1.12);
}
.task-card.done .check-btn {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.task-body { flex: 1; min-width: 0; }
.task-name {
  font-weight: 700;
  font-size: .97rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.35;
}
.task-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.type-tag {
  font-size: .66rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.type-tag.performance { background: rgba(168,85,247,.2);  color: #c084fc; }
.type-tag.activity    { background: rgba(96,165,250,.2);  color: #93c5fd; }
.xp-badge {
  font-size: .72rem;
  color: var(--gold-2);
  font-weight: 700;
}

/* ────────────────────────────────────────────────────────────────
   11. EMPTY STATE
──────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--muted);
}
.empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 14px;
  opacity: .35;
}
.empty-title {
  font-family: var(--font-title);
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .07em;
}
.empty-sub {
  font-size: .83rem;
  line-height: 1.65;
}
.empty-sub strong { color: var(--purple-3); }

/* ────────────────────────────────────────────────────────────────
   12. BUTTONS
──────────────────────────────────────────────────────────────── */
.btn {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 11px 20px;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .03em;
  transition: all var(--t);
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  position: relative; overflow: hidden;
  cursor: pointer;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px var(--glow); }
.btn:active { transform: translateY(0); }

.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t);
}
.btn:hover::after { background: rgba(255,255,255,.07); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #1a0900;
}
.btn-gold:hover { box-shadow: 0 6px 20px var(--gold-glow); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--purple-3); color: var(--purple-3); box-shadow: none; transform: none; }

.btn-green {
  background: linear-gradient(135deg, #065f46, var(--green));
  color: #fff;
}

.btn-performance {
  background: linear-gradient(135deg, #4c1d95, var(--purple-2));
  color: #fff;
  flex: 1; justify-content: center; text-align: center;
  flex-direction: column; gap: 4px;
  padding: 14px;
}
.btn-performance small { font-weight: 800; color: var(--gold-2); font-size: .8rem; }

.btn-activity {
  background: linear-gradient(135deg, #1e3a8a, var(--blue));
  color: #fff;
  flex: 1; justify-content: center; text-align: center;
  flex-direction: column; gap: 4px;
  padding: 14px;
}
.btn-activity small { font-weight: 800; color: var(--gold-2); font-size: .8rem; }

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 7px 14px; font-size: .79rem; border-radius: 8px; }
.btn-row  { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.type-btn-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

/* ────────────────────────────────────────────────────────────────
   13. QR SCANNER CARD
──────────────────────────────────────────────────────────────── */
.qr-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.qr-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-2), transparent);
}

/* Info banner */
.info-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(109,40,217,.1);
  border: 1px solid rgba(109,40,217,.28);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: .83rem;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 18px;
}
.info-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Video */
#video-wrap {
  display: none;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--border-2);
}
#qr-video  { width: 100%; display: block; }
#qr-canvas { display: none; }

/* Scan overlay & animated frame */
.scan-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.scan-frame {
  width: 200px; height: 200px;
  border: 2px solid var(--purple-2);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.52);
  position: relative;
}
/* Corner accents */
.corner {
  position: absolute;
  width: 22px; height: 22px;
  border-color: var(--purple-3);
  border-style: solid;
}
.tl { top:-2px;    left:-2px;   border-width: 3px 0 0 3px; border-radius: 5px 0 0 0; }
.tr { top:-2px;    right:-2px;  border-width: 3px 3px 0 0; border-radius: 0 5px 0 0; }
.bl { bottom:-2px; left:-2px;   border-width: 0 0 3px 3px; border-radius: 0 0 0 5px; }
.br { bottom:-2px; right:-2px;  border-width: 0 3px 3px 0; border-radius: 0 0 5px 0; }

/* Animated scan beam */
.scan-beam {
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-3), transparent);
  animation: scanBeam 2s ease-in-out infinite;
}
@keyframes scanBeam { 0%,100%{top:4%} 50%{top:92%} }

/* Detected result */
.qr-result {
  display: none;
  margin-top: 16px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: var(--r-md);
  padding: 16px;
  animation: fadeUp .3s ease;
}
.qr-result.show { display: block; }
.qr-result-label {
  font-weight: 800;
  font-size: .75rem;
  color: var(--green-2);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.qr-result-text {
  color: #fff;
  word-break: break-all;
  font-size: .94rem;
  font-weight: 600;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.qr-result-note {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* XP legend */
.xp-legend {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.xp-legend-title {
  font-weight: 700;
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: 10px;
  letter-spacing: .04em;
}
.xp-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.xp-tag {
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.xp-tag.performance { background: rgba(168,85,247,.18); color: #c084fc; }
.xp-tag.activity    { background: rgba(96,165,250,.18); color: #93c5fd; }
.xp-val {
  font-size: .82rem;
  font-weight: 800;
  color: var(--gold-2);
}

/* ────────────────────────────────────────────────────────────────
   14. REWARDS PANEL
──────────────────────────────────────────────────────────────── */
.rewards-intro {
  background: linear-gradient(135deg, rgba(245,158,11,.07), rgba(109,40,217,.07));
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: .84rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
  text-align: center;
}
.rewards-intro strong { color: var(--gold-2); }

/* Earned reward item */
.earned-reward {
  background: var(--card);
  border: 1px solid rgba(245,158,11,.4);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(251,191,36,.03));
  box-shadow: 0 0 20px rgba(245,158,11,.08);
  animation: fadeUp .4s ease;
}
.earned-reward-icon { font-size: 2.2rem; width: 50px; text-align: center; flex-shrink: 0; }
.earned-reward-info { flex: 1; min-width: 0; }
.earned-reward-name { font-weight: 700; color: #fff; font-size: .95rem; }
.earned-reward-sub  { font-size: .77rem; color: var(--muted); margin-top: 3px; }
.earned-reward-badge {
  font-size: .7rem; font-weight: 800;
  padding: 3px 12px; border-radius: 20px;
  background: rgba(245,158,11,.2); color: var(--gold-2);
  white-space: nowrap; letter-spacing: .05em;
}

/* Empty rewards */
.no-rewards {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
}
.no-rewards span { font-size: 2.5rem; display: block; margin-bottom: 10px; opacity: .3; }

/* XP Roadmap rows */
.roadmap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: .83rem;
  transition: all var(--t);
}
.roadmap-row.done {
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.22);
}
.roadmap-row.current {
  background: rgba(109,40,217,.1);
  border: 1px solid rgba(109,40,217,.35);
  box-shadow: 0 0 12px var(--glow);
}
.roadmap-row.future {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  opacity: .5;
}
.roadmap-icon { font-size: 1.15rem; width: 26px; text-align: center; flex-shrink: 0; }
.roadmap-level { font-weight: 800; min-width: 58px; }
.roadmap-row.done    .roadmap-level { color: var(--gold-2); }
.roadmap-row.current .roadmap-level { color: var(--purple-3); }
.roadmap-row.future  .roadmap-level { color: var(--muted); }
.roadmap-xp { flex: 1; color: var(--muted); }
.roadmap-status { font-size: .72rem; font-weight: 800; letter-spacing: .05em; }
.roadmap-row.done    .roadmap-status { color: var(--green-2); }
.roadmap-row.current .roadmap-status { color: var(--purple-3); }
.roadmap-row.future  .roadmap-status { color: var(--muted-2); }

/* ────────────────────────────────────────────────────────────────
   15. MODALS
──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5, 5, 20, .85);
  backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  max-width: 400px; width: 100%;
  text-align: center;
  position: relative; overflow: hidden;
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1);
  box-shadow:
    0 24px 60px rgba(0,0,0,.6),
    0 0 40px var(--glow);
}
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-2), transparent);
}

@keyframes popIn {
  from { transform: scale(.6) translateY(24px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}

.modal-emoji { font-size: 4.2rem; display: block; margin-bottom: 14px; }

.modal-title {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: #fff;
  letter-spacing: .04em;
}
.gradient-text {
  background: linear-gradient(90deg, var(--purple-3), var(--gold-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-body {
  color: var(--text-2);
  font-size: .93rem;
  line-height: 1.7;
  margin-bottom: 20px;
}
.modal-body strong { color: #fff; }
.highlight-text {
  color: var(--purple-3);
  word-break: break-word;
  display: block;
  margin-top: 4px;
}

.modal-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 16px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color var(--t), box-shadow var(--t);
}
.modal-input:focus {
  border-color: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(168,85,247,.2);
}
.modal-input::placeholder { color: var(--muted); }

/* ─── Reward picker grid ─── */
.reward-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}
.reward-option {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px 12px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.reward-option:hover {
  border-color: var(--purple-2);
  background: rgba(168,85,247,.1);
  transform: translateY(-2px);
}
.reward-option.selected {
  border-color: var(--gold-2);
  background: rgba(245,158,11,.1);
  box-shadow: 0 0 16px rgba(245,158,11,.2);
}
.reward-option-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.reward-option-name { font-size: .8rem; font-weight: 800; color: #fff; line-height: 1.3; }
.reward-option-desc { font-size: .7rem; color: var(--muted); margin-top: 3px; }

/* Checkmark for selected */
.reward-check {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px;
  background: var(--gold-2); border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: .65rem; color: #000; font-weight: 900;
}
.reward-option.selected .reward-check { display: flex; }

/* ────────────────────────────────────────────────────────────────
   16. CONFETTI
──────────────────────────────────────────────────────────────── */
#confetti-wrap {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  overflow: hidden;
}
.cp {
  position: absolute;
  top: -5%;
  animation: fall linear forwards;
  border-radius: 3px;
}
@keyframes fall {
  0%   { opacity: 1; transform: rotate(0deg) translateX(0); }
  100% { opacity: 0; top: 110%; transform: rotate(720deg) translateX(70px); }
}

/* ────────────────────────────────────────────────────────────────
   17. TOAST
──────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 12px 26px;
  font-size: .9rem; font-weight: 700;
  color: #fff;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 800;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  max-width: calc(100vw - 40px);
  overflow: hidden; text-overflow: ellipsis;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ────────────────────────────────────────────────────────────────
   18. XP FLOAT ANIMATION
──────────────────────────────────────────────────────────────── */
.xp-float {
  position: fixed;
  pointer-events: none; z-index: 700;
  font-family: var(--font-ui);
  font-weight: 800; font-size: 1.4rem;
  color: var(--gold-2);
  text-shadow: 0 0 14px var(--gold-glow);
  animation: floatUp 1.5s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  40%  { opacity: 1; transform: translateY(-40px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-100px) scale(.8); }
}

/* ────────────────────────────────────────────────────────────────
   19. UTILITIES
──────────────────────────────────────────────────────────────── */
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 20px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────────────────────────────
   20. SCROLLBAR
──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }