/* ==========================================================================
   STACKSAGE COMPONENTS — Codecademy Dark Editorial Style
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. PLAYER QUIZ BUTTONS — .quiz-option-btn / .option-letter-badge
      (player.js uses these class names — must be styled here)
   -------------------------------------------------------------------------- */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.85rem 0;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.5;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary-border);
  background: var(--primary-muted);
  color: var(--text-primary);
}

.quiz-option-btn:disabled {
  cursor: default;
}

.quiz-option-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

.quiz-option-btn.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.2);
}

.option-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.quiz-option-btn:hover:not(:disabled) .option-letter-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.quiz-option-btn.correct .option-letter-badge {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.quiz-option-btn.incorrect .option-letter-badge {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

/* Quiz feedback box */
.quiz-feedback-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.quiz-feedback-box.correct {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.quiz-feedback-box.incorrect {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.feedback-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.quiz-feedback-box.correct .feedback-title {
  color: var(--success);
}

.quiz-feedback-box.incorrect .feedback-title {
  color: var(--error);
}

.feedback-explanation {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Diagram nodes (used in problem/scenario screens) */
.diagram-node {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1rem;
  flex: 1;
  min-width: 0;
}

.diagram-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Ghost button — make more readable */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--border-emphasis);
}

.btn-ghost:disabled {
  opacity: 0.3;
  cursor: default;
}


.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(13, 17, 23, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  min-width: 0;
}

/* Brand logo — Codecademy bordered-box treatment */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-box {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  letter-spacing: -0.02em;
  background: var(--bg-surface-elevated);
}

.brand-logo-box span.brand-bracket {
  color: var(--primary);
}

.brand-logo-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 2px 6px;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 2px 5px;
  background: var(--primary-muted);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 6px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Hide old brand-icon-box */
.brand-icon-box {
  display: none;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Nav HUD */
.nav-user-hud {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.streak-hud {
  background: var(--streak-bg);
  color: var(--streak-fire);
  border-color: var(--streak-border);
}

.streak-hud:hover {
  background: rgba(251, 143, 68, 0.2);
}

.streak-hud .flame-icon {
  font-size: 0.85rem;
}

.xp-hud {
  background: var(--primary-muted);
  color: var(--primary);
  border-color: var(--primary-border);
}

.xp-hud:hover {
  background: rgba(245, 197, 24, 0.22);
}

/* User avatar */
.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.user-avatar-btn:hover {
  border-color: var(--border-emphasis);
  background: var(--bg-card-hover);
}

.user-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--primary-text);
}

/* User Profile Dropdown Menu */
.profile-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface, #161b22);
  border: 1px solid var(--border-emphasis, #30363d);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  width: 220px;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  white-space: normal;
  text-align: left;
  cursor: default;
}

.profile-dropdown-menu.open {
  display: flex !important;
}

.profile-dropdown-menu .btn {
  display: flex !important;
  width: 100% !important;
  box-sizing: border-box;
  white-space: normal;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(13, 17, 23, 0.98);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  min-width: 56px;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active svg {
  stroke: var(--primary);
}

/* ── Hamburger button — hidden on desktop, shown ≤900px ── */
/* ── Hamburger button ──
   Always display:inline-flex but invisible/collapsed on desktop.
   Transitions in with a spring bounce at ≤1050px. */
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  cursor: pointer;
  /* Desktop: invisible (takes no visual space but keeps layout slot) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.75) rotate(-15deg);
  transition:
    opacity    0.25s ease,
    visibility 0.25s ease,
    transform  0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.15s ease,
    border-color 0.15s ease,
    color      0.15s ease;
}

.hamburger-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-border);
  color: var(--primary);
}

.hamburger-btn[aria-expanded="true"],
.hamburger-btn.is-open {
  background: var(--bg-card-hover);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: scale(1) rotate(90deg);
}

/* ── Mobile HUD + Nav dropdown panel ──
   Uses opacity+visibility+transform so both open AND close animate. */
.mobile-hud-panel {
  display: flex;                /* always flex — hidden via opacity/visibility */
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  right: 0;
  background: rgba(13, 17, 23, 0.98);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 0 var(--radius-md);
  padding: 0.75rem;
  gap: 0.4rem;
  z-index: 99;
  min-width: 210px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: top right;
  /* Closed state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition:
    opacity    0.22s ease,
    visibility 0.22s ease,
    transform  0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* Open state */
.mobile-hud-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Nav links section inside panel */
.mobile-hud-panel .mobile-panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.35rem;
}

.mobile-hud-panel .mobile-panel-nav a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.mobile-hud-panel .mobile-panel-nav a:hover,
.mobile-hud-panel .mobile-panel-nav a.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

/* HUD items inside panel */
.mobile-hud-panel .hud-pill {
  justify-content: flex-start;
  width: 100%;
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
}

.mobile-hud-panel .btn-ghost,
.mobile-hud-panel .nav-google-btn,
.mobile-hud-panel .user-avatar-btn {
  width: 100%;
  justify-content: flex-start;
  font-size: 0.82rem;
}

/* ── At ≤1050px: nav links won't fit — collapse to hamburger ── */
@media (max-width: 1050px) {
  .navbar-inner {
    gap: 0.75rem;
    padding: 0 1rem;
  }

  /* Collapse nav links without display:none so transition works */
  .nav-links {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    flex: 0 0 0;
    min-width: 0;
    overflow: hidden;
    gap: 0;
  }

  /* Collapse HUD */
  .nav-user-hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    flex: 0 0 0;
    overflow: hidden;
  }

  /* Spring in hamburger — pinned to right edge */
  .hamburger-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1) rotate(0deg);
    width: 38px;
    overflow: visible;
    margin-left: auto;   /* push past all collapsed flex items to the right edge */
  }
}

/* ── At ≤768px: show mobile bottom nav, tighten inner padding ── */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .navbar {
    height: var(--header-height);
    min-height: unset;
    padding: 0;
    align-items: center;
  }

  .navbar-inner {
    padding: 0 0.75rem;
  }

  .mobile-bottom-nav {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   2. STREAK POPOVER
   -------------------------------------------------------------------------- */
.streak-popover {
  position: absolute;
  top: calc(var(--header-height) + 4px);
  right: 1.5rem;
  width: 300px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  z-index: 200;
  display: none;
  animation: fadeInDown 0.18s ease;
}

.streak-popover.open {
  display: block;
}

.streak-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.streak-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0.75rem 0;
  text-align: center;
  width: 100%;
}

.streak-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.streak-day-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
}

.streak-day-circle {
  width: 100%;
  max-width: 26px;
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  box-sizing: border-box;
}

.streak-day-circle.completed {
  background: linear-gradient(135deg, var(--streak-fire), #f43f5e);
  border-color: transparent;
  color: white;
}

.streak-day-circle.today {
  border: 1.5px solid var(--streak-fire);
  color: var(--streak-fire);
  background: var(--streak-bg);
  animation: pulseGlow 2s infinite;
}

/* --------------------------------------------------------------------------
   3. LANDING PAGE
   -------------------------------------------------------------------------- */
.landing-hero {
  text-align: center;
  max-width: 800px;
  margin: 2rem auto 3.5rem auto;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.landing-hero h1 {
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.landing-hero .hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 2rem auto;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 600px;
  margin: 0 auto;
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

.hero-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-family: var(--font-mono);
}

.interactive-teaser {
  max-width: 820px;
  margin: 3rem auto 4rem auto;
  padding: 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  margin-bottom: 0.75rem;
}

.teaser-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.teaser-tabs-group {
  display: flex;
  gap: 0.4rem;
  flex: 1 1 auto;
}

.teaser-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.teaser-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.teaser-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.teaser-autoplay-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.teaser-autoplay-toggle:hover {
  color: #fff;
  border-color: var(--accent-blue);
}

/* Slider Track */
.teaser-carousel-viewport {
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-md);
}

.teaser-carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  width: 200%;
}

.teaser-slide {
  width: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.teaser-card-inner {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Slide 1: Superpowers Buttons */
.superpower-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}

@media (max-width: 680px) {
  .superpower-buttons-grid {
    grid-template-columns: 1fr;
  }
}

.superpower-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
}

.superpower-btn:hover {
  border-color: var(--border-default);
  background: rgba(255, 255, 255, 0.05);
}

.superpower-btn.active {
  border-color: var(--primary-light, #818cf8);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25), inset 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.superpower-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #818cf8, #06b6d4);
}

.superpower-btn-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.superpower-btn-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.superpower-detail-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  margin-top: 0.75rem;
  animation: fadeIn 0.25s ease;
}

.superpower-detail-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.superpower-detail-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.superpower-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.superpower-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-blue);
}

/* Slide 2: Terminal Window */
.teaser-terminal-window {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  font-family: var(--font-mono);
}

.teaser-terminal-header {
  background: #161b22;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.teaser-terminal-dots {
  display: flex;
  gap: 6px;
}

.teaser-dot-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.teaser-dot-red { background: #ff5f56; }
.teaser-dot-yellow { background: #ffbd2e; }
.teaser-dot-green { background: #27c93f; }

.teaser-terminal-title {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.teaser-terminal-body {
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #c9d1d9;
  min-height: 175px;
  max-height: 250px;
  overflow-y: auto;
}

.terminal-prompt {
  color: #58a6ff;
  font-weight: 700;
}

.terminal-cmd-text {
  color: #fff;
  font-weight: 600;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #58a6ff;
  vertical-align: middle;
  animation: terminalBlink 0.9s infinite;
}

@keyframes terminalBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.terminal-output {
  color: #8b949e;
  margin: 0.4rem 0;
}

.terminal-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  margin-top: 0.4rem;
}

.feature-pillar-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}

.feature-pillar-card:hover {
  border-color: var(--border-default);
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   4. DASHBOARD — 2-column layout (sidebar + main)
   -------------------------------------------------------------------------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 246px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

/* Left sidebar */
.dashboard-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-text);
}

.sidebar-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-stat-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
  overflow: hidden;
}

.sidebar-badges-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

/* Main content area */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Dashboard header */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.welcome-box h1 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin-bottom: 0.25rem;
}

/* Mission card — replaced glassmorphism with dark solid */
.streak-banner-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--streak-border);
  border-radius: var(--radius-md);
}

.streak-big-flame {
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flamePulse 2s infinite ease-in-out;
}

/* Today's mission card */
.mission-hero-card {
  position: relative;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mission-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 197, 24, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.mission-meta-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.mission-title {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  margin-bottom: 0.4rem;
}

.mission-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.mission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Course card */
.course-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.course-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.course-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-muted);
  border: 1px solid var(--accent-blue-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. COURSE PAGE & ROADMAP
   -------------------------------------------------------------------------- */
.course-hero-header {
  margin-bottom: 2rem;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.course-hero-header h1 {
  margin-bottom: 0.6rem;
}

.course-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0 2rem 0;
}

@media (max-width: 768px) {
  .course-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.course-stat-card {
  padding: 1rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* Roadmap */
.roadmap-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  padding-left: 2.5rem;
}

.roadmap-container::before {
  content: '';
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 1.15rem;
  width: 2px;
  background: var(--border-subtle);
  border-radius: 2px;
}

.roadmap-lesson-node {
  position: relative;
  margin-bottom: 1.25rem;
}

.roadmap-node-dot {
  position: absolute;
  left: -2.5rem;
  top: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  z-index: 2;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
}

.roadmap-lesson-node.completed .roadmap-node-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.roadmap-lesson-node.current .roadmap-node-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 0 0 3px var(--primary-muted);
  animation: pulseDot 2s infinite;
}

.roadmap-lesson-node.locked .roadmap-node-dot {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-faint);
}

.roadmap-card {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.roadmap-lesson-node.current .roadmap-card {
  border-color: var(--primary-border);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.15);
}

.roadmap-lesson-node.completed .roadmap-card {
  border-color: rgba(63, 185, 80, 0.25);
  background: var(--bg-card);
}

/* --------------------------------------------------------------------------
   6. LESSON PLAYER
   -------------------------------------------------------------------------- */
.player-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.player-top-bar {
  position: sticky;
  top: 0;
  height: 60px;
  background: rgba(13, 17, 23, 0.98);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 10;
}

.player-progress-bar {
  flex: 1;
  max-width: 400px;
  margin: 0 1.5rem;
}

.player-card-container {
  flex: 1;
  max-width: 700px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-md);
  animation: cardSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.25rem 0;
  gap: 1rem;
}

.player-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

#step-prev-btn,
#step-next-btn {
  min-height: 42px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

#step-prev-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.step-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.step-card-title {
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  margin-bottom: 1.1rem;
}

/* Comparison tabs */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

@media (max-width: 580px) {
  .comparison-container {
    grid-template-columns: 1fr;
  }
}

.comparison-box {
  padding: 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-surface-elevated);
}

.comparison-box:hover {
  border-color: var(--border-emphasis);
}

.comparison-box.active-tab {
  border-color: var(--primary);
  background: var(--primary-muted);
}

/* Scenario diagram */
.scenario-diagram {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  margin: 1.1rem 0;
}

.diagram-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   7. QUIZ / MCQ STYLES
   -------------------------------------------------------------------------- */
.quiz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.quiz-option {
  padding: 1rem 1.25rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
  width: 100%;
  font-family: var(--font-sans);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary-border);
  background: var(--primary-muted);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-muted);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.2);
}

.quiz-option-letter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.quiz-option.selected .quiz-option-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

/* --------------------------------------------------------------------------
   8. INTERACTIVE SIMULATION / TERMINAL
   -------------------------------------------------------------------------- */
.sim-terminal {
  background: #010409;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

.sim-terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sim-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.sim-prompt {
  color: var(--success);
}

.sim-command {
  color: var(--text-primary);
}

.sim-output {
  color: var(--text-secondary);
}

.sim-comment {
  color: var(--text-muted);
}

.sim-highlight {
  color: var(--primary);
  font-weight: 600;
}

.sim-error {
  color: var(--error);
}

/* Clickable sim steps */
.sim-step-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-primary);
  text-align: left;
  margin-bottom: 0.5rem;
}

.sim-step-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-muted);
}

.sim-step-btn.completed {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

/* Simulation Sandboxes & Widgets */
.simulation-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.simulation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.sim-toggle-group {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.sim-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-toggle-btn:hover {
  color: var(--text-primary);
}

.sim-toggle-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.sim-workbench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 680px) {
  .sim-workbench-grid {
    grid-template-columns: 1fr;
  }
}

.sim-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  transition: all 0.2s ease;
}

.sim-box.container-box-active {
  border-color: rgba(245, 197, 24, 0.45);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.08) 0%, var(--bg-surface) 100%);
}

.sim-box.raw-box-active {
  border-color: rgba(248, 81, 73, 0.4);
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.08) 0%, var(--bg-surface) 100%);
}

.sim-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-ingredient-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.sim-ingredient-item.checked {
  border-color: rgba(63, 185, 80, 0.35);
}

.sim-ingredient-item.disabled {
  opacity: 0.6;
  border-color: rgba(248, 81, 73, 0.35);
}

.sim-target-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-target-btn {
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-target-btn:hover {
  border-color: var(--border-emphasis);
  background: var(--bg-card-hover);
}

.sim-target-btn.selected {
  border-color: var(--primary);
  background: var(--primary-muted);
}

/* Boot Race simulator */
.race-lane {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}

.race-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.race-time-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.race-progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-base);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
}

.race-progress-bar {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-full);
}

.race-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Architecture Inspector */
.arch-inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
}

@media (max-width: 680px) {
  .arch-inspector-grid {
    grid-template-columns: 1fr;
  }
}

.arch-stack-column {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.arch-layer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.arch-layer-card:hover {
  border-color: var(--border-emphasis);
  transform: translateX(3px);
}

.arch-layer-card.active {
  border-color: var(--primary);
  background: var(--primary-muted);
  transform: translateX(5px);
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.2);
}

.arch-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   9. BADGES PAGE
   -------------------------------------------------------------------------- */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.badge-item-card,
.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.15rem;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-item-card:hover,
.badge-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.badge-item-card.unlocked,
.badge-card.earned {
  border-color: rgba(245, 197, 24, 0.4);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.08) 0%, var(--bg-surface-elevated) 100%);
}

.badge-item-card.unlocked:hover,
.badge-card.earned:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(245, 197, 24, 0.2);
}

.badge-item-card.locked,
.badge-card.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

.badge-item-card.locked:hover,
.badge-card.locked:hover {
  opacity: 0.85;
  filter: grayscale(0.3);
  border-color: var(--border-emphasis);
}

.badge-icon-wrap,
.badge-icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.badge-item-card:hover .badge-icon-wrap,
.badge-card:hover .badge-icon {
  transform: scale(1.1);
}

.badge-item-card.unlocked .badge-icon-wrap {
  filter: drop-shadow(0 4px 14px rgba(245, 197, 24, 0.4));
}

.badge-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Badge Detail Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   10. XP TOAST
   -------------------------------------------------------------------------- */
.xp-toast {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  right: 1.5rem;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s ease 2.2s forwards;
}

/* --------------------------------------------------------------------------
   11. SECURITY GATE (passphrase modal)
   -------------------------------------------------------------------------- */
.security-gate-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-image: radial-gradient(circle, rgba(88, 166, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.security-gate-backdrop.hidden {
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.security-gate-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.gate-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.gate-badge-linear {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gate-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseGlow 2s infinite;
}

.gate-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.gate-icon-circle svg {
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

.security-gate-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.security-gate-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.passphrase-input-wrapper {
  position: relative;
  margin-bottom: 0.75rem;
}

.passphrase-input {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.passphrase-input::placeholder {
  color: var(--text-muted);
}

.passphrase-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-muted);
}

.passphrase-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passphrase-toggle-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.passphrase-toggle-btn:hover {
  color: var(--text-secondary);
}

.gate-submit-btn {
  width: 100%;
  margin-bottom: 0.75rem;
  min-height: 42px;
}

.gate-status-msg {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  min-height: 1.5rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.gate-status-msg.success {
  color: var(--success);
}

.gate-status-msg.error {
  color: var(--error);
}

.gate-specs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.gate-specs-footer span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   12. DEMO MODE TOGGLE (Discreet bottom button)
   -------------------------------------------------------------------------- */
.demo-floating-widget {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 0.75rem);
  right: 1rem;
  z-index: 300;
  display: flex;
  align-items: center;
}

@media (min-width: 769px) {
  .demo-floating-widget {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}

.demo-toggle-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0.75;
}

.demo-toggle-btn:hover {
  border-color: var(--border-emphasis);
  color: var(--text-primary);
  opacity: 1;
  transform: translateY(-1px);
}

.demo-toggle-btn.is-active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   13. LESSON RESULTS / COMPLETION
   -------------------------------------------------------------------------- */
.results-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.results-score-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  background: var(--primary-muted);
}

.results-score-number {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.results-score-total {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Badge unlock notification */
.badge-unlock-card {
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   14. LESSON PLAYER NAVIGATION FOOTER
   -------------------------------------------------------------------------- */
.player-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   15. SHAKE ANIMATION (gate error)
   -------------------------------------------------------------------------- */
.shake {
  animation: shakeX 0.4s ease;
}

/* --------------------------------------------------------------------------
   16. CELEBRATION / COMPLETION SCREEN
   -------------------------------------------------------------------------- */
.celebration-screen {
  text-align: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.celebration-screen::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(245, 197, 24, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.celebration-flame {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounceIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.celebration-screen .pill-success {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-xs);
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.35);
  display: inline-flex;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

/* 3-column reward stats grid */
.celebration-rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.75rem 0;
}

@media (max-width: 480px) {
  .celebration-rewards-grid {
    grid-template-columns: 1fr;
  }
}

.reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.reward-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* XP card — vibrant yellow/gold */
.reward-card:nth-child(1) {
  border-color: rgba(245, 197, 24, 0.4);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.12) 0%, rgba(30, 36, 44, 0.85) 100%);
  animation-delay: 0.1s;
}

.reward-card:nth-child(1) .reward-card-value {
  color: var(--primary);
  text-shadow: 0 0 12px rgba(245, 197, 24, 0.3);
}

/* Streak card — flame orange */
.reward-card:nth-child(2) {
  border-color: rgba(255, 120, 73, 0.4);
  background: linear-gradient(180deg, rgba(255, 120, 73, 0.12) 0%, rgba(30, 36, 44, 0.85) 100%);
  animation-delay: 0.2s;
}

.reward-card:nth-child(2) .reward-card-value {
  color: var(--streak-fire);
  text-shadow: 0 0 12px rgba(255, 120, 73, 0.3);
}

/* Accuracy card — score dependent (perfect / good / low) */
.reward-card:nth-child(3),
.reward-card.accuracy-perfect {
  border-color: rgba(63, 185, 80, 0.4);
  background: linear-gradient(180deg, rgba(63, 185, 80, 0.12) 0%, rgba(30, 36, 44, 0.85) 100%);
  animation-delay: 0.3s;
}

.reward-card.accuracy-perfect .reward-card-value,
.reward-card:nth-child(3) .reward-card-value {
  color: var(--success);
  text-shadow: 0 0 12px rgba(63, 185, 80, 0.3);
}

.reward-card.accuracy-good {
  border-color: rgba(245, 197, 24, 0.4);
  background: linear-gradient(180deg, rgba(245, 197, 24, 0.12) 0%, rgba(30, 36, 44, 0.85) 100%);
}

.reward-card.accuracy-good .reward-card-value {
  color: var(--primary);
  text-shadow: 0 0 12px rgba(245, 197, 24, 0.3);
}

.reward-card.accuracy-low {
  border-color: rgba(248, 81, 73, 0.4);
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.12) 0%, rgba(30, 36, 44, 0.85) 100%);
}

.reward-card.accuracy-low .reward-card-value {
  color: var(--error);
  text-shadow: 0 0 12px rgba(248, 81, 73, 0.3);
}

.reward-card-icon {
  font-size: 1.85rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.reward-card-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.reward-card-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Badge unlock row */
.badge-unlock-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  background: rgba(245, 197, 24, 0.07);
  border: 1px solid rgba(245, 197, 24, 0.28);
  border-radius: var(--radius-md);
  text-align: left;
  animation: fadeInDown 0.35s ease 0.4s both;
}

.badge-unlock-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

/* --------------------------------------------------------------------------
   17. QUIZ QUESTION BLOCK
   -------------------------------------------------------------------------- */
.quiz-question-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.quiz-question-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   18. STEP META BADGE (override to be pill-shaped with bg)
   -------------------------------------------------------------------------- */
.step-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.65rem;
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   19. ANALOGY / INSIGHT BOXES (concept screens)
   -------------------------------------------------------------------------- */
.analogy-box {
  background: rgba(245, 197, 24, 0.06);
  border: 1px solid rgba(245, 197, 24, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.insight-highlight-box {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
}

.insight-highlight-box strong {
  color: var(--accent-blue);
  display: block;
  font-size: 0.87rem;
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   20. FLOATING XP TOAST
   -------------------------------------------------------------------------- */
.xp-toast {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  right: 1.5rem;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9999;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(245, 197, 24, 0.3);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s ease 2.2s forwards;
  pointer-events: none;
}

/* ==========================================================================
   Security Passphrase Gate (AES-256-GCM)
   ========================================================================== */
.security-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at top center, rgba(30, 27, 75, 0.85) 0%, rgba(10, 15, 30, 0.98) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.security-gate-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.security-gate-modal {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.2), 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-gate-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.security-gate-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
  animation: floatSubtle 4s ease-in-out infinite;
}

.security-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.security-gate-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.security-gate-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.security-gate-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.passphrase-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.passphrase-input {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 1rem;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  outline: none;
}

.passphrase-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 16px var(--primary-glow);
  background: rgba(2, 6, 23, 0.95);
}

.toggle-password-visibility-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.toggle-password-visibility-btn:hover {
  color: var(--text-primary);
}

.security-gate-submit-btn {
  width: 100%;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}

.security-gate-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, var(--primary-light) 0%, #8b5cf6 100%);
}

.security-gate-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gate-status-msg {
  min-height: 24px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
  text-align: center;
  transition: all 0.2s;
}

.gate-status-msg.error {
  color: #fb7185;
}

.gate-status-msg.success {
  color: #34d399;
}

.security-specs-bar {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.security-specs-bar span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

@keyframes shakeGate {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

.security-gate-modal.shake {
  animation: shakeGate 0.45s ease-in-out;
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.35);
}

/* ==========================================================================
   Paywall Modal & Streak to Save Discount Engine
   ========================================================================== */
.paywall-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 19, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.paywall-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.paywall-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 2.25rem 2rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95) 0%, rgba(13, 18, 30, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 40px rgba(245, 158, 11, 0.1);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.paywall-backdrop.open .paywall-card {
  transform: scale(1) translateY(0);
}

.paywall-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.paywall-close-btn:hover {
  color: var(--text-primary);
}

.paywall-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 2.2rem;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}

.streak-discount-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.streak-discount-box.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.12);
}

.paywall-perks-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.paywall-perk-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.paywall-perk-item span:first-child {
  color: var(--success);
  font-weight: 800;
  font-family: var(--font-mono);
}

.lesson-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  color: var(--streak-fire);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.streak-banner-course {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(249, 115, 22, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   CLI Terminal & Interactive Layer Simulator Styles
   ========================================================================== */
.terminal-window {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75);
  font-family: var(--font-mono);
  margin-top: 0.5rem;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.75rem;
}

.terminal-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.term-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.term-btn:hover {
  opacity: 0.8;
}

.term-close {
  background: #f43f5e;
}

.term-min {
  background: #f59e0b;
}

.term-max {
  background: #10b981;
}

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-detach-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.term-detach-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Detached Floating Terminal Window */
.terminal-window.is-detached {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(660px, calc(100vw - 32px));
  height: 420px;
  max-width: 96vw;
  max-height: 94vh;
  z-index: 1050;
  margin-top: 0;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(56, 189, 248, 0.4), 0 0 32px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(11, 15, 25, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.4);
  animation: detachSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  resize: both;
  overflow: hidden;
  min-width: 320px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

@keyframes detachSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.terminal-window.is-detached .terminal-topbar {
  flex-shrink: 0;
  cursor: grab;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  user-select: none;
}

.terminal-window.is-detached .terminal-topbar:active {
  cursor: grabbing;
}

.terminal-window.is-detached .terminal-screen {
  flex: 1 1 0px;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.terminal-detached-placeholder {
  border: 2px dashed rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.04);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.2s ease;
}

.terminal-screen {
  padding: 1rem 1.15rem;
  min-height: 180px;
  max-height: 270px;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: left;
}

/* Custom Cyberpunk Scrollbar for Terminal */
.terminal-screen::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.terminal-screen::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.terminal-screen::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.7);
}

.terminal-screen {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) rgba(0, 0, 0, 0.3);
}

.term-line-input {
  margin-bottom: 0.35rem;
}

.term-prompt {
  color: #34d399;
  font-weight: 700;
  margin-right: 0.35rem;
}

.term-cmd {
  color: #38bdf8;
  font-weight: 700;
}

.term-line-output {
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  margin-bottom: 0.65rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line-system {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.term-line-error {
  color: #f87171;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.term-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.term-cli-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.term-cli-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.term-enter-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.term-enter-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #fff;
}

.terminal-checklist {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.checklist-item.done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
  font-weight: 700;
}

.image-layer-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.layer-block {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.layer-ro {
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--primary);
}

.layer-writable {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--streak-fire);
}

/* --------------------------------------------------------------------------
   14. RICH FORMATTED TEXT & COMMANDMENTS LISTS
   -------------------------------------------------------------------------- */
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  color: var(--accent-cyan, #38bdf8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rich-numbered-cards {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rich-numbered-cards li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.rich-numbered-cards li:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

.rich-list-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light, #818cf8);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 2px;
}

.rich-list-body {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.rich-list-title {
  color: var(--text-primary);
  margin-right: 0.35rem;
}

.rich-bullet-cards {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rich-bullet-cards li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
}

.rich-bullet-dot {
  color: var(--primary-light, #818cf8);
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   13. INTERACTIVE ONBOARDING TOUR
   -------------------------------------------------------------------------- */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}

.tour-spotlight {
  position: fixed;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary-light, #818cf8);
  box-shadow: 0 0 0 9999px rgba(10, 15, 29, 0.84), 0 0 30px rgba(99, 102, 241, 0.4);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1001;
}

.tour-card {
  position: fixed;
  z-index: 1002;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.2s ease;
  box-sizing: border-box;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-light, #818cf8);
  letter-spacing: 0.08em;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.tour-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.tour-close-btn:hover {
  color: var(--text-primary);
}

.tour-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.45rem 0;
  letter-spacing: -0.01em;
}

.tour-body {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.tour-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.tour-dot.active {
  width: 20px;
  border-radius: 9999px;
  background: var(--primary-light, #818cf8);
}

.tour-dot.completed {
  background: rgba(99, 102, 241, 0.5);
}

.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.tour-skip-btn {
  font-size: 0.76rem !important;
  color: var(--text-muted) !important;
}

.tour-skip-btn:hover {
  color: var(--text-primary) !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MULTI-TRACK COURSE CATALOG & DOMAIN FILTER TABS
   ══════════════════════════════════════════════════════════════════════════════ */
.catalog-track-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--border-default);
  padding: 0.4rem;
  border-radius: var(--radius-full, 9999px);
  margin: 1.5rem auto 2.5rem auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.track-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.track-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.track-tab-btn.active {
  background: var(--bg-surface-elevated, #21262d);
  color: var(--text-primary);
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.track-tab-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full, 9999px);
  color: var(--text-muted);
}

.track-tab-btn.active .track-tab-count {
  background: rgba(99, 102, 241, 0.25);
  color: var(--primary-light, #818cf8);
}

/* Domain Track Pills */
.pill-track-devops {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 9999px);
}

.pill-track-mlops {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 9999px);
}

.pill-track-finops {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 9999px);
}

.pill-track-secops {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 9999px);
}

.pill-simulator {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Course Catalog Grid */
.course-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

.catalog-course-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.catalog-course-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-emphasis);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.catalog-course-card.active-selected {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.catalog-course-card.active-selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.catalog-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  display: inline-block;
}

.coming-soon-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 0 auto 2.5rem auto;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}