/* =====================================================================
   SYNAPSIA — Bioluminescent Neural Observatory Design System
   ===================================================================== */
:root {
  --bg-deep: #050814;
  --bg-surface: rgba(13, 20, 42, 0.78);
  --bg-surface-solid: #0d142a;
  --bg-elevated: rgba(20, 31, 62, 0.86);
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(56, 242, 230, 0.38);

  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;

  --cyan: #38f2e6;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --emerald: #34d399;
  --rose: #fb7185;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 12px 40px rgba(2, 6, 23, 0.55);
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 75% 55% at 15% 10%, rgba(56, 242, 230, 0.08), transparent 60%),
    radial-gradient(ellipse 65% 50% at 88% 15%, rgba(167, 139, 250, 0.09), transparent 58%),
    radial-gradient(ellipse 55% 45% at 50% 95%, rgba(96, 165, 250, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#ambient-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ================= TOPBAR & HUD ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin: 12px 0 20px;
  background: rgba(8, 13, 30, 0.84);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 2px 6px 2px 2px;
  text-align: left;
}

.brand-orb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #04101a;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px rgba(56, 242, 230, 0.45);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; letter-spacing: 0.14em; font-weight: 800; }
.brand-text small { font-size: 9px; letter-spacing: 0.12em; color: var(--cyan); opacity: 0.85; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 48, 0.68);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-pill {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-soft);
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.nav-pill:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-pill.active {
  color: #03131c;
  background: linear-gradient(135deg, var(--cyan), #7ef9f0);
  box-shadow: 0 0 16px rgba(56, 242, 230, 0.35);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: var(--rose);
  color: #fff;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(19, 29, 58, 0.85);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 48, 0.9);
  border: 1px solid rgba(56, 242, 230, 0.28);
  gap: 2px;
}
.lang-opt {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.16s ease;
}
.lang-opt:hover { color: #fff; }
.lang-opt.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #04101a;
  box-shadow: 0 0 12px rgba(56, 242, 230, 0.35);
}

button.hud-pill { cursor: pointer; transition: border-color 0.2s, transform 0.15s; }
button.hud-pill:hover { border-color: var(--border-bright); transform: translateY(-1px); }

.hud-roman {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: #fff;
  font-size: 10px;
}

.hud-combo-pill.hot {
  border-color: rgba(251, 191, 36, 0.65);
  color: var(--gold);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}

.hud-timer-pill.running {
  border-color: rgba(52, 211, 153, 0.65);
  color: var(--emerald);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(19, 29, 58, 0.8);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: all 0.18s;
}
.btn-icon:hover { border-color: var(--border-bright); background: rgba(56, 242, 230, 0.14); }

/* ================= VIEWS & SHARED CARDS ================= */
.view { display: none; animation: fadeSlide 0.24s ease; }
.view.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2 { margin: 2px 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
h4 { margin: 0 0 12px; font-size: 14.5px; font-weight: 700; color: var(--cyan); }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.eyebrow, .block-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 4px;
}

.muted-sm { font-size: 13px; color: var(--text-muted); }
.muted-xs { font-size: 12px; color: var(--text-muted); }

/* ================= BUTTONS & CHIPS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.full-w { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #22d3ee);
  color: #031520;
  box-shadow: 0 4px 18px rgba(56, 242, 230, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(56, 242, 230, 0.45); }

.btn-accent {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(96, 165, 250, 0.25));
  border-color: rgba(167, 139, 250, 0.45);
  color: #e9d5ff;
}
.btn-accent:hover { background: rgba(167, 139, 250, 0.35); transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-soft);
}
.btn-ghost:hover { border-color: var(--border-bright); color: #fff; background: rgba(255, 255, 255, 0.08); }

.btn-danger {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--rose);
}
.btn-danger:hover { background: rgba(251, 113, 133, 0.25); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.tag-success { color: var(--emerald); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.14); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.75);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
}
.chip:hover { border-color: var(--chip-accent, var(--cyan)); color: #fff; }
.chip.active {
  background: rgba(56, 242, 230, 0.16);
  border-color: var(--chip-accent, var(--cyan));
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 242, 230, 0.2);
}
.chip.correct { border-color: var(--emerald); background: rgba(52, 211, 153, 0.2); color: #fff; }
.chip.wrong { border-color: var(--rose); background: rgba(251, 113, 133, 0.2); color: #fff; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-lg { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

.segmented {
  display: inline-flex;
  background: rgba(9, 14, 30, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
}
.seg-btn.active { background: rgba(56, 242, 230, 0.18); color: var(--cyan); }

.subtab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.subtab-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.subtab-btn:hover { border-color: var(--border-bright); color: #fff; }
.subtab-btn.active {
  background: linear-gradient(135deg, rgba(56, 242, 230, 0.18), rgba(167, 139, 250, 0.18));
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 18px rgba(56, 242, 230, 0.18);
}

/* ================= HUB LAYOUT ================= */
.hub-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(340px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.connectome-card { display: flex; flex-direction: column; }
.connectome-stage {
  position: relative;
  flex: 1;
  min-height: 440px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 50%, rgba(16, 28, 62, 0.72), rgba(5, 9, 22, 0.92));
  border: 1px solid rgba(56, 242, 230, 0.16);
  overflow: hidden;
}
#connectome-canvas { width: 100%; height: 100%; display: block; }
.connectome-footnote { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

.hub-side-col { display: flex; flex-direction: column; gap: 14px; }

.rank-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rank-crest {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #050a18;
  box-shadow: 0 0 22px rgba(167, 139, 250, 0.4);
  flex-shrink: 0;
}
.rank-info { flex: 1; }
.rank-title { font-size: 16.5px; font-weight: 800; }
.rank-en { font-size: 12px; color: var(--violet); font-weight: 600; }
.overall-badge { text-align: right; }
.overall-badge strong { display: block; font-size: 22px; font-family: var(--font-mono); color: var(--cyan); line-height: 1.1; }
.overall-badge small { font-size: 11px; color: var(--text-muted); }

.xp-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold));
  transition: width 0.5s ease;
}
.xp-bar-meta { margin-top: 5px; font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }

.hub-stats-mini {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.hub-stats-mini strong { display: block; font-size: 14px; font-family: var(--font-mono); color: var(--text); }
.hub-stats-mini span { font-size: 10.5px; color: var(--text-muted); }

.zpd-card {
  background: linear-gradient(145deg, rgba(16, 30, 66, 0.88), rgba(24, 22, 58, 0.85));
  border-color: rgba(56, 242, 230, 0.34);
}
.zpd-eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; color: var(--gold); margin-bottom: 5px; }
.zpd-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.zpd-desc { font-size: 13px; color: var(--text-soft); margin-bottom: 12px; }
.zpd-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.inspector-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.inspector-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px;
  background: rgba(8, 13, 30, 0.9); border: 1.5px solid var(--cyan); flex-shrink: 0;
}
.inspector-title { font-weight: 800; font-size: 15px; }
.inspector-en { font-size: 11.5px; color: var(--text-muted); }
.mastery-chip {
  margin-left: auto; padding: 4px 10px; border-radius: 999px; border: 1px solid;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 800;
}
.inspector-summary { font-size: 12.8px; color: var(--text-soft); margin-bottom: 12px; }

.tier-track-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 12px; }
.tier-mini-pill {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: rgba(9, 15, 34, 0.72); color: var(--text-soft);
  cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.16s;
}
.tier-mini-pill:hover { border-color: var(--cyan); color: #fff; }
.tier-mini-pill.done { border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.1); }
.tier-mini-pill .t-badge { font-family: var(--font-mono); font-weight: 800; }
.tier-mini-pill .t-state { margin-left: auto; color: var(--emerald); }
.inspector-actions { display: flex; gap: 8px; }
.inspector-actions .btn { flex: 1; }

/* Wings Section */
.wings-section { margin: 22px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.wing-card {
  text-align: left;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.wing-card:hover { transform: translateY(-4px); }
.wing-card.w-cyan:hover { border-color: var(--cyan); box-shadow: 0 12px 32px rgba(56, 242, 230, 0.18); }
.wing-card.w-violet:hover { border-color: var(--violet); box-shadow: 0 12px 32px rgba(167, 139, 250, 0.18); }
.wing-card.w-gold:hover { border-color: var(--gold); box-shadow: 0 12px 32px rgba(251, 191, 36, 0.18); }
.wing-card.w-rose:hover { border-color: var(--rose); box-shadow: 0 12px 32px rgba(251, 113, 133, 0.18); }
.wing-icon { font-size: 26px; }
.wing-title { font-size: 15px; font-weight: 800; }
.wing-card p { font-size: 12.5px; color: var(--text-muted); flex: 1; margin: 0; }
.wing-cta { font-size: 12.5px; font-weight: 700; color: var(--cyan); margin-top: 4px; }

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.ach-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border); background: rgba(9, 14, 32, 0.65);
}
.ach-pill.locked { opacity: 0.44; filter: grayscale(0.75); }
.ach-pill.unlocked { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.08); }
.ach-ico { font-size: 20px; }
.ach-title { font-size: 12.5px; font-weight: 700; }
.ach-desc { font-size: 11px; color: var(--text-muted); line-height: 1.35; }

/* ================= ACADEMY & CURRICULUM ================= */
.filter-bar {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.filter-bar.compact { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}
.module-card:hover { transform: translateY(-3px); border-color: var(--border-bright); }
.module-card.completed { border-color: rgba(52, 211, 153, 0.42); }
.mod-card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mod-domain-lbl { font-size: 11.5px; font-weight: 700; }
.mod-time { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.mod-done-badge { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--emerald); }
.mod-title { font-size: 15px; font-weight: 800; margin: 2px 0 0; line-height: 1.35; }
.mod-en { font-size: 11.5px; color: var(--text-muted); }
.mod-preview { font-size: 12.5px; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.mod-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; }
.mod-xp { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.mod-open-cta { font-weight: 700; color: var(--cyan); }

/* Lesson Reader */
.lesson-shell { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.lesson-topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.lesson-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.lesson-hero { padding: 6px 2px; }
.lesson-title { font-size: 25px; margin: 0 0 4px; }
.lesson-en { font-size: 13.5px; color: var(--violet); font-weight: 600; }

.lesson-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 18px 20px;
}
.intuition-block {
  background: linear-gradient(135deg, rgba(56, 242, 230, 0.08), rgba(13, 20, 42, 0.85));
  border-color: rgba(56, 242, 230, 0.3);
}
.landmark-block {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.07), rgba(13, 20, 42, 0.85));
  border-color: rgba(251, 191, 36, 0.28);
}

.lesson-formula {
  background: rgba(6, 11, 26, 0.92);
  border: 1px solid rgba(167, 139, 250, 0.38);
  border-radius: 14px;
  padding: 14px 18px;
}
.lesson-formula code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--cyan);
  margin-top: 6px;
  line-height: 1.5;
}

.mech-list { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; color: var(--text-soft); font-size: 14px; }
.mech-list li::marker { color: var(--cyan); }

.lesson-check-card {
  background: rgba(14, 24, 52, 0.88);
  border: 1px solid rgba(56, 242, 230, 0.35);
  border-radius: 16px;
  padding: 20px;
}
.check-q { font-size: 15.5px; font-weight: 700; margin: 8px 0 14px; }

.options-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.option-btn {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 12px 15px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(8, 14, 32, 0.78); color: var(--text); font-size: 13.8px; font-weight: 500;
  cursor: pointer; transition: all 0.16s; font-family: inherit;
}
.option-btn:hover:not(:disabled) { border-color: var(--cyan); background: rgba(56, 242, 230, 0.08); transform: translateX(3px); }
.option-btn:disabled { cursor: default; }
.option-btn.correct { border-color: var(--emerald); background: rgba(52, 211, 153, 0.18); color: #fff; }
.option-btn.wrong { border-color: var(--rose); background: rgba(251, 113, 133, 0.16); color: #fecdd3; }

.opt-letter {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.15); font-family: var(--font-mono); font-size: 12px; font-weight: 800;
}
.option-btn.correct .opt-letter { background: var(--emerald); color: #041911; }
.option-btn.wrong .opt-letter { background: var(--rose); color: #20040a; }

.check-feedback {
  display: none; margin-top: 14px; padding: 13px 16px; border-radius: 12px; font-size: 13.5px;
}
.check-feedback.show { display: block; animation: fadeSlide 0.2s ease; }
.check-feedback.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.45); color: #d1fae5; }
.check-feedback.err { background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.45); color: #ffe4e6; }
.check-feedback p { margin: 5px 0 0; color: var(--text-soft); }

.lesson-footer-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.lesson-footer-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= BRAIN ATLAS & SVG ================= */
.atlas-layout, .sniper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.atlas-stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.brain-svg-wrap {
  background: radial-gradient(circle at 50% 48%, rgba(22, 36, 74, 0.65), rgba(5, 9, 22, 0.92));
  border: 1px solid rgba(56, 242, 230, 0.18);
  border-radius: 14px;
  padding: 10px;
}
.brain-svg { width: 100%; height: auto; display: block; }
.brain-region { cursor: pointer; transition: opacity 0.15s; }
.brain-region path { transition: fill-opacity 0.18s, stroke-width 0.18s; }
.brain-region:hover path { fill-opacity: 0.58; stroke-width: 2.8; }

.atlas-region-pills, .sniper-quick-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.atlas-info-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.atlas-tier-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.atlas-t-btn {
  padding: 7px 6px; border-radius: 9px; border: 1px solid var(--border);
  background: rgba(9, 14, 32, 0.7); color: var(--text-muted); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.atlas-t-btn.active { border-color: var(--t-color); color: #fff; background: rgba(255, 255, 255, 0.08); }
.atlas-tier-body { padding: 14px; border-radius: 12px; background: rgba(8, 14, 34, 0.72); border: 1px solid var(--border); margin-bottom: 12px; }
.atlas-desc { font-size: 14px; color: var(--text); margin: 4px 0 0; }
.atlas-clinical-box { padding: 14px; border-radius: 12px; background: rgba(251, 113, 133, 0.08); border: 1px solid rgba(251, 113, 133, 0.3); font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }

/* ================= SRS FLASHCARD DECK ================= */
.srs-shell { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.srs-metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini-stat-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center;
}
.ms-val { font-size: 22px; font-weight: 800; font-family: var(--font-mono); }
.ms-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.srs-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.flashcard {
  min-height: 250px;
  border-radius: 18px;
  border: 1px solid rgba(56, 242, 230, 0.36);
  background: linear-gradient(145deg, rgba(16, 28, 62, 0.92), rgba(10, 15, 34, 0.95));
  padding: 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.65);
  transition: transform 0.2s, border-color 0.2s;
}
.flashcard:hover { transform: translateY(-2px); border-color: var(--cyan); }
.flashcard .fc-back { display: none; }
.flashcard.flipped .fc-front { display: none; }
.flashcard.flipped .fc-back { display: block; opacity: 1; }
.flashcard.flipped {
  border-color: var(--emerald);
  background: linear-gradient(145deg, rgba(14, 38, 42, 0.94), rgba(10, 18, 38, 0.96));
  box-shadow: 0 18px 46px rgba(52, 211, 153, 0.16);
}
.fc-hint { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--cyan); margin-bottom: 14px; }
.fc-text { font-size: 18.5px; font-weight: 700; line-height: 1.55; color: #f8fafc; }
.fc-tap-prompt { margin-top: 20px; font-size: 12px; color: var(--text-muted); }
.fc-source { margin-top: 18px; font-size: 12px; color: var(--violet); }

.srs-controls { text-align: center; margin-top: 16px; }
.srs-rate-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.srs-rate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rate-btn {
  padding: 11px 8px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-surface);
  color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit; transition: all 0.16s;
}
.rate-btn span { font-size: 13.5px; font-weight: 800; }
.rate-btn small { font-size: 11px; color: var(--text-muted); }
.rate-btn.r1:hover { border-color: var(--rose); background: rgba(251, 113, 133, 0.18); }
.rate-btn.r2:hover { border-color: var(--gold); background: rgba(251, 191, 36, 0.18); }
.rate-btn.r3:hover { border-color: var(--cyan); background: rgba(56, 242, 230, 0.18); }
.rate-btn.r4:hover { border-color: var(--emerald); background: rgba(52, 211, 153, 0.22); }
.empty-srs { text-align: center; padding: 36px; }

/* ================= INTERACTIVE LABS ================= */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.lab-stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lab-stage-head code { font-family: var(--font-mono); font-size: 11.5px; color: var(--cyan); }
.live-readouts { display: flex; gap: 8px; flex-wrap: wrap; }
.readout {
  padding: 6px 11px; border-radius: 10px; background: rgba(6, 11, 26, 0.85); border: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 84px;
}
.r-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.r-val { font-family: var(--font-mono); font-size: 13.5px; font-weight: 800; color: var(--cyan); }

.lab-canvas {
  width: 100%;
  display: block;
  border-radius: 14px;
  background: #060a18;
  border: 1px solid rgba(56, 242, 230, 0.2);
}

.canvas-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--text-muted);
}
.canvas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.canvas-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

.lab-missions-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.mission-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mission-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 11px; border: 1px solid var(--border); background: rgba(7, 12, 28, 0.72);
}
.mission-item.done { border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.09); }
.mission-check {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  border: 1.5px solid var(--text-muted); font-size: 12px; font-weight: 800;
}
.mission-item.done .mission-check { border-color: var(--emerald); background: var(--emerald); color: #041911; }
.mission-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.m-done-lbl { font-size: 10.5px; color: var(--emerald); font-family: var(--font-mono); }
.mission-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Sliders & Controls */
.ctrl-row { margin-bottom: 14px; }
.ctrl-slider { margin-bottom: 14px; }
.sl-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.sl-head strong { font-family: var(--font-mono); color: var(--cyan); }
.sl-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
  cursor: pointer;
}

.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.lab-insight-box {
  padding: 12px 14px; border-radius: 12px; background: rgba(56, 242, 230, 0.08);
  border: 1px solid rgba(56, 242, 230, 0.25); font-size: 12.8px; color: var(--text-soft);
}
.toggle-row { margin-bottom: 9px; }
.switch-lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--text-soft); }
.switch-lbl.compact { font-size: 12px; }
.soft-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.rpe-btn-col { display: flex; flex-direction: column; gap: 7px; }
.rpe-btn-col .btn { justify-content: flex-start; text-align: left; }

/* ================= ARCADE GAMES ================= */
.game-top-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.game-progress-pill {
  padding: 6px 13px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 12.5px; font-family: var(--font-mono); color: var(--text-soft);
}
.sniper-meta, .blitz-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sniper-cue-label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 6px; }
.sniper-prompt-text { font-size: 17px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }

.neuro-select {
  background: var(--bg-surface-solid); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; font-family: inherit;
}

.blitz-card, .decoder-card, .cascade-stage { max-width: 880px; margin: 0 auto; }
.blitz-q { font-size: 18px; font-weight: 700; line-height: 1.48; margin: 4px 0 16px; }

.confidence-btn {
  margin-left: auto;
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1); color: var(--gold); font-size: 12px; font-weight: 700; cursor: pointer;
}
.confidence-btn.active {
  background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1c1002;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}

/* Cascade Game */
.cascade-title { font-size: 19px; margin-bottom: 4px; }
.cascade-slots { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.cascade-slot {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
  border: 1px dashed rgba(148, 163, 184, 0.25); background: rgba(7, 12, 28, 0.65); color: var(--text-muted); font-size: 13.5px;
}
.cascade-slot.next { border-color: var(--cyan); border-style: solid; background: rgba(56, 242, 230, 0.07); color: var(--cyan); }
.cascade-slot.filled { border-color: var(--emerald); border-style: solid; background: rgba(52, 211, 153, 0.12); color: #fff; font-weight: 600; }
.slot-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.16); font-family: var(--font-mono); font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.cascade-slot.filled .slot-num { background: var(--emerald); color: #041911; }

.cascade-pool { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; margin-top: 14px; }
.cascade-tile {
  padding: 13px 14px; border-radius: 11px; border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(20, 28, 58, 0.85); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; font-family: inherit; transition: all 0.16s;
}
.cascade-tile:hover { border-color: var(--cyan); transform: translateY(-2px); background: rgba(56, 242, 230, 0.14); }
.cascade-tile.shake-err { border-color: var(--rose); background: rgba(251, 113, 133, 0.22); animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.result-card { max-width: 600px; margin: 24px auto; text-align: center; padding: 34px 28px; }
.result-badge { font-size: 46px; margin-bottom: 6px; }
.result-score { font-size: 32px; font-weight: 900; font-family: var(--font-mono); color: var(--cyan); margin: 8px 0 10px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ================= CLINICAL NEURO-DETECTIVE ================= */
.clinic-header-bar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.case-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 15px; padding: 16px;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: all 0.2s;
}
.case-card:hover { transform: translateY(-3px); border-color: var(--rose); }
.case-card.solved { border-color: rgba(52, 211, 153, 0.45); }
.case-card-top { display: flex; align-items: center; gap: 8px; }
.case-code {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 800; color: var(--rose);
  padding: 2px 8px; border-radius: 6px; background: rgba(251, 113, 133, 0.14); border: 1px solid rgba(251, 113, 133, 0.35);
}
.case-title { font-size: 15.5px; font-weight: 800; margin: 2px 0 0; }
.case-patient { font-size: 12px; color: var(--cyan); font-weight: 600; }
.case-snippet { font-size: 12.8px; color: var(--text-soft); flex: 1; }
.case-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }

.case-workbench { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.case-wb-title { font-size: 22px; margin-bottom: 6px; }
.case-patient-banner { font-size: 13.5px; color: var(--cyan); margin-bottom: 8px; }
.case-presentation { font-size: 14.5px; color: var(--text); line-height: 1.62; margin-bottom: 14px; }

.vitals-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vital-pill {
  padding: 9px 12px; border-radius: 10px; background: rgba(7, 12, 28, 0.78); border: 1px solid var(--border);
}
.vital-pill.wide { grid-column: 1 / -1; border-color: rgba(251, 113, 133, 0.35); }
.vital-pill span { display: block; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.vital-pill strong { font-size: 13px; color: #fff; font-family: var(--font-mono); }

.case-stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stepper-node {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: rgba(9, 14, 32, 0.7); color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.stepper-node.active { border-color: var(--cyan); color: #fff; background: rgba(56, 242, 230, 0.12); }
.stepper-node.done { border-color: var(--emerald); color: var(--emerald); background: rgba(52, 211, 153, 0.1); }
.sn-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.18); font-family: var(--font-mono); font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.stepper-node.active .sn-num { background: var(--cyan); color: #04131c; }
.stepper-node.done .sn-num { background: var(--emerald); color: #041911; }

/* ================= FOCUS DRAWER & REPLAY MODAL ================= */
.focus-drawer {
  position: fixed;
  top: 0; right: -400px; width: 370px; max-width: 92vw; height: 100vh;
  z-index: 80;
  background: rgba(9, 14, 32, 0.96);
  backdrop-filter: blur(22px);
  border-left: 1px solid rgba(56, 242, 230, 0.28);
  padding: 20px;
  overflow-y: auto;
  transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -16px 0 50px rgba(0, 0, 0, 0.65);
}
.focus-drawer.open { right: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.drawer-section { padding: 14px 0; border-top: 1px solid var(--border); }
.drawer-timer-big { font-size: 40px; font-weight: 900; font-family: var(--font-mono); color: var(--cyan); text-align: center; margin: 8px 0 12px; }

.soundscape-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sc-btn {
  padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(16, 24, 52, 0.72);
  color: var(--text); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; font-family: inherit;
}
.sc-btn strong { font-size: 13px; }
.sc-btn small { font-size: 11px; color: var(--text-muted); }
.sc-btn.active { border-color: var(--cyan); background: rgba(56, 242, 230, 0.16); box-shadow: 0 0 14px rgba(56, 242, 230, 0.2); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center;
  background: rgba(3, 6, 16, 0.78); backdrop-filter: blur(10px); padding: 20px;
}
.modal-backdrop.open { display: grid; }
.modal-box {
  max-width: 440px; width: 100%; background: var(--bg-surface-solid); border: 1px solid rgba(56, 242, 230, 0.42);
  border-radius: 20px; padding: 26px; text-align: center; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.replay-ring-wrap { position: relative; width: 132px; height: 132px; margin: 16px auto; }
.replay-svg { width: 100%; height: 100%; }
#replay-ring-progress { transition: stroke-dashoffset 0.9s linear; }
.replay-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 36px; font-weight: 900; font-family: var(--font-mono); color: var(--cyan);
}
.replay-msg { font-size: 13.5px; color: var(--text-soft); margin-bottom: 18px; }

/* ================= TOAST STACK ================= */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px; pointer-events: none;
}
.neuro-toast {
  padding: 12px 15px; border-radius: 12px; background: rgba(10, 17, 38, 0.96);
  border: 1px solid var(--cyan); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateX(24px); transition: all 0.28s ease;
}
.neuro-toast.show { opacity: 1; transform: translateX(0); }
.neuro-toast.toast-achievement, .neuro-toast.toast-rank {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(38, 28, 12, 0.96), rgba(14, 20, 44, 0.96));
}
.toast-title { font-size: 13px; font-weight: 800; color: var(--cyan); }
.neuro-toast.toast-achievement .toast-title, .neuro-toast.toast-rank .toast-title { color: var(--gold); }
.toast-body { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1120px) {
  .hub-hero-grid, .lab-grid, .atlas-layout, .sniper-layout { grid-template-columns: 1fr; }
  .wings-grid { grid-template-columns: repeat(2, 1fr); }
  .connectome-stage { min-height: 360px; }
}

@media (max-width: 720px) {
  .app-shell { padding: 0 12px 48px; }
  .wings-grid, .srs-metrics-row, .srs-rate-grid, .case-stepper { grid-template-columns: 1fr; }
  .hub-stats-mini { grid-template-columns: repeat(3, 1fr); }
  .vitals-strip { grid-template-columns: 1fr; }
}
