:root {
  --bg: #070b11;
  --panel: rgba(8, 15, 26, 0.72);
  --panel-strong: rgba(10, 18, 33, 0.88);
  --line: rgba(138, 181, 255, 0.18);
  --line-strong: rgba(141, 252, 235, 0.4);
  --text: #eef2ff;
  --muted: rgba(222, 230, 255, 0.72);
  --cyan: #7ef4ff;
  --gold: #ffcf70;
  --lime: #b8ff52;
  --red: #ff6f74;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --shell-viewport-height: 100vh;
}

@supports (height: 100dvh) {
  :root {
    --shell-viewport-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 18%, rgba(126, 244, 255, 0.14), transparent 0 26rem),
    radial-gradient(circle at 84% 20%, rgba(255, 111, 116, 0.16), transparent 0 28rem),
    linear-gradient(160deg, #060913 0%, #081322 54%, #02050b 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", sans-serif;
}

body {
  overflow-x: hidden;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.hidden {
  display: none !important;
}

.icon-sprite {
  height: 0;
  position: absolute;
  width: 0;
}

.ui-icon {
  fill: none;
  flex: 0 0 auto;
  height: 1rem;
  stroke: currentColor;
  width: 1rem;
}

.ambient-layer {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
}

.ambient-grid,
.ambient-scan,
.ambient-orb {
  position: absolute;
}

.ambient-grid {
  inset: -15%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 4.8rem 4.8rem;
  mask-image: radial-gradient(circle at center, black 38%, transparent 76%);
  opacity: 0.25;
  transform: perspective(100rem) rotateX(76deg) translateY(-16rem);
}

.ambient-orb {
  border-radius: 50%;
  filter: blur(3rem);
  mix-blend-mode: screen;
}

.ambient-orb-a {
  background: rgba(126, 244, 255, 0.2);
  height: 18rem;
  left: -4rem;
  top: 18%;
  width: 18rem;
  animation: drift 13s ease-in-out infinite alternate;
}

.ambient-orb-b {
  background: rgba(255, 207, 112, 0.15);
  bottom: 12%;
  height: 22rem;
  right: -8rem;
  width: 22rem;
  animation: drift 17s ease-in-out infinite alternate-reverse;
}

.ambient-scan {
  inset: -10% 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(126, 244, 255, 0.05) 48%,
    rgba(126, 244, 255, 0.1) 50%,
    transparent 52%
  );
  animation: scan 8s linear infinite;
  opacity: 0.7;
}

.page-shell {
  min-height: var(--shell-viewport-height);
  padding: 2rem;
  position: relative;
}

.hero-panel,
.game-shell,
.ending-shell {
  position: relative;
  z-index: 1;
}

.hero-panel {
  align-items: stretch;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  height: calc(var(--shell-viewport-height) - 4rem);
  max-height: calc(var(--shell-viewport-height) - 4rem);
}

.hero-copy,
.hero-visual,
.status-rail,
.question-stage,
.intel-rail,
.ending-shell {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1rem, 2vw, 2rem) 0;
}

.hero-copy h1 {
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin: 0 0 1rem -0.2rem;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.45) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--cyan);
  padding-left: 1.2rem;
  margin: 0 0 1.5rem;
  opacity: 0.85;
  position: relative;
}
.hero-kicker::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cyan);
  border-radius: 3px;
}

.hero-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-badge {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transform: none !important;
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.hero-badge::before { display: none; }

.hero-badge span {
  display: flex;
  flex-direction: column;
}

.hero-badge small {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  margin-bottom: 0.8rem;
  opacity: 0.5;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.hero-badge strong {
  color: #fff;
  font-size: 1.45rem;
  font-family: var(--font-mono);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1rem 0 0;
  max-width: 32rem;
  text-wrap: balance;
}

.hero-lead span {
  color: var(--cyan);
  border-bottom: 1px solid rgba(126, 244, 255, 0.3);
}

.hero-actions,
.ending-actions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
}

.primary-button,
.ghost-button,
.choice-button {
  border-radius: 2rem;
  padding: 1rem 2.5rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-button {
  background: #fff;
  color: #000;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  box-shadow: none;
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.primary-button:hover {
  background: var(--cyan);
  transform: translateY(-2px);
}

.ghost-button:hover {
  border-color: #fff;
  transform: translateY(-2px);
}

.hero-note {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  letter-spacing: 0.05em;
}

.hero-visual {
  border-radius: 1.5rem;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
  padding: 2rem;
  position: relative;
  background: rgba(255, 255, 255, 0.01);
}

.hero-visual::before,
.hero-visual::after {
  display: none;
}

.clearance-badge {
  align-self: flex-start;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 0 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.clearance-badge::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 5px;
  background: var(--cyan);
  border-radius: 10px;
}

.clearance-tag {
  color: var(--gold);
  display: block;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.clearance-badge strong {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 5.5rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.clearance-badge p,
.rail-label,
.question-copy,
.feedback-line,
.intel-block p,
.rules-block li {
  color: var(--muted);
}

.signal-strip {
  align-items: end;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.5rem;
  padding-top: 0;
  position: relative;
  z-index: 1;
}

.signal-card {
  align-items: center;
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.96), rgba(226, 232, 245, 0.9));
  border: 1px solid rgba(12, 27, 43, 0.08);
  border-radius: 1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  color: #0c1726;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 4.7rem;
  padding: 0.72rem 0.82rem 0.8rem;
  position: relative;
}

.signal-card::before {
  background: rgba(255, 243, 192, 0.82);
  border: 1px solid rgba(63, 47, 10, 0.08);
  content: "";
  height: 0.78rem;
  left: 0.9rem;
  position: absolute;
  top: -0.28rem;
  width: 2.6rem;
}

.signal-card .ui-icon {
  color: #102537;
  height: 1.05rem;
  margin-top: 0.1rem;
  width: 1.05rem;
}

.signal-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.signal-copy small,
.signal-id {
  color: rgba(14, 28, 45, 0.48);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-copy strong {
  color: rgba(8, 19, 30, 0.88);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
}

.signal-id {
  align-self: start;
  justify-self: end;
}

.signal-card-threat {
  transform: rotate(-3deg);
}

.signal-card-gatekeeper {
  transform: translateY(0.4rem) rotate(1.4deg);
}

.signal-card-mythos {
  transform: rotate(-1.6deg);
}

.sticker-cluster {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.8rem;
  margin: 0.5rem 0 0.5rem;
  min-height: auto;
}

.hero-object-card {
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.96), rgba(226, 232, 245, 0.9));
  border-radius: 1.2rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
  color: #091220;
  overflow: hidden;
  padding: 0.9rem;
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
}

.hero-object-card::before {
  background: rgba(255, 244, 192, 0.76);
  border: 1px solid rgba(63, 47, 10, 0.08);
  content: "";
  height: 1.1rem;
  left: calc(50% - 1.8rem);
  position: absolute;
  top: -0.36rem;
  transform: rotate(-5deg);
  width: 3.6rem;
}

.hero-object-photo {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08)),
    url("./assets/clearance-pass-visual.svg") center/cover no-repeat;
  border-radius: 0.8rem;
  height: 11rem;
  overflow: hidden;
  position: relative;
}

.hero-object-photo::before,
.hero-object-photo::after {
  content: "";
  position: absolute;
}

.hero-object-photo::before {
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 1.1rem 1.1rem;
  opacity: 0.3;
}

.hero-object-photo::after {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.16)),
    radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.18), transparent 0 16%);
}

.hero-object-copy {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 0.35rem 0.2rem;
}

.hero-object-tag {
  color: rgba(12, 28, 44, 0.45);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.hero-object-copy strong {
  font-size: 1rem;
}

.hero-object-copy span {
  color: rgba(14, 26, 42, 0.68);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hero-object-stamp {
  background: rgba(14, 30, 45, 0.08);
  border: 1px solid rgba(10, 23, 38, 0.14);
  border-radius: 999px;
  bottom: 1rem;
  color: rgba(9, 21, 35, 0.78);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.42rem 0.68rem;
  position: absolute;
  right: 1rem;
}

.sticker-card {
  background: linear-gradient(180deg, rgba(250, 251, 255, 0.95), rgba(229, 235, 247, 0.9));
  border-radius: 1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  color: #0c1322;
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
  width: 100%;
}

.sticker-card::before {
  background: rgba(255, 244, 191, 0.76);
  border: 1px solid rgba(76, 56, 0, 0.08);
  content: "";
  height: 1.05rem;
  left: calc(50% - 1.7rem);
  position: absolute;
  top: -0.35rem;
  transform: rotate(-4deg);
  width: 3.4rem;
}

.sticker-card-a {
  grid-column: 2;
  grid-row: 1;
}

.sticker-card-b {
  grid-column: 2;
  grid-row: 2;
}

.sticker-card-c {
  display: none;
}

.sticker-image {
  border-radius: 0.6rem;
  height: 4.5rem;
  overflow: hidden;
  position: relative;
}

.sticker-image::before,
.sticker-image::after {
  content: "";
  position: absolute;
}

.sticker-image::before {
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.sticker-image::after {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%, transparent 72%, rgba(0, 0, 0, 0.14)),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 1rem 1rem, 1rem 1rem;
  mix-blend-mode: screen;
  opacity: 0.42;
}

.sticker-image-a::before {
  background-image: url("./assets/threat-snapshot.svg");
}

.sticker-image-b::before {
  background-image: url("./assets/route-slip.svg");
}

.sticker-image-c::before {
  background-image: url("./assets/mythos-file.svg");
}

.sticker-meta {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem 0.3rem 0.2rem;
}

.sticker-meta span {
  color: rgba(17, 25, 43, 0.56);
  display: block;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.sticker-meta strong {
  display: block;
  font-size: 0.9rem;
  margin-top: 0.18rem;
}

.sticker-icon {
  color: #102537;
  height: 1.2rem;
  width: 1.2rem;
}

.game-shell {
  border-radius: 2rem;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: minmax(16rem, 18rem) minmax(0, 1fr) minmax(16rem, 20rem);
  height: calc(var(--shell-viewport-height) - 4rem);
  max-height: calc(var(--shell-viewport-height) - 4rem);
  min-height: calc(var(--shell-viewport-height) - 4rem);
  overflow: hidden;
  padding: 1.4rem;
}

.status-rail,
.intel-rail {
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem;
}

.rail-block,
.checkpoint-block,
.rules-block,
.intel-block {
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.2rem;
  padding: 1rem;
}

.rail-label {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.rail-label-icon {
  align-items: center;
  display: inline-flex;
  gap: 0.55rem;
}

.rail-label-icon .ui-icon {
  color: var(--cyan);
}

.meter {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  height: 0.55rem;
  overflow: hidden;
}

.meter-fill,
.checkpoint-progress-fill {
  border-radius: inherit;
  height: 100%;
  transition: width 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meter-flash {
  animation: meter-glow 500ms ease-out;
}

.meter-fill-cyan {
  background: linear-gradient(90deg, #4dbdfd, var(--cyan));
}

.meter-fill-red {
  background: linear-gradient(90deg, #ff5161, #ffb174);
}

.meter-fill-gold {
  background: linear-gradient(90deg, #ffb26f, #ffe087);
}

.meter-fill-lime {
  background: linear-gradient(90deg, #90e95f, var(--lime));
}

.rail-block strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 0.75rem;
}

.checkpoint-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.checkpoint-head span,
.checkpoint-head strong,
.stage-id {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.checkpoint-progress {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  height: 0.6rem;
  margin-top: 0.9rem;
  overflow: hidden;
}

.checkpoint-progress-fill {
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  width: 10%;
}

.snapshot-card {
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.94), rgba(228, 235, 247, 0.88));
  border-radius: 1.25rem;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  color: #091220;
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
}

.snapshot-card::before {
  background: rgba(255, 242, 184, 0.78);
  border: 1px solid rgba(63, 47, 10, 0.08);
  content: "";
  height: 0.95rem;
  position: absolute;
  right: 1rem;
  top: -0.3rem;
  transform: rotate(8deg);
  width: 3.1rem;
}

.snapshot-photo {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.08)),
    url("./assets/threat-snapshot.svg") center/cover no-repeat;
  border-radius: 0.95rem;
  height: 10rem;
  overflow: hidden;
  position: relative;
}

.snapshot-photo::before,
.snapshot-photo::after {
  content: "";
  position: absolute;
}

.snapshot-photo::before {
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 1rem 1rem;
  opacity: 0.36;
}

.snapshot-photo::after {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%, transparent 70%, rgba(0, 0, 0, 0.14)),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.16), transparent 0 14%);
}

.snapshot-meta {
  display: grid;
  gap: 0.28rem;
  padding: 0.85rem 0.25rem 0.15rem;
}

.snapshot-tag {
  color: rgba(15, 28, 46, 0.46);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.snapshot-meta strong {
  font-size: 0.98rem;
}

.snapshot-meta span {
  color: rgba(13, 26, 43, 0.68);
  font-size: 0.9rem;
  line-height: 1.55;
}

.rules-block ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.1rem;
}

.shortcut-note {
  color: rgba(233, 239, 255, 0.66);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.7;
  margin: 0.95rem 0 0;
}

.question-stage {
  border-radius: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow: hidden;
  padding: 1.6rem;
}

.stage-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.stage-head h2 {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.95;
  margin: 0;
}

.stage-id {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--cyan);
  margin: 0;
  padding: 0.55rem 0.9rem;
}

.stage-body {
  display: grid;
  flex: 1 1 auto;
  gap: 1.2rem;
  margin-top: 1.8rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.question-copy {
  font-size: 1.15rem;
  line-height: 1.65;
  margin: 0;
  max-width: 52rem;
  text-wrap: balance; /* Optimized for typographic balance */
  letter-spacing: -0.01em;
}

.choices-list {
  display: grid;
  gap: 1rem;
}

.choice-button {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.5rem;
  color: var(--text);
  display: flex;
  gap: 1rem;
  min-height: 5.7rem;
  padding: 1rem 1.15rem;
  text-align: left;
}

.choice-index {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--cyan);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.3rem;
  justify-content: center;
  margin-top: 0.2rem;
  width: 2.3rem;
}

.choice-copy strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.choice-copy span {
  color: var(--muted);
  line-height: 1.6;
}

.choice-button {
  transition: all 200ms ease, transform 150ms ease;
  cursor: pointer;
}

.choice-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(126, 244, 255, 0.25);
  box-shadow: 0 0 20px rgba(126, 244, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.choice-button:active {
  transform: translateY(0) scale(0.99);
}

.choice-button.is-selected {
  background:
    linear-gradient(135deg, rgba(126, 244, 255, 0.13), rgba(184, 255, 82, 0.08)),
    rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(126, 244, 255, 0.1), 0 16px 30px rgba(126, 244, 255, 0.12), 0 0 30px rgba(126, 244, 255, 0.15);
  animation: choice-pulse 600ms ease-out;
}

.choice-button.secret-choice {
  background:
    linear-gradient(120deg, rgba(184, 255, 82, 0.18), rgba(126, 244, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(184, 255, 82, 0.35);
  position: relative;
}

.choice-button.secret-choice::after {
  animation: flicker 1.6s linear infinite;
  content: "HIDDEN";
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  position: absolute;
  right: 1rem;
  top: 0.9rem;
}

.stage-foot {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.8rem;
}

.feedback-stack {
  display: grid;
  gap: 0.8rem;
  max-width: 70%;
}

.feedback-line {
  margin: 0;
}

.impact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.impact-chip {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(241, 245, 255, 0.82);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  padding: 0.45rem 0.7rem;
}

.impact-chip.positive {
  background: rgba(126, 244, 255, 0.08);
  border-color: rgba(126, 244, 255, 0.18);
}

.impact-chip.negative {
  background: rgba(255, 111, 116, 0.08);
  border-color: rgba(255, 111, 116, 0.18);
}

.impact-chip.neutral {
  background: rgba(255, 255, 255, 0.04);
}

.route-log {
  display: grid;
  gap: 0.7rem;
  max-height: 20rem;
  overflow: auto;
}

.log-details[open] summary {
  margin-bottom: 0.85rem;
}

.log-details summary {
  cursor: pointer;
  list-style: none;
}

.log-details summary::-webkit-details-marker {
  display: none;
}

.route-log-item {
  border-left: 2px solid rgba(126, 244, 255, 0.28);
  color: rgba(236, 241, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.55;
  padding-left: 0.85rem;
}

.route-log-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
}

.route-log-item span {
  display: block;
}

.intel-block-muted {
  margin-top: auto;
}

.secret-checklist {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.secret-check-item {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.secret-check-bullet {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.48);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  height: 1.3rem;
  justify-content: center;
  width: 1.3rem;
}

.secret-check-item.is-done .secret-check-bullet {
  background: rgba(184, 255, 82, 0.1);
  border-color: rgba(184, 255, 82, 0.36);
  color: var(--lime);
}

.secret-check-item.is-done span:last-child {
  color: rgba(245, 255, 229, 0.9);
}

.ending-shell {
  align-items: center;
  border-radius: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.1fr);
  height: calc(var(--shell-viewport-height) - 4rem);
  max-height: calc(var(--shell-viewport-height) - 4rem);
  min-height: calc(var(--shell-viewport-height) - 4rem);
  overflow: hidden;
  padding: 1.6rem;
}

.ending-banner {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 207, 112, 0.35), transparent 0 30rem),
    linear-gradient(145deg, rgba(10, 16, 28, 0.75), rgba(4, 8, 14, 0.95));
  border-radius: 1.6rem;
  min-height: 100%;
  position: relative;
}

.ending-banner::before,
.ending-banner::after {
  content: "";
  position: absolute;
}

.ending-banner::before {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  inset: 14%;
}

.ending-banner::after {
  border: 1px solid rgba(126, 244, 255, 0.14);
  border-radius: 50%;
  inset: 26%;
}

.ending-artifacts {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.ending-artifacts::before,
.ending-artifacts::after {
  content: "";
  position: absolute;
}

.ending-banner.ending-opus .ending-artifacts::before {
  background:
    linear-gradient(180deg, rgba(246, 249, 255, 0.04), rgba(9, 13, 20, 0.08)),
    url("./assets/clearance-pass-visual.svg") center/cover no-repeat;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  height: 11rem;
  left: 12%;
  top: 16%;
  transform: rotate(-8deg);
  width: 8.4rem;
}

.ending-banner.ending-opus .ending-artifacts::after {
  background:
    linear-gradient(135deg, rgba(126, 244, 255, 0.16), rgba(255, 207, 112, 0.14)),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 34, 52, 0.08);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  color: #0b1d2b;
  content: "AUTHORIZED";
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  height: 2.3rem;
  letter-spacing: 0.08em;
  left: 33%;
  padding-top: 0.7rem;
  text-align: center;
  top: 54%;
  width: 7.6rem;
}

.ending-banner.ending-blocked .ending-artifacts::before {
  background:
    repeating-linear-gradient(
      -24deg,
      rgba(255, 206, 112, 0.9),
      rgba(255, 206, 112, 0.9) 1rem,
      rgba(15, 18, 24, 0.92) 1rem,
      rgba(15, 18, 24, 0.92) 2rem
    );
  border-radius: 999px;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
  height: 2.2rem;
  left: 10%;
  top: 22%;
  transform: rotate(-10deg);
  width: 14rem;
}

.ending-banner.ending-blocked .ending-artifacts::after {
  background:
    linear-gradient(180deg, rgba(255, 111, 116, 0.12), rgba(8, 11, 17, 0.08)),
    url("./assets/threat-snapshot.svg") center/cover no-repeat;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
  height: 10.4rem;
  left: 25%;
  top: 46%;
  transform: rotate(9deg);
  width: 8.1rem;
}

.ending-banner.ending-mythos .ending-artifacts::before {
  background:
    linear-gradient(180deg, rgba(184, 255, 82, 0.06), rgba(0, 0, 0, 0.08)),
    url("./assets/mythos-file.svg") center/cover no-repeat;
  border: 1px solid rgba(184, 255, 82, 0.2);
  border-radius: 1.15rem;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
  height: 10.8rem;
  left: 14%;
  top: 20%;
  width: 8rem;
}

.ending-banner.ending-mythos .ending-artifacts::after {
  background: linear-gradient(135deg, rgba(184, 255, 82, 0.18), rgba(126, 244, 255, 0.18));
  border: 1px solid rgba(184, 255, 82, 0.28);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  color: rgba(242, 255, 226, 0.96);
  content: "MYTHOS TRACE";
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  height: 2.3rem;
  left: 40%;
  letter-spacing: 0.08em;
  padding-top: 0.7rem;
  text-align: center;
  top: 58%;
  width: 8rem;
}

.ending-banner.ending-opus {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 207, 112, 0.32), transparent 0 28rem),
    radial-gradient(circle at 72% 68%, rgba(126, 244, 255, 0.18), transparent 0 24rem),
    linear-gradient(145deg, rgba(9, 16, 27, 0.78), rgba(3, 8, 15, 0.96));
}

.ending-banner.ending-blocked {
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 111, 116, 0.28), transparent 0 28rem),
    radial-gradient(circle at 76% 68%, rgba(255, 188, 114, 0.1), transparent 0 24rem),
    linear-gradient(145deg, rgba(21, 11, 18, 0.82), rgba(8, 6, 10, 0.98));
}

.ending-banner.ending-mythos {
  background:
    radial-gradient(circle at 28% 30%, rgba(184, 255, 82, 0.28), transparent 0 28rem),
    radial-gradient(circle at 72% 68%, rgba(126, 244, 255, 0.16), transparent 0 26rem),
    linear-gradient(145deg, rgba(8, 18, 16, 0.82), rgba(3, 10, 12, 0.97));
}

.ending-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0;
}

.ending-content h2 {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.92;
  margin: 0;
  text-transform: uppercase;
}

.ending-copy {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
  margin: 0;
  max-width: 42rem;
}

.ending-stats {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.ending-stat {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.1rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.95rem 1rem;
  transform: translateX(-16px);
}

.ending-stat span {
  color: var(--muted);
}

.ending-stat strong {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

@keyframes scan {
  0% {
    transform: translateY(-20%);
  }
  100% {
    transform: translateY(120%);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(1.5rem, -1rem, 0) scale(1.08);
  }
}

@keyframes flicker {
  0%,
  19%,
  23%,
  100% {
    opacity: 0.95;
  }
  20%,
  22% {
    opacity: 0.22;
  }
}

@keyframes choice-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(126, 244, 255, 0.5), 0 0 30px rgba(126, 244, 255, 0.15);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(126, 244, 255, 0), 0 0 30px rgba(126, 244, 255, 0.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(126, 244, 255, 0), 0 0 30px rgba(126, 244, 255, 0.15);
  }
}

@keyframes meter-glow {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.6);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes impact-chip-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 400ms ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 500ms ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 400ms ease-out forwards;
}

.section-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.section-visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease;
}

.choice-button {
  opacity: 0;
}

.choice-button.animate-in {
  animation: fade-in-up 400ms ease-out forwards;
}

.feedback-line {
  overflow: hidden;
}

.feedback-line span {
  display: inline-block;
}

@media (max-width: 1100px) {
  .hero-panel,
  .game-shell,
  .ending-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
  }

  .game-shell,
  .ending-shell {
    height: auto;
    max-height: none;
    min-height: auto;
    overflow: visible;
  }

  .sticker-cluster {
    min-height: 30rem;
  }

  .hero-object-card {
    left: 9.4rem;
  }

  .question-stage {
    order: 1;
  }

  .status-rail {
    order: 2;
  }

  .intel-rail {
    order: 3;
  }

  .snapshot-card {
    max-width: 26rem;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 1rem;
  }

  .hero-panel {
    gap: 0.85rem;
  }

  .hero-copy,
  .hero-visual,
  .question-stage,
  .status-rail,
  .intel-rail,
  .ending-shell {
    border-radius: 1.4rem;
  }

  .hero-copy h1 {
    font-size: 3.35rem;
  }

  .hero-copy {
    padding: 1.35rem;
  }

  .hero-kicker {
    font-size: 0.95rem;
  }

  .hero-badges {
    gap: 0.55rem;
    margin-top: 1.05rem;
  }

  .hero-badge {
    padding: 0.52rem 0.74rem;
  }

  .hero-badge strong {
    font-size: 0.82rem;
  }

  .hero-lead {
    font-size: 1rem;
    line-height: 1.65;
    margin-top: 1.35rem;
  }

  .hero-actions {
    margin-top: 1.3rem;
  }

  .hero-note {
    margin-top: 1.25rem;
    padding-top: 0.95rem;
  }

  .hero-visual {
    padding: 1.15rem;
  }

  .stage-head h2 {
    font-size: 2.3rem;
  }

  .stage-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-stack {
    max-width: none;
  }

  .sticker-cluster {
    margin: 0.5rem 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1rem;
  }

  .hero-object-card {
    grid-column: 1;
    grid-row: auto;
  }

  .sticker-card-a {
    grid-column: 1;
    grid-row: auto;
  }

  .sticker-card-b {
    grid-column: 1;
    grid-row: auto;
  }

  .sticker-card-c {
    display: none;
  }

  .signal-strip {
    gap: 0.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-card {
    min-height: 3.95rem;
    padding: 0.58rem 0.66rem 0.68rem;
  }

  .signal-copy strong {
    font-size: 0.74rem;
  }

  .signal-card-mythos,
  .signal-id {
    display: none;
  }

  .ending-banner.ending-blocked .ending-artifacts::before {
    width: 10rem;
  }

  .status-rail {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkpoint-block,
  .snapshot-card,
  .rules-block {
    grid-column: 1 / -1;
  }

  .intel-rail {
    gap: 0.85rem;
  }

  .route-log {
    max-height: 11rem;
  }

  .log-details {
    display: grid;
    gap: 0.65rem;
  }

  .log-details:not([open]) .route-log {
    display: none;
  }
}

@media (min-width: 721px) and (max-height: 900px) {
  .game-shell {
    gap: 1rem;
    padding: 1rem;
  }

  .status-rail {
    align-content: start;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.95rem;
  }

  .status-rail .checkpoint-block,
  .status-rail .snapshot-card,
  .status-rail .rules-block {
    grid-column: 1 / -1;
  }

  .status-rail .rail-block,
  .status-rail .checkpoint-block,
  .status-rail .snapshot-card,
  .status-rail .rules-block,
  .intel-block {
    padding: 0.85rem;
  }

  .rail-label {
    font-size: 0.76rem;
    margin-bottom: 0.5rem;
  }

  .rail-block strong {
    font-size: 1.35rem;
    margin-top: 0.55rem;
  }

  .checkpoint-progress {
    margin-top: 0.7rem;
  }

  .snapshot-photo {
    height: 7.4rem;
  }

  .snapshot-meta {
    gap: 0.22rem;
    padding-top: 0.7rem;
  }

  .snapshot-meta span,
  .rules-block li,
  .shortcut-note,
  .route-log-item,
  .secret-check-item {
    font-size: 0.82rem;
  }

  .question-stage {
    padding: 1.35rem;
  }

  .stage-body {
    margin-top: 1.25rem;
  }

  .stage-foot {
    margin-top: 1.25rem;
  }

  .intel-rail {
    gap: 0.8rem;
    padding: 0.95rem;
  }
}

/* --- NEW OPTIMIZED STYLES --- */
.ambient-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.15));
  background-size: 100% 4px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}

.glitch-title {
  position: relative;
  display: inline-block;
  transform: translateZ(0); /* hardware accel */
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.7;
  z-index: -1;
  pointer-events: none;
}

.glitch-title::before {
  left: 3px;
  text-shadow: -2px 0 rgba(255, 111, 116, 0.7);
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch-title::after {
  left: -3px;
  text-shadow: 2px 0 rgba(126, 244, 255, 0.7);
  animation: glitch-anim-2 4s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip-path: inset(20% 0 80% 0); }
  20% { clip-path: inset(60% 0 10% 0); }
  40% { clip-path: inset(40% 0 50% 0); }
  60% { clip-path: inset(80% 0 5% 0); }
  80% { clip-path: inset(10% 0 70% 0); }
  100% { clip-path: inset(30% 0 20% 0); }
}

@keyframes glitch-anim-2 {
  0% { clip-path: inset(10% 0 60% 0); }
  20% { clip-path: inset(30% 0 20% 0); }
  40% { clip-path: inset(70% 0 10% 0); }
  60% { clip-path: inset(20% 0 50% 0); }
  80% { clip-path: inset(50% 0 30% 0); }
  100% { clip-path: inset(5% 0 80% 0); }
}

.choice-button {
  position: relative;
  overflow: hidden;
}

.choice-button::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(126, 244, 255, 0.15) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.choice-button:hover::before {
  opacity: 1;
}

.choice-index, .choice-copy {
  position: relative;
  z-index: 1;
}

/* Enhance 3D interactions for visual elements */
.hero-object-card, .sticker-card, .signal-card {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.hero-object-card:hover {
  transform: translateY(-4px) !important;
  z-index: 10;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.sticker-card:hover {
  transform: translateY(-4px) !important;
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.signal-card:hover {
  transform: scale(1.05) translateY(-5px) !important;
  z-index: 10;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

/* Add a glowing border effect to active choice */
.choice-button.is-selected {
  position: relative;
}
.choice-button.is-selected::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  z-index: -1;
  opacity: 0.5;
  filter: blur(8px);
  animation: pulse-glow 2s infinite alternate;
}
@keyframes pulse-glow {
  0% { opacity: 0.4; filter: blur(6px); }
  100% { opacity: 0.8; filter: blur(12px); }
}

/* Enhance Primary Button */
.primary-button {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.primary-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  z-index: -1;
}
.primary-button:hover::after {
  left: 150%;
}
