:root {
  /* Default Coolors-style palette — click 右側按鈕可隨機更換 */
  --ink: #1b263b;
  --teal: #415a77;
  --mist: #e0e1dd;
  --slate: #778da9;
  --coral: #e09f3e;
  --white: #f4f5f2;
  --ink-rgb: 27, 38, 59;
  --teal-rgb: 65, 90, 119;
  --mist-rgb: 224, 225, 221;
  --slate-rgb: 119, 141, 169;
  --coral-rgb: 224, 159, 62;
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
  --transition-palette: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease;
}

body,
.hero__bg,
.chapter__sticky,
.chapter__scroll,
.rail-section,
.reveal,
footer,
.cta,
.scroll-progress,
.rail-panel {
  transition: var(--transition-palette);
}

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

html {
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--mist);
  overflow-x: hidden;
  line-height: 1.5;
}

/* —— Progress bar —— */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  z-index: 100;
  transform-origin: left;
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(var(--teal-rgb), 0.55), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, rgba(var(--coral-rgb), 0.28), transparent 50%),
    linear-gradient(165deg, var(--ink) 0%, var(--slate) 48%, var(--teal) 100%);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 28px,
      rgba(var(--mist-rgb), 0.12) 28px,
      rgba(var(--mist-rgb), 0.12) 29px
    );
  animation: pattern-drift 28s linear infinite;
}

@keyframes pattern-drift {
  from { background-position: 0 0; }
  to { background-position: 120px 80px; }
}

.hero__layers {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__layer {
  position: absolute;
  left: -5%;
  width: 110%;
  height: 42%;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  will-change: transform;
}

.hero__layer--1 {
  bottom: -8%;
  height: 48%;
  background: rgba(var(--ink-rgb), 0.85);
}

.hero__layer--2 {
  bottom: 6%;
  height: 36%;
  background: rgba(var(--teal-rgb), 0.55);
}

.hero__layer--3 {
  bottom: 18%;
  height: 28%;
  background: rgba(var(--mist-rgb), 0.22);
}

.hero__content {
  max-width: 40rem;
  padding-bottom: clamp(2rem, 8vh, 5rem);
}

.site-logo {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
}

.site-logo img {
  display: block;
  height: auto;
}

.site-logo--float {
  position: fixed;
  top: 1rem;
  left: clamp(1rem, 4vw, 3rem);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background-color 0.35s ease;
  background: rgba(var(--ink-rgb), 0.82);
  padding: 0.45rem 0.65rem;
}

.site-logo--float.is-visible {
  pointer-events: auto;
}

.site-logo--float .logo-svg {
  width: clamp(100px, 18vw, 140px);
  height: auto;
}

.site-logo--footer .logo-svg {
  width: clamp(120px, 28vw, 160px);
  height: auto;
  margin-bottom: 0.25rem;
}

.logo-svg {
  display: block;
  overflow: visible;
}

.brand {
  margin-bottom: 1.25rem;
}

.brand__logo {
  display: block;
  width: min(88vw, 28rem);
  height: auto;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  opacity: 0.9;
  max-width: 32ch;
  margin-bottom: 1.75rem;
}

.hero .hero__headline {
  opacity: 1;
  margin-bottom: 0.75rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--mist);
  border: none;
  padding: 0.9rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.cta:hover {
  background: var(--coral);
  color: var(--white);
  transform: translateY(-2px);
}

.cta svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.25s ease;
}

.cta:hover svg {
  transform: translateY(3px);
}

/* —— Sticky progressive chapters —— */
.chapters {
  position: relative;
}

.chapter {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100svh;
}

@media (min-width: 900px) {
  .chapter {
    grid-template-columns: 1fr 1fr;
  }
}

.chapter__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--mist);
  overflow: hidden;
}

.chapter__sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(var(--teal-rgb), 0.12), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(var(--coral-rgb), 0.1), transparent 40%);
  pointer-events: none;
}

.chapter__index {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
  color: rgba(var(--ink-rgb), 0.1);
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
  position: relative;
}

.chapter__sticky h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  position: relative;
  max-width: 12ch;
}

.chapter__sticky p {
  position: relative;
  font-size: 1.05rem;
  max-width: 36ch;
  color: var(--slate);
}

.chapter__scroll {
  background: var(--ink);
  color: var(--mist);
  padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4rem;
  min-height: 220svh;
}

.chapter--alt .chapter__scroll {
  background: var(--slate);
}

.chapter--coral .chapter__scroll {
  background: var(--teal);
}

.beat {
  opacity: 0.22;
  transform: translateY(2.5rem);
  max-width: 28rem;
  will-change: transform, opacity;
}

.beat.is-active {
  opacity: 1;
  transform: none;
}

.beat h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.beat p {
  font-size: 1.05rem;
  opacity: 0.88;
}

.beat__tag {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--coral);
  font-weight: 600;
}

.chapter--alt .beat__tag,
.chapter--coral .beat__tag {
  color: var(--mist);
  opacity: 0.7;
}

/* —— Horizontal scroll track —— */
.rail-section {
  position: relative;
  height: 300svh;
  background: var(--mist);
}

.rail-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.rail-intro {
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin-bottom: 2rem;
}

.rail-intro h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.rail-intro p {
  color: var(--slate);
  max-width: 40ch;
}

.rail-track {
  display: flex;
  gap: 1.5rem;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  width: max-content;
  will-change: transform;
}

.rail-panel {
  width: min(78vw, 28rem);
  height: min(48vh, 22rem);
  flex-shrink: 0;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.rail-panel:nth-child(1) {
  background: linear-gradient(145deg, var(--ink), var(--teal));
}

.rail-panel:nth-child(2) {
  background: linear-gradient(145deg, var(--slate), var(--ink));
}

.rail-panel:nth-child(3) {
  background: linear-gradient(145deg, var(--teal), color-mix(in srgb, var(--teal) 65%, black));
}

.rail-panel:nth-child(4) {
  background: linear-gradient(145deg, color-mix(in srgb, var(--coral) 70%, black), var(--coral));
}

.rail-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.04) 18px,
      rgba(255, 255, 255, 0.04) 19px
    );
  pointer-events: none;
}

.rail-panel span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.rail-panel h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

/* —— Reveal text —— */
.reveal {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  background:
    linear-gradient(
      180deg,
      var(--mist) 0%,
      color-mix(in srgb, var(--mist) 72%, var(--teal)) 50%,
      var(--mist) 100%
    );
  text-align: center;
}

.reveal__inner {
  max-width: 22rem;
  perspective: 600px;
}

.reveal__inner h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.reveal__line {
  display: block;
  opacity: 0;
  transform: translateY(1.25rem);
}

.reveal.is-inview .reveal__line {
  opacity: 1;
  transform: none;
}

.reveal__inner p {
  color: var(--slate);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(0.75rem);
}

.reveal.is-inview p {
  opacity: 1;
  transform: none;
}

/* —— Footer —— */
footer {
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--ink);
  color: var(--mist);
}

footer .palette {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 1.5rem;
  flex-wrap: wrap;
}

footer .swatch {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid rgba(var(--mist-rgb), 0.25);
}

/* —— Palette shuffle dock —— */
.palette-dock {
  position: fixed;
  right: clamp(0.75rem, 2.5vw, 1.25rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
}

.palette-dock__btn {
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid rgba(var(--mist-rgb), 0.35);
  background: rgba(var(--ink-rgb), 0.92);
  color: var(--mist);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(var(--ink-rgb), 0.28);
  transition: transform 0.2s ease, background 0.35s ease, border-color 0.35s ease;
}

.palette-dock__btn:hover {
  transform: scale(1.06);
  background: var(--coral);
  color: var(--white);
  border-color: transparent;
}

.palette-dock__btn:active {
  transform: scale(0.96);
}

.palette-dock__btn.is-spinning svg {
  animation: shuffle-spin 0.45s ease;
}

@keyframes shuffle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.palette-dock__btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.palette-dock__swatches {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem;
  background: rgba(var(--ink-rgb), 0.88);
  border: 1px solid rgba(var(--mist-rgb), 0.2);
}

.palette-dock__swatches span {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  transition: background-color 0.35s ease;
}

.palette-dock__hint {
  writing-mode: vertical-rl;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(var(--mist-rgb), 0.92);
  padding: 0.55rem 0.25rem;
  font-weight: 600;
  max-height: 7rem;
}

footer a {
  color: var(--coral);
  font-weight: 600;
}

footer p {
  font-size: 0.95rem;
  opacity: 0.85;
  max-width: 40ch;
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__pattern {
    animation: none !important;
  }
  .beat,
  .reveal__line,
  .reveal__inner p {
    opacity: 1 !important;
    transform: none !important;
  }
  .egg-rain__bar {
    animation: none !important;
    opacity: 0 !important;
  }
  .egg-flip {
    transition: none !important;
    transform: none !important;
  }
}

[hidden] {
  display: none !important;
}
.egg-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(1rem);
  z-index: 120;
  max-width: min(90vw, 24rem);
  padding: 0.85rem 1.15rem;
  background: rgba(var(--ink-rgb), 0.94);
  color: var(--mist);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  border-left: 3px solid var(--coral);
}

.egg-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.egg-badge {
  position: fixed;
  left: clamp(0.75rem, 2.5vw, 1.25rem);
  bottom: 1.25rem;
  z-index: 96;
  min-width: 2.5rem;
  padding: 0.35rem 0.55rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  background: rgba(var(--ink-rgb), 0.9);
  color: var(--mist);
  border: 1px solid rgba(var(--mist-rgb), 0.25);
}

.egg-badge.is-complete {
  background: var(--coral);
  color: var(--white);
  border-color: transparent;
}

.egg-rain {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

.egg-rain.is-active {
  opacity: 1;
}

.egg-rain__bar {
  position: absolute;
  top: -60px;
  border-radius: 2px;
  animation: egg-fall linear forwards;
  opacity: 0.9;
}

@keyframes egg-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  12% { opacity: 0.95; }
  100% {
    transform: translateY(110vh) rotate(18deg);
    opacity: 0;
  }
}

.egg-flip {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transform: rotate(180deg);
  transform-origin: center center;
}

.chapter__index {
  user-select: none;
}

.scroll-progress {
  cursor: pointer;
}

body.egg-complete .palette-dock__hint {
  color: var(--coral);
}

/* —— Madness layer —— */
.madness-hud {
  position: fixed;
  left: clamp(0.75rem, 2.5vw, 1.25rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 94;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: auto;
  pointer-events: none;
}

.madness-hud__toggle {
  pointer-events: auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(var(--ink-rgb), 0.25);
  background: rgba(var(--mist-rgb), 0.92);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.madness-hud__toggle:hover {
  background: var(--coral);
  color: var(--white);
  border-color: transparent;
}

.madness-hud__panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  width: min(42vw, 9.5rem);
  pointer-events: none;
}

.madness-hud.is-open .madness-hud__panel {
  display: flex;
}

.madness-hud.is-collapsed .madness-hud__panel {
  display: none;
}

.madness-kicker {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.floor-hud,
.time-hud,
.soul-hud {
  background: rgba(var(--ink-rgb), 0.88);
  color: var(--mist);
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(var(--mist-rgb), 0.18);
}

.floor-hud strong,
.time-hud strong,
.soul-hud strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.floor-hud.is-ping {
  outline: 2px solid var(--coral);
}

.time-bought {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  opacity: 0.8;
}

.time-hud.is-critical {
  border-color: var(--coral);
  color: var(--coral);
}

.time-hud.is-broke {
  background: var(--coral);
  color: var(--white);
}

.soul-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.soul-card {
  position: absolute;
  width: min(70vw, 16rem);
  padding: 0.7rem 0.85rem;
  background: rgba(10, 12, 18, 0.82);
  color: #d7dde8;
  border-left: 3px solid var(--coral);
  opacity: 0;
  transform: translateY(12px) rotate(-1deg);
  transition: opacity 0.45s ease, transform 0.45s ease;
  font-size: 0.82rem;
}

.soul-card header {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.35rem;
}

.soul-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  color: var(--mist);
}

.soul-card--real {
  border-left-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(var(--teal-rgb), 0.35);
}

.soul-card.is-in {
  opacity: 1;
  transform: translateY(0) rotate(-1deg);
}

.soul-card.is-out {
  opacity: 0;
  transform: translateY(-18px) rotate(2deg);
}

.infect-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  z-index: 115;
  padding: 0.65rem 1rem;
  background: var(--coral);
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.infect-banner.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.is-infected {
  animation: infect-flash 0.9s ease;
}

@keyframes infect-flash {
  0%, 100% { filter: none; }
  40% { filter: hue-rotate(60deg) saturate(1.4); }
}

.alarm-overlay {
  position: fixed;
  inset: 0;
  z-index: 118;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(80, 0, 0, 0.55);
  color: #ffd0d0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.alarm-overlay.is-show {
  opacity: 1;
  pointer-events: auto;
  animation: alarm-pulse 0.8s ease infinite;
}

.alarm-overlay p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 3rem);
  letter-spacing: 0.08em;
}

@keyframes alarm-pulse {
  0%, 100% { background: rgba(80, 0, 0, 0.5); }
  50% { background: rgba(140, 0, 0, 0.62); }
}

body.is-emergency {
  cursor: not-allowed;
}

html.is-scroll-locked,
html.is-scroll-locked body {
  overflow: hidden;
}

.contract-modal {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(var(--ink-rgb), 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.contract-modal.is-show {
  opacity: 1;
  pointer-events: auto;
}

.contract-modal__panel {
  width: min(92vw, 26rem);
  background: var(--mist);
  color: var(--ink);
  padding: 1.5rem;
  border-top: 4px solid var(--coral);
}

.contract-modal__panel h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0.35rem 0 0.75rem;
  letter-spacing: -0.03em;
}

.contract-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.cta--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid rgba(var(--ink-rgb), 0.35);
}

.cta--ghost:hover {
  background: var(--ink);
  color: var(--mist);
}

#contractFlip.is-holding {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

.future-note {
  margin-top: 1rem !important;
  font-size: 0.9rem !important;
  opacity: 0.85;
  color: var(--coral) !important;
}

.door-cta {
  margin-top: 1.5rem;
}

.elevator-doors {
  position: fixed;
  inset: 0;
  z-index: 130;
  pointer-events: none;
}

.elevator-doors__leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06), transparent 40%),
    linear-gradient(180deg, #1a1a1a, #0c0c0c);
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.elevator-doors__leaf--left {
  left: 0;
  border-right: 1px solid rgba(255,255,255,0.12);
  transform: translateX(0);
}

.elevator-doors__leaf--right {
  right: 0;
  border-left: 1px solid rgba(255,255,255,0.12);
  transform: translateX(0);
}

.elevator-doors.is-open .elevator-doors__leaf--left {
  transform: translateX(-102%);
}

.elevator-doors.is-open .elevator-doors__leaf--right {
  transform: translateX(102%);
}

.blank-exit {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  background: #fff;
  color: #111;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.blank-exit.is-show {
  opacity: 1;
  pointer-events: auto;
}

.blank-exit__void {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
}

.blank-exit__hint {
  font-size: 0.95rem;
  opacity: 0.7;
  max-width: 20rem;
  text-align: center;
}

.blank-exit__back {
  background: #1b263b !important;
  color: #e0e1dd !important;
  font-size: 1rem;
  padding: 1rem 1.5rem;
}

.blank-exit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
  pointer-events: auto;
}

.blank-exit .cta {
  margin-top: 0;
  pointer-events: auto;
}

body.time-sold-out .time-hud {
  animation: alarm-pulse 1.2s ease infinite;
}

@media (max-width: 720px) {
  .madness-hud {
    top: auto;
    bottom: 4.5rem;
    transform: none;
  }

  .madness-hud.is-open .madness-hud__panel {
    flex-direction: row;
    width: auto;
    max-width: calc(100vw - 5rem);
    overflow-x: auto;
  }

  .floor-hud,
  .time-hud,
  .soul-hud {
    min-width: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soul-card,
  .infect-banner,
  .elevator-doors__leaf,
  .blank-exit,
  body.is-infected {
    animation: none !important;
    transition: none !important;
  }
}
