:root {
  --slant: 3cqw;
  --ink: #07090c;
  --paper: #e8e2d3;
  --note: #d7ccb1;
  --slip: #eaedf0;
  --gutter: #050709;
  --lamp: #f0c462;
  --danger: #d94c3d;
  --crt: #8cd2e0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--paper);
  overflow: hidden;
  font-family: "Crimson Pro", Georgia, serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #0d1318 0%, #000 72%);
}

#phone {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  background: var(--gutter);
  overflow: hidden;
  cursor: pointer;
  container-type: inline-size;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.9);
}

/* Full-frame flash / blackout transition overlay */
#fx {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
}

#fx.flash-white {
  background: #fff6dc;
  animation: flashWhite 0.72s ease-out forwards;
}

#fx.flash-black {
  background: #000;
  animation: flashBlack 0.85s ease-out forwards;
}

#fx.flash-flicker {
  background: #000;
  animation: flashFlicker 1.2s linear forwards;
}

@keyframes flashWhite {
  0% { opacity: 0.96; }
  100% { opacity: 0; }
}

@keyframes flashBlack {
  0% { opacity: 0.98; }
  35% { opacity: 0.94; }
  100% { opacity: 0; }
}

@keyframes flashFlicker {
  0%   { opacity: 0; background: #fff3c8; }
  7%   { opacity: 0.95; background: #000; }
  14%  { opacity: 0.28; background: #f0c462; }
  21%  { opacity: 0.98; background: #000; }
  29%  { opacity: 0.42; background: #d48f2e; }
  37%  { opacity: 1; background: #000; }
  45%  { opacity: 0.78; background: #000; }
  52%  { opacity: 1; background: #000; }
  84%  { opacity: 1; background: #000; }
  100% { opacity: 0; background: #000; }
}

/* Fourth-wall photorealistic cracked phone glass overlay */
#crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  overflow: hidden;
  transition: opacity 0.9s ease;
}

#crack.on {
  opacity: 1;
  transition: opacity 0.04s linear;
}

#crack img {
  position: absolute;
  display: none;
  user-select: none;
  pointer-events: none;
}

#crack.lvl1 #crack-sm {
  display: block;
  width: 66%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transform: translate(-50%, -50%);
  opacity: 0.92;
}

#crack.lvl2 #crack-lg {
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
}

/* 2-second dying-bulb flicker creature scare page */
.page.flicker-scare {
  background: #000;
  padding: 0;
}

.page.flicker-scare > .panel {
  border: 0;
  opacity: 0;
  transform: none;
}

.page.flicker-scare > .panel::after { display: none; }

.page.flicker-scare.on > .panel.flicker-run {
  animation: bulbFlicker 2.2s linear forwards;
}

body.still .page.flicker-scare.on > .panel {
  opacity: 1;
}

@keyframes bulbFlicker {
  0%   { opacity: 0; }
  11%  { opacity: 0; }
  13%  { opacity: 0.92; filter: brightness(1.15) contrast(1.15); }
  21%  { opacity: 0.78; }
  23%  { opacity: 0; }
  37%  { opacity: 0; }
  39%  { opacity: 0.88; filter: brightness(1.08); }
  47%  { opacity: 0; }
  62%  { opacity: 0; }
  65%  { opacity: 1; filter: brightness(1.25) contrast(1.2); }
  79%  { opacity: 0.94; }
  82%  { opacity: 0.15; }
  85%  { opacity: 0.65; }
  88%  { opacity: 0; }
  100% { opacity: 0; }
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5cqw;
  padding: 8cqw 2.2cqw 3.4cqw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s ease;
}

.page.on { opacity: 1; }

.page.blackout {
  background: #000;
  justify-content: center;
  align-items: center;
  gap: 4.5cqw;
  padding: 12cqw 6cqw;
}

/* Pitch-black centered warning beat that smoothly glides up as a full-bleed splash rises behind it */
.page.reveal {
  background: #000;
  padding: 8cqw 2.2cqw 3.4cqw;
}

.page.reveal > .beat {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 44%;
  z-index: 4;
  max-width: none;
  font-size: 7.4cqw;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.95), 0 0 28px rgba(240, 196, 98, 0.35);
  transition: opacity 0.4s ease, top 0.7s cubic-bezier(0.2, 0.9, 0.2, 1), transform 0.5s ease;
}

.page.reveal:has(.panel.in) > .beat {
  top: 5.5%;
}

/* Full-screen top-to-bottom comic typography MONEY SHOT page + door background reveal */
.page.moneyshot {
  background: #000;
  padding: 9cqw 3.5cqw 4.5cqw;
  justify-content: space-between;
}

.page.moneyshot > .panel.bg-door {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  z-index: 1;
  transform: scale(1.03);
}

.page.moneyshot > .panel.bg-door::after { display: none; }

.page.moneyshot > .panel.bg-door.in {
  opacity: 0.56;
  transform: none;
  transition: opacity 0.9s ease, transform 1s ease;
}

.page.moneyshot > .js-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.page.moneyshot > .js-face.boom {
  animation: faceScare 0.48s linear forwards;
}

@keyframes faceScare {
  0%   { opacity: 0; transform: scale(1.02); }
  10%  { opacity: 1; transform: scale(1.08); filter: contrast(1.25) brightness(1.15); }
  78%  { opacity: 0.96; transform: scale(1.12); }
  90%  { opacity: 0.35; }
  100% { opacity: 0; transform: scale(1.14); }
}

.page.moneyshot > .money {
  position: relative;
  z-index: 3;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 2cqw 0 3cqw;
  opacity: 0;
  transform: none;
  transition: opacity 0.25s ease;
}

.page.moneyshot > .money.on {
  opacity: 1;
}

.page.moneyshot > .money .mline {
  font-family: "Comic Neue", "Cinzel", sans-serif;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  text-align: center;
  line-height: 0.95;
  letter-spacing: 0.04em;
  min-height: 1em;
  color: #edf9fc;
  text-shadow:
    -0.5cqw 0 0 rgba(100, 215, 240, 0.72),
    0.5cqw 0 0 rgba(217, 76, 61, 0.48),
    0 1cqw 3cqw rgba(0, 0, 0, 0.95);
}

.page.moneyshot > .money .mline.big { font-size: 13.5cqw; }
.page.moneyshot > .money .mline.med { font-size: 13.5cqw; color: var(--crt); }
.page.moneyshot > .money .mline.end { font-size: 13cqw; color: #fff; }

.page.moneyshot:has(.bg-door.in) > .money {
  opacity: 0.78;
}

.page.moneyshot > .choice {
  position: relative;
  z-index: 4;
  margin: 0 0 1cqw;
}

.page.moneyshot > .choice button {
  background: rgba(5, 7, 9, 0.86);
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.85);
}

/* Interactive 3D Page-Flipping 1984 Tide Book */
.page.flipbook-page {
  background: radial-gradient(circle at 50% 45%, #181410 0%, #050506 85%);
  padding: 8.5cqw 3cqw 4cqw;
}

.flipbook {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  perspective: 1400px;
  border-radius: 0 2cqw 2cqw 0;
  box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, 0.9), -1.2cqw 0 0 #261e16, -2cqw 0 0 #140f0b;
}

.flipbook .sheet {
  position: absolute;
  inset: 0;
  background: #d8ccb2;
  color: #17130e;
  border: 0.4cqw solid #3a2e20;
  border-left: 0;
  border-radius: 0 1.8cqw 1.8cqw 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 0.72s cubic-bezier(0.32, 0.08, 0.24, 1), opacity 0.58s ease, box-shadow 0.5s ease;
  backface-visibility: hidden;
  box-shadow: inset 3.5cqw 0 4.5cqw rgba(24, 16, 8, 0.34), 0.6cqw 0.6cqw 2cqw rgba(0, 0, 0, 0.55);
}

.flipbook .sheet.turned {
  transform: rotateY(-122deg) skewY(-2deg);
  opacity: 0;
  pointer-events: none;
  box-shadow: inset 6cqw 0 8cqw rgba(0, 0, 0, 0.65);
}

.flipbook .sheet .shead {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2cqw 3.2cqw 1.2cqw 4.5cqw;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.5cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4b3d2b;
  border-bottom: 0.3cqw solid rgba(58, 46, 32, 0.28);
  background: rgba(205, 190, 158, 0.6);
}

.flipbook .sheet .sart {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #cfc2a4;
}

.flipbook .sheet .sart img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flipbook .sheet .bnote {
  flex: none;
  padding: 2.6cqw 3.4cqw 2.8cqw 4.6cqw;
  background: #ded2b7;
  border-top: 0.4cqw solid #3a2e20;
  font-family: "Crimson Pro", Georgia, serif;
  font-weight: 600;
  font-style: normal;
  font-size: 3.7cqw;
  line-height: 1.3;
  color: #16110b;
}

.flipbook .sheet .sturn {
  display: block;
  margin-top: 1.2cqw;
  text-align: right;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.35cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b5539;
}

.page.shake {
  animation: shake 0.55s cubic-bezier(0.3, 0.7, 0.3, 1);
}

@keyframes shake {
  0% { transform: translate(0, 0); }
  12% { transform: translate(-2.4cqw, 1.3cqw); }
  28% { transform: translate(2cqw, -1.1cqw); }
  46% { transform: translate(-1.2cqw, 0.7cqw); }
  68% { transform: translate(0.7cqw, -0.3cqw); }
  100% { transform: none; }
}

/* Black-screen multi-tap horror beat cards */
.beat {
  opacity: 0;
  transform: scale(0.94) translateY(2cqw);
  transition: opacity 0.32s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
  text-align: center;
  max-width: 90%;
  font-style: normal;
}

.beat.on {
  opacity: 1;
  transform: none;
}

.beat.time {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 4.6cqw;
  letter-spacing: 0.26em;
  color: var(--crt);
}

.beat.knock {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 9.5cqw;
  letter-spacing: 0.18em;
  color: var(--paper);
  text-shadow: 0 0 24px rgba(232, 226, 211, 0.28);
}

.beat.knock.loud {
  font-size: 12cqw;
  color: #fff;
  text-shadow: 0 0 32px rgba(240, 196, 98, 0.35);
}

.beat.click {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  font-size: 8.2cqw;
  letter-spacing: 0.22em;
  color: var(--lamp);
  text-shadow: 0 0 22px rgba(240, 196, 98, 0.35);
}

.beat.count {
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 4.1cqw;
  letter-spacing: 0.08em;
  color: rgba(232, 226, 211, 0.78);
}

.beat.whisper {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 3.9cqw;
  letter-spacing: 0.08em;
  color: var(--crt);
}

.panel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: none;
  overflow: hidden;
  background: #000;
  opacity: 0;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.97);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border: 0.35cqw solid rgba(232, 226, 211, 0.22);
}

.panel.cutA::after { border-bottom: 0; }
.panel.cutT::after { border-top: 0; }

.panel.in {
  opacity: 1;
  transform: none;
}

/* Dropped-book overlay card (slams down at an angle on top of the book-search page!) */
.page > .panel.dropcard {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 26%;
  width: auto;
  aspect-ratio: 16 / 10;
  z-index: 5;
  box-shadow: 0 3cqw 8cqw rgba(0, 0, 0, 0.92), 0 0 0 0.45cqw rgba(232, 226, 211, 0.35);
  transform: translateY(-28cqw) scale(1.16) rotate(-7deg);
  transition: opacity 0.28s ease, transform 0.42s cubic-bezier(0.18, 0.9, 0.26, 1.08);
}

.page > .panel.dropcard.in {
  opacity: 1;
  transform: rotate(-3deg);
}

.panel.splash {
  aspect-ratio: auto;
  flex: 1 1 0;
  min-height: 0;
}

.panel.cutA {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--slant)));
}

.panel.cutT {
  clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 100%);
}

.panel.cutA.cutT {
  clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 calc(100% - var(--slant)));
}

.panel.joined {
  margin-top: calc(-1 * var(--slant));
}

.panel img,
.panel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel video {
  opacity: 0;
  transition: opacity 0.18s linear;
}

.panel video.live { opacity: 1; }

.panel.in img.drift {
  animation: drift 12s ease-out forwards;
}

@keyframes drift {
  from { transform: scale(1.09) translate(var(--px, 1.5%), var(--py, -1%)); }
  to { transform: scale(1.01); }
}

/* 2x2 Grid Row (used for Page 3 setup beats: cot, books, TV, CDs) */
.row {
  display: flex;
  gap: 1.5cqw;
  flex: none;
}

.row .panel {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  aspect-ratio: 4 / 3;
}

/* Full-Page 4-Strip Stack (used for Page 4 "Zero Signal" 4 separate full-width beats) */
.strips {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  gap: 1.2cqw;
}

.strips .panel {
  aspect-ratio: auto;
  flex: 1 1 0;
  min-height: 0;
}

.strips .panel.cutA { --slant: 2.2cqw; }
.strips .panel.cutT { --slant: 2.2cqw; }
.strips .panel.joined { margin-top: -2.2cqw; }

/* Rotated ~32-degree angled 4-shard animated comic quad (M01-M04) */
.quad {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  background: var(--gutter);
}

.quad .panel.shard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: #000;
}

.quad .panel.shard::after {
  display: none;
}

/* Four shards meeting around a ~32-degree rotated '+' crosshair with even dark gutters */
.quad .panel.q1 {
  clip-path: polygon(0% 0%, 62% 0%, 48.2% 48%, 0% 36.2%);
}

.quad .panel.q2 {
  clip-path: polygon(65% 0%, 100% 0%, 100% 60.8%, 51.4% 48.8%);
}

.quad .panel.q3 {
  clip-path: polygon(0% 39.2%, 48.6% 51.2%, 35% 100%, 0% 100%);
}

.quad .panel.q4 {
  clip-path: polygon(51.8% 52%, 100% 63.8%, 100% 100%, 38% 100%);
}

/* Frame each shard's focal video/image directly inside its own quadrant bounding box */
.quad .panel.shard .media,
.diag2 .panel.shard .media {
  position: absolute;
  overflow: hidden;
  transition: filter 0.6s ease;
}

.quad .panel.shard.past .media,
.diag2 .panel.shard.past .media {
  filter: grayscale(100%) brightness(0.45) contrast(1.08);
}

/* 30-degree diagonal 2-panel split (bottom half of Page 9 book notes) */
.diag2 {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  background: var(--gutter);
}

.diag2 .panel.shard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: #000;
}

.diag2 .panel.shard::after { display: none; }
.diag2 .panel.d1 { clip-path: polygon(0% 0%, 64.5% 0%, 30.5% 100%, 0% 100%); }
.diag2 .panel.d2 { clip-path: polygon(68% 0%, 100% 0%, 100% 100%, 34% 100%); }
.diag2 .panel.d1 .media { left: 0; top: 0; width: 65%; height: 100%; }
.diag2 .panel.d2 .media { right: 0; top: 0; width: 66%; height: 100%; }

#phone.clip-lock {
  cursor: progress;
}

.quad .panel.q1 .media { left: 0; top: 0; width: 64%; height: 50%; }
.quad .panel.q2 .media { right: 0; top: 0; width: 52%; height: 62%; }
.quad .panel.q3 .media { left: 0; bottom: 0; width: 50%; height: 62%; }
.quad .panel.q4 .media { right: 0; bottom: 0; width: 64%; height: 50%; }

/* Retro broadcast TV closed-caption subtitle inside CRT panel */
.panel > .cap.sub {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  font-size: 3.1cqw;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: pre-line;
  padding: 1.2cqw 2.4cqw;
  background: rgba(2, 4, 6, 0.84);
  color: #f6e788;
  border: 0;
  border-top: 0.25cqw solid rgba(140, 210, 224, 0.35);
  border-bottom: 0.25cqw solid rgba(140, 210, 224, 0.35);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
  max-width: none;
}

/* Compact badge caption inside grid/strip/shard panels */
.panel > .cap.tag {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.75cqw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7cqw 1.6cqw;
  background: rgba(5, 7, 9, 0.88);
  color: var(--paper);
  border: 0.3cqw solid rgba(240, 196, 98, 0.6);
  box-shadow: 0 0.5cqw 1.2cqw rgba(0, 0, 0, 0.7);
  max-width: 90%;
}

/* Upright captions only (never italic) */
.cap,
.title > * {
  opacity: 0;
  transform: translateY(1.5cqw);
  transition: opacity 0.45s ease 0.2s, transform 0.45s ease 0.2s;
}

.cap.on,
.title.on > * {
  opacity: 1;
  transform: none;
}

.cap {
  font-size: 3.6cqw;
  line-height: 1.28;
  font-style: normal;
  color: var(--ink);
  background: var(--paper);
  padding: 1.3cqw 2.2cqw;
  border: 0.45cqw solid var(--ink);
  box-shadow: 0.8cqw 0.8cqw 0 rgba(0, 0, 0, 0.65);
}

.cap.note {
  background: var(--note);
  border-left: 1.4cqw solid #3b3022;
  color: #19140e;
  font-size: 3.45cqw;
}

.cap.slip {
  background: var(--slip);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.95cqw;
  line-height: 1.36;
  letter-spacing: 0.01em;
  border: 0.45cqw solid #1a2129;
  color: #0e1318;
}

.cap.dark {
  background: rgba(6, 9, 13, 0.94);
  color: var(--paper);
  border: 0.4cqw solid rgba(240, 196, 98, 0.65);
}

.page > .cap {
  align-self: flex-start;
  max-width: 96%;
  margin: 0 1cqw;
  z-index: 3;
  flex: none;
}

.page > .cap.r { align-self: flex-end; }

.panel > .cap {
  position: absolute;
  max-width: 86%;
  z-index: 3;
}

/* Slanted top, straight bottom caption band between two panels */
.page > .cap.band {
  align-self: stretch;
  max-width: none;
  margin: calc(-1 * var(--slant)) 0 0;
  border: 0;
  box-shadow: none;
  padding: calc(var(--slant) + 1.3cqw) 3.2cqw 1.6cqw;
  clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 100%);
}

/* Speech & eerie mimic bubbles */
.bub {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bub.on { opacity: 1; }

.bub svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0.5cqw 0.7cqw rgba(0, 0, 0, 0.45));
}

.bub.mimic svg {
  filter: drop-shadow(0 0 0.5cqw rgba(140, 210, 224, 0.34)) drop-shadow(0 0.5cqw 0.7cqw rgba(0, 0, 0, 0.6));
}

.bub .edge {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-linejoin: round;
}

.bub .fill {
  fill: #fdfcf7;
  stroke: none;
}

.bub.mimic .fill {
  fill: #d8e4e8;
}

.bub.mimic .edge {
  fill: #091318;
  stroke: #091318;
}

.bub .say {
  position: absolute;
  margin: 0;
  padding: 0 0 0 0.02em;
  font-family: "Comic Neue", "Comic Sans MS", sans-serif;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  font-size: 2.55cqw;
  line-height: 1.16;
  letter-spacing: 0.02em;
  text-align: center;
  text-wrap: balance;
  white-space: pre-line;
  color: var(--ink);
  opacity: 1;
  transition: none;
}

.bub.big .say { font-size: 3.15cqw; }

.bub.hush .say {
  font-size: 2.35cqw;
  color: #363c44;
}

.bub.mimic .say {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.35cqw;
  letter-spacing: 0.04em;
  padding-left: 0.04em;
  color: #0c1f29;
}

/* Title & End cards */
.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3cqw;
  margin: auto 0;
  padding: 0 5cqw;
}

.title h1 {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-style: normal;
  font-size: 9.2cqw;
  line-height: 1.1;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--paper);
  text-shadow: 0 0 28px rgba(240, 196, 98, 0.25);
}

.title.small h1 { font-size: 8.2cqw; }

.title .sub {
  font-family: "Cinzel", Georgia, serif;
  font-size: 3.8cqw;
  font-style: normal;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lamp);
}

.title .line {
  font-size: 4.7cqw;
  font-style: normal;
  opacity: 0.9;
  max-width: 88%;
  line-height: 1.3;
}

.title .meta {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.7cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 226, 211, 0.55);
}

.title button.enter,
.title button.replay {
  margin-top: 2cqw;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 3.7cqw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lamp);
  border: 0.45cqw solid var(--lamp);
  padding: 2.2cqw 5.2cqw;
  cursor: pointer;
  pointer-events: none;
  box-shadow: 0 0 28px rgba(240, 196, 98, 0.25);
}

.page.on .title button.enter,
.page.on .title button.replay { pointer-events: auto; }
.title button.enter:hover,
.title button.replay:hover { background: #f8d684; }

/* Standard inline tactile action button */
.action {
  display: flex;
  justify-content: center;
  margin: 1.5cqw 1cqw 0;
  opacity: 0;
  transform: translateY(1.2cqw);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 6;
}

.action.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.action:not(.over).done {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.action button {
  width: 100%;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 3.9cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lamp);
  border: 0.45cqw solid var(--lamp);
  padding: 2.4cqw 3.4cqw;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(240, 196, 98, 0.3);
  animation: actionPulse 2s ease-in-out infinite;
}

/* Creative diegetic overlaid brass switch / emergency breaker / bolt control inside a panel */
.panel > .action.over {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 4.5%;
  margin: 0;
}

.action.breaker button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4cqw;
  background: linear-gradient(180deg, #1b2129 0%, #0b0f14 100%);
  border: 0.45cqw solid var(--lamp);
  color: var(--paper);
  padding: 2.4cqw 3.6cqw;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.85), 0 0 28px rgba(240, 196, 98, 0.28);
}

.action.breaker .switch-track {
  display: inline-flex;
  align-items: center;
  width: 11cqw;
  height: 5.2cqw;
  padding: 0.6cqw;
  border-radius: 3cqw;
  background: #050709;
  border: 0.35cqw solid rgba(240, 196, 98, 0.7);
  flex: none;
}

.action.breaker .switch-knob {
  width: 3.6cqw;
  height: 3.6cqw;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 12px rgba(240, 196, 98, 0.85);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.action.breaker.flipped .switch-knob {
  transform: translateX(5.6cqw);
  background: #fff6dc;
}

.action.breaker .switch-label {
  flex: 1 1 auto;
  text-align: left;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 3.8cqw;
  letter-spacing: 0.1em;
}

.action.breaker .switch-led {
  width: 2cqw;
  height: 2cqw;
  border-radius: 50%;
  background: #463a24;
  border: 0.25cqw solid rgba(240, 196, 98, 0.6);
  flex: none;
}

.action.breaker.flipped .switch-led {
  background: #ffe08a;
  box-shadow: 0 0 14px #ffe08a;
}

.action.breaker.danger button {
  background: linear-gradient(180deg, #4a120d 0%, #1c0706 100%);
  border-color: #ff6d5e;
  color: #fff;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.9), 0 0 32px rgba(217, 76, 61, 0.55);
}

.action.breaker.danger .switch-track {
  border-color: rgba(255, 118, 102, 0.8);
}

.action.breaker.danger .switch-knob {
  transform: translateX(5.6cqw);
  background: #ff6b5c;
  box-shadow: 0 0 14px rgba(255, 107, 92, 0.95);
}

.action.breaker.danger.flipped .switch-knob {
  transform: translateX(0);
  background: #555;
  box-shadow: none;
}

.action.breaker.danger .switch-led {
  background: #ff4e3d;
  border-color: #ff9c90;
  box-shadow: 0 0 14px #ff4e3d;
}

.action.breaker.danger.flipped .switch-led {
  background: #1c1010;
  box-shadow: none;
}

.action.danger button {
  background: linear-gradient(180deg, #b83227 0%, #7d1e16 100%);
  border-color: #ff8c7e;
  color: #fff;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.85), 0 0 28px rgba(217, 76, 61, 0.55);
}

.action.bolt button {
  background: linear-gradient(180deg, #252c35 0%, #10151b 100%);
  border-color: #9cb4c9;
  color: #eef4fa;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.85), 0 0 24px rgba(140, 210, 224, 0.25);
}

.action button:hover { filter: brightness(1.1); }

@keyframes actionPulse {
  50% { transform: scale(1.015); }
}

/* Interactive horror choice */
.choice {
  display: flex;
  flex-direction: column;
  gap: 2cqw;
  margin: 1.5cqw 1cqw 0;
  opacity: 0;
  transition: opacity 0.4s ease 0.25s;
  pointer-events: none;
}

.choice.on {
  opacity: 1;
  pointer-events: auto;
}

.choice button {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-style: normal;
  font-size: 3.8cqw;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: rgba(240, 196, 98, 0.07);
  border: 0.45cqw solid var(--lamp);
  padding: 2.4cqw 3cqw;
  cursor: pointer;
  text-align: center;
}

.choice button:hover,
.choice button:focus-visible {
  background: var(--lamp);
  color: var(--ink);
  outline: none;
}

/* HUD Chrome */
#bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.9cqw;
  background: rgba(232, 226, 211, 0.12);
  z-index: 9;
}

#bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lamp);
  transition: width 0.3s ease;
}

#top {
  position: absolute;
  top: 1.2cqw;
  right: 1.6cqw;
  z-index: 10;
  display: flex;
  gap: 1.2cqw;
}

#top button {
  font: inherit;
  font-size: 2.9cqw;
  line-height: 1.15;
  color: var(--paper);
  background: rgba(5, 7, 9, 0.72);
  border: 0.3cqw solid rgba(232, 226, 211, 0.45);
  border-radius: 1.2cqw;
  padding: 0.5cqw 1.8cqw;
  cursor: pointer;
}

#top button:hover {
  border-color: var(--lamp);
  color: var(--lamp);
}

#ref {
  position: absolute;
  top: 1.5cqw;
  left: 1.8cqw;
  z-index: 10;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 2.7cqw;
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--paper);
  opacity: 0.65;
  background: rgba(5, 7, 9, 0.65);
  padding: 0.3cqw 1.4cqw;
  border-radius: 1cqw;
  pointer-events: none;
}

#ref:empty { display: none; }

#hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5.5cqw;
  z-index: 9;
  text-align: center;
  font-size: 3.1cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232, 226, 211, 0.62);
  pointer-events: none;
}

body.still *,
body.still *::before,
body.still *::after {
  transition: none !important;
  animation: none !important;
}

/* Tear-off calendar chip for "Day N" caption prefixes.
   Floated in flow (not overhanging): band captions clip-path their top
   edge and panels clip overflow, so anything outside the box gets cut. */
.daycal {
  float: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 7.4cqw;
  margin: -0.2cqw 1.7cqw 0.4cqw -0.6cqw;
  transform: rotate(-3deg);
  background: #f6f1e4;
  border: 0.4cqw solid var(--ink);
  box-shadow: 0.5cqw 0.5cqw 0 rgba(0, 0, 0, 0.45);
}
.daycal-l {
  background: var(--ink);
  color: var(--paper);
  font-size: 1.6cqw;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-align: center;
  padding: 0.4cqw 0.8cqw 0.3cqw;
}
.daycal-n {
  font-size: 4.2cqw;
  line-height: 1;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 0.45cqw 0.8cqw 0.55cqw;
}
.cap.dark .daycal {
  border-color: rgba(240, 196, 98, 0.65);
  box-shadow: 0.5cqw 0.5cqw 0 rgba(0, 0, 0, 0.8);
}
