:root,
:root[data-theme="light"] {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --accent: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.12);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #090d14;
  --surface: #111722;
  --surface-2: #161f2e;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #1e293b;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.14);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
}

:root[data-theme-mode="psychedelic"] {
  --bg: #070316;
  --surface: rgba(16, 7, 36, 0.94);
  --surface-2: #160a33;
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(192, 132, 252, 0.28);
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.15);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.18);
  --shadow-sm: 0 2px 10px rgba(34, 211, 238, 0.20);
}

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

html {
  font-size: clamp(12px, min(1.25vw, 2.6vh), 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 73.75rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem 4.8rem;
}

/* TOP BAR */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.8rem;
  line-height: 1.25;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: -0.04em;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon:hover,
.brand-icon:focus,
.brand-icon:active,
.brand-icon:visited {
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.brand-title-link:hover,
.brand-title-link:focus,
.brand-title-link:active,
.brand-title-link:visited {
  color: inherit;
  text-decoration: none;
  outline: none;
}

.brand-author {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: normal;
  margin-left: 0.15rem;
}

.version-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.44rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.version-badge:hover {
  border-color: var(--accent);
}

.brand-text p {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.nav-link,
.home-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.38rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}

.nav-link:hover,
.home-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.guide-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-tag.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.guide-section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(19px, 1.28rem, 28px);
  font-weight: 800;
}

.guide-section p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: clamp(14.5px, 0.95rem, 21px);
}

.guide-list {
  margin: 0 0 0.95rem;
  padding-left: 1.35rem;
  font-size: clamp(14.5px, 0.95rem, 21px);
  color: var(--text-secondary);
  line-height: 1.62;
}

.guide-callout {
  margin-top: 1.25rem;
  padding: 1.05rem 1.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--accent);
  border-radius: 10px;
  font-family: var(--mono);
}

.guide-callout h3 {
  margin: 0 0 0.65rem;
  font-size: clamp(15px, 0.98rem, 22px);
  font-weight: 800;
  color: var(--text);
}

.guide-callout p {
  margin: 0 0 0.62rem;
  font-family: var(--mono);
  font-size: clamp(13.5px, 0.91rem, 19px);
  color: var(--text-secondary);
  line-height: 1.62;
}

.guide-callout p:last-child {
  margin-bottom: 0;
}

/* DEMO BOXES */
.demo-stage {
  position: relative;
  height: 165px;
  background: #070a10;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  border: 1.5px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.demo-barrier {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22), transparent);
  border-right: 2px dashed rgba(239, 68, 68, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.demo-barrier span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: rgba(248, 113, 113, 0.8);
  text-transform: uppercase;
}

.demo-capsule {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.68rem;
  border-radius: 7px;
  background: rgba(17, 24, 39, 0.94);
  border: 1.5px solid #334155;
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  z-index: 1;
}

.speed-tag {
  font-size: 0.64rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.lane-slow {
  top: 18px;
  animation: driftLeft 8.5s linear infinite;
}

.lane-normal {
  top: 66px;
  animation: driftLeft 6.5s linear infinite;
}

.lane-fast {
  top: 114px;
  border-left: 3px solid #38bdf8;
  animation: driftLeft 4.8s linear infinite;
}

@keyframes driftLeft {
  0% {
    left: 92%;
    transform: translate3d(0, 0, 0);
  }

  72% {
    box-shadow: none;
  }

  80% {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  }

  96% {
    opacity: 1;
  }

  100% {
    left: 48px;
    transform: translate3d(-100%, 0, 0);
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
    opacity: 0;
  }
}

/* Demo 2: Prefix Lock Interactive Animation */
.prefix-demo-box {
  background: #070a10;
  border: 1.5px solid #334155;
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.prefix-words-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.p-word {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.95);
  border: 1.5px solid #334155;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.p-word.locked {
  background: rgba(12, 54, 79, 0.95);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.p-word .typed {
  color: #4ade80;
}

.prefix-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e293b;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #94a3b8;
}

.sim-key {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 5px;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #4ade80;
  font-weight: 800;
}

/* Power-up showcase cards */
.powerup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.powerup-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: var(--text);
}

.powerup-sample {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.75rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.65rem;
}

.powerup-sample.freeze {
  background: rgba(8, 47, 73, 0.95);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.powerup-sample.surge {
  background: rgba(69, 26, 3, 0.95);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}

.powerup-sample.shield {
  background: rgba(6, 78, 59, 0.95);
  border: 1.5px solid #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.powerup-sample.overdrive {
  background: rgba(67, 20, 7, 0.95);
  border: 1.5px solid #fb923c;
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.35);
}

.powerup-sample.nova {
  background: rgba(74, 4, 78, 0.95);
  border: 1.5px solid #e879f9;
  box-shadow: 0 0 12px rgba(232, 121, 249, 0.38);
}

.powerup-sample.repair {
  background: rgba(5, 46, 22, 0.95);
  border: 1.5px solid #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.powerup-sample.chrono {
  background: rgba(14, 116, 144, 0.95);
  border: 1.5px solid #67e8f9;
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.45);
}

.powerup-sample.mire {
  background: rgba(45, 26, 14, 0.95);
  border: 1.5px solid #d97706;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.38);
}

.powerup-sample.vowel {
  background: rgba(68, 12, 46, 0.95);
  border: 1.5px solid #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.38);
}

.powerup-sample.stasis {
  background: rgba(15, 36, 74, 0.95);
  border: 1.5px solid #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.4);
}

.powerup-sample.override {
  background: rgba(11, 56, 52, 0.96);
  border: 1.5px solid #2dd4bf;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.42);
}

.powerup-sample.accel {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #f59e0b;
  border-right: 3px solid #f59e0b;
}

.powerup-sample.scramble {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #84cc16;
  box-shadow: 0 0 11px rgba(132, 204, 22, 0.32);
}

.powerup-sample.cloud {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #94a3b8;
  position: relative;
  overflow: hidden;
}

.powerup-sample.cloud > span:not(.power-badge) {
  position: relative;
  z-index: 1;
}

.powerup-sample.cloud::after {
  content: '';
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 26px;
  right: -60px;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 26px 16px at 24px 50%, rgba(15, 23, 42, 0.95) 25%, rgba(30, 41, 59, 0.88) 55%, rgba(203, 213, 225, 0.35) 75%, transparent 100%),
    radial-gradient(ellipse 20px 14px at 38px 40%, rgba(15, 23, 42, 0.92) 20%, rgba(203, 213, 225, 0.4) 60%, transparent 100%),
    radial-gradient(ellipse 28px 17px at 110px 52%, rgba(15, 23, 42, 0.95) 25%, rgba(30, 41, 59, 0.88) 55%, rgba(203, 213, 225, 0.35) 75%, transparent 100%),
    radial-gradient(ellipse 22px 14px at 124px 42%, rgba(15, 23, 42, 0.92) 20%, rgba(203, 213, 225, 0.4) 60%, transparent 100%);
  background-repeat: repeat-x;
  background-size: 160px 100%;
  animation: cloudDrift 3s ease-in-out infinite alternate;
  opacity: 1;
}

@keyframes cloudDrift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50px);
  }
}

.powerup-sample.flux {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #06b6d4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.32);
}

.powerup-sample.adrenaline {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #fb923c;
  border-left: 3px solid #f97316;
}

.powerup-sample.phantom {
  background: transparent !important;
  border: 1.5px dashed rgba(244, 114, 182, 0.65);
  box-shadow: 0 0 12px rgba(232, 121, 249, 0.35);
}

:root[data-theme="light"] .powerup-sample.phantom {
  color: #831843;
  border-color: rgba(219, 39, 119, 0.72);
  box-shadow: 0 0 10px rgba(219, 39, 119, 0.22);
}

:root[data-theme="light"] .powerup-sample.phantom .power-badge.phantom {
  background: rgba(219, 39, 119, 0.14);
  color: #9d174d;
  border-color: rgba(219, 39, 119, 0.55);
}

/* The live sandbox stage uses a dark #05080f canvas in all themes */
:root[data-theme="light"] .sb-stage .powerup-sample.phantom {
  color: #fbcfe8;
  border-color: rgba(244, 114, 182, 0.72);
  box-shadow: 0 0 12px rgba(232, 121, 249, 0.35);
}

:root[data-theme="light"] .sb-stage .powerup-sample.phantom .power-badge.phantom {
  background: rgba(236, 72, 153, 0.22);
  color: #f9a8d4;
  border-color: rgba(244, 114, 182, 0.45);
}

.powerup-sample.colossus {
  background: rgba(34, 24, 6, 0.96);
  border: 1.5px solid #eab308;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.38);
}

.powerup-sample.bomb {
  background: rgba(45, 13, 14, 0.95);
  border: 1.5px solid #f97316;
}

.powerup-sample.split {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #ec4899;
}

.powerup-sample.jammer {
  background: rgba(49, 16, 66, 0.95);
  border: 1.5px solid #a855f7;
}

.powerup-sample.singularity {
  background: rgba(28, 10, 18, 0.96);
  border: 1.5px solid #f43f5e;
}

.powerup-sample.buffer {
  background: rgba(46, 16, 101, 0.95);
  border: 1.5px solid #a78bfa;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.35);
}

.powerup-sample.compressor {
  background: rgba(30, 41, 59, 0.95);
  border: 1.5px solid #94a3b8;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.35);
}

.powerup-sample.midas {
  background: rgba(66, 32, 6, 0.95);
  border: 1.5px solid #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
}

.powerup-sample.repulsor {
  background: rgba(8, 47, 73, 0.95);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.powerup-sample.synapse {
  background: rgba(59, 7, 100, 0.95);
  border: 1.5px solid #c084fc;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.35);
}

.powerup-sample.drifter {
  background: rgba(8, 51, 68, 0.95);
  border: 1.5px solid #22d3ee;
}

.powerup-sample.redacted {
  background: rgba(30, 41, 59, 0.95);
  border: 1.5px solid #94a3b8;
}

.powerup-sample.revenant {
  background: rgba(59, 7, 100, 0.95);
  border: 1.5px solid #c084fc;
}

.powerup-sample.escort {
  background: rgba(69, 26, 3, 0.95);
  border: 1.5px solid #fbbf24;
}

.powerup-sample.fuse {
  background: rgba(76, 5, 25, 0.95);
  border: 1.5px solid #fb7185;
}

.power-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.power-badge.freeze {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.power-badge.surge {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.power-badge.shield {
  background: rgba(52, 211, 153, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.power-badge.overdrive {
  background: rgba(251, 146, 60, 0.22);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.45);
}

.power-badge.nova {
  background: rgba(232, 121, 249, 0.22);
  color: #f5d0fe;
  border: 1px solid rgba(232, 121, 249, 0.45);
}

.power-badge.repair {
  background: rgba(74, 222, 128, 0.22);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.45);
}

.power-badge.chrono {
  background: rgba(103, 232, 249, 0.25);
  color: #cffafe;
  border: 1px solid rgba(103, 232, 249, 0.55);
}

.power-badge.mire {
  background: rgba(217, 119, 6, 0.25);
  color: #fde68a;
  border: 1px solid rgba(217, 119, 6, 0.5);
}

.power-badge.vowel {
  background: rgba(244, 114, 182, 0.22);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.48);
}

.power-badge.stasis {
  background: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.48);
}

.power-badge.override {
  background: rgba(45, 212, 191, 0.24);
  color: #99f6e4;
  border: 1px solid rgba(45, 212, 191, 0.52);
}

.power-badge.buffer {
  background: rgba(167, 139, 250, 0.24);
  color: #ddd6fe;
  border: 1px solid rgba(167, 139, 250, 0.5);
}

.power-badge.compressor {
  background: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.power-badge.midas {
  background: rgba(250, 204, 21, 0.24);
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.55);
}

.power-badge.repulsor {
  background: rgba(56, 189, 248, 0.24);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.52);
}

.power-badge.synapse {
  background: rgba(192, 132, 252, 0.24);
  color: #f3e8ff;
  border: 1px solid rgba(192, 132, 252, 0.55);
}

.power-badge.accel {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.power-badge.flux {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.45);
}

.power-badge.adrenaline {
  background: rgba(251, 146, 60, 0.22);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.5);
}

.power-badge.phantom {
  background: rgba(244, 114, 182, 0.22);
  color: #f5d0fe;
  border: 1px solid rgba(244, 114, 182, 0.6);
}

.power-badge.colossus {
  background: rgba(234, 179, 8, 0.22);
  color: #fef08a;
  border: 1px solid rgba(234, 179, 8, 0.55);
}

.power-badge.bomb {
  background: rgba(249, 115, 22, 0.22);
  color: #fed7aa;
  border: 1px solid rgba(249, 115, 22, 0.52);
}

.power-badge.cloud {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.45);
  position: relative;
  z-index: 4;
}

.power-badge.split {
  background: rgba(236, 72, 153, 0.22);
  color: #fbcfe8;
  border: 1px solid rgba(236, 72, 153, 0.45);
}

.power-badge.jammer {
  background: rgba(168, 85, 247, 0.22);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.power-badge.scramble {
  background: rgba(132, 204, 22, 0.22);
  color: #bef264;
  border: 1px solid rgba(132, 204, 22, 0.5);
}

.power-badge.singularity {
  background: rgba(244, 63, 94, 0.24);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.55);
}

.power-badge.drifter {
  background: rgba(34, 211, 238, 0.22);
  color: #a5f3fc;
  border: 1px solid rgba(34, 211, 238, 0.48);
}

.power-badge.redacted {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.48);
}

.power-badge.revenant {
  background: rgba(192, 132, 252, 0.22);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.5);
}

.power-badge.escort {
  background: rgba(251, 191, 36, 0.24);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.55);
}

.power-badge.fuse {
  background: rgba(251, 113, 133, 0.24);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.55);
}

.powerup-card p {
  margin: 0;
  font-size: clamp(14px, 0.9rem, 20px);
  color: var(--text-secondary);
}

.powerup-card p strong {
  color: var(--text);
}

/* Demo 3: Level Cycle Grid */
.level-cycle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.lvl-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.65rem 0.7rem;
  text-align: center;
  font-family: var(--mono);
}

.lvl-step.milestone {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.lvl-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

.lvl-step.milestone .lvl-num {
  color: var(--gold);
}

.lvl-effect {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.2rem;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  font-weight: 700;
  padding: 0.08rem 0.34rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.bottom-dock {
  position: fixed;
  bottom: 0.75rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 20;
}

.dock-pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.18rem;
  box-shadow: var(--shadow-sm);
}

.dock-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0.45rem;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dock-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.lang-flag {
  width: 15px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.28);
}

.dock-btn[data-theme-val="psychedelic"] {
  color: #a21caf;
}

:root[data-theme="dark"] .dock-btn[data-theme-val="psychedelic"] {
  color: #e879f9;
}

.dock-btn[data-theme-val="psychedelic"].active {
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #06b6d4);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (max-width: 680px) {

  .level-cycle-grid,
  .powerup-grid {
    grid-template-columns: 1fr;
  }
}

.htp-h2-mt { margin-top: 1.5rem; }
.htp-p-mb0 { margin-bottom: 0; }

/* v2.5.0: Interactive Filter Bar & Live Capsule Sandbox */
.htp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0.9rem;
}

.htp-filter-btn {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.htp-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.htp-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

:root[data-theme="dark"] .htp-filter-btn.active {
  color: #061019;
}

.htp-sandbox {
  background: #070a10;
  border: 1.5px solid #334155;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  color: #f1f5f9;
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.65rem;
}

.sb-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
}

.sb-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  padding: 0.16rem 0.52rem;
  border-radius: 6px;
}

.sb-stage {
  min-height: 76px;
  border-radius: 9px;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  background:
    linear-gradient(to right, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    #05080f;
  background-size: 28px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  cursor: text;
  outline: none;
}

.sb-stage:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28);
}

.sb-capsule-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.sb-capsule {
  position: relative;
  font-size: 1.12rem;
  padding: 0.4rem 0.88rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.sb-capsule.sb-locked {
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
  transform: scale(1.03);
}

.sb-capsule.sb-error {
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
}

.sb-typed {
  color: #38bdf8;
  text-decoration: underline;
}

.sb-trimmed {
  color: #64748b;
  text-decoration: line-through;
  opacity: 0.6;
}

.sb-masked {
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.sb-fuse-track {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.sb-fuse-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transform-origin: left center;
}

.sb-footer {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #94a3b8;
}

.sb-status.ok {
  color: #34d399;
  font-weight: 700;
}

.sb-status.err {
  color: #f87171;
  font-weight: 700;
}

.powerup-card.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.powerup-card.is-clickable:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.powerup-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.is-filtered-out {
  display: none;
}
