/* =============================================
   TEAM21 ACADEMY 4 KIDS — DESIGN SYSTEM
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- TOKENS --- */
:root {
  /* Palette */
  --bg:       #07101f;
  --bg2:      #0c1830;
  --bg3:      #111e35;
  --surface:  rgba(255,255,255,.045);
  --border:   rgba(255,255,255,.09);
  --border2:  rgba(255,255,255,.16);

  --brand:    #4f8ef7;
  --brand2:   #8b5cf6;
  --gold:     #f4b942;
  --gold2:    #ffd166;
  --green:    #34d399;
  --red:      #f87171;
  --pink:     #fb7185;
  --teal:     #2dd4bf;
  --orange:   #fb923c;

  /* Text */
  --text:     #e8f0fe;
  --text2:    #8aa8cc;
  --text3:    #4a6880;

  /* Type */
  --font-display: 'Nunito', system-ui, sans-serif;
  --font-body:    'Space Grotesk', system-ui, sans-serif;
  --font-code:    'JetBrains Mono', 'Courier New', monospace;

  /* Radii */
  --r-sm: .5rem;
  --r-md: .9rem;
  --r-lg: 1.3rem;
  --r-xl: 2rem;

  /* Sidebar */
  --sidebar-w: 240px;
  --topbar-h:  58px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* =============================================
   SCREEN ROUTING
   ============================================= */
.page { display: none; }
.page.active { display: block; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: rgba(79,142,247,.4); border-radius: 3px; }

/* =============================================
   ACADEMY SHELL (sidebar + content)
   ============================================= */
.academy-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* TOP BAR */
.topbar {
  grid-column: 1 / -1;
  background: rgba(7,16,31,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.topbar-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: .6rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.topbar-logo .logo-t21 { color: var(--gold); }
.topbar-search {
  flex: 1; max-width: 340px; margin: 0 auto;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: .4rem 1rem .4rem 2.4rem;
  color: var(--text);
  font-size: .85rem;
  outline: none;
  transition: .2s;
}
.topbar-search input:focus { border-color: var(--brand); background: rgba(79,142,247,.07); }
.topbar-search input::placeholder { color: var(--text3); }
.topbar-search .search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: .85rem;
}
.topbar-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.topbar-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
  cursor: pointer; border: 2px solid rgba(79,142,247,.4);
}
.topbar-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--r-sm);
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  transition: .2s;
}
.topbar-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.topbar-btn.gold { border-color: rgba(244,185,66,.4); color: var(--gold); }
.topbar-btn.gold:hover { background: rgba(244,185,66,.1); }
.hamburger { display: none; padding: .4rem; color: var(--text2); font-size: 1.2rem; }

/* SIDEBAR */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}
.sidebar-section { padding: 1rem .7rem .3rem; }
.sidebar-label {
  font-size: .66rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 0 .5rem;
  margin-bottom: .35rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: var(--r-sm);
  color: var(--text2);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: .18s;
  margin-bottom: .1rem;
  border: 1px solid transparent;
}
.sidebar-item:hover { background: var(--surface); color: var(--text); }
.sidebar-item.active {
  background: rgba(79,142,247,.14);
  border-color: rgba(79,142,247,.25);
  color: #7eb3ff;
  font-weight: 700;
}
.sidebar-item .si-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-item .si-badge {
  margin-left: auto;
  font-size: .62rem;
  font-weight: 700;
  padding: .12rem .4rem;
  border-radius: .35rem;
  background: rgba(79,142,247,.2);
  color: var(--brand);
}
.sidebar-item .si-badge.new { background: rgba(52,211,153,.2); color: var(--green); }
.sidebar-divider { height: 1px; background: var(--border); margin: .5rem .7rem; }
.sidebar-bottom { margin-top: auto; padding: .8rem .7rem; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .6rem; border-radius: var(--r-sm);
  cursor: pointer; transition: .2s;
}
.sidebar-user:hover { background: var(--surface); }
.sidebar-user .su-av {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar-user .su-name { font-size: .82rem; font-weight: 600; color: var(--text); }
.sidebar-user .su-level { font-size: .7rem; color: var(--text3); }

/* MAIN CONTENT */
.main-content {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: calc(100vh - var(--topbar-h));
}
.content-pad { padding: 2rem 2rem 3rem; max-width: 1200px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--r-xl);
  font-weight: 700;
  font-family: var(--font-body);
  transition: all .25s;
  cursor: pointer;
  white-space: nowrap;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  padding: .7rem 1.8rem;
  font-size: .9rem;
  box-shadow: 0 4px 20px rgba(79,142,247,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,142,247,.45); }
.btn-gold {
  background: linear-gradient(135deg, #e8a020, var(--gold2));
  color: #1a0e00;
  padding: .7rem 1.8rem;
  font-size: .9rem;
  box-shadow: 0 4px 20px rgba(244,185,66,.25);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(244,185,66,.4); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: .65rem 1.5rem;
  font-size: .88rem;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border2); }
.btn-green {
  background: linear-gradient(135deg, #059669, var(--green));
  color: #fff;
  padding: .7rem 1.8rem;
  font-size: .9rem;
}
.btn-green:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(52,211,153,.35); }
.btn-sm { padding: .4rem 1rem; font-size: .78rem; border-radius: var(--r-md); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: .6rem; background: var(--surface); border: 1px solid var(--border); color: var(--text2); font-size: 1rem; }
.btn-icon:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all .25s;
}
.card:hover { border-color: var(--border2); }
.card-lift:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.35); }

/* =============================================
   BADGES / TAGS
   ============================================= */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 700;
  padding: .18rem .55rem;
  border-radius: .4rem;
  white-space: nowrap;
}
.badge-blue   { background: rgba(79,142,247,.18); color: #7eb3ff; }
.badge-purple { background: rgba(139,92,246,.18); color: #c084fc; }
.badge-green  { background: rgba(52,211,153,.18); color: #34d399; }
.badge-gold   { background: rgba(244,185,66,.18); color: var(--gold); }
.badge-red    { background: rgba(248,113,113,.18); color: #f87171; }
.badge-teal   { background: rgba(45,212,191,.18); color: var(--teal); }
.badge-orange { background: rgba(251,146,60,.18); color: var(--orange); }
.badge-pink   { background: rgba(251,113,133,.18); color: var(--pink); }

/* =============================================
   PROGRESS
   ============================================= */
.progress-track {
  height: 6px; background: rgba(255,255,255,.07);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .6s ease;
}
.progress-fill.gold { background: linear-gradient(90deg, #e8a020, var(--gold2)); }
.progress-fill.green { background: linear-gradient(90deg, #059669, var(--green)); }

/* =============================================
   PAGE HEADERS
   ============================================= */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.page-header .eyebrow {
  font-size: .72rem; font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .4rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: .35rem;
}
.page-header p { color: var(--text2); font-size: .95rem; max-width: 560px; }
.page-header .ph-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

/* =============================================
   GRID HELPERS
   ============================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1.2rem; }
.grid-auto-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.2rem; }

/* =============================================
   SECTION LABELS
   ============================================= */
.section-label {
  font-size: .72rem; font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .8rem;
  display: flex; align-items: center; gap: .6rem;
}
.section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--border);
}

/* =============================================
   STAT BOX
   ============================================= */
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.3rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.stat-box .sb-icon { font-size: 1.4rem; margin-bottom: .2rem; }
.stat-box .sb-val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-box .sb-label { font-size: .75rem; color: var(--text3); font-weight: 600; }
.stat-box .sb-trend { font-size: .72rem; color: var(--green); font-weight: 700; margin-top: .2rem; }

/* =============================================
   CODE BLOCK
   ============================================= */
.code-block {
  background: #030810;
  border: 1px solid rgba(79,142,247,.2);
  border-radius: var(--r-md);
  padding: 1.1rem 1.3rem;
  font-family: var(--font-code);
  font-size: .82rem;
  color: #93c5fd;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
  position: relative;
}
.code-block .cb-lang {
  position: absolute; top: .6rem; right: .8rem;
  font-size: .62rem; font-weight: 700;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: .08em;
}
.code-block .kw  { color: #c084fc; }
.code-block .str { color: #86efac; }
.code-block .fn  { color: #fbbf24; }
.code-block .cm  { color: #3b5278; }
.code-block .num { color: #fb923c; }
.code-block .tag { color: #f87171; }
.code-block .atr { color: #93c5fd; }

/* =============================================
   QUIZ
   ============================================= */
.quiz-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .7rem 1rem;
  margin-bottom: .45rem;
  cursor: pointer;
  color: var(--text2);
  font-size: .88rem;
  display: flex; align-items: center; gap: .7rem;
  transition: .2s;
}
.quiz-option:hover { background: rgba(79,142,247,.08); border-color: rgba(79,142,247,.3); color: var(--text); }
.quiz-option.correct { background: rgba(52,211,153,.1); border-color: var(--green); color: var(--green); pointer-events: none; }
.quiz-option.wrong   { background: rgba(248,113,113,.1); border-color: var(--red); color: var(--red); pointer-events: none; }
.quiz-option.disabled { pointer-events: none; opacity: .5; }
.quiz-letter {
  width: 26px; height: 26px; border-radius: .4rem;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; flex-shrink: 0;
}

/* =============================================
   NOTIFICATIONS
   ============================================= */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  padding: .85rem 1.2rem;
  font-size: .87rem;
  font-weight: 600;
  color: var(--text);
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: slideInToast .3s ease, fadeOutToast .3s ease 2.7s forwards;
  max-width: 320px;
  display: flex; align-items: center; gap: .6rem;
}
@keyframes slideInToast { from { transform: translateX(120%); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes fadeOutToast { to { opacity:0; transform: translateX(20px); } }

/* =============================================
   CERTIFICATE
   ============================================= */
.cert-paper {
  background: linear-gradient(160deg, #fffdf5 0%, #fff8e0 40%, #f0f6ff 100%);
  border: 3px solid #c8a800;
  border-radius: 1.4rem;
  padding: 3rem 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  color: #1a0f00;
  max-width: 760px;
  margin: 0 auto;
}
.cert-corner { position: absolute; width: 52px; height: 52px; border: 2.5px solid #c8a800; }
.cert-corner.tl { top:16px; left:16px; border-right:none; border-bottom:none; border-radius:3px 0 0 0; }
.cert-corner.tr { top:16px; right:16px; border-left:none; border-bottom:none; border-radius:0 3px 0 0; }
.cert-corner.bl { bottom:16px; left:16px; border-right:none; border-top:none; border-radius:0 0 0 3px; }
.cert-corner.br { bottom:16px; right:16px; border-left:none; border-top:none; border-radius:0 0 3px 0; }
.cert-watermark {
  position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  font-size:9rem; color:#c8a800; opacity:.04;
  font-family:var(--font-display); font-weight:900;
  pointer-events:none; white-space:nowrap;
}
.cert-inner-border {
  position:absolute; inset:12px;
  border:1px solid rgba(200,168,0,.3);
  border-radius:1rem; pointer-events:none;
}

/* =============================================
   ANIMATIONS
   ============================================= */
.float { animation: floatY 3.5s ease-in-out infinite alternate; }
@keyframes floatY { from{transform:translateY(0)} to{transform:translateY(-10px)} }

.pulse { animation: pulseScale 2s ease-in-out infinite; }
@keyframes pulseScale { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }

.glow-brand { box-shadow: 0 0 20px rgba(79,142,247,.4); }

.confetti-piece {
  position: fixed; pointer-events: none;
  animation: confettiFall 3.5s ease-in forwards;
  z-index: 9999; border-radius: 2px;
}
@keyframes confettiFall {
  0%  { transform: translateY(-30px) rotate(0deg); opacity:1; }
  100%{ transform: translateY(105vh) rotate(720deg); opacity:0; }
}

/* =============================================
   LANDING PAGE (pre-login)
   ============================================= */
#page-landing {
  background: var(--bg);
  min-height: 100vh;
}
.landing-nav {
  position: sticky; top:0; z-index:100;
  background: rgba(7,16,31,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex; align-items: center; gap: 1.2rem;
}
.landing-nav .ln-logo {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 900;
}
.landing-nav .ln-logo span { color: var(--gold); }
.landing-nav .ln-links { display: flex; gap: .2rem; margin: 0 auto; }
.landing-nav .ln-link {
  padding: .38rem .9rem;
  border-radius: var(--r-sm);
  color: var(--text2); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: .18s;
}
.landing-nav .ln-link:hover { color: var(--text); background: var(--surface); }
.ln-right { display: flex; gap: .6rem; align-items: center; margin-left: auto; }

/* HERO */
.hero-section {
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 60% at 30% 40%, rgba(79,142,247,.1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 75% 60%, rgba(139,92,246,.1) 0%, transparent 70%);
}
.hero-stars { position:absolute; inset:0; pointer-events:none; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(244,185,66,.1);
  border: 1px solid rgba(244,185,66,.3);
  border-radius: var(--r-xl);
  padding: .35rem 1.1rem;
  font-size: .75rem; font-weight: 800;
  color: var(--gold);
  letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 1.3rem;
}
.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: .9rem;
  background: linear-gradient(135deg, #fff 0%, #b4d4ff 40%, #d4b4ff 70%, #ffb4c8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: var(--text2);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; margin-bottom: 3rem; }

/* AGE TILES */
.age-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}
.age-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1rem 1.2rem;
  cursor: pointer;
  transition: all .3s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.age-tile::before {
  content:''; position:absolute; inset:0; opacity:0; transition:.3s;
  border-radius: var(--r-lg);
}
.age-tile:hover { transform: translateY(-6px); border-color: var(--border2); }
.age-tile.a1:hover::before { opacity:1; background: radial-gradient(ellipse at top,rgba(251,146,60,.12),transparent 70%); }
.age-tile.a2:hover::before { opacity:1; background: radial-gradient(ellipse at top,rgba(52,211,153,.12),transparent 70%); }
.age-tile.a3:hover::before { opacity:1; background: radial-gradient(ellipse at top,rgba(79,142,247,.12),transparent 70%); }
.age-tile.a4:hover::before { opacity:1; background: radial-gradient(ellipse at top,rgba(139,92,246,.12),transparent 70%); }
.age-tile .at-icon {
  font-size: 2.4rem; margin-bottom: .7rem;
  display: block; position: relative; z-index:1;
}
.age-tile .at-badge {
  font-size: .68rem; font-weight: 700; padding: .18rem .6rem;
  border-radius: var(--r-xl); margin-bottom: .5rem; display: inline-block;
  position: relative; z-index:1;
}
.age-tile h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 800; margin-bottom: .3rem; position:relative;z-index:1; }
.age-tile p { font-size: .78rem; color: var(--text2); line-height: 1.55; margin-bottom: .7rem; position:relative;z-index:1; }
.at-langs { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; position:relative;z-index:1; }
.at-pill {
  font-size: .65rem; font-weight: 700;
  padding: .14rem .45rem; border-radius: .35rem;
}
.at-pill-scratch { background: rgba(249,115,22,.2); color: #fb923c; }
.at-pill-block   { background: rgba(139,92,246,.2); color: #c084fc; }
.at-pill-python  { background: rgba(52,211,153,.2); color: #34d399; }
.at-pill-web     { background: rgba(236,72,153,.2); color: #f472b6; }
.at-pill-c       { background: rgba(45,212,191,.2); color: #2dd4bf; }
.at-pill-java    { background: rgba(251,146,60,.2); color: #fb923c; }

/* =============================================
   DASHBOARD
   ============================================= */
.welcome-banner {
  background: linear-gradient(135deg, rgba(79,142,247,.15), rgba(139,92,246,.1));
  border: 1px solid rgba(79,142,247,.2);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.8rem;
  display: flex; align-items: center; gap: 1.2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.welcome-banner .wb-text h2 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 900;
  margin-bottom: .2rem;
}
.welcome-banner .wb-text p { color: var(--text2); font-size: .88rem; }
.welcome-banner .wb-emoji { font-size: 3rem; }
.welcome-banner .wb-actions { margin-left: auto; }

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
}
.course-card:hover { transform: translateY(-4px); border-color: var(--border2); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.cc-banner {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem;
  position: relative;
}
.cc-banner.scratch  { background: linear-gradient(135deg,#f97316,#ef4444); }
.cc-banner.python   { background: linear-gradient(135deg,#1d4ed8,#0891b2); }
.cc-banner.web      { background: linear-gradient(135deg,#be185d,#7c3aed); }
.cc-banner.clang    { background: linear-gradient(135deg,#065f46,#059669); }
.cc-banner.java     { background: linear-gradient(135deg,#b91c1c,#c2410c); }
.cc-banner.cpp      { background: linear-gradient(135deg,#1e40af,#065f46); }
.cc-banner.robotics { background: linear-gradient(135deg,#374151,#1f2937); }
.cc-banner.blockly  { background: linear-gradient(135deg,#5b21b6,#1e3a8a); }
.cc-banner.ai       { background: linear-gradient(135deg,#312e81,#701a75); }
.cc-badge {
  position:absolute; top:.5rem; right:.5rem;
  background:rgba(0,0,0,.45); backdrop-filter:blur(6px);
  border-radius: .4rem;
  font-size: .62rem; font-weight:700; color:#fff;
  padding: .18rem .5rem;
}
.cc-body { padding: 1rem 1.1rem 1.2rem; }
.cc-body h3 { font-family:var(--font-display); font-size:.97rem; font-weight:800; margin-bottom:.3rem; }
.cc-body p { font-size:.78rem; color:var(--text2); margin-bottom:.8rem; line-height:1.55; }
.cc-meta { display:flex; gap:.3rem; flex-wrap:wrap; align-items:center; }
.cc-progress { margin-top:.8rem; }
.cc-progress-label { display:flex; justify-content:space-between; font-size:.7rem; color:var(--text3); margin-bottom:.3rem; }

/* =============================================
   LAB
   ============================================= */
.lab-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
.lab-editor-wrap {
  background: #030810;
  border: 1px solid rgba(79,142,247,.2);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.lab-editor-toolbar {
  background: #060d1e;
  border-bottom: 1px solid rgba(79,142,247,.15);
  padding: .6rem 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.lab-editor-toolbar .dot { width:10px;height:10px;border-radius:50%; }
.lab-editor-toolbar .dot.r{background:#ef4444;}
.lab-editor-toolbar .dot.y{background:#fbbf24;}
.lab-editor-toolbar .dot.g{background:#34d399;}
.lab-file-tab {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(79,142,247,.12);
  border: 1px solid rgba(79,142,247,.2);
  border-radius: .4rem;
  padding: .25rem .7rem;
  font-family: var(--font-code);
  font-size: .75rem; color: var(--brand);
  font-weight: 600;
}
.lab-run-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #059669, var(--green));
  color:#fff; border:none;
  border-radius:.5rem;
  padding: .38rem .9rem;
  font-size: .8rem; font-weight:700;
  cursor:pointer; transition:.2s;
  display:flex; align-items:center; gap:.35rem;
}
.lab-run-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(52,211,153,.4); }
.lab-editor {
  padding: 1.2rem;
  min-height: 260px;
  font-family: var(--font-code);
  font-size: .85rem;
  line-height: 1.8;
  color: #93c5fd;
  outline: none;
  white-space: pre;
  overflow-x: auto;
}
.lab-output {
  background: #020609;
  border-top: 1px solid rgba(79,142,247,.15);
  padding: .8rem 1.2rem;
  font-family: var(--font-code);
  font-size: .82rem;
  color: var(--green);
  min-height: 80px;
  max-height: 160px;
  overflow-y: auto;
}
.lab-output-label {
  font-size: .65rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: .4rem;
}
.lab-panel {
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 1rem;
}
.lab-panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.lab-panel-header {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; gap: .5rem;
}
.lab-panel-body { padding: .9rem 1rem; }
.lab-hint {
  background: rgba(244,185,66,.07);
  border: 1px solid rgba(244,185,66,.2);
  border-radius: var(--r-sm);
  padding: .7rem .9rem;
  font-size: .8rem; color: #fcd34d;
  margin-bottom: .6rem;
  line-height:1.55;
}
.lab-hint::before { content:'💡 '; font-style:normal; }
.lab-challenge-step {
  display: flex; align-items: flex-start; gap: .6rem;
  margin-bottom: .6rem; font-size: .82rem; color: var(--text2);
}
.lab-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(79,142,247,.2); color: var(--brand);
  font-size: .65rem; font-weight: 800;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; margin-top:.1rem;
}
.lab-step-num.done { background: rgba(52,211,153,.2); color: var(--green); }

/* =============================================
   LESSON VIEW
   ============================================= */
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
.lesson-main { display: flex; flex-direction: column; gap: 1.2rem; }
.lesson-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}
.lesson-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 800;
  margin-bottom: .7rem;
  display:flex; align-items:center; gap:.5rem;
}
.lesson-card p { color: var(--text2); line-height:1.75; font-size:.92rem; margin-bottom:.8rem; }
.lesson-card p:last-child { margin-bottom:0; }

.fun-fact {
  background: rgba(244,185,66,.07);
  border: 1px solid rgba(244,185,66,.18);
  border-left: 3px solid var(--gold);
  border-radius: .4rem var(--r-sm) var(--r-sm) .4rem;
  padding: .8rem 1rem;
  font-size: .83rem; color: #fcd34d;
  line-height:1.6;
}
.fun-fact strong { color: var(--gold2); }

.challenge-box {
  background: rgba(139,92,246,.07);
  border: 1px solid rgba(139,92,246,.2);
  border-left: 3px solid var(--brand2);
  border-radius: .4rem var(--r-sm) var(--r-sm) .4rem;
  padding: .9rem 1rem;
}
.challenge-box h4 { font-size:.88rem; font-weight:700; color:#c084fc; margin-bottom:.3rem; }
.challenge-box p { font-size:.8rem; color:#9a70cc; line-height:1.6; margin:0; }

.lesson-step-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.2rem;
  gap: .8rem; flex-wrap: wrap;
}
.lesson-step-progress {
  display: flex; gap: .4rem; align-items: center; flex: 1;
  justify-content: center;
}
.step-dot {
  height: 6px; width: 28px; border-radius: 3px;
  background: rgba(255,255,255,.07); transition: .4s;
}
.step-dot.done { background: var(--brand); }
.step-dot.active { background: linear-gradient(90deg,var(--brand),var(--brand2)); }

/* =============================================
   CERTIFICATION
   ============================================= */
.test-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.3rem;
  margin-bottom: 1rem;
}
.test-card .tc-num { font-size:.7rem; font-weight:700; color:var(--brand); letter-spacing:.06em; text-transform:uppercase; margin-bottom:.5rem; }
.test-card .tc-q { font-size:.95rem; font-weight:600; color:var(--text); margin-bottom:.9rem; line-height:1.5; }
.test-opt {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .8rem; border-radius: var(--r-sm);
  cursor: pointer; border: 1px solid transparent;
  transition: .2s; margin-bottom:.3rem;
}
.test-opt:hover { background: rgba(255,255,255,.05); border-color: var(--border); }
.test-opt.selected { background: rgba(79,142,247,.1); border-color: rgba(79,142,247,.3); }
.test-opt input { accent-color: var(--brand); width:15px; height:15px; flex-shrink:0; }
.test-opt label { font-size:.87rem; color:var(--text2); cursor:pointer; }
.test-opt.selected label { color: var(--text); }

.timer-track { background: rgba(255,255,255,.07); border-radius: 1rem; height:8px; overflow:hidden; margin-bottom:1.5rem; }
.timer-fill  { height:100%; border-radius:1rem; background:linear-gradient(90deg,var(--green),var(--brand)); transition:width 1s linear; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width:900px) {
  .academy-shell { grid-template-columns: 1fr; }
  .sidebar { display:none; position:fixed; left:0; top:var(--topbar-h); height:calc(100vh - var(--topbar-h)); width:var(--sidebar-w); z-index:150; }
  .sidebar.open { display:flex; }
  .hamburger { display:flex; }
  .lab-layout { grid-template-columns:1fr; }
  .lesson-layout { grid-template-columns:1fr; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .content-pad { padding:1.2rem 1rem 2rem; }
}
@media (max-width:600px) {
  .grid-2,.grid-3,.grid-4 { grid-template-columns:1fr; }
  .age-tiles { grid-template-columns: repeat(2,1fr); }
  .hero-h1 { font-size:2rem; }
  .cert-paper { padding:2rem 1.5rem; }
}
@media print {
  .academy-shell { display:block!important; }
  .topbar,.sidebar,.no-print { display:none!important; }
  .cert-paper { border:3px solid #c8a800!important; box-shadow:none!important; }
  body { background:#fff; }
}

/* =============================================
   v2 ADDITIONS — TIME CAPSULE / HISTORY CARDS
   ============================================= */
.history-card {
  position: relative;
  background: linear-gradient(135deg, rgba(244,185,66,.06), rgba(139,92,246,.05));
  border: 1px solid rgba(244,185,66,.25);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.5rem 1.3rem;
  overflow: hidden;
}
.history-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(244,185,66,.03) 0, rgba(244,185,66,.03) 2px, transparent 2px, transparent 14px);
  pointer-events: none;
}
.history-ribbon {
  position: absolute; top: 0; right: 1.2rem;
  background: linear-gradient(135deg, #e8a020, var(--gold2));
  color: #1a0e00;
  font-size: .62rem; font-weight: 800;
  letter-spacing: .08em;
  padding: .3rem .8rem;
  border-radius: 0 0 .5rem .5rem;
  box-shadow: 0 3px 10px rgba(244,185,66,.3);
}
.history-content {
  display: flex; align-items: flex-start; gap: 1rem;
  position: relative; z-index: 1;
  padding-top: .4rem;
}
.history-year {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 900;
  color: var(--gold);
  min-width: 70px;
  line-height: 1.1;
  flex-shrink: 0;
  text-align: center;
  padding-top: .2rem;
}
.history-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(244,185,66,.3));
}
.history-text h4 {
  font-family: var(--font-display);
  font-size: .92rem; font-weight: 800;
  color: #fcd34d;
  margin-bottom: .35rem;
}
.history-text p {
  font-size: .82rem; color: #d4b878;
  line-height: 1.6; margin: 0;
}

/* =============================================
   v2 ADDITIONS — CONTINUE BANNER
   ============================================= */
.continue-banner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: linear-gradient(135deg, rgba(52,211,153,.12), rgba(79,142,247,.1));
  border: 1px solid rgba(52,211,153,.3);
  border-radius: var(--r-lg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all .25s;
}
.continue-banner:hover { transform: translateY(-2px); border-color: rgba(52,211,153,.5); }
.continue-banner .cb-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  animation: floatY 2.5s ease-in-out infinite alternate;
}
.continue-banner .cb-text { flex: 1; min-width: 0; }
.continue-banner .cb-label {
  font-size: .68rem; font-weight: 700; color: var(--green);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem;
}
.continue-banner .cb-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--text); }
.continue-banner .cb-sub { font-size: .78rem; color: var(--text2); margin-top: .1rem; }
.continue-banner .cb-arrow { font-size: 1.4rem; color: var(--green); flex-shrink: 0; }

/* =============================================
   v2 ADDITIONS — LAB STARS & REWARD POPUP
   ============================================= */
.lab-stars-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(244,185,66,.06);
  border: 1px solid rgba(244,185,66,.2);
  border-radius: var(--r-md);
  padding: .8rem 1rem;
  margin-bottom: .8rem;
}
.lab-stars-bar .lsb-label { font-size: .78rem; color: var(--gold); font-weight: 700; }

@keyframes starPop {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.lab-step-num.done {
  background: rgba(52,211,153,.25) !important;
  color: var(--green) !important;
}
.lab-step-num.done::after { content: ' ✓'; }

/* =============================================
   v2 ADDITIONS — FEATURED/FLAGSHIP COURSE GLOW
   ============================================= */
.cc-banner.ai {
  background: linear-gradient(135deg, #4c1d95, #1e3a8a, #312e81);
  background-size: 200% 200%;
  animation: aiGradient 6s ease infinite;
}
@keyframes aiGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.at-pill-ai { background: rgba(168,85,247,.2); color: #c084fc; }

/* =============================================
   v2 ADDITIONS — MISC POLISH
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 37%, rgba(255,255,255,.04) 63%);
  background-size: 400% 100%;
  animation: skeletonLoad 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeletonLoad { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

