/* ===================================================================
   KOSMIQ — retro-arcade cosmic pixel theme
   =================================================================== */

@font-face {
  font-family: 'PressStart';
  src: url('../assets/fonts/PressStart2P-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'VT323';
  src: url('../assets/fonts/VT323-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg0:#05030f;
  --bg1:#0b0830;
  --bg2:#160a3a;
  --panel:#171042;
  --panel2:#221662;
  --panel-edge:#3a2a8f;
  --ink:#eaf0ff;
  --ink-dim:#9aa6e0;
  --cyan:#46e5ff;
  --cyan-dk:#1597b8;
  --magenta:#ff4fd8;
  --gold:#ffd43b;
  --gold-dk:#c79a16;
  --green:#58cc02;
  --green-dk:#3f9400;
  --red:#ff5470;
  --red-dk:#c2293f;
  --violet:#9d6bff;
  --shadow: 0 6px 0 rgba(0,0,0,0.45);
}

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

html,body{ height:100%; }
body{
  font-family:'VT323', monospace;
  background:
    radial-gradient(1200px 700px at 70% -10%, #2a1170 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #15235e 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 100%);
  color:var(--ink);
  overflow:hidden;
  image-rendering:pixelated;
  letter-spacing:.5px;
  -webkit-font-smoothing:none;
  user-select:none;
}

/* twinkling pixel starfield behind everything */
#starfield-bg{ position:fixed; inset:0; z-index:0; pointer-events:none; }

/* subtle CRT scanlines */
body::after{
  content:""; position:fixed; inset:0; z-index:9999; pointer-events:none;
  background:repeating-linear-gradient(0deg, rgba(0,0,0,0.0) 0px, rgba(0,0,0,0.0) 2px, rgba(0,0,0,0.10) 3px, rgba(0,0,0,0.0) 4px);
  mix-blend-mode:multiply; opacity:.55;
}

.pix{ font-family:'PressStart', monospace; }

#app{
  position:relative; z-index:1;
  height:100%; width:100%;
  max-width:780px; margin:0 auto;
  display:flex; flex-direction:column;
}

/* ---------- TOP BAR ---------- */
#topbar{
  display:flex; align-items:stretch; gap:8px;
  padding:8px 10px 6px;
  flex:0 0 auto;
}
#topbar.hidden{ display:none; }

/* avatar square (left) */
.tb-avatar{
  width:54px; height:54px; flex:0 0 54px;
  border:2px solid var(--panel-edge);
  border-radius:10px;
  background:var(--panel);
  overflow:hidden;
  cursor:pointer;
  image-rendering:pixelated;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset;
}
.tb-avatar img{
  width:100%; height:100%; object-fit:cover;
  image-rendering:pixelated;
  display:block;
}

/* stats card (right) — single rounded bar containing everything */
.tb-card{
  flex:1 1 auto; min-width:0;
  display:flex; align-items:center; gap:6px;
  padding:5px 6px;
  background:var(--panel);
  border:2px solid var(--panel-edge);
  border-radius:12px;
}

.tb-pill{
  display:flex; align-items:center; gap:3px;
  font-family:'PressStart'; font-size:8px; line-height:1;
  border:2px solid var(--panel-edge);
  border-radius:8px;
  padding:5px 6px;
  background: rgba(0,0,0,0.25);
  flex:0 0 auto;
}
.tb-pill .ico{
  font-size:11px;
  filter:drop-shadow(0 0 4px currentColor);
}
.tb-pill b{ color:#fff; }
.tb-pill.tb-streak{ color:var(--gold); }
.tb-pill.tb-gems{ color:var(--cyan); }
.tb-pill.tb-hearts{ color:var(--red); }

/* XP block (flex) */
.tb-xp{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px; padding:0 2px; }
.tb-xp-top{
  display:flex; align-items:center; gap:6px;
  font-family:'PressStart'; font-size:8px; line-height:1;
  color:var(--ink-dim);
}
.tb-lv b{ color:#fff; }
.tb-name{
  color:#fff;
  flex:1 1 auto; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tb-xp-num{ color:var(--gold); flex:0 0 auto; font-size:7px; }
.tb-bar{
  height:8px; background:#0a0726;
  border:2px solid var(--panel-edge);
  border-radius:6px; overflow:hidden; position:relative;
}
.tb-bar > i{
  display:block; height:100%; width:0%;
  background:linear-gradient(90deg, var(--gold), #fff2a8);
  box-shadow:0 0 8px var(--gold);
  transition:width .5s cubic-bezier(.2,.9,.2,1);
}

/* topbar mini buttons (log + settings gear) */
.tb-mini{
  flex:0 0 auto;
  width:24px; height:24px;
  display:grid; place-items:center;
  background: rgba(0,0,0,0.25);
  border:2px solid var(--panel-edge);
  border-radius:7px;
  color:var(--ink-dim);
  font-size:12px; line-height:1;
  cursor:pointer;
  padding:0;
  transition: color .15s, transform .15s;
}
.tb-mini:hover{ color:#fff; }
.tb-gear:hover{ transform:rotate(20deg); }

@media (max-width: 480px){
  #topbar{ padding:6px 6px 4px; gap:5px; }
  .tb-avatar{ width:44px; height:44px; flex-basis:44px; border-radius:8px; }
  .tb-card{ gap:4px; padding:4px 4px; border-radius:10px; }
  .tb-pill{ font-size:7px; padding:3px 4px; gap:2px; border-width:1px; border-radius:6px; }
  .tb-pill .ico{ font-size:9px; }
  .tb-xp{ gap:2px; padding:0 1px; }
  .tb-xp-top{ font-size:7px; gap:4px; }
  .tb-xp-num{ font-size:6px; }
  .tb-bar{ height:6px; border-width:1px; }
  .tb-mini{ width:20px; height:20px; font-size:10px; border-radius:5px; border-width:1px; }
  .tb-name{ display:none; }
}
@media (max-width: 340px){
  .tb-lv{ display:none; }
}

/* Stargazer's Log dropdown */
.log-dropdown{
  position:fixed; z-index:1000;
  display:flex; flex-direction:column; gap:8px;
  padding:10px;
  background:linear-gradient(180deg, var(--panel), var(--panel2));
  border:2px solid var(--panel-edge);
  border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.55);
  max-height: calc(100vh - 80px);
  overflow-y:auto;
  animation: logDropIn .15s ease-out;
}
.log-dropdown .home-side{ margin:0; gap:8px; }
@keyframes logDropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }


/* ---------- SCREENS ---------- */
.screen{
  flex:1 1 auto; min-height:0;
  overflow-y:auto; overflow-x:hidden;
  padding:6px 16px 26px;
  display:none;
  scrollbar-width:thin; scrollbar-color:var(--violet) transparent;
}
.screen::-webkit-scrollbar{ width:8px; }
.screen::-webkit-scrollbar-thumb{ background:var(--violet); border-radius:4px; }
.screen.active{ display:block; animation:fadein .25s ease; }
@keyframes fadein{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

/* ---------- BUTTONS ---------- */
.btn{
  font-family:'PressStart'; font-size:12px;
  color:#06121a; background:var(--cyan);
  border:none; border-radius:14px;
  padding:15px 18px; cursor:pointer;
  box-shadow:0 5px 0 var(--cyan-dk);
  transition:transform .05s, box-shadow .05s, filter .1s;
  text-transform:uppercase; letter-spacing:1px;
  width:100%;
}
.btn:hover{ filter:brightness(1.08); }
.btn:active{ transform:translateY(5px); box-shadow:0 0 0 var(--cyan-dk); }
.btn.green{ background:var(--green); box-shadow:0 5px 0 var(--green-dk); color:#06210a; }
.btn.gold{ background:var(--gold); box-shadow:0 5px 0 var(--gold-dk); color:#241a00; }
.btn.red{ background:var(--red); box-shadow:0 5px 0 var(--red-dk); color:#2a0008; }
.btn.ghost{ background:transparent; color:var(--ink-dim); box-shadow:none; border:2px solid var(--panel-edge); }
.btn.ghost:active{ transform:translateY(2px); }
.btn:disabled{ filter:grayscale(.6) brightness(.7); cursor:not-allowed; }
.btn.sm{ width:auto; font-size:10px; padding:11px 14px; }
.btn.steel{ background:#8fa4c4; box-shadow:0 5px 0 #445775; color:#0a1220; }

/* ---------- SPLASH CHOOSER ---------- */
#splash .start-wrap.chooser{ width:300px; display:flex; flex-direction:column; gap:16px; }
#splash .choose-btn{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 14px 16px; }
#splash .choose-btn .choose-title{ font-family:'PressStart'; font-size:14px; letter-spacing:1px; }
#splash .choose-btn .choose-sub{
  font-family:'VT323'; font-size:16px; text-transform:none; letter-spacing:0;
  opacity:.85; line-height:1.1;
}

/* ---------- ASTRONOMER SCREEN ---------- */
#screen-astronomer{
  background:radial-gradient(900px 700px at 50% 20%, #0d1a2e 0%, #05070f 70%);
  color:#c7d4e6;
}
#screen-astronomer.active{ display:flex; }
.astro-wrap{
  margin:auto; text-align:center; padding:40px 24px; max-width:520px;
  display:flex; flex-direction:column; align-items:center; gap:16px;
}
.astro-title{
  font-family:'PressStart'; font-size:26px; letter-spacing:3px;
  color:#dfe8f5; text-shadow:0 0 10px rgba(140,180,230,.35);
}
.astro-sub{ font-family:'VT323'; font-size:20px; color:#8ea3c2; margin-top:-6px; }
.astro-badge{
  font-family:'PressStart'; font-size:10px; letter-spacing:2px;
  color:#5f7fa8; border:2px solid #26364f; padding:8px 12px; border-radius:4px;
  background:rgba(20,32,54,.5); margin-top:8px;
}
.astro-coming{
  font-family:'PressStart'; font-size:18px; color:#e6eefb;
  margin-top:12px; letter-spacing:2px;
}
.astro-note{ font-family:'VT323'; font-size:18px; color:#7f93b3; max-width:380px; }
.astro-back{ margin-top:24px; width:auto; padding:12px 22px;
  color:#a9bcd8; border-color:#324662;
}
.astro-verify-btn{
  margin-top:14px; padding:14px 18px; width:100%; max-width:360px;
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.astro-verified-ribbon{
  font-family:'VT323'; font-size:16px; color:#dbe7ff;
  background:linear-gradient(90deg,#1e3a63,#26527a);
  border:2px solid #4c78a8; padding:8px 14px; border-radius:4px; letter-spacing:1px;
}
.astro-status{ font-family:'VT323'; font-size:18px; color:#8ea3c2; min-height:20px; }
.astro-status.ok{ color:#7de6a0; }
.astro-status.err{ color:#ff8a8a; }

/* Astronomer modal (custom, WebView-safe) */
#astro-modal-host{ position:fixed; inset:0; z-index:900; }
.astro-modal-back{
  position:absolute; inset:0; background:rgba(4,7,16,.78);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.astro-modal-card{
  background:#0e1830; border:3px solid #2a4270; border-radius:6px;
  padding:22px; max-width:440px; width:100%; color:#c7d4e6;
  box-shadow:0 0 30px rgba(60,100,160,.35);
}
.astro-modal-title{
  font-family:'PressStart'; font-size:14px; letter-spacing:2px;
  color:#dfe8f5; margin:0 0 10px;
}
.astro-modal-body{ font-family:'VT323'; font-size:19px; line-height:1.35; color:#a9bcd8; }
.astro-modal-actions{ margin-top:18px; display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

/* ---------- SPLASH ---------- */
#splash{
  position:fixed; inset:0; z-index:500;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:22px; text-align:center;
  background:radial-gradient(900px 700px at 50% 30%, #1a0b52 0%, var(--bg0) 70%);
}
#splash h1{
  font-family:'PressStart'; font-size:30px; line-height:1.5;
  background:linear-gradient(90deg,var(--cyan),var(--magenta),var(--gold));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 0 14px rgba(157,107,255,.5));
}
#splash .tag{ font-size:24px; color:var(--ink-dim); margin-top:-8px; }
#splash .mascot-holder{ width:200px; height:200px; }
#splash .start-wrap{ width:280px; }
#splash .hint{ font-size:18px; color:var(--ink-dim); }
.float{ animation:float 3s ease-in-out infinite; }
@keyframes float{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-10px);} }

/* ---------- BOOT LOADER (shown until JS replaces splash) ---------- */
.boot{ display:flex; flex-direction:column; align-items:center; gap:28px; }
.boot-orbit{ position:relative; width:220px; height:220px; }
.boot-sun{
  position:absolute; top:50%; left:50%; width:28px; height:28px; margin:-14px 0 0 -14px;
  background:#ffcc33; image-rendering:pixelated;
  box-shadow:0 0 0 4px #ff8a00, 0 0 24px 4px rgba(255,170,40,.55);
  animation:boot-pulse 1.6s ease-in-out infinite;
}
.boot-ring{
  position:absolute; inset:0; border:2px dashed rgba(157,107,255,.35); border-radius:50%;
}
.boot-ring-1{ inset:30px; animation:boot-spin 3s linear infinite; }
.boot-ring-2{ inset:14px; animation:boot-spin 6s linear infinite reverse; }
.boot-ring-3{ inset:0;    animation:boot-spin 10s linear infinite; }
.boot-planet{
  position:absolute; top:-6px; left:50%; width:12px; height:12px; margin-left:-6px;
  image-rendering:pixelated; box-shadow:0 0 8px rgba(255,255,255,.5);
}
.boot-planet.p1{ background:#5fd3ff; }
.boot-planet.p2{ background:#ff6ad5; width:10px; height:10px; }
.boot-planet.p3{ background:#9bff7a; width:14px; height:14px; }
.boot-title{
  font-family:'PressStart'; font-size:30px; letter-spacing:2px;
  background:linear-gradient(90deg,#5fd3ff,#ff6ad5,#ffd166);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 0 12px rgba(157,107,255,.55));
  animation:boot-pulse 2.2s ease-in-out infinite;
}
.boot-tag{ font-family:'VT323',monospace; font-size:20px; color:var(--ink-dim); letter-spacing:1px; transition:opacity .25s ease; min-height:24px; text-align:center; }
.boot-dots i{ font-style:normal; opacity:0; animation:boot-dot 1.4s infinite; }
.boot-dots i:nth-child(2){ animation-delay:.2s; }
.boot-dots i:nth-child(3){ animation-delay:.4s; }
@keyframes boot-spin{ to{ transform:rotate(360deg); } }
@keyframes boot-pulse{ 0%,100%{ transform:scale(1);} 50%{ transform:scale(1.08);} }
@keyframes boot-dot{ 0%,80%,100%{ opacity:0;} 40%{ opacity:1;} }

/* ---------- HOME / SKILL TREE ---------- */
.home-hero{
  display:flex; align-items:center; gap:14px;
  background:linear-gradient(135deg,var(--panel2),var(--panel));
  border:3px solid var(--panel-edge); border-radius:18px;
  padding:14px 16px; margin:6px 0 18px;
  box-shadow:var(--shadow);
}
.home-hero canvas{ width:84px; height:84px; flex:0 0 auto; }
.home-hero .speech{ flex:1; }
.home-hero .speech .pix{ font-size:11px; color:var(--gold); margin-bottom:6px; }
.home-hero .speech p{ font-size:21px; line-height:1.05; color:var(--ink); }

.unit{ margin-bottom:30px; }
.unit-banner{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border-radius:16px; padding:14px 18px; margin-bottom:6px;
  border:3px solid rgba(255,255,255,.18);
  box-shadow:var(--shadow);
}
.unit-banner .ut{ font-family:'PressStart'; font-size:13px; color:#fff; text-shadow:2px 2px 0 rgba(0,0,0,.4); }
.unit-banner .us{ font-size:19px; color:rgba(255,255,255,.85); margin-top:4px; }
.unit-banner .uemoji{ font-size:34px; filter:drop-shadow(0 3px 0 rgba(0,0,0,.4)); }

/* serpentine path of lesson nodes */
.path{ display:flex; flex-direction:column; align-items:center; gap:8px; padding-top:6px; }
.node-row{ display:flex; width:100%; justify-content:center; }
.node{
  position:relative; width:84px; height:84px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  transition:transform .08s;
}
.node:active{ transform:translateY(4px); }
.node .disk{
  width:72px; height:72px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:34px; position:relative;
  background:transparent !important;
  border:none;
  box-shadow:none;
}
.node.locked .disk{ background:transparent !important; box-shadow:none; filter:grayscale(.8) brightness(.55); }
.node.locked{ cursor:not-allowed; }
.node.done .disk::after{ content:none; }
.node-rating{
  position:absolute; top:-10px; right:-10px;
  width:30px; height:30px; pointer-events:none;
  filter:drop-shadow(0 0 4px rgba(255,212,59,.55));
}
.node-rating svg{ width:100%; height:100%; display:block; }
.node-rating-num{
  position:absolute; top:18px; right:-14px;
  font-family:'PressStart'; font-size:7px; color:var(--gold);
  background:rgba(0,0,0,.55); padding:2px 4px; border-radius:6px;
  text-shadow:1px 1px 0 #000; pointer-events:none; white-space:nowrap;
}
.node.current .disk{ animation:pulse 1.4s ease-in-out infinite; border-radius:50%; }
@keyframes pulse{ 0%,100%{box-shadow:0 0 0 0 rgba(255,212,59,.55);} 50%{box-shadow:0 0 0 14px rgba(255,212,59,0);} }
.node .label{
  position:absolute; top:100%; left:50%; transform:translateX(-50%); margin-top:-6px;
  width:104px; text-align:center; line-height:1.15;
  font-size:12px; color:var(--ink-dim); word-wrap:break-word;
  text-shadow:0 1px 2px rgba(0,0,0,.85);
}
.node.current .label{ color:var(--gold); }

/* ---------- LESSON ---------- */
#lesson-head{ display:flex; align-items:center; gap:12px; padding:12px 4px 16px; }
#lesson-head .x{ font-family:'PressStart'; font-size:18px; color:var(--ink-dim); cursor:pointer; background:none; border:none; }
#lesson-head .x:hover{ color:var(--red); }
#lesson-head .bar{ flex:1; height:18px; }
#lesson-head .bar > i{ background:linear-gradient(90deg,var(--green),#a6ff5e); box-shadow:0 0 10px var(--green); }
#lesson-head .hp{ font-family:'PressStart'; font-size:12px; color:var(--red); display:flex; align-items:center; gap:4px; }

.q-prompt{ font-family:'PressStart'; font-size:15px; line-height:1.7; margin:8px 4px 18px; color:var(--ink); }
.q-sub{ font-size:20px; color:var(--ink-dim); margin:-8px 4px 18px; }

.q-figure{ display:flex; justify-content:center; margin:6px 0 18px; }
.q-figure .scene-frame{
  position:relative; padding:8px;
  border:3px solid var(--panel-edge); border-bottom-width:6px;
  border-radius:18px;
  background:linear-gradient(180deg,#120a3a,#06031a);
  box-shadow:var(--shadow), inset 0 0 18px rgba(70,229,255,0.08);
}
.q-figure .scene-frame::before{
  content:""; position:absolute; inset:-2px; border-radius:18px; pointer-events:none;
  background:repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 3px);
  mix-blend-mode:overlay;
}
.q-figure canvas.quiz-scene{
  display:block; width:160px; height:160px; image-rendering:pixelated;
  border-radius:12px;
}
.live-ribbon{
  font-family:'PressStart'; font-size:8px;
  background:linear-gradient(90deg,#2a0040,#003a4a);
  color:var(--magenta); border:2px solid var(--magenta);
  padding:4px 7px; border-radius:6px; letter-spacing:1px;
  box-shadow:0 0 10px rgba(255,79,216,.35);
}

.choices{ display:flex; flex-direction:column; gap:12px; }
.choices.grid2{ display:grid; grid-template-columns:1fr 1fr; }
.choice{
  position:relative; overflow:hidden;
  font-family:'VT323'; font-size:22px; line-height:1.1;
  background:var(--panel); color:var(--ink);
  border:3px solid var(--panel-edge); border-bottom-width:6px;
  border-radius:14px; padding:16px 16px; cursor:pointer; text-align:left;
  transition:transform .08s, background .15s, border-color .15s, box-shadow .15s;
  display:flex; align-items:center; gap:10px;
}
.choice .key{
  font-family:'PressStart'; font-size:10px; color:var(--violet);
  border:2px solid var(--panel-edge); border-radius:6px; padding:5px 7px;
  flex:0 0 auto; background:#0d0828; transition:background .15s, color .15s, border-color .15s;
}
.choice:hover{ background:var(--panel2); }
.choice:active{ transform:translateY(3px); border-bottom-width:3px; }
.choice.sel{
  background:#10306b; border-color:var(--cyan);
  box-shadow:0 0 0 2px rgba(70,229,255,.15), 0 0 18px rgba(70,229,255,.25);
}
.choice.sel .key{ background:var(--cyan); color:#04121a; border-color:var(--cyan); }
.choice.correct{
  background:#16401a; border-color:var(--green);
  box-shadow:0 0 0 2px rgba(88,204,2,.2), 0 0 22px rgba(88,204,2,.35);
  animation:choice-correct .35s ease-out;
}
.choice.correct .key{ background:var(--green); color:#0a1a02; border-color:var(--green); }
.choice.wrong{
  background:#3f1320; border-color:var(--red);
  animation:choice-wrong .35s ease-out;
}
.choice.wrong .key{ background:var(--red); color:#1a040a; border-color:var(--red); }
.choice.disabled{ pointer-events:none; }
.choice.dimmed{
  opacity:.18; filter:grayscale(.6) blur(.4px);
  pointer-events:none; transition:opacity .25s, filter .25s;
}
@keyframes choice-correct{
  0%{ transform:scale(1); }
  35%{ transform:scale(1.025); }
  100%{ transform:scale(1); }
}
@keyframes choice-wrong{
  0%,100%{ transform:translateX(0); }
  20%{ transform:translateX(-6px); }
  40%{ transform:translateX(6px); }
  60%{ transform:translateX(-4px); }
  80%{ transform:translateX(4px); }
}

/* True / False large pads */
.tf-pads{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:10px; }
.tf-pad{
  font-family:'PressStart'; font-size:14px; color:var(--ink);
  background:var(--panel); border:3px solid var(--panel-edge); border-bottom-width:7px;
  border-radius:18px; padding:22px 10px 18px; cursor:pointer; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  transition:transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.tf-pad .tf-ico{ font-size:34px; line-height:1; }
.tf-pad.t{ color:var(--green); }
.tf-pad.f{ color:var(--red); }
.tf-pad:active{ transform:translateY(3px); border-bottom-width:4px; }
.tf-pad.sel.t{ background:#16401a; border-color:var(--green); box-shadow:0 0 18px rgba(88,204,2,.35); }
.tf-pad.sel.f{ background:#3f1320; border-color:var(--red); box-shadow:0 0 18px rgba(255,84,112,.35); }
.tf-pad.correct{ background:#16401a; border-color:var(--green); animation:choice-correct .35s; }
.tf-pad.wrong{ background:#3f1320; border-color:var(--red); animation:choice-wrong .35s; }
.tf-pad.disabled{ pointer-events:none; opacity:.85; }

/* matching */
.match-wrap{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.match-col{ display:flex; flex-direction:column; gap:10px; }
.match-tile{
  font-family:'VT323'; font-size:20px; line-height:1.05;
  background:var(--panel); border:3px solid var(--panel-edge); border-bottom-width:6px;
  border-radius:12px; padding:13px; cursor:pointer; text-align:center;
  transition:background .15s, border-color .15s, transform .08s;
}
.match-tile:active{ transform:translateY(3px); border-bottom-width:3px; }
.match-tile.sel{ background:#10306b; border-color:var(--cyan); box-shadow:0 0 14px rgba(70,229,255,.3); }
.match-tile.done{ background:#16401a; border-color:var(--green); color:var(--green); pointer-events:none; }
.match-tile.miss{ background:#3f1320; border-color:var(--red); animation:shake .3s; }
@keyframes shake{ 0%,100%{transform:translateX(0);} 25%{transform:translateX(-6px);} 75%{transform:translateX(6px);} }

@media (prefers-reduced-motion: reduce){
  .choice.correct, .choice.wrong, .tf-pad.correct, .tf-pad.wrong{ animation:none; }
}

/* lesson footer / feedback */
#lesson-foot{
  position:sticky; bottom:0; margin-top:18px;
  background:linear-gradient(180deg, transparent, var(--bg0) 30%);
  padding-top:16px;
}
.feedback{
  border-radius:14px; padding:14px 16px; margin-bottom:12px;
  display:none; align-items:flex-start; gap:12px;
}
.feedback.show{ display:flex; animation:popin .25s; }
@keyframes popin{ from{transform:translateY(14px); opacity:0;} to{transform:none; opacity:1;} }
.feedback.good{ background:#14361b; border:3px solid var(--green); }
.feedback.bad{ background:#3a1320; border:3px solid var(--red); }
.feedback .fico{ font-size:30px; }
.feedback .ft{ font-family:'PressStart'; font-size:13px; margin-bottom:6px; }
.feedback.good .ft{ color:var(--green); }
.feedback.bad .ft{ color:var(--red); }
.feedback .fx{ font-size:19px; color:var(--ink); line-height:1.15; }

/* ---------- RESULT ---------- */
#result{ text-align:center; }
.result-card{ padding:30px 10px 10px; }
.result-card h2{ font-family:'PressStart'; font-size:22px; color:var(--gold);
  text-shadow:0 0 18px rgba(255,212,59,.5); margin-bottom:8px; }
.result-card .sub{ font-size:22px; color:var(--ink-dim); margin-bottom:18px; }
.result-card .mascot-holder{ width:170px; height:170px; margin:0 auto 14px; }
.result-stats{ display:flex; gap:12px; justify-content:center; margin:18px 0 26px; flex-wrap:wrap; }
.rstat{ background:var(--panel); border:3px solid var(--panel-edge); border-radius:14px;
  padding:14px 18px; min-width:104px; box-shadow:var(--shadow); }
.rstat .rv{ font-family:'PressStart'; font-size:18px; }
.rstat .rl{ font-size:17px; color:var(--ink-dim); margin-top:6px; }
.rstat.xp .rv{ color:var(--gold); }
.rstat.acc .rv{ color:var(--cyan); }
.rstat.gem .rv{ color:var(--magenta); }

/* ---------- EXPLORE (3D Observatory) ---------- */
#explore{ padding-bottom:90px; }
.obs-head{ font-family:'PressStart'; font-size:14px; color:var(--cyan); margin:4px 4px 4px;
  text-shadow:0 0 12px rgba(70,229,255,.5); }
.obs-sub{ font-size:19px; color:var(--ink-dim); margin:0 4px 12px; }
#three-stage{
  position:relative; width:100%; aspect-ratio:1.25/1; max-height:46vh;
  border:3px solid var(--panel-edge); border-radius:18px; overflow:hidden;
  background:radial-gradient(circle at 50% 40%, #120a3a, #04030d);
  box-shadow:var(--shadow); touch-action:none;
}
#three-canvas{ width:100%; height:100%; display:block; cursor:grab; }
#three-canvas:active{ cursor:grabbing; }
.obs-badge{ position:absolute; top:10px; left:10px; font-family:'PressStart'; font-size:9px;
  color:var(--ink-dim); background:rgba(5,3,15,.6); padding:6px 8px; border-radius:8px;
  border:1px solid var(--panel-edge); }
.obs-hint{ position:absolute; bottom:10px; right:12px; font-size:16px; color:var(--ink-dim);
  background:rgba(5,3,15,.5); padding:3px 8px; border-radius:8px; }
.obj-title{ font-family:'PressStart'; font-size:16px; color:var(--gold); margin:16px 4px 6px; }
.obj-fact{ font-size:21px; line-height:1.18; color:var(--ink); margin:0 4px 6px; }
.obj-data{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 4px; }
.obj-data .d{ background:var(--panel); border:2px solid var(--panel-edge); border-radius:10px; padding:9px 11px; }
.obj-data .d .k{ font-family:'PressStart'; font-size:8px; color:var(--violet); }
.obj-data .d .v{ font-size:20px; color:var(--ink); margin-top:4px; }
.obj-picker{ display:flex; gap:8px; overflow-x:auto; padding:6px 4px 10px; scrollbar-width:none; }
.obj-picker::-webkit-scrollbar{ display:none; }
.obj-chip{
  flex:0 0 auto; font-family:'VT323'; font-size:18px;
  background:var(--panel); border:2px solid var(--panel-edge); border-radius:12px;
  padding:9px 13px; cursor:pointer; white-space:nowrap; display:flex; align-items:center; gap:6px;
}
.obj-chip:active{ transform:translateY(2px); }
.obj-chip.active{ background:#10306b; border-color:var(--cyan); color:var(--cyan); }

/* ---------- BOTTOM NAV ---------- */
#nav{
  flex:0 0 auto; display:flex; gap:8px; padding:8px 14px 14px;
  border-top:2px solid var(--panel-edge); background:rgba(7,4,22,.85); backdrop-filter:blur(4px);
}
#nav.hidden{ display:none; }
.nav-btn{
  flex:1; background:none; border:2px solid transparent; border-radius:12px;
  color:var(--ink-dim); cursor:pointer; padding:8px 4px; font-family:'VT323'; font-size:15px;
  display:flex; flex-direction:column; align-items:center; gap:3px;
}
.nav-btn .ni{ font-size:22px; }
.nav-btn.active{ color:var(--cyan); border-color:var(--panel-edge); background:var(--panel); }

/* ---------- PROFILE ---------- */
#profile .pcard{ background:var(--panel); border:3px solid var(--panel-edge); border-radius:16px;
  padding:18px; margin-bottom:14px; box-shadow:var(--shadow); }
#profile h2{ font-family:'PressStart'; font-size:16px; color:var(--cyan); margin:8px 4px 14px; }
.pgrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pbox{ background:var(--panel2); border:2px solid var(--panel-edge); border-radius:12px; padding:14px; text-align:center; }
.pbox .pv{ font-family:'PressStart'; font-size:18px; color:var(--gold); }
.pbox .pl{ font-size:17px; color:var(--ink-dim); margin-top:6px; }
.ach{ display:flex; align-items:center; gap:12px; padding:10px 4px; border-bottom:1px solid var(--panel-edge); }
.ach:last-child{ border-bottom:none; }
.ach .ae{ font-size:28px; filter:grayscale(1) brightness(.6); }
.ach.unlocked .ae{ filter:none; filter:drop-shadow(0 0 6px var(--gold)); }
.ach .an{ font-family:'PressStart'; font-size:11px; }
.ach .ad{ font-size:17px; color:var(--ink-dim); }
.ach.unlocked .an{ color:var(--gold); }

/* ---------- MODAL ---------- */
.modal-bg{ position:fixed; inset:0; z-index:600; background:rgba(3,2,10,.78);
  display:none; align-items:center; justify-content:center; padding:24px; }
.modal-bg.show{ display:flex; animation:fadein .2s; }
.modal{ background:var(--panel); border:3px solid var(--panel-edge); border-radius:18px;
  padding:24px; max-width:380px; width:100%; text-align:center; box-shadow:0 10px 0 rgba(0,0,0,.4); }
.modal h3{ font-family:'PressStart'; font-size:15px; margin-bottom:12px; color:var(--gold); }
.modal p{ font-size:20px; color:var(--ink-dim); margin-bottom:18px; line-height:1.2; }
.modal .row{ display:flex; gap:10px; }

/* cheatsheet button + modal */
.cheatsheet-btn{
  font-family:'PressStart'; font-size:8px;
  background:linear-gradient(90deg,#1a2a4a,#0f3a3a);
  color:#7fe3ff; border:2px solid #4cc4ff;
  padding:4px 7px; border-radius:6px; letter-spacing:1px;
  cursor:pointer; box-shadow:0 0 10px rgba(76,196,255,.30);
  transition:transform .08s, box-shadow .15s;
}
.cheatsheet-btn:hover{ transform:translateY(-1px); box-shadow:0 0 14px rgba(76,196,255,.55); }
.cheatsheet-btn:active{ transform:translateY(0); }
.cheatsheet-modal{ position:relative; text-align:left; max-width:340px; }
.cheatsheet-close{
  position:absolute; top:10px; right:10px; width:28px; height:28px;
  background:transparent; color:var(--ink); border:2px solid var(--panel-edge);
  border-radius:8px; font-family:'PressStart'; font-size:10px; cursor:pointer;
}
.cheatsheet-close:hover{ border-color:var(--magenta); color:var(--magenta); }
.cheatsheet-label{
  font-family:'PressStart'; font-size:9px; color:var(--violet);
  letter-spacing:1px; margin:14px 0 6px;
}
.cheatsheet-list{ display:flex; flex-direction:column; gap:6px; }
.cheatsheet-eq{
  font-family:'VT323'; font-size:20px; color:var(--ink); line-height:1.2;
  background:var(--panel2); border:2px solid var(--panel-edge);
  border-radius:8px; padding:8px 10px; white-space:pre-wrap; word-break:break-word;
}
.cheatsheet-note{
  margin-top:14px; font-family:'VT323'; font-size:18px;
  color:var(--ink-dim); line-height:1.25;
}

/* equation lines inside prompts / concept body */
.q-equation{
  display:block; margin:8px auto; padding:8px 12px;
  font-family:'VT323'; font-size:22px; color:#cfe9ff; text-align:center;
  background:rgba(76,196,255,.08); border-left:3px solid #4cc4ff;
  border-radius:6px; white-space:pre-wrap; word-break:break-word;
  letter-spacing:0.5px;
}
.q-equation sup, .q-equation sub{
  font-family:'VT323'; font-size:0.72em; line-height:0; position:relative;
  color:#ffd23b; padding:0 1px;
}
.q-equation sup{ top:-0.55em; }
.q-equation sub{ bottom:-0.3em; }
.concept-body-wrap{ display:flex; flex-direction:column; gap:6px; }
.concept-body-wrap .concept-body{ margin:0; }

/* confetti canvas */
#confetti{ position:fixed; inset:0; z-index:550; pointer-events:none; display:none; }

/* toast */
#toast{ position:fixed; left:50%; bottom:80px; transform:translateX(-50%) translateY(20px);
  background:var(--panel2); border:2px solid var(--gold); border-radius:12px; padding:11px 16px;
  font-family:'PressStart'; font-size:11px; color:var(--gold); z-index:700; opacity:0;
  transition:opacity .3s, transform .3s; pointer-events:none; }
#toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

@media (max-width:520px){
  #splash h1{ font-size:21px; }
  .q-prompt{ font-size:13px; }
  .home-hero .speech p{ font-size:18px; }
}

/* ---------- COMBO BADGE ---------- */
.combo-badge{
  font-family:'PressStart'; font-size:10px;
  padding:6px 10px; border-radius:10px;
  white-space:nowrap; flex:0 0 auto;
}
.combo-badge.combo-2{
  background:#342000; border:2px solid var(--gold); color:var(--gold);
  animation:combo-pop .3s cubic-bezier(.2,1.5,.4,1);
}
.combo-badge.combo-3{
  background:#2f0028; border:2px solid var(--magenta); color:var(--magenta);
  box-shadow:0 0 12px rgba(255,79,216,.35);
  animation:combo-pop .3s cubic-bezier(.2,1.5,.4,1);
}
@keyframes combo-pop{
  from{ transform:scale(.5) translateY(-4px); opacity:0; }
  to  { transform:scale(1) translateY(0);      opacity:1; }
}

/* ---------- POWER-UP ROW ---------- */
.pu-row{
  display:flex; gap:8px; padding:0 4px 12px;
  justify-content:flex-end;
}
.pu-btn{
  font-family:'VT323'; font-size:19px;
  background:var(--panel); border:2px solid var(--panel-edge); border-bottom-width:4px;
  border-radius:10px; padding:7px 12px;
  color:var(--ink); cursor:pointer;
  display:flex; align-items:center; gap:5px;
  transition:background .1s, border-color .1s;
}
.pu-btn:hover{ background:var(--panel2); }
.pu-btn:active{ transform:translateY(2px); border-bottom-width:2px; }
.pu-btn:disabled{ opacity:.35; cursor:not-allowed; pointer-events:none; }
.pu-btn.active{
  background:#0c2040; border-color:var(--cyan); color:var(--cyan);
  animation:shield-pulse 1.5s ease-in-out infinite;
}
.pu-btn span{ font-size:15px; color:var(--ink-dim); }
@keyframes shield-pulse{
  0%,100%{ box-shadow:0 0 5px rgba(70,229,255,.2); }
  50%    { box-shadow:0 0 18px rgba(70,229,255,.65); }
}

/* ---------- HINT BUBBLE ---------- */
.hint-bubble{
  background:#0d200d; border:2px solid var(--green);
  border-radius:12px; padding:12px 14px;
  font-size:19px; color:var(--ink); line-height:1.3;
  margin:0 4px 14px;
  animation:popin .2s ease;
}

/* ---------- SHIELD FEEDBACK ---------- */
.feedback.shield{ background:#2a2000; border:3px solid var(--gold); }
.feedback.shield .ft{ color:var(--gold); }
.feedback.shield .fico{ font-size:26px; }

/* ---------- SHOP ---------- */
.shop-wrap{
  background:var(--panel); border:2px solid var(--panel-edge);
  border-radius:14px; padding:4px 14px 8px;
  box-shadow:var(--shadow); margin-bottom:18px;
}
.shop-item{
  display:flex; align-items:center; gap:12px;
  padding:13px 0; border-bottom:1px solid var(--panel-edge);
}
.shop-item:last-child{ border-bottom:none; }
.shop-ico{ font-size:28px; flex:0 0 auto; }
.shop-info{ flex:1; min-width:0; }
.shop-name{ font-family:'PressStart'; font-size:10px; color:var(--ink); margin-bottom:5px; }
.shop-desc{ font-size:16px; color:var(--ink-dim); line-height:1.1; }
.shop-right{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex:0 0 auto; }
.shop-owned{ font-family:'PressStart'; font-size:9px; color:var(--cyan); }
.shop-cost{ font-size:16px; color:var(--gold); }

/* ---------- RESULT COMBO STAT ---------- */
.rstat.combo .rv{ color:var(--magenta); }

/* =========================================================
   AUTH SCREEN
   ========================================================= */
#auth-screen{
  position:fixed; inset:0; z-index:550;
  display:flex; flex-direction:column; align-items:center;
  justify-content:flex-start;
  padding:calc(24px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  gap:16px;
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  scrollbar-width:none; -ms-overflow-style:none;
  background:radial-gradient(900px 700px at 50% 30%, #1a0b52 0%, var(--bg0) 70%);
  transition:opacity .28s;
}
#auth-screen::-webkit-scrollbar{ width:0; height:0; display:none; }
/* pointer-reactive nebula that follows the cursor */
#auth-screen::before{
  content:""; position:fixed; inset:0; pointer-events:none; z-index:0;
  background:radial-gradient(420px 420px at var(--mx,50%) var(--my,35%),
    rgba(0,220,255,.13), rgba(157,107,255,.07) 45%, transparent 70%);
  transition:background-position .3s;
}
.auth-logo{
  position:relative; z-index:1; margin-top:auto;
  font-size:22px; line-height:1.5; text-align:center;
  background:linear-gradient(90deg,var(--cyan),var(--magenta),var(--gold));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 0 12px rgba(157,107,255,.5));
}
.auth-sub{
  position:relative; z-index:1;
  font-size:20px; color:var(--ink-dim); text-align:center;
}


.auth-card{
  position:relative;
  background:var(--panel); border:3px solid var(--panel-edge);
  border-radius:20px; padding:22px 20px; width:100%; max-width:400px;
  display:flex; flex-direction:column; gap:14px;
  box-shadow:0 10px 0 rgba(0,0,0,.4);
  margin-bottom:auto;
  transition:box-shadow .25s, border-color .2s;
}
@media (hover:hover){
  .auth-card:hover{
    box-shadow:0 10px 0 rgba(0,0,0,.4), 0 0 26px rgba(0,220,255,.18);
  }
}


/* tabs — pinned so they never scroll out of reach */
.auth-tabs{
  display:flex; gap:0;
  position:sticky; top:-4px; z-index:3;
  background:var(--panel);
  padding:4px 0 6px;
}
.auth-tab{
  position:relative; overflow:hidden;
  flex:1; font-family:'PressStart'; font-size:10px; padding:12px 8px;
  background:var(--bg2); border:2px solid var(--panel-edge);
  color:var(--ink-dim); cursor:pointer; transition:background .15s, color .15s;
}
.auth-tab:first-child{ border-radius:10px 0 0 10px; }
.auth-tab:last-child { border-radius:0 10px 10px 0; }
.auth-tab.active{ background:var(--panel2); border-color:var(--cyan); color:var(--cyan); }
.auth-tab::after{
  content:""; position:absolute; left:12%; right:12%; bottom:4px; height:2px;
  background:var(--cyan); box-shadow:0 0 8px var(--cyan);
  transform:scaleX(0); transform-origin:center;
  transition:transform .22s cubic-bezier(.2,.8,.3,1);
}
.auth-tab.active::after{ transform:scaleX(1); }

/* inputs */
.auth-input{
  font-family:'VT323'; font-size:22px;
  background:var(--bg1); border:2px solid var(--panel-edge); border-radius:10px;
  padding:12px 14px; color:var(--ink); width:100%; outline:none;
  transition:border-color .15s, box-shadow .25s;
}
.auth-input:focus{
  border-color:var(--cyan);
  box-shadow:0 0 0 2px rgba(0,220,255,.14), 0 0 14px rgba(0,220,255,.22);
  animation:auth-scan .5s ease-out;
}
.auth-input::placeholder{ color:var(--ink-dim); opacity:.55; }

/* cta + error */
.auth-cta{ position:relative; overflow:hidden; margin-top:2px; }
.auth-cta.btn.green::after{
  content:""; position:absolute; top:0; bottom:0; width:40%;
  left:-50%; pointer-events:none;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  animation:auth-shimmer 3.6s ease-in-out infinite;
}
.auth-err{
  color:var(--red); font-size:17px; display:none;
  background:rgba(255,84,112,.08); border:1px solid var(--red-dk);
  border-radius:8px; padding:9px 11px; line-height:1.3;
  animation:auth-err-in .28s ease-out;
}

/* ---- astronomical auth motion ---- */
@keyframes auth-shake{
  0%,100%{ transform:translateX(0); }
  15%{ transform:translateX(-8px); }
  30%{ transform:translateX(7px); }
  45%{ transform:translateX(-5px); }
  60%{ transform:translateX(4px); }
  80%{ transform:translateX(-2px); }
}
@keyframes auth-err-in{
  from{ opacity:0; transform:translateY(-6px); }
  to{ opacity:1; transform:translateY(0); }
}
@keyframes auth-flash{
  0%,100%{ border-color:var(--panel-edge); box-shadow:0 10px 0 rgba(0,0,0,.4); }
  40%{ border-color:var(--red); box-shadow:0 10px 0 rgba(0,0,0,.4), 0 0 26px rgba(255,84,112,.5); }
}
.auth-card.auth-shake{ animation:auth-shake .38s steps(2,end), auth-flash .5s ease-out; }
@keyframes auth-pulse{
  from{ box-shadow:0 0 0 0 rgba(0,220,255,.55); }
  to{ box-shadow:0 0 0 22px rgba(0,220,255,0); }
}
.auth-cta.auth-pulse{ animation:auth-pulse .6s ease-out; }
@keyframes auth-shimmer{
  0%{ left:-50%; } 55%,100%{ left:120%; }
}
@keyframes auth-scan{
  from{ box-shadow:0 0 0 2px rgba(0,220,255,.35), 0 0 24px rgba(0,220,255,.4); }
  to{ box-shadow:0 0 0 2px rgba(0,220,255,.14), 0 0 14px rgba(0,220,255,.22); }
}
@media (prefers-reduced-motion: reduce){
  .auth-card.auth-shake,
  .auth-cta.auth-pulse,
  .auth-cta.btn.green::after,
  .auth-input:focus,
  .auth-err{ animation:none !important; }
  #auth-screen::before{ display:none; }
}


/* divider */
.auth-div{ text-align:center; font-size:18px; color:var(--ink-dim); }

/* guest button */
.auth-guest{
  position:relative; overflow:hidden;
  background:var(--panel2); border:3px solid var(--panel-edge); border-bottom-width:5px;
  border-radius:14px; color:var(--cyan); font-family:'PressStart'; font-size:11px;
  padding:15px; cursor:pointer; width:100%; text-align:center;
  transition:filter .1s, box-shadow .25s; letter-spacing:.5px;
}
.auth-guest::before{
  content:""; position:absolute; inset:0; pointer-events:none; opacity:0;
  transition:opacity .25s;
  background:
    radial-gradient(2px 2px at 14% 30%, #fff, transparent 60%),
    radial-gradient(2px 2px at 32% 72%, #9fd0ff, transparent 60%),
    radial-gradient(2px 2px at 68% 26%, #ffd9b0, transparent 60%),
    radial-gradient(2px 2px at 86% 66%, #fff, transparent 60%);
}
.auth-guest:hover{ filter:brightness(1.15); box-shadow:0 0 18px rgba(0,220,255,.2); }
.auth-guest:hover::before{ opacity:1; animation:auth-twinkle 1.4s steps(2,end) infinite; }
@keyframes auth-twinkle{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }
.auth-guest:active{ transform:translateY(3px); border-bottom-width:2px; }
.auth-guest:disabled{ opacity:.5; cursor:not-allowed; }

.auth-guest-hint{ text-align:center; font-size:17px; color:var(--ink-dim); }
.auth-link{
  background:none; border:none; padding:0;
  font-family:'VT323'; font-size:18px; color:var(--ink-dim);
  cursor:pointer; text-align:right; width:100%;
  transition:color .15s;
}
.auth-link:hover{ color:var(--cyan); }
.auth-divider{
  display:flex; align-items:center; justify-content:center;
  font-family:'Press Start 2P'; font-size:9px; color:var(--ink-dim);
  margin:14px 0 8px; letter-spacing:2px; position:relative;
}
.auth-divider::before, .auth-divider::after{
  content:""; flex:1; height:1px;
  background:linear-gradient(90deg, transparent, rgba(159,208,255,.25), transparent);
  margin:0 10px;
}
.auth-guest{ width:100%; margin-top:2px; }
.auth-guest-note{
  font-family:'VT323'; font-size:15px; color:var(--ink-dim);
  text-align:center; margin-top:8px; line-height:1.25;
}
.auth-success{
  color:var(--green); font-size:17px; display:none;
  background:rgba(88,204,2,.08); border:1px solid var(--green-dk);
  border-radius:8px; padding:9px 11px; line-height:1.3;
}

/* password field with eye toggle */
.pw-wrap{ position:relative; }
.pw-wrap .auth-input{ padding-right:46px; }
.pw-eye{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:transparent; border:none; cursor:pointer;
  font-size:20px; line-height:1; padding:6px 8px;
  color:var(--ink-dim); border-radius:6px;
}
.pw-eye:hover{ color:var(--cyan); background:rgba(0,0,0,.2); }

/* password strength meter */
.pw-meter{ display:flex; align-items:center; gap:10px; margin-top:-4px; }
.pw-bar{
  flex:1; height:8px; background:var(--bg1);
  border:2px solid var(--panel-edge); border-radius:4px; overflow:hidden;
}
.pw-fill{ height:100%; width:0%; transition:width .15s, background .15s; }
.pw-fill.s0{ width:0%;   background:transparent; }
.pw-fill.s1{ width:20%;  background:var(--red); }
.pw-fill.s2{ width:40%;  background:#ff9f43; }
.pw-fill.s3{ width:60%;  background:#ffd43b; }
.pw-fill.s4{ width:80%;  background:var(--green); }
.pw-fill.s5{ width:100%; background:var(--cyan); }
.pw-label{
  font-family:'PressStart'; font-size:8px;
  color:var(--ink-dim); min-width:78px; text-align:right;
}
.pw-hint{
  font-family:'VT323'; font-size:16px; color:var(--ink-dim);
  line-height:1.35; margin-top:-2px;
}

/* Register-mode guidance callout */
.auth-edu-note{
  border:2px solid var(--cyan);
  background:linear-gradient(180deg, rgba(0,220,255,0.10), rgba(0,220,255,0.04));
  border-radius:12px;
  padding:10px 12px;
  margin:2px 0 4px;
  box-shadow:0 0 0 2px rgba(0,220,255,0.10) inset, 0 0 12px rgba(0,220,255,0.18);
}
.auth-edu-title{
  font-family:'Press Start 2P'; font-size:9px; line-height:1.45;
  color:var(--cyan); margin-bottom:6px;
}
.auth-edu-body{
  font-family:'VT323'; font-size:17px; line-height:1.25;
  color:var(--ink);
}
.auth-edu-body b{ color:var(--cyan); }
.auth-edu-tip{
  font-family:'VT323'; font-size:15px; line-height:1.25;
  color:var(--gold); margin-top:6px;
}




/* =========================================================
   ACCOUNT SECTION (profile page)
   ========================================================= */
.acct-wrap{
  background:var(--panel); border:2px solid var(--panel-edge);
  border-radius:14px; padding:14px 16px; margin-bottom:14px;
  box-shadow:var(--shadow);
}
.acct-row{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.acct-icon{ font-size:26px; flex:0 0 auto; }
.acct-info{ flex:1; min-width:0; }
.acct-email{
  font-family:'PressStart'; font-size:10px; color:var(--cyan);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.acct-status{ font-size:16px; color:var(--ink-dim); margin-top:5px; }
.acct-btns{ display:flex; gap:8px; flex-wrap:wrap; }

/* =========================================================
   LIVE SKY TRACKER
   ========================================================= */
#sky{
  padding:0; overflow:hidden;
  display:none; flex-direction:column;
  background:#010008;
}
#sky.active{ display:flex; }

/* ── Permission screen ── */
.sky-perm{
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:16px; padding:32px 24px; text-align:center;
  background:radial-gradient(800px 600px at 50% 40%, #0d0630 0%, #010008 70%);
}
.sky-perm-icon{ font-size:64px; filter:drop-shadow(0 0 20px #9d6bff); }
.sky-perm-title{
  font-size:20px;
  background:linear-gradient(90deg,var(--cyan),var(--magenta));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.sky-perm-desc{ font-size:20px; color:var(--ink); max-width:340px; line-height:1.4; }
.sky-perm-note{ font-size:17px; color:var(--ink-dim); max-width:320px; line-height:1.3; }
.sky-perm-warn{ font-size:15px; color:var(--ink-dim); opacity:.6; }

/* ── Canvas ── */
.sky-canvas{
  flex:1; width:100%; display:block;
  image-rendering:pixelated;
  touch-action:none;
}

/* ── Warning strip ── */
.sky-warn-strip{
  flex:0 0 auto;
  background:rgba(255,212,59,.1); border-top:1px solid var(--gold);
  color:var(--gold); font-size:15px;
  padding:8px 14px; text-align:center;
}

/* ---------- additions: lesson body, node lock, achievements ---------- */
.lesson-body{ padding:2px 2px 8px; min-height:40vh; }
.node-row{ padding-bottom:52px; }
.node .disk{ overflow:visible; }
.node .disk canvas{ width:48px; height:48px; image-rendering:pixelated; }
.node .disk .lock{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:26px; filter:drop-shadow(0 2px 2px rgba(0,0,0,.6));
}
.obj-info{ margin-top:4px; }
.ach-grid{ display:block; background:var(--panel); border:2px solid var(--panel-edge);
  border-radius:14px; padding:6px 14px; box-shadow:var(--shadow); }
.ach .ach-txt{ flex:1; text-align:left; }
.result-card .mascot-holder canvas{ width:100%; height:100%; image-rendering:pixelated; }
#profile .pcard{ display:flex; align-items:center; gap:16px; text-align:left; }
#profile .pcard canvas{ width:72px; height:72px; image-rendering:pixelated; flex:0 0 auto; }
#profile .pcard .pv{ font-family:'PressStart'; font-size:15px; color:var(--gold); }
#profile .pcard .pl{ font-size:18px; color:var(--ink-dim); margin-top:6px; }

/* ── Sky tracker lock overlay (pre-launch gate) ───────────────── */
.sky-lock{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at center, #0a0820 0%, #05030f 70%); padding:24px; text-align:center; }
.sky-lock-inner{ max-width:340px; }
.sky-lock-title{ font-family:'PressStart'; font-size:22px; color:var(--gold); letter-spacing:1px;
  text-shadow:3px 3px 0 #000, 0 0 12px rgba(255,212,59,.45); margin-bottom:18px; }
.sky-lock-sub{ font-family:'VT323',monospace; font-size:20px; color:var(--ink-dim); line-height:1.4;
  margin-top:8px; text-transform:none; letter-spacing:.5px; }
.sky-lock-star{ font-family:'PressStart'; font-size:42px; color:#46e5ff; margin-top:22px;
  text-shadow:0 0 14px rgba(70,229,255,.7); animation: skyLockBlink 1.6s steps(2) infinite; }
@keyframes skyLockBlink { 50% { opacity:.35; } }

/* ===== Dynamic AI lessons ===== */
.node.ai-placeholder .disk{
  background: transparent !important;
  border:2px dashed #a78bfa;
  box-shadow:0 0 12px rgba(167,139,250,.45);
}
.node.ai-placeholder .label{ color:#c4b5fd; }
.node.ai-lesson .disk{ filter:drop-shadow(0 0 6px rgba(167,139,250,.55)); }
.node.loading .disk{ animation: aiPulse .9s ease-in-out infinite; }
@keyframes aiPulse{
  0%,100%{ transform:scale(1); filter:brightness(1); }
  50%{ transform:scale(1.08); filter:brightness(1.4); }
}

.concept-tag{
  font-family:'PressStart'; font-size:10px; color:#c4b5fd; letter-spacing:1px;
  text-align:center; flex:1;
}
.concept-card{
  margin:24px 16px; padding:22px 18px;
  background:linear-gradient(160deg,#1b1340,#0d0a25);
  border:2px solid #6d28d9;
  box-shadow:0 0 0 4px #05030f, 0 0 18px rgba(124,58,237,.55);
  image-rendering:pixelated;
}
.concept-title{
  font-family:'PressStart'; font-size:14px; color:#fff;
  text-align:center; line-height:1.5; margin-bottom:14px;
  text-shadow:2px 2px 0 #6d28d9;
}
.concept-headline{
  font-family:'PressStart'; font-size:10px; color:#fbbf24;
  text-align:center; line-height:1.6; margin-bottom:18px;
  letter-spacing:.5px;
}
.concept-body{
  font-family:'VT323',monospace; font-size:22px; color:#e9e4ff;
  line-height:1.45; text-align:left;
}

/* ===== profile name + username rows ===== */
.pname-row, .puser-row{ display:flex; align-items:center; gap:8px; }
.puser-row{ margin-top:4px; }
.puser{
  font-family:'VT323',monospace; font-size:18px; color:#9ad9ff;
  letter-spacing:0.5px;
}
.pname-edit{
  background:transparent; border:2px solid var(--panel-edge);
  color:var(--ink-dim); cursor:pointer; padding:2px 8px;
  border-radius:6px; font-size:14px; line-height:1;
  font-family:'VT323',monospace;
}
.pname-edit:hover{ color:var(--gold); border-color:var(--gold); }

/* ===== settings gear + modal ===== */
#profile .pcard{ position:relative; }
.pgear{
  position:absolute; top:10px; right:10px;
  background:transparent; border:2px solid var(--panel-edge);
  color:var(--ink-dim); cursor:pointer; width:36px; height:36px;
  border-radius:8px; font-size:20px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition:transform .25s ease, color .2s, border-color .2s;
}
.pgear:hover{ color:var(--gold); border-color:var(--gold); transform:rotate(60deg); }

.settings-modal{ min-width:300px; max-width:420px; }
.settings-modal .settings-sec{
  font-family:'PressStart'; font-size:11px; color:var(--gold);
  letter-spacing:1px; margin:6px 0 14px;
}
.settings-modal .settings-hint{
  font-family:'VT323',monospace; font-size:16px; color:var(--ink-dim);
  margin:8px 0 18px; line-height:1.2;
}
.setting-row{ margin-bottom:18px; }
.setting-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.setting-label{ font-family:'VT323',monospace; font-size:20px; color:#e9e4ff; }
.setting-val{ font-family:'PressStart'; font-size:10px; color:var(--gold); }
.setting-slider{
  -webkit-appearance:none; appearance:none;
  width:100%; height:8px; border-radius:4px;
  background:linear-gradient(90deg, #5fd3ff 0%, #9d6bff 100%);
  outline:none; cursor:pointer;
  border:2px solid var(--panel-edge);
}
.setting-slider::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:18px; height:18px; border-radius:50%;
  background:var(--gold); border:2px solid #2a1d05;
  box-shadow:0 0 8px rgba(255,209,102,.6);
  cursor:pointer;
}
.setting-slider::-moz-range-thumb{
  width:18px; height:18px; border-radius:50%;
  background:var(--gold); border:2px solid #2a1d05;
  box-shadow:0 0 8px rgba(255,209,102,.6);
  cursor:pointer;
}

/* ---------- PROGRESS REPORT ---------- */
.report-head{
  display:flex; align-items:center; gap:10px;
  margin:6px 0 14px;
}
.report-head .x{
  font-size:22px; line-height:1;
  background:transparent; border:none; color:var(--ink);
  cursor:pointer; padding:4px 10px;
}
.report-title{
  flex:1; text-align:center; font-size:13px;
  color:var(--cyan); letter-spacing:1px; margin:0;
}
.report-info{
  width:32px; height:32px; border-radius:50%;
  background:var(--panel); border:2px solid var(--panel-edge);
  color:var(--cyan); font-size:16px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.report-info:hover{ background:var(--panel-edge); }
.report-empty{
  background:var(--panel); border:2px solid var(--panel-edge);
  border-radius:14px; padding:18px; color:var(--ink-dim);
  font-size:16px; line-height:1.35; margin-bottom:14px;
}
#report{ padding-bottom:24px; }

/* ---- About me (bio) card ---- */
.bio-card{
  background:linear-gradient(180deg, rgba(40,90,180,0.18), rgba(20,40,90,0.28));
  border:2px solid var(--panel-edge);
  border-radius:14px; padding:14px;
  margin-bottom:14px;
}
.bio-body{
  color:var(--ink); font-size:14px; line-height:1.45;
  white-space:pre-wrap; word-wrap:break-word;
  margin-bottom:10px;
}
.bio-empty{ color:var(--ink-dim); font-style:italic; }
.bio-foot{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.bio-hint{ font-size:11px; color:var(--ink-dim); }
.bio-textarea{
  width:100%; min-height:140px; resize:vertical;
  font-family:inherit; font-size:13px; line-height:1.45;
  padding:10px;
}

/* ============ NOVA CHAT ============ */
#screen-nova{
  position:fixed; inset:0; display:none; flex-direction:column;
  background:linear-gradient(180deg, #08071a 0%, #05030f 100%);
  z-index:40;
  padding-bottom:64px; /* nav */
}
#screen-nova.active{ display:flex; }
.nova-head{
  display:flex; align-items:center; gap:8px;
  padding:10px 10px; border-bottom:2px solid var(--panel-edge);
  background:rgba(10,8,28,0.92);
  position:relative; z-index:5;
}
.nova-head-title{ flex:1; min-width:0; }
.nova-head-title-clickable{ cursor:pointer; }
.nova-head-title .pix{ font-size:11px; color:var(--accent); }
.nova-head-title .nova-title{ font-size:11px; color:var(--accent); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nova-sub{ font-size:10px; color:var(--ink-dim); margin-top:3px; display:flex; align-items:center; gap:5px; }
.nova-online-dot{ display:inline-block; width:7px; height:7px; border-radius:50%; background:#3ddc6b; box-shadow:0 0 6px #3ddc6b; }

.nova-avatar-sm{ width:40px; height:40px; border-radius:50%; overflow:hidden; border:2px solid var(--panel-edge); flex-shrink:0; padding:0; background:transparent; cursor:pointer; }
.nova-avatar-sm img{ width:100%; height:100%; object-fit:cover; image-rendering:pixelated; display:block; }
.nova-avatar-btn:active{ transform:scale(0.94); }

.nova-icon-btn{
  background:rgba(255,255,255,0.06); border:2px solid var(--panel-edge);
  color:var(--ink); width:38px; height:38px; border-radius:8px;
  font-size:18px; line-height:1; cursor:pointer; padding:0;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.nova-icon-btn:hover{ background:rgba(255,255,255,0.12); }
.nova-icon-btn.danger{ color:#ff8a92; border-color:#5a2a2f; }
.nova-icon-btn.danger:hover{ background:rgba(255,80,80,0.2); border-color:#ff5e6e; }
.nova-icon-btn:disabled{ opacity:0.35; cursor:not-allowed; }

/* avatar popup */
.nova-avatar-popup{
  position:fixed; inset:0; background:rgba(0,0,0,0.75);
  display:flex; align-items:center; justify-content:center;
  z-index:200; animation:novaFade .18s ease-out;
}
@keyframes novaFade{ from{opacity:0} to{opacity:1} }
.nova-avatar-popup-card{
  text-align:center; padding:18px;
  background:rgba(10,8,28,0.95); border:3px solid var(--accent);
  border-radius:14px; max-width:80vw;
}
.nova-avatar-popup-card img{
  width:240px; height:240px; max-width:70vw; max-height:70vw;
  border-radius:50%; image-rendering:pixelated; border:3px solid var(--panel-edge);
}
.nova-avatar-popup-name{ font-size:14px; color:var(--accent); margin-top:14px; }
.nova-avatar-popup-sub{ font-size:11px; color:var(--ink-dim); margin-top:6px; display:flex; align-items:center; justify-content:center; gap:6px; }

/* dropdown menu */
.nova-menu{
  position:absolute; right:8px; top:62px; z-index:30;
  background:rgba(14,11,32,0.98); border:2px solid var(--panel-edge);
  border-radius:10px; min-width:210px; padding:6px;
  box-shadow:0 8px 24px rgba(0,0,0,0.5);
}
.nova-menu-item{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:10px 12px; background:transparent; border:none;
  color:var(--ink); font-family:inherit; font-size:12px; cursor:pointer;
  text-align:left; border-radius:6px;
}
.nova-menu-item:hover{ background:rgba(255,255,255,0.08); }
.nova-menu-ic{ display:flex; align-items:center; color:var(--accent); }
.nova-menu-backdrop{ position:fixed; inset:0; z-index:20; }

.nova-search{ padding:8px 10px; border-bottom:1px solid rgba(255,255,255,0.06); display:flex; gap:6px; align-items:center; }
.nova-search-input{
  flex:1; padding:10px 12px; border-radius:10px;
  background:rgba(255,255,255,0.06); border:2px solid var(--panel-edge);
  color:var(--ink); font-family:inherit; font-size:13px;
}
.nova-search-input:focus{ outline:none; border-color:var(--accent); }
.nova-search-close{
  width:36px; height:36px; border-radius:8px; flex-shrink:0;
  background:rgba(255,255,255,0.06); border:2px solid var(--panel-edge);
  color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center;
}

.nova-list-body{ flex:1; overflow-y:auto; padding:8px 8px 20px; }
.nova-section-label{
  font-size:10px; color:var(--ink-dim); text-transform:uppercase;
  letter-spacing:1px; padding:10px 8px 6px;
}
.nova-thread-row{ display:flex; align-items:stretch; gap:6px; margin:4px 4px; }
.nova-thread-main{
  flex:1; text-align:left; padding:12px 14px;
  background:rgba(40,90,180,0.14); border:2px solid var(--panel-edge);
  border-radius:10px; color:var(--ink); cursor:pointer; font-family:inherit;
  display:flex; flex-direction:column; gap:4px; min-width:0;
}
.nova-thread-main:hover{ background:rgba(40,90,180,0.25); }
.nova-thread-title{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nova-thread-time{ font-size:10px; color:var(--ink-dim); }
.nova-row-act{
  width:38px; background:rgba(255,255,255,0.06); border:2px solid var(--panel-edge);
  color:var(--ink); border-radius:10px; cursor:pointer; font-size:14px;
}
.nova-row-act.danger:hover{ background:rgba(255,80,80,0.2); border-color:#ff5e6e; }

.nova-empty{ padding:40px 20px; text-align:center; color:var(--ink-dim); }
.nova-empty-avatar{ width:140px; height:140px; border-radius:50%; image-rendering:pixelated; margin-bottom:12px; }
.nova-empty .pix{ font-size:11px; color:var(--accent); margin:8px 0; }

.nova-search-hit{
  display:block; width:calc(100% - 8px); margin:4px;
  text-align:left; padding:10px 12px;
  background:rgba(255,255,255,0.04); border:1px solid var(--panel-edge);
  border-radius:8px; color:var(--ink); cursor:pointer; font-family:inherit;
}
.nova-hit-role{ font-size:10px; color:var(--accent); margin-bottom:4px; }
.nova-hit-text{ font-size:12px; line-height:1.4; color:var(--ink-dim); }
mark{ background:rgba(255,220,90,0.4); color:var(--ink); padding:0 2px; border-radius:2px; }

.nova-msgs{ flex:1; overflow-y:auto; padding:12px 10px; display:flex; flex-direction:column; gap:8px; }
.nova-date-sep{ display:flex; justify-content:center; margin:10px 0 4px; }
.nova-date-sep span{
  font-size:9px; letter-spacing:1.2px; color:var(--ink-dim);
  background:rgba(255,255,255,0.06); padding:4px 10px; border-radius:10px;
  border:1px solid var(--panel-edge); font-family:'Press Start 2P', monospace;
}

.nova-msg{ display:flex; gap:8px; align-items:flex-end; max-width:100%; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; transition:background .15s; padding:2px 4px; border-radius:8px; }
.nova-msg.is-user{ flex-direction:row-reverse; }
.nova-msg.is-selected{ background:rgba(123,59,255,0.18); }
.nova-msg-avatar{ width:32px; height:32px; border-radius:50%; overflow:hidden; flex-shrink:0; border:2px solid var(--panel-edge); }
.nova-msg-avatar img{ width:100%; height:100%; object-fit:cover; image-rendering:pixelated; display:block; }
.nova-bubble{
  max-width:78%; padding:10px 12px; border-radius:14px;
  background:rgba(40,90,180,0.22); border:2px solid var(--panel-edge);
  color:var(--ink); font-size:13px; line-height:1.5;
  word-wrap:break-word; position:relative;
}
.nova-msg.is-user .nova-bubble{
  background:linear-gradient(135deg, #5a32d6, #7b3bff);
  border-color:#9a6cff; color:#fff;
}
.nova-msg.is-typing .nova-bubble{ opacity:0.6; font-style:italic; }
.nova-bubble-body{ white-space:pre-wrap; }
.nova-bubble-meta{ font-size:9px; color:rgba(255,255,255,0.55); margin-top:4px; text-align:right; letter-spacing:0.5px; }
.nova-quote{
  font-size:11px; padding:6px 8px; margin-bottom:6px;
  border-left:3px solid var(--accent); background:rgba(0,0,0,0.25);
  border-radius:4px; color:var(--ink-dim);
}
.nova-quote-link{ cursor:pointer; transition:background 0.15s ease; }
.nova-quote-link:hover, .nova-quote-link:focus{ background:rgba(0,0,0,0.4); outline:none; }
.nova-quote-link:active{ transform:scale(0.98); }
.nova-flash{ animation:novaFlash 1.4s ease-out; }
@keyframes novaFlash{ 0%{background:rgba(255,220,90,0.35)} 100%{background:transparent} }

.nova-reply-bar{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; margin:0 8px; border-radius:10px 10px 0 0;
  background:rgba(40,30,80,0.6); border:2px solid var(--accent); border-bottom:none;
}
.nova-reply-inner{ flex:1; min-width:0; }
.nova-reply-meta{ font-size:10px; color:var(--accent); font-family:'Press Start 2P', monospace; }
.nova-reply-text{ font-size:12px; color:var(--ink-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:4px; }
.nova-reply-cancel{
  background:transparent; border:none; color:var(--ink); cursor:pointer;
  width:30px; height:30px; display:flex; align-items:center; justify-content:center;
}

.nova-composer{
  display:flex; align-items:flex-end; gap:8px;
  padding:8px 10px; background:rgba(10,8,28,0.95);
  border-top:2px solid var(--panel-edge);
}
.nova-input{
  flex:1; resize:none; padding:10px 12px; border-radius:12px;
  background:rgba(255,255,255,0.06); border:2px solid var(--panel-edge);
  color:var(--ink); font-family:inherit; font-size:13px; line-height:1.4;
  max-height:140px;
}
.nova-input:focus{ outline:none; border-color:var(--accent); }
.nova-send{
  width:42px; height:42px; border-radius:50%; border:none;
  background:linear-gradient(135deg, #5a32d6, #7b3bff);
  color:#fff; font-size:16px; cursor:pointer; flex-shrink:0;
}
.nova-send:hover{ filter:brightness(1.15); }

/* ===================================================================
   LEARN — current-lesson banner, constellation paths, side panel,
   parallax observatory background
   =================================================================== */

/* Orange chapter name card — slim & elegant */
.home-current{
  display:flex; align-items:center; gap:10px;
  background:linear-gradient(135deg,#f59e0b,#d97706);
  border:2px solid #ffb84a;
  border-radius:12px;
  padding:8px 10px;
  margin:6px 0 12px;
  box-shadow:var(--shadow);
  cursor:pointer;
  position:relative; z-index:2;
}
.home-current canvas{ width:40px; height:40px; flex:0 0 auto;
  filter:drop-shadow(0 0 6px rgba(255,212,59,.55)); }
.home-current .hc-text{ flex:1; min-width:0; }
.home-current .hc-title{
  font-family:'PressStart'; font-size:8px; color:#fff;
  line-height:1.3; text-shadow:1px 1px 0 rgba(0,0,0,.35);
}
.home-current .hc-sub{
  font-size:12px; color:rgba(255,255,255,.92);
  margin-top:3px; line-height:1.15;
}
.home-current .hc-reward{
  flex:0 0 auto;
  display:flex; flex-direction:column; align-items:center; gap:1px;
  background:rgba(0,0,0,.18); border:1px solid rgba(255,255,255,.35);
  border-radius:8px; padding:4px 7px;
}
.home-current .hc-star{ font-size:14px; color:#ffd43b; line-height:1; filter:drop-shadow(0 0 3px #ffd43b); }
.home-current .hc-xp{ font-family:'PressStart'; font-size:7px; color:#fff; }

.home-main{ min-width:0; position:relative; z-index:2; }

/* Inline (non-sticky) Stargazer cards under the first chapter banner */
.home-side{
  display:flex; flex-direction:column; gap:10px;
  margin:0 0 14px;
}
.side-card{
  background:linear-gradient(180deg, var(--panel), var(--panel2));
  border:3px solid var(--panel-edge);
  border-radius:14px;
  padding:12px 12px;
  box-shadow:var(--shadow);
}
.side-card-title{
  font-family:'PressStart'; font-size:10px; color:var(--cyan);
  display:flex; align-items:center; gap:6px;
  margin-bottom:10px; letter-spacing:1px;
}
.side-card-title .sc-ico{ font-size:14px; }

.log-rows{ display:flex; flex-direction:column; gap:8px; }
.log-row{
  display:flex; align-items:center; gap:8px;
  font-size:16px; color:var(--ink);
}
.log-row .lr-ico{ font-size:16px; width:18px; text-align:center; }
.log-row .lr-label{ flex:1; color:var(--ink-dim); }
.log-row .lr-val{
  font-family:'PressStart'; font-size:11px; color:var(--gold);
}

/* Daily Goal */
.goal-head{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:8px;
}
.goal-label{ font-family:'PressStart'; font-size:10px; color:var(--ink-dim); letter-spacing:1px; }
.goal-val{ font-family:'PressStart'; font-size:10px; color:var(--gold); }
.goal-bar{
  height:10px; background:rgba(255,255,255,.08);
  border:2px solid var(--panel-edge); border-radius:6px; overflow:hidden;
}
.goal-bar > i{
  display:block; height:100%; width:0%;
  background:linear-gradient(90deg, var(--gold), #fff2a8);
  box-shadow:0 0 8px var(--gold);
  transition:width .5s cubic-bezier(.2,.9,.2,1);
}

/* Daily fact tip card */
.tip-card{
  display:flex; gap:10px; align-items:flex-start;
  position:relative;
}
.tip-card::before{
  content:""; position:absolute; left:-10px; top:24px;
  width:0; height:0;
  border:8px solid transparent;
  border-right-color:var(--panel-edge);
}
.tip-card canvas{
  width:48px; height:48px; flex:0 0 auto;
  filter:drop-shadow(0 0 5px rgba(255,212,59,.55));
}
.tip-card .tip-text{
  font-size:15px; color:var(--ink-dim); line-height:1.25;
}

/* Compact side cards on narrow screens so the 150px column reads well */
/* Side cards now render full-width inline; keep defaults at all sizes */

/* Constellation stage (path for one chapter) */
.constellation-stage{
  position:relative; width:100%;
  margin-top:6px; padding-top:24px;
}
.constellation-name{
  position:absolute; top:0; right:6px;
  font-family:'PressStart'; font-size:9px;
  color:var(--ink-dim); letter-spacing:1px;
  opacity:.7;
}
.constellation-lines{
  position:absolute; inset:0; width:100%; height:100%;
  pointer-events:none;
}
.c-line{
  stroke: rgba(196, 181, 253, .55);
  stroke-width: 0.45;
  stroke-dasharray: 1.2 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(157,107,255,.45));
}
.c-microstar{
  fill: rgba(255,255,255,.7);
  filter: drop-shadow(0 0 1.5px rgba(255,255,255,.8));
}

/* Absolutely positioned nodes inside the constellation */
.node.node-abs{
  position:absolute;
  transform: translate(-50%, -50%);
}
.node.node-abs:active{ transform: translate(-50%, calc(-50% + 4px)); }
.node.current.node-abs .disk{
  box-shadow: 0 0 0 4px rgba(255,212,59,.35), 0 0 20px rgba(255,212,59,.55);
}
.node.node-abs .label{
  width:112px; margin-top:-8px;
}

/* ---------- STATIC BACKGROUND (Learn screen only) ---------- */
#home-bg-layers{
  position:fixed; inset:0;
  pointer-events:none;
  z-index:0;
  display:none;
  overflow:hidden;
}
body.on-home #home-bg-layers{ display:block; }

#home-bg-layers .hb-back,
#home-bg-layers .hb-mid{
  position:absolute; inset:0;
  background-repeat:repeat;
}
#home-bg-layers .hb-back{
  background-image:
    radial-gradient(1px 1px at 28px 50px, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1px 1px at 110px 170px, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 200px 30px, rgba(180,200,255,.65), transparent 60%),
    radial-gradient(1px 1px at 70px 220px, rgba(255,220,180,.6), transparent 60%),
    radial-gradient(1px 1px at 260px 110px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 160px 260px, rgba(200,220,255,.55), transparent 60%);
  background-size: 300px 300px;
  opacity:.9;
}
#home-bg-layers .hb-mid{
  background-image:
    radial-gradient(2px 2px at 50px 90px, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 180px 150px, rgba(157,107,255,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 220px 40px, rgba(70,229,255,.8), transparent 60%),
    radial-gradient(1.8px 1.8px at 90px 260px, rgba(255,212,59,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 300px 220px, rgba(255,255,255,.85), transparent 60%);
  background-size: 360px 360px;
  opacity:.9;
}
#home-bg-layers .hb-observatory{
  position:fixed;
  left:50%; bottom:var(--home-nav-offset, 72px);
  width:min(100vw, 780px);
  transform:translateX(-50%);
  pointer-events:none;
  display:block;
  line-height:0;
  overflow:visible;
}
#home-bg-layers .hb-observatory img{
  display:block;
  width:100%; height:auto;
  image-rendering:pixelated;
  user-select:none;
  filter:saturate(.92) brightness(.74) contrast(1.08) drop-shadow(0 -10px 22px rgba(5,3,15,.35));
}


/* Keep the legacy serpentine path hidden when stages replace it */
.unit > .path{ display:none; }

/* Nova modal — replaces native confirm/prompt */
.nova-modal-overlay{
  position:fixed; inset:0; background:rgba(5,3,15,.78);
  display:flex; align-items:center; justify-content:center;
  z-index:10050; padding:20px; animation:novaModalFade .12s ease-out;
}
@keyframes novaModalFade{from{opacity:0}to{opacity:1}}
.nova-modal{
  background:#0d0a22; border:2px solid #5b4bd1;
  box-shadow:0 0 0 2px #05030f, 0 10px 40px rgba(91,75,209,.4);
  padding:20px 18px 16px; max-width:340px; width:100%;
  font-family:'VT323',monospace; color:#e8e6ff;
  image-rendering:pixelated;
}
.nova-modal-title{
  font-family:'Press Start 2P',monospace;
  font-size:11px; line-height:1.5; color:#c9bfff;
  margin-bottom:10px;
}
.nova-modal-msg{ font-size:17px; line-height:1.3; color:#b8b3da; margin-bottom:14px; }
.nova-modal-input{
  width:100%; box-sizing:border-box;
  background:#05030f; border:2px solid #3a2f7a; color:#fff;
  font-family:'VT323',monospace; font-size:18px;
  padding:8px 10px; margin-bottom:14px; outline:none;
}
.nova-modal-input:focus{ border-color:#8b7bff; }
.nova-modal-btns{ display:flex; gap:8px; justify-content:flex-end; }
.nova-modal-btn{
  font-family:'Press Start 2P',monospace; font-size:9px;
  padding:9px 14px; cursor:pointer;
  border:2px solid #3a2f7a; background:#1a1438; color:#e8e6ff;
  transition:transform .08s, background .12s;
}
.nova-modal-btn:hover{ background:#2a1f5a; transform:translateY(-1px); }
.nova-modal-btn:active{ transform:translateY(0); }
.nova-modal-ok{ background:#5b4bd1; border-color:#8b7bff; }
.nova-modal-ok:hover{ background:#6e5ce0; }
.nova-modal-ok.danger{ background:#c1364a; border-color:#ff6b7a; }
.nova-modal-ok.danger:hover{ background:#d8455a; }

/* Hide scrollbars globally — keep scroll functionality, just no visible bar (native-app feel) */
*::-webkit-scrollbar{ width:0 !important; height:0 !important; background:transparent !important; }
*::-webkit-scrollbar-thumb{ background:transparent !important; }
*::-webkit-scrollbar-track{ background:transparent !important; }
*{ scrollbar-width:none !important; -ms-overflow-style:none !important; }

/* Retro pixel calendar (Jump to Date) */
.nova-cal{ max-width:320px; }
.nova-cal-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:10px;
}
.nova-cal-title{
  font-family:'Press Start 2P',monospace; font-size:10px;
  color:#c9bfff; letter-spacing:1px;
}
.nova-cal-nav{
  font-family:'Press Start 2P',monospace; font-size:10px;
  background:#1a1438; color:#e8e6ff; border:2px solid #3a2f7a;
  width:28px; height:28px; cursor:pointer; line-height:1;
}
.nova-cal-nav:hover:not(:disabled){ background:#2a1f5a; }
.nova-cal-nav:disabled{ opacity:.3; cursor:not-allowed; }
.nova-cal-dow{
  display:grid; grid-template-columns:repeat(7,1fr); gap:2px;
  margin-bottom:4px;
}
.nova-cal-dow > div{
  font-family:'Press Start 2P',monospace; font-size:8px;
  color:#7a72b8; text-align:center; padding:4px 0;
}
.nova-cal-grid{
  display:grid; grid-template-columns:repeat(7,1fr); gap:2px;
  margin-bottom:12px;
}
.nova-cal-cell{
  font-family:'VT323',monospace; font-size:16px;
  background:transparent; color:#5a5380; border:2px solid transparent;
  padding:6px 0; text-align:center; cursor:default;
  aspect-ratio:1/1; display:flex; align-items:center; justify-content:center;
}
.nova-cal-cell.is-avail{
  color:#fff; background:#2a1f5a; border-color:#5b4bd1; cursor:pointer;
}
.nova-cal-cell.is-avail:hover{ background:#5b4bd1; border-color:#8b7bff; }
.nova-cal-cell.is-dim{ color:#3a335a; opacity:.55; }

/* ---------- NOVA HINT OVERLAY (top sheet) ---------- */
#screen-lesson{ position:relative; }
.nova-hint-overlay{
  position:fixed;
  top:64px; right:8px; left:8px;
  z-index:60;
  display:flex; align-items:flex-start; justify-content:flex-end; gap:6px;
  pointer-events:none;
  transform:translateY(-24px);
  opacity:0;
  transition:transform .25s cubic-bezier(.2,.8,.25,1), opacity .25s ease-out;
}
.nova-hint-overlay.in{ transform:translateY(0); opacity:1; }
.nova-hint-img{
  width:96px; height:auto;
  image-rendering:pixelated;
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.55));
  flex:0 0 auto;
  margin-top:8px;
}
.nova-hint-bubble{
  background:#0d200d;
  border:2px solid var(--green);
  border-radius:12px;
  padding:10px 12px 12px 12px;
  font-size:16px; line-height:1.25;
  color:var(--ink);
  max-width:min(70vw, 280px);
  max-height:calc(100vh - 140px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none; -ms-overflow-style:none;
  word-break:break-word;
  position:relative;
  pointer-events:auto;
  box-shadow:0 4px 14px rgba(0,0,0,.5);
}
.nova-hint-bubble::-webkit-scrollbar{ width:0; height:0; display:none; }
.nova-hint-bubble::after{
  content:"";
  position:absolute;
  right:-10px; top:24px;
  width:0; height:0;
  border:8px solid transparent;
  border-left-color:var(--green);
}
.nova-hint-close{
  position:sticky; float:right;
  top:0; right:0;
  background:transparent; border:0;
  color:var(--ink);
  font-family:inherit; font-size:14px;
  cursor:pointer; padding:2px 6px;
  line-height:1;
}
.nova-hint-close:hover{ color:var(--green); }
@media (min-width:520px){
  .nova-hint-img{ width:120px; }
  .nova-hint-bubble{ max-width:320px; font-size:17px; }
}
@media (max-width:360px){
  .nova-hint-img{ width:80px; }
  .nova-hint-bubble{ max-width:62vw; font-size:14px; }
}

/* ===== Guest upsell modal (extends nova-modal styles) ===== */
.guest-upsell{ max-width: 420px; }
.guest-upsell .nova-modal-title{
  color:#ffd86b; text-align:center; letter-spacing:1px;
}
.guest-upsell-line{
  font-family:'VT323', monospace;
  font-size:18px; line-height:1.35;
  color:#e8ecff; margin:6px 0; text-align:center;
}
.guest-upsell-perks{
  list-style:none; padding:10px 6px 4px; margin:10px 0 4px;
  border:2px solid #3a2f70; background:#13102a; border-radius:6px;
}
.guest-upsell-perks li{
  font-family:'VT323', monospace; font-size:17px;
  color:#bcd3ff; padding:3px 8px;
}
.guest-upsell .nova-modal-actions{
  display:flex; gap:8px; justify-content:center;
  margin-top:14px; flex-wrap:wrap;
}
.guest-upsell .btn.green{
  background:#4ade80; color:#06210f; border-color:#1d6b3a;
}

/* ===== Pro upsell — plan buttons inside the upsell modal ===== */
.pro-price-block{ margin-top: 6px; }
.pro-price-row{ display:flex; gap:10px; margin-top:8px; }
.pro-plan-btn{
  flex:1; position:relative; background:rgba(255,255,255,0.05);
  border:2px solid rgba(255,255,255,0.18); border-radius:8px;
  color:#f3f5ff; padding:14px 8px 10px; cursor:pointer; text-align:center;
  font-family:'VT323',monospace;
}
.pro-plan-btn.pro-plan-best{
  background:rgba(124,255,178,0.10); border-color:#7cffb2;
  box-shadow:0 0 0 3px rgba(124,255,178,0.18);
}
.pro-plan-label{ font-family:'Press Start 2P',monospace; font-size:9px; letter-spacing:1.4px; opacity:0.85; }
.pro-plan-amt{ font-size:28px; margin-top:6px; font-family:'Press Start 2P',monospace; }
.pro-plan-amt span{ font-size:12px; opacity:0.7; margin-left:2px; }
.pro-plan-save{ font-size:14px; opacity:0.85; margin-top:4px; color:#7cffb2; }
.pro-plan-badge{
  position:absolute; top:-9px; left:50%; transform:translateX(-50%);
  background:#7cffb2; color:#05030f; font-family:'Press Start 2P',monospace;
  font-size:8px; padding:3px 6px; border-radius:4px; letter-spacing:1px;
}

/* ===== Nova free-tier counter under composer ===== */
.nova-free-counter{
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:6px 12px 10px; font-size:14px; opacity:0.85;
  color:#cfe1ff; background:transparent;
}
.nova-free-counter.at-limit{ color:#ffb0b0; }
.nova-free-upgrade{
  background:transparent; border:1px solid rgba(124,255,178,0.5);
  color:#7cffb2; padding:2px 8px; border-radius:4px; cursor:pointer;
  font-family:'VT323',monospace; font-size:14px;
}
.nova-free-upgrade:hover{ background:rgba(124,255,178,0.10); }

/* ===== Profile: subscription row ===== */
.acct-sub-row{
  margin-top:10px; padding:10px 12px; border-radius:8px;
  background:rgba(124,255,178,0.06); border:1px solid rgba(124,255,178,0.25);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  flex-wrap:wrap;
}
.acct-sub-info{ flex:1; min-width:0; }
.acct-sub-tier{ font-family:'Press Start 2P',monospace; font-size:10px; letter-spacing:1.2px; color:#7cffb2; }
.acct-sub-detail{ font-size:14px; opacity:0.85; margin-top:2px; }
.acct-sub-btn{
  background:#7cffb2; color:#05030f; border:none; border-radius:6px;
  padding:6px 12px; font-family:'Press Start 2P',monospace; font-size:9px;
  letter-spacing:1px; cursor:pointer;
}
.acct-sub-btn.ghost{ background:transparent; color:#cfe1ff; border:1px solid rgba(255,255,255,0.3); }

/* =================== GLOSSARY =================== */
#screen-glossary { padding: 18px 14px 90px; }
.glossary-wrap { max-width: 640px; margin: 0 auto; }
.glossary-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 14px; position: relative;
}
.glossary-back {
  position: absolute; left: 0; top: 0;
}
.glossary-title {
  font-family: 'Press Start 2P', monospace;
  color: #ffe27a; font-size: 16px; letter-spacing: 2px;
  margin: 0; text-shadow: 2px 2px 0 #000;
}
.glossary-count {
  font-family: 'VT323', monospace; font-size: 16px;
  color: #7cffb2; letter-spacing: 1px;
}
.glossary-search { margin-bottom: 14px; }
.glossary-input {
  width: 100%; box-sizing: border-box;
  background: #0b0820; color: #eaf3ff;
  border: 2px solid #3b3560; border-radius: 6px;
  padding: 10px 12px; font-family: 'VT323', monospace; font-size: 18px;
  outline: none;
}
.glossary-input:focus { border-color: #7cffb2; }
.glossary-list { display: flex; flex-direction: column; gap: 6px; }
.glossary-letter {
  font-family: 'Press Start 2P', monospace; font-size: 12px;
  color: #ff7aa8; letter-spacing: 2px;
  padding: 10px 6px 4px; border-bottom: 1px dashed rgba(255,255,255,0.15);
  margin-top: 8px;
}
.glossary-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; padding: 10px 12px;
}
.glossary-term {
  font-family: 'Press Start 2P', monospace; font-size: 10px;
  color: #ffe27a; letter-spacing: 1px; margin-bottom: 6px;
}
.glossary-def {
  font-family: 'VT323', monospace; font-size: 17px;
  color: #eaf3ff; line-height: 1.35;
}
.glossary-meta {
  margin-top: 6px; font-family: 'VT323', monospace; font-size: 14px;
  color: #8ea3c9; letter-spacing: 0.5px;
}
.glossary-empty {
  text-align: center; padding: 40px 20px;
  font-family: 'VT323', monospace; font-size: 18px; color: #8ea3c9;
}
.glossary-empty-title {
  font-family: 'Press Start 2P', monospace; font-size: 12px;
  color: #ffe27a; letter-spacing: 2px; margin-bottom: 10px;
}
.glossary-empty-sub { font-size: 16px; }

/* ===================================================================
   ASTRONOMER MODE — uses Explorer theme; only chip + Learn placeholder
   =================================================================== */
.tb-mode-chip{
  font-family:'PressStart'; font-size:8px; letter-spacing:1px;
  color:#0a1220; background:#f7c948;
  border:0; padding:6px 8px; margin-left:6px;
  box-shadow:0 3px 0 #a2801a; cursor:pointer; border-radius:2px;
}
.tb-mode-chip:active{ transform:translateY(2px); box-shadow:0 1px 0 #a2801a; }

.astro-learn{
  display:flex; flex-direction:column; align-items:center;
  padding:28px 18px 40px; gap:16px; text-align:center;
}
.astro-learn-title{
  font-family:'PressStart'; font-size:16px; color:#f7c948;
  letter-spacing:2px; margin:6px 0 0;
}
.astro-learn-sub{ font-family:'VT323'; font-size:20px; color:#a9bcd8; margin:0; }
.astro-learn-card{
  display:flex; align-items:center; gap:14px;
  background:rgba(20,16,40,0.6); border:2px solid #3a2f66;
  padding:14px; max-width:520px; width:100%;
  box-shadow:0 4px 0 #1a1436;
}
.astro-learn-body{ text-align:left; flex:1; }
.astro-learn-headline{
  font-family:'PressStart'; font-size:9px; color:#7de6a0; margin-bottom:6px;
}
.astro-learn-note{ font-family:'VT323'; font-size:18px; color:#c8d3ea; line-height:1.3; margin:0; }
.astro-learn-actions{ margin-top:10px; }

/* ============================================================
   ASTRONOMER — courses list & add-course form
   ============================================================ */
.astro-learn-head { text-align: center; margin: 8px 0 18px; }
.astro-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 8px 12px 28px;
}
.astro-course-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #9ba3c9;
  font-family: "VT323", monospace;
  font-size: 20px;
  padding: 24px 0;
}
.astro-course-card {
  background: #0d0b22;
  border: 2px solid #2a2957;
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #e5e8ff;
  box-shadow: 0 0 0 2px #05030f, 0 0 12px rgba(80,120,255,0.15);
  font-family: "VT323", monospace;
  text-align: left;
}
.astro-course-code {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: #ffd166;
  letter-spacing: 1px;
}
.astro-course-title {
  font-size: 17px;
  color: #ffffff;
  line-height: 1.15;
}
.astro-course-meta {
  font-size: 15px;
  color: #9ba3c9;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.astro-course-sep { opacity: 0.5; }
.astro-course-status {
  margin-top: 4px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: #6ce3ff;
}
.astro-course-status.ready { color: #6cff9c; }
.astro-course-status.failed { color: #ff6c8a; }
.astro-course-status.archived { color: #9ba3c9; }
.astro-course-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.astro-course-actions .btn.small {
  padding: 6px 10px;
  font-size: 10px;
}
.astro-course-emphasis {
  font-size: 15px;
  color: #c9d0ff;
  margin-top: 6px;
}

.astro-course-add {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 140px;
  background: #0a0819;
  color: #c9d0ff;
  text-align: center;
  transition: transform 0.08s, border-color 0.15s;
}
.astro-course-add:hover { border-color: #6cff9c; transform: translateY(-2px); }
.astro-course-add-plus {
  font-family: "Press Start 2P", monospace;
  font-size: 28px;
  color: #6cff9c;
  margin-bottom: 6px;
}
.astro-course-add-label {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffffff;
}
.astro-course-add-sub {
  font-family: "VT323", monospace;
  font-size: 15px;
  color: #9ba3c9;
  margin-top: 4px;
}

/* --- Add Course form --- */
.astro-form-wrap {
  padding: 16px 14px 40px;
  max-width: 640px;
  margin: 0 auto;
  color: #e5e8ff;
}
.astro-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.astro-form-title {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: #ffd166;
  letter-spacing: 1px;
  margin: 0;
}
.astro-form-sub {
  font-family: "VT323", monospace;
  font-size: 17px;
  color: #9ba3c9;
  margin: 0 0 16px;
}
.astro-form { display: flex; flex-direction: column; gap: 14px; }
.astro-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.astro-label {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: #c9d0ff;
}
.astro-input {
  background: #0a0819;
  border: 2px solid #2a2957;
  border-radius: 4px;
  padding: 10px 12px;
  color: #ffffff;
  font-family: "VT323", monospace;
  font-size: 18px;
  outline: none;
}
.astro-input:focus { border-color: #6cff9c; }
.astro-select { appearance: none; cursor: pointer; }
.astro-textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.35;
}
.astro-syllabus-label-row {
  display: flex; align-items: center; justify-content: space-between;
}
.astro-expand { padding: 4px 8px; font-size: 9px; }
.astro-hint {
  font-family: "VT323", monospace;
  font-size: 14px;
  color: #6b7098;
  margin-top: 2px;
}
.astro-pdf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.astro-pdf-btn { padding: 6px 10px; font-size: 9px; }
.astro-pdf-status {
  font-family: "VT323", monospace;
  font-size: 14px;
  color: #8b90b8;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.astro-pdf-status.ok { color: #7bd88f; }
.astro-pdf-status.err { color: #ff6b9d; }
.astro-suggest {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #0a0819;
  border: 2px solid #2a2957;
  border-top: none;
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
}
.astro-suggest-row {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #1a1740;
}
.astro-suggest-row:hover { background: #14112f; }
.astro-suggest-name {
  font-family: "VT323", monospace;
  font-size: 17px;
  color: #ffffff;
}
.astro-suggest-sub {
  font-family: "VT323", monospace;
  font-size: 14px;
  color: #9ba3c9;
}
.astro-suggest-other { color: #6cff9c; font-family: "VT323", monospace; font-size: 16px; }
.astro-form-error {
  min-height: 20px;
  font-family: "VT323", monospace;
  color: #ff6c8a;
  font-size: 16px;
}
.astro-form-submit { margin-top: 6px; }

/* Fullscreen syllabus editor */
.astro-syllabus-fs-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 3, 15, 0.94);
  z-index: 400;
  display: flex; align-items: stretch; justify-content: stretch;
}
.astro-syllabus-fs {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
}
.astro-syllabus-fs-top {
  display: flex; align-items: center; justify-content: space-between;
}
.astro-syllabus-fs-title {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: #ffd166;
  letter-spacing: 1px;
}
.astro-syllabus-fs-ta {
  flex: 1;
  background: #05030f;
  border: 2px solid #2a2957;
  border-radius: 4px;
  padding: 14px;
  color: #ffffff;
  font-family: "VT323", monospace;
  font-size: 20px;
  line-height: 1.4;
  outline: none;
  resize: none;
}
.astro-syllabus-fs-ta:focus { border-color: #6cff9c; }

.astro-course-detail-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.astro-course-detail-status { padding: 12px 0; }

/* --- Astronomer course detail: exams + chapters --- */
.astro-section-title {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: #7be3ff;
  letter-spacing: 1px;
  margin: 14px 0 8px;
  opacity: 0.85;
}
.astro-exam-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.astro-exam-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 2px solid #2a3a5a;
  background: #0a1428;
  font-family: "VT323", monospace;
  font-size: 16px;
  color: #d9e8ff;
}
.astro-exam-name { flex: 1; }
.astro-exam-date { color: #ffcc66; font-family: "Press Start 2P", monospace; font-size: 8px; letter-spacing: 1px; }
.astro-exam-date.muted { color: #6a7a9a; }
.astro-exam-count {
  padding: 2px 6px;
  border: 1px solid #ffcc66;
  color: #ffcc66;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 1px;
}
.astro-exam-count.soon { color: #ff9a4d; border-color: #ff9a4d; }
.astro-exam-count.past { color: #6a7a9a; border-color: #3a4a6a; }

.astro-chapter-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.astro-chapter-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 10px;
  border-left: 3px solid #7be3ff;
  background: rgba(123, 227, 255, 0.04);
  font-family: "VT323", monospace;
  font-size: 17px;
  color: #e6f2ff;
}
.astro-chapter-num {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: #7be3ff;
  min-width: 22px;
}
.astro-chapter-title { flex: 1; line-height: 1.3; }

.astro-generate-btn { margin-top: 12px; }
.astro-regen { margin-top: 14px; align-self: flex-start; }

/* --- Astronomer: Chapter accordion ------------------------------- */
.astro-chapter-gate-note {
  font-family: "VT323", monospace;
  font-size: 15px;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
  border-left: 3px solid #ffd166;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.astro-chapter-accordion {
  border-left: 3px solid #7be3ff;
  background: rgba(123, 227, 255, 0.04);
  margin-bottom: 4px;
}
.astro-chapter-accordion.open { background: rgba(123, 227, 255, 0.08); }
.astro-chapter-head {
  width: 100%;
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #e6f2ff;
  font-family: "VT323", monospace;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}
.astro-chapter-head:hover { background: rgba(123, 227, 255, 0.06); }
.astro-chapter-caret {
  margin-left: auto;
  font-family: "VT323", monospace;
  color: #7be3ff;
  font-size: 18px;
}
.astro-chapter-panel {
  padding: 4px 12px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.astro-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.astro-lesson-name {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #b8f5c9;
  letter-spacing: 0.5px;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.astro-lesson-btn,
.astro-learn-btn {
  width: auto;
  flex: 0 0 auto;
  font-size: 10px;
  padding: 8px 12px;
  align-self: center;
  white-space: nowrap;
}

.astro-learn-btn.locked,
.astro-learn-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.astro-chapter-hint {
  margin: 0;
  color: #a8b6d0;
  font-family: "VT323", monospace;
  font-size: 15px;
}
.astro-chapter-action { align-self: flex-start; }
.astro-chapter-action:disabled { opacity: 0.5; cursor: not-allowed; }




/* --- Astronomer: Practice Material ------------------------------- */
.astro-material-box {
  margin-top: 18px;
  padding: 14px;
  border: 2px solid #2a2450;
  background: rgba(10, 8, 30, 0.6);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.astro-style-row { display: flex; align-items: center; gap: 8px; }
.astro-style-pill {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  padding: 5px 8px;
  border: 2px solid #2a2450;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.astro-style-pill.ok { color: #7bff9e; border-color: #2f7a44; background: rgba(40, 100, 60, 0.2); }
.astro-style-pill.pending { color: #b7b0d6; border-color: #3a3560; background: rgba(40, 35, 80, 0.4); }

.astro-material-list { display: flex; flex-direction: column; gap: 6px; }
.astro-material-loading,
.astro-material-empty {
  font-family: "VT323", monospace;
  color: #8b83b0;
  font-size: 16px;
  padding: 6px 2px;
}
.astro-material-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid #2a2450;
  background: rgba(20, 15, 45, 0.6);
  border-radius: 4px;
}
.astro-material-name {
  flex: 1;
  font-family: "VT323", monospace;
  font-size: 17px;
  color: #d8d2f2;
  word-break: break-word;
}
.astro-material-del {
  width: auto !important;
  flex: 0 0 auto;
  min-width: 28px;
  padding: 2px 8px !important;
  font-size: 14px !important;
  line-height: 1;
}
.astro-material-name { min-width: 0; }

.astro-material-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #2a2450;
}
.astro-material-ta { min-height: 90px; resize: vertical; }
.astro-material-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- Founding cadet (first users) modal ---- */
.founder-modal{ max-width: 520px; }
.founder-form{ margin: 10px 0 4px; }
.founder-field{ margin-bottom: 12px; }
.founder-label{
  font-family:'Press Start 2P', monospace; font-size:8px; letter-spacing:1.2px;
  color:#9fd0ff; margin-bottom:6px;
}
.founder-input{
  width:100%; box-sizing:border-box; background:rgba(0,0,0,0.35);
  border:1px solid rgba(255,255,255,0.2); border-radius:6px; color:#f3f5ff;
  padding:8px 10px; font-family:'VT323', monospace; font-size:18px; line-height:1.3;
  resize:vertical; outline:none;
}
.founder-input:focus{ border-color:#7cffb2; box-shadow:0 0 0 2px rgba(124,255,178,0.18); }
.founder-err{
  margin-top:6px; color:#ff9090; font-family:'VT323', monospace; font-size:16px;
}

/* ---- Feedback screen ---- */
.fb-wrap { padding: 18px 16px 90px; max-width: 640px; margin: 0 auto; }
.fb-sub { font-family: var(--font-body, inherit); color: #9fb0d8; margin: 6px 0 14px; font-size: 15px; }
.fb-input {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: #0d0a24; color: #e8ecff;
  border: 2px solid #3a2f6e; border-radius: 6px;
  padding: 12px; font-family: var(--font-body, inherit); font-size: 17px;
  outline: none; margin-bottom: 12px;
}
.fb-input:focus { border-color: #6c5cff; }
.fb-msg { margin-top: 10px; color: #9fb0d8; font-family: var(--font-body, inherit); font-size: 15px; }

/* ===== Legal links (auth footer + profile bottom) ===== */
.legal-links{
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;
  gap:8px;margin-top:14px;
}
.legal-link{
  background:none;border:0;padding:2px 2px;cursor:pointer;
  font-family:"VT323",monospace;font-size:16px;line-height:1.2;
  color:var(--muted,#9aa3c7);text-decoration:underline;
  text-underline-offset:3px;opacity:.8;
}
.legal-link:hover,.legal-link:focus-visible{color:var(--accent,#7ad7ff);opacity:1;}
.legal-sep{color:var(--muted,#9aa3c7);opacity:.5;font-size:16px;}
.legal-links-auth{margin-top:16px;}
.legal-foot{
  margin-top:22px;padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
}


/* ---- Astronomer per-course glossary ---- */
.astro-glossary-box{margin:14px 0;border:2px solid #2a2350;background:#0b0820;padding:10px}
.astro-glossary-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.astro-glossary-head .astro-section-title{margin:0}
.astro-glossary-panel{margin-top:10px;max-height:340px;overflow-y:auto;scrollbar-width:none}
.astro-glossary-panel::-webkit-scrollbar{display:none}
.astro-glossary-chapter{font-family:"Press Start 2P",monospace;font-size:8px;color:#6de3ff;margin:12px 0 6px;letter-spacing:1px}
.astro-glossary-row{border-left:3px solid #2a2350;padding:4px 0 6px 8px;margin-bottom:6px}
.astro-glossary-term{font-family:"Press Start 2P",monospace;font-size:9px;color:#ffd76d;margin-bottom:4px}
.astro-glossary-def{font-family:"VT323",monospace;font-size:17px;line-height:1.25;color:#cfd6ff}

/* ===== Social channels (profile row + invite popup) ===== */
.social-foot{
  margin-top:22px;padding-top:16px;
  border-top:1px solid rgba(255,255,255,.08);
  text-align:center;
}
.social-foot-title{
  font-family:"Press Start 2P",monospace;font-size:10px;
  letter-spacing:2px;color:#ffd76d;margin-bottom:12px;
  text-shadow:2px 2px 0 rgba(0,0,0,.6);
}
.social-row{
  display:flex;flex-direction:column;gap:10px;
  align-items:stretch;
}
.social-btn{
  display:flex;align-items:center;gap:12px;
  padding:10px 14px;cursor:pointer;text-align:left;
  background:#0b0820;
  border:2px solid #2a2350;
  box-shadow:0 4px 0 #14102e, inset 0 0 0 1px rgba(255,255,255,.04);
  transition:transform .08s ease, border-color .15s ease, background .15s ease;
  image-rendering:pixelated;
}
.social-btn:hover{
  transform:translateY(-2px);
  background:#120d2e;
}
.social-btn:active{
  transform:translateY(2px);
  box-shadow:0 1px 0 #14102e;
}
.social-discord:hover{border-color:#5865F2;}
.social-instagram:hover{border-color:#E1306C;}
.social-youtube:hover{border-color:#FF0000;}
.social-btn svg{
  flex:none;width:26px;height:26px;
  filter:drop-shadow(2px 2px 0 rgba(0,0,0,.55));
}
.social-btn-txt{display:flex;flex-direction:column;gap:3px;min-width:0;}
.social-btn-label{
  font-family:"Press Start 2P",monospace;font-size:9px;
  letter-spacing:1px;color:#fff;line-height:1.5;
}
.social-btn-sub{
  font-family:"VT323",monospace;font-size:16px;line-height:1;
  color:#9aa3c7;
}

/* invite popup */
.social-invite{
  text-align:center;
  border:2px solid #5d3fd3;
  box-shadow:0 0 0 2px #14102e, 0 0 34px rgba(93,63,211,.35);
}
.social-invite-stars{
  color:#ffd76d;letter-spacing:10px;font-size:16px;
  margin-bottom:8px;
  animation:social-twinkle 2.2s ease-in-out infinite;
}
.social-invite h3{margin-bottom:8px;}
.social-invite-sub{
  font-family:"VT323",monospace;font-size:18px;line-height:1.35;
  color:#cfd6ff;margin:0 0 14px;
}
.social-invite .row{justify-content:center;margin-top:12px;}
@keyframes social-twinkle{
  0%,100%{opacity:.55;transform:scale(1);}
  50%{opacity:1;transform:scale(1.12);}
}
@media (prefers-reduced-motion: reduce){
  .social-invite-stars{animation:none;}
}
@media (min-width:520px){
  .social-row{flex-direction:row;}
  .social-btn{flex:1;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:14px 8px;}
  .social-btn-txt{align-items:center;}
}

/* ===================== PROBLEM COACH ===================== */
.coach-wrap { padding-bottom: 90px; }
.coach-body { display: flex; flex-direction: column; gap: 14px; }
.coach-course-card .astro-course-actions { margin-top: 10px; }
.coach-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coach-left { font-family: "VT323", monospace; font-size: 18px; color: #ffd76d; }
.coach-panel {
  border: 3px solid #2b2350; background: #0d0a22;
  box-shadow: 0 0 0 3px #05030f; padding: 14px; display: flex;
  flex-direction: column; gap: 10px; align-items: flex-start;
}
.coach-course-name { font-family: "Press Start 2P", monospace; font-size: 11px; color: #7ee7ff; }
.coach-help { font-family: "VT323", monospace; font-size: 18px; line-height: 1.25; color: #cfc9ee; margin: 0; }
.coach-upload { width: 100%; }
.coach-status { font-family: "VT323", monospace; font-size: 18px; color: #9d95c8; line-height: 1.25; }
.coach-status.warn { color: #ffb1b1; }
.coach-out { display: flex; flex-direction: column; gap: 14px; }
.coach-card {
  border: 3px solid #2b2350; background: #0b0820;
  box-shadow: 0 0 0 3px #05030f; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.coach-note {
  font-family: "VT323", monospace; font-size: 18px; color: #ffd76d;
  border-left: 4px solid #ffd76d; padding-left: 8px; line-height: 1.25;
}
.coach-sec { display: flex; flex-direction: column; gap: 8px; }
.coach-sec-title { font-family: "Press Start 2P", monospace; font-size: 9px; color: #7ee7ff; letter-spacing: 1px; }
.coach-item { border-left: 3px solid #2b2350; padding-left: 8px; }
.coach-text { font-family: "VT323", monospace; font-size: 19px; line-height: 1.3; color: #e6e2ff; }
.coach-sim { display: flex; flex-direction: column; gap: 10px; }
.coach-sim-btn { width: 100%; }
.coach-solved { border-color: #3a5f2b; }
.coach-step { display: flex; gap: 8px; align-items: flex-start; }
.coach-step-n {
  font-family: "Press Start 2P", monospace; font-size: 9px; color: #05030f;
  background: #7ee7ff; padding: 5px 6px; min-width: 20px; text-align: center;
}
.coach-step-txt { flex: 1; }
.coach-answer { border: 3px solid #ffd76d; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.coach-answer-label { font-family: "Press Start 2P", monospace; font-size: 9px; color: #ffd76d; }
.coach-answer-val .coach-text { color: #fff6d6; }
