:root {
  --background: #06070b;
  --foreground: #f5f5f7;
  --card: #0d0f15;
  --primary: #5b9eff;
  --primary-dark: #3a72d8;
  --secondary: #11141b;
  --accent: #161a23;
  --destructive: #ff6b6b;
  --border: #f5f5f714;
  --surface: #ffffff08;
  --surface-hover: #ffffff0d;
  --surface-active: #ffffff14;
  --glass-border: #f5f5f714;
  --row-hover: #5b9eff0a;
  --t2: #f5f5f7eb;
  --t3: #f5f5f7b8;
  --t4: #f5f5f78c;
  --t5: #f5f5f76b;
  --t6: #f5f5f73d;
  --sidebar: #0d0f1599;
  --radius: .625rem;
  --success: #22c55e;
  --warning: #f59e0b;
  --purple: #a855f7;
  --cyan: #06b6d4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--foreground);
  background: var(--background);
  font-family: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.hud {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.brand,
.controls,
.counter,
.rail,
.help {
  border: 1px solid var(--border);
  background: #0d0f15cc;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px #00000040;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  pointer-events: auto;
}

.mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: 14px;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
.step h1,
.step h2 {
  font-family: "New York", Georgia, serif;
}

.brand strong {
  color: var(--t2);
  font-size: 16px;
  line-height: 1;
}

.brand small {
  margin-top: 3px;
  color: var(--t5);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.controls {
  display: flex;
  gap: 6px;
  padding: 7px;
  border-radius: 14px;
  pointer-events: auto;
}

.controls button,
.rail button {
  border: 0;
  border-radius: 10px;
  color: var(--t4);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.controls button {
  min-height: 34px;
  padding: 8px 11px;
}

.controls button:hover,
.rail button:hover {
  color: var(--t2);
  background: var(--surface-hover);
}

.counter {
  min-width: 76px;
  padding: 12px 13px;
  border-radius: 14px;
  color: var(--t3);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  pointer-events: auto;
}

.counter span:first-child {
  color: var(--primary);
}

.rail {
  position: fixed;
  left: 16px;
  top: 86px;
  z-index: 45;
  display: grid;
  gap: 4px;
  width: 156px;
  padding: 8px;
  border-radius: 16px;
}

.rail button {
  min-height: 31px;
  padding: 7px 9px;
  text-align: left;
}

.rail button.active {
  color: #fff;
  background: #5b9eff24;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 20%, #5b9eff10, transparent 32%),
    radial-gradient(circle at 18% 82%, #22c55e0d, transparent 28%),
    #06070b;
}

.grid-plane {
  position: absolute;
  inset: -100px;
  opacity: .32;
  background-image:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle, #000 35%, transparent 78%);
}

.canvas {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
  transition: transform 900ms cubic-bezier(.16, 1, .3, 1);
  will-change: transform;
}

.step {
  position: absolute;
  top: 0;
  left: 0;
  width: 640px;
  min-height: 430px;
  padding: 34px;
  transform: translate(-50%, -50%);
  opacity: .16;
  filter: saturate(.85);
  transition: opacity .35s ease, filter .35s ease, box-shadow .35s ease;
}

.step.active {
  opacity: 1;
  z-index: 20;
  filter: saturate(1);
}

.card.active,
.overview.active {
  background: linear-gradient(145deg, #10131a, #090b10);
}

.rupture.active {
  background: linear-gradient(145deg, #1a1010, #08090d);
}

.final.active {
  background: linear-gradient(145deg, #0c1711, #080a0d);
}

.card,
.overview,
.rupture,
.final {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, #10131aee, #090b10ee);
  box-shadow: 0 34px 100px #00000070;
}

.overview {
  width: 940px;
  min-height: 520px;
  padding: 46px;
  text-align: center;
  outline: 1px solid #5b9eff24;
}

.kicker,
.number {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 9px;
  border: 1px solid #5b9eff30;
  border-radius: 999px;
  color: var(--primary);
  background: #5b9eff12;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.overview h1 {
  margin: 44px 0 0;
  color: #fff;
  font-size: 82px;
  line-height: .93;
}

.overview p {
  max-width: 660px;
  margin: 24px auto 0;
  color: var(--t3);
  font-size: 24px;
  font-weight: 760;
  line-height: 1.28;
}

.route {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 42px;
}

.route span,
.split span,
.descent span,
.actions span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--t3);
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
}

.step h2 {
  margin: 22px 0 0;
  color: #fff;
  font-size: 48px;
  line-height: .98;
  letter-spacing: 0;
}

.step p,
.step li {
  color: var(--t3);
  font-size: 22px;
  line-height: 1.35;
}

.step p {
  margin: 18px 0 0;
}

.lead {
  color: var(--t2) !important;
  font-weight: 850;
}

.verse {
  display: inline-block;
  margin-top: 16px !important;
  color: var(--primary) !important;
  font-size: 15px !important;
  font-weight: 950;
  text-transform: uppercase;
}

.punch {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  color: #fff;
  background: #5b9eff14;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.18;
}

.step small {
  display: block;
  margin-top: 16px;
  color: var(--t5);
  font-size: 14px;
  line-height: 1.35;
}

.symbol {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 92px;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #ffffff08;
}

.symbol::before,
.symbol::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 4px solid var(--primary);
  border-radius: 50%;
}

.symbol::after {
  inset: 34px 18px 18px 34px;
  border-color: var(--success);
  border-left-color: transparent;
  border-bottom-color: transparent;
}

.decision::before {
  border-radius: 8px;
  transform: rotate(45deg);
}

.pulse::before {
  border-radius: 50%;
  border-color: var(--warning);
}

.pulse::after {
  inset: 42px 18px 28px 18px;
  border: 0;
  border-top: 5px solid var(--primary);
  border-radius: 0;
  transform: skewX(-26deg);
}

.fire::before {
  border-radius: 70% 30% 65% 35%;
  border-color: var(--warning);
  transform: rotate(35deg);
}

.storm::before {
  inset: 26px 14px 28px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, transparent 35%, var(--primary) 36% 56%, transparent 57%);
}

.crown::before {
  inset: 30px 18px 28px;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--warning), #ffd166);
  clip-path: polygon(0 100%, 0 38%, 24% 68%, 50% 20%, 76% 68%, 100% 38%, 100% 100%);
}

.book::before {
  border-radius: 4px;
  border-color: var(--cyan);
}

.checklist::before {
  border-radius: 8px;
  border-color: var(--success);
}

.doorway::before {
  border-radius: 999px 999px 8px 8px;
  border-color: var(--primary);
}

.hands::before {
  inset: 22px;
  border-radius: 20px 20px 50px 50px;
  border-color: var(--purple);
}

.split,
.descent,
.actions,
.texts {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.split {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.descent {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.texts {
  grid-template-columns: 1fr;
}

.texts article {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.texts b {
  color: var(--primary);
  font-size: 15px;
}

.texts span {
  color: var(--t3);
  font-size: 15px;
  font-weight: 750;
}

.rupture {
  width: 820px;
  min-height: 500px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(145deg, #1a1010f2, #08090df2);
  border-color: #ff6b6b42;
}

.rupture h2 {
  margin-top: 14px;
  font-size: 70px;
}

.rupture p {
  margin: 6px 0;
  color: #fff;
  font-size: 36px;
  font-weight: 900;
}

.silence {
  margin-top: 18px;
  color: var(--destructive);
  font-size: 16px;
  font-weight: 950;
  letter-spacing: .2em;
}

.final {
  width: 820px;
  min-height: 430px;
  display: grid;
  align-content: center;
  text-align: center;
  border-color: #22c55e40;
  background: linear-gradient(145deg, #0c1711f2, #080a0df2);
}

.final h2 {
  font-size: 58px;
}

.help {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
}

.help span {
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--t4);
  background: var(--surface);
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .hud {
    align-items: flex-start;
  }

  .brand {
    min-width: 0;
  }

  .brand div {
    display: none;
  }

  .controls button {
    padding: 7px 8px;
    font-size: 11px;
  }

  .rail {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 58px;
    width: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow-x: auto;
  }

  .rail button {
    white-space: nowrap;
    text-align: center;
  }

  .help {
    display: none;
  }

  .step {
    width: 520px;
    min-height: 390px;
  }
}
