:root {
  --bg: #050304;
  --panel: rgba(255,255,255,.035);
  --line: rgba(255,255,255,.07);
  --bone: #d9d2c5;
  --dim: #9a9084; /* ~6:1 on black — the old #6f675d failed AA at 3.7:1 (grader round 1, defect 6) */
  --ember: #ff7a1a;
  --blood: #8a0f1a;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--bone);
  font-family: 'Special Elite', 'Courier New', monospace;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Backdrop: ONE fixed layer behind every view. The gradient is part of the image stack, so
   a scrolling view can never outrun it (the old per-view ::before overlay only covered the first
   screen height — the raw floor texture showed through below it on long pages). ---- */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5,3,4,.40), rgba(5,3,4,.10)),
              url('../assets/art/bg-menu.webp') no-repeat center bottom / cover;
  background-color: var(--bg);
}
/* Text sits straight on the cracked floor now: a soft shadow keeps it readable on the bright
   patches without darkening the art (Wietse 2026-09-02: "we lost the nice background graphics"). */
#view-menu, #view-arm, #view-custom, #view-gotcha, #view-sale, #view-disclaimer { text-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* ---- Film grain + vignette (fixed full-screen overlay on every view) ---- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1999;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.75) 100%);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .85; }
  50%      { opacity: 1; }
}

.view {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 20px) 20px max(env(safe-area-inset-bottom), 20px);
  overflow-y: auto;
}
.view.active { display: flex; }

/* Wordmark — Creepster, bone, dying-neon flicker + ember shadow. No orange fill. */
.title {
  font-family: 'Creepster', cursive;
  font-size: clamp(2.4rem, 12vw, 4rem);
  line-height: 0.95;
  text-align: center;
  color: var(--bone);
  text-shadow: 0 0 24px rgba(255,122,26,.28), 0 4px 0 #1a0d06;
  margin-top: 12px;
  animation: neon-flicker 8s infinite;
}
/* Wietse's chrome wordmark (2026-09-08) replaces the Creepster text: cut out on alpha, so it sits
   on the floor art. Width-capped so the menu keeps its first card above the fold at 360x640. */
.title .logo { display: block; width: min(78vw, 340px); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.75)); }
@media (max-height: 700px) { .title .logo { width: min(66vw, 280px); } .title { margin-top: 4px; } }
@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  4%  { opacity: .35; }
  5%  { opacity: 1; }
  18% { opacity: 1; }
  19% { opacity: .35; }
  20% { opacity: 1; }
  42% { opacity: 1; }
  43% { opacity: .5; }
  44% { opacity: 1; }
  71% { opacity: 1; }
  72% { opacity: .35; }
  73% { opacity: 1; }
}

.sub-title {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  text-align: center;
  text-shadow: 0 0 18px rgba(255,122,26,.22);
}
.tagline { text-align: center; color: var(--dim); margin: 10px 0 22px; font-style: italic; }

.scare-list { display: flex; flex-direction: column; gap: 12px; }
.scare-card {
  display: flex;
  align-items: center;
  gap: 14px;
  /* Real backdrop: the bright patches of the cracked-floor art bled through the old
     3.5% white wash and drowned the subtitles (grader round 1, defect 6). */
  background: rgba(10, 7, 8, .62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--bone);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.08s;
}
.scare-card:active { transform: scale(0.97); background: rgba(28,22,24,.72); }
.card-icon {
  width: 64px; height: 64px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: inset 0 0 18px #000;
  flex: none;
}
.card-body { flex: 1; min-width: 0; }
.card-body b {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.08rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  display: block;
  font-weight: 400;
}
.card-body small { color: var(--dim); font-size: 0.82rem; line-height: 1.35; display: block; margin-top: 3px; }

/* lock badge + LOCKED hint (hidden when unlocked — main.js toggles .locked) */
.lock-col { display: none; flex-direction: column; align-items: center; gap: 3px; }
.lock-badge { display: inline-flex; }
.lock-hint {
  color: #ff3b4a; /* --blood measured 2.1:1 at this size — unreadable (grader round 1, defect 6) */
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.scare-card.locked .lock-col { display: flex; }
.scare-card.locked .card-icon { filter: grayscale(1) brightness(.45); }
.scare-card.locked .card-body b { color: var(--dim); }
.menu-foot { text-align: center; color: var(--dim); font-size: 0.8rem; margin-top: 22px; }

/* Menu */
#view-menu { background: transparent; }
#view-menu > * { position: relative; z-index: 1; }

/* Arm / sale / custom — darker version of the same bg treatment */
#view-arm, #view-custom, #view-sale, #view-disclaimer { background: transparent; }
#view-arm > *, #view-custom > *, #view-sale > *, #view-disclaimer > * { position: relative; z-index: 1; }

.arm-box { margin: auto 0; display: flex; flex-direction: column; gap: 18px; text-align: center; }
/* Instructions read left-aligned in a narrow column — centred multi-line prose is slower to
   read, and this is the one screen the prankster must actually absorb (grader round 1, defect 19). */
.howto { color: var(--bone); line-height: 1.5; text-align: left; max-width: 420px; margin: 0 auto; width: 100%; }
.perm-note { color: var(--dim); font-size: 0.85rem; font-style: italic; text-align: left; max-width: 420px; margin: 0 auto; width: 100%; }
.perm-note.err { color: #ff3b4a; font-style: normal; font-size: 0.95rem; }
/* Volume line on every arm screen (app: maxed at ARM by the shell; web: the prankster does it) */
.arm-volume { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto; padding: 10px 14px; max-width: 420px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--bone); font-size: 0.9rem; line-height: 1.35; text-align: left; }
.arm-volume-icon { flex: none; color: var(--ember); }
.big-btn {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.25rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #a3121f, #4a0810);
  color: var(--bone);
  border: 1px solid rgba(255,59,74,.2);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  animation: arm-pulse 2.4s ease-in-out infinite;
}
.big-btn:active { transform: scale(0.97); }
@keyframes arm-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(138,15,26,.53); }
  50%      { box-shadow: 0 0 28px rgba(138,15,26,.53); }
}
.ghost-btn { background: none; border: none; color: #b8b0a4; font: inherit; font-size: 1rem; padding: 10px; cursor: pointer; }

/* Paywall */
.paywall-list { list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 1.05rem; line-height: 1.4; }

/* Your Own Scare setup */
.custom-previews { display: flex; gap: 18px; justify-content: center; align-items: flex-start; }
.custom-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.custom-preview figcaption { font-size: 0.65rem; letter-spacing: 3px; color: var(--dim); }
#custom-photo-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.custom-scream-slot { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 1rem; border-radius: 12px; border: 1px dashed var(--line); color: var(--dim); }
#custom-scream-preview { width: 170px; height: 40px; }
.file-btn { position: relative; display: block; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--bone); font: inherit; background: var(--panel); }
.file-btn:active { transform: scale(0.98); }
.file-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.custom-status { color: var(--dim); font-size: 0.85rem; font-style: italic; min-height: 1.2em; }
.custom-pranks-label { text-align: center; font-size: 0.7rem; letter-spacing: 4px; color: var(--dim); margin-top: 6px; }
#custom-pranks { width: 100%; max-width: 340px; }
#custom-pranks .scare-card { padding: 10px 14px; }

/* Stage — the stage stays black by default */
#view-stage { padding: 0; background: #000; }
#stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }

.stage-hint { color: var(--dim); font-size: 0.95rem; margin-top: 14px; line-height: 1.5; }
.stage-big { font-family: 'Special Elite', 'Courier New', monospace; font-size: 1.8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--bone); }

/* Hush — the ambush trap: pure-black listening stage, no UI until it fires */
.hush-black {
  position: absolute;
  inset: 0;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.hush-nobody {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.hush-nobody .ghost-btn {
  color: var(--dim);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Module options — segmented control on the arm screen (Hush sensitivity) */
#arm-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.opt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 300px;
}
.opt-label {
  color: var(--dim);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}
.seg-btn {
  flex: 1;
  background: var(--panel);
  border: none;
  color: var(--bone);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 11px 0;
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.sel {
  background: var(--blood);
  color: #fff;
  text-shadow: 0 0 12px rgba(255,60,74,.55);
}

/* Candle — full-bleed candle image, CSS flame at the wick anchor */
.candle-scene {
  position: absolute; inset: 0;
  background: url('../assets/art/stage-candle.webp') no-repeat center center / cover;
}
.candle-glow {
  position: absolute;
  left: 52.8%; top: 31.2%;
  width: 22vh; height: 22vh;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,150,40,.28), transparent 70%);
  pointer-events: none;
  transition: opacity .4s, transform .12s;
}
/* .flame = anchor box (JS drives its transform/opacity while the victim blows);
   .flame-body = the painted flame with the idle flicker. Split so the CSS animation
   never overrides the inline blow transform. */
.flame {
  position: absolute;
  left: 52.8%; top: 31.2%;
  width: 4.5vh;
  height: 7vh;
  transform: translate(-50%, -50%);
  transform-origin: 50% 95%;
  transition: transform .1s linear, opacity .1s linear;
}
.flame-body {
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 75%, #fff8d0 0%, #ffd257 35%, #ff8f1f 70%, rgba(255,80,0,0) 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  filter: blur(0.6px);
  transform-origin: 50% 95%;
  animation: flicker 0.16s infinite alternate;
}
@keyframes flicker {
  from { transform: scaleX(1) scaleY(1) rotate(-1.5deg); opacity: 0.96; }
  to   { transform: scaleX(0.92) scaleY(1.06) rotate(1.5deg); opacity: 1; }
}
.candle-hint {
  position: absolute;
  left: 0; right: 0;
  bottom: 6vh;
  text-align: center;
  color: #b8ad9a;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 10px 18px;
  background: linear-gradient(180deg, transparent, rgba(5,3,4,.8) 30%, rgba(5,3,4,.95));
  z-index: 2;
}

/* Reaction — legit reflex game (the trap), Special Elite + idle bg + grain */
.rt-pad { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.rt-wait { background: #7a1220; }
.rt-go { background: #1d7a2e; }
.rt-idle { background: #0b0b10; }
.rt-num { font-family: 'Special Elite', 'Courier New', monospace; font-size: 1.6rem; letter-spacing: 3px; color: rgba(255,255,255,0.85); }
.rt-ms { font-size: 2.4rem; font-variant-numeric: tabular-nums; }

/* Steady Hand Maze — plain, honest reflex game (the trap). No horror styling. */
.maze-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.maze-level { font-family: 'Special Elite', 'Courier New', monospace; font-size: 1.4rem; letter-spacing: 3px; color: rgba(255,255,255,0.85); }
.maze-canvas {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0b10;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.maze-hint { color: var(--dim); font-size: 0.95rem; line-height: 1.5; }

/* Pulse */
.pulse-bpm { font-size: 5rem; font-variant-numeric: tabular-nums; color: #a00; text-shadow: 0 0 30px rgba(255,20,30,.35); }
.pulse-bpm.idle { color: #2b2323; text-shadow: none; }
.pulse-label { color: var(--dim); letter-spacing: 3px; font-size: 0.8rem; }
.ecg { width: 100%; max-width: 340px; height: 90px; margin-top: 18px; }
.ecg polyline { fill: none; stroke: var(--blood); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(255,40,50,0.6)); }
#pulse-video { position: absolute; width: 1px; height: 1px; opacity: 0.01; pointer-events: none; }

/* Ouija */
/* r1-17: the board was a small dim tile in a big empty stage. Same art, more presence:
   near-full-width board, bigger brighter letters, a candlelit glow on the planchette. */
.ouija-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
  max-width: min(94vw, 440px);
  padding: 26px 14px;
  background: url('../assets/art/stage-ouija-board.webp') no-repeat center center / cover;
  border: 1px solid #4a3620;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,.7), 0 0 60px rgba(255,150,40,.10), inset 0 0 70px rgba(0,0,0,.45);
}
.ouija-letter {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: clamp(1.35rem, 7vw, 1.7rem);
  color: #ecdcae;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(0,0,0,.9);
  text-align: center;
  padding: 9px 0;
  transition: color 0.15s, text-shadow 0.15s;
}
.ouija-letter.lit { color: #fff2c9; text-shadow: 0 0 14px #ffca66, 0 0 30px #ff8a1a; }
.planchette {
  position: absolute;
  width: 104px; height: 104px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.8)) drop-shadow(0 0 16px rgba(255,170,60,.45));
  transition: left 0.9s cubic-bezier(0.45, 0, 0.3, 1), top 0.9s cubic-bezier(0.45, 0, 0.3, 1);
  pointer-events: none;
  object-fit: cover;
}
.planchette.moving { animation: planch-wobble 0.5s ease-in-out infinite; }
@keyframes planch-wobble {
  0%, 100% { transform: translate(-50%, -50%) rotate(-5deg); }
  50%      { transform: translate(-50%, -50%) rotate(5deg); }
}
.ouija-spelled { min-height: 2.6rem; font-family: 'Special Elite', 'Courier New', monospace; font-size: 1.9rem; letter-spacing: 7px; color: #ff3b4a; text-shadow: 0 0 14px rgba(255,60,70,.45); margin-top: 16px; }
.ouija-input { background: #17100a; border: 1px solid #3a2a14; color: var(--bone); font: inherit; font-size: 1.2rem; padding: 12px; border-radius: 10px; text-align: center; width: 100%; max-width: 280px; }

/* Gotcha */
#view-gotcha { background: transparent; }
#view-gotcha > * { position: relative; z-index: 1; }
.gotcha-box { margin: auto 0; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: center; }
.gotcha-title { font-family: 'Creepster', cursive; font-size: 3.2rem; color: var(--bone); text-shadow: 0 0 24px rgba(255,122,26,.3), 0 4px 0 #1a0d06; animation: neon-flicker 8s infinite; }
.gotcha-sub { color: var(--dim); font-style: italic; }
/* Reaction replay card */
.reaction-card { width: 100%; max-width: 190px; display: flex; flex-direction: column; gap: 10px; align-items: center; position: relative; }
/* r6-04: the card sits on screen from the moment the gotcha opens — the empty video box
   reserves its exact height while the recorder finishes, so nothing jumps when the clip
   lands. The overlay text lives on the video box; buttons wake up with the swap. */
.clip-developing {
  display: none;
  position: absolute;
  top: 0; left: 0; width: 100%;
  aspect-ratio: 9 / 16;
  align-items: center; justify-content: center;
  padding: 0 12px; box-sizing: border-box; text-align: center;
  color: var(--dim); font-size: 0.85rem; font-style: italic;
  animation: clip-develop 1.1s ease-in-out infinite alternate;
  pointer-events: none;
}
.reaction-card.developing .clip-developing { display: flex; }
.reaction-card.developing #reaction-clip { background: #120709; box-shadow: inset 0 0 0 1px rgba(255,122,26,.22); }
.reaction-card.developing .share-btn { opacity: .35; pointer-events: none; }
@keyframes clip-develop { from { opacity: .45; } to { opacity: 1; } }
#reaction-clip {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 0 26px rgba(255,122,26,.18);
  background: #000;
}
.share-btn {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #a3121f, #4a0810);
  color: var(--bone);
  border: 1px solid rgba(255,59,74,.2);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.share-btn:active { transform: scale(0.97); }
/* Save = the quieter sibling of Share (r3-03): same shape, panel-dark, one step down. */
.share-btn-quiet {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--bone);
}
.clip-note { color: var(--dim); font-size: 0.8rem; font-style: italic; line-height: 1.4; }
.meter-wrap { width: 100%; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.meter-label { font-size: 0.75rem; letter-spacing: 4px; color: var(--dim); margin-bottom: 10px; }
.meter-bar { height: 18px; background: #0d0710; border-radius: 9px; overflow: hidden; }
/* Mic was off: no score, so the bar shows an empty dashed track instead of a filled one (r1-11). */
.meter-bar.nomic { background: repeating-linear-gradient(45deg, #0d0710 0 8px, #1c1418 8px 16px); border: 1px dashed #4a3a3e; }
#meter-fill { height: 100%; width: 0%; border-radius: 9px; background: linear-gradient(90deg, #3d0a10, #8a0f1a 55%, #ff7a1a); transition: width 1.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.meter-score { font-family: 'Special Elite', 'Courier New', monospace; font-size: 2rem; color: var(--bone); margin-top: 8px; }
.meter-verdict { color: var(--dim); font-style: italic; }
/* r4-01: with the clip card the gotcha stack ran 904 px and its only exit ended at 862 px —
   below the fold at 640/844-px viewports. Two-part fix: the exit is pinned to the bottom of
   the scrollport (sticky, so it can never leave the screen no matter what the stack grows to),
   and on short screens the stack is compacted so little scrolling is needed at all. */
#btn-again {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -10px 26px 12px rgba(5,3,4,.72);
}
@media (max-height: 900px) {
  .gotcha-box { gap: 10px; }
  .gotcha-title { font-size: 2.3rem; }
  .gotcha-sub { font-size: 0.9rem; }
  .reaction-card { max-width: 148px; gap: 8px; }
  .reaction-card .share-btn { font-size: 0.85rem; padding: 7px 12px; letter-spacing: 1px; }
  .meter-wrap { padding: 10px 14px; }
  .meter-label { margin-bottom: 6px; }
  .meter-score { font-size: 1.4rem; margin-top: 4px; }
  .meter-verdict { font-size: 0.85rem; }
}
/* r5-03: at 360x640 the 900px-tier stack still ran 705 px, so the sticky exit rested on the
   scream-o-meter (score + verdict hidden behind it and its shadow) until the user scrolled.
   Under 700 px the stack must FIT the viewport outright — then the exit sits in its natural
   spot and covers nothing. Sizes derived by measurement at 360x640 (qa gate r5-03). */
@media (max-height: 700px) {
  .gotcha-box { gap: 8px; }
  .gotcha-title { font-size: 1.8rem; }
  .gotcha-sub { font-size: 0.82rem; }
  .reaction-card { max-width: 112px; gap: 6px; }
  .reaction-card .share-btn { font-size: 0.76rem; padding: 5px 10px; letter-spacing: 1px; }
  .clip-note { font-size: 0.72rem; }
  .meter-wrap { padding: 8px 12px; }
  .meter-score { font-size: 1.15rem; margin-top: 2px; }
  .meter-verdict { font-size: 0.78rem; }
  #btn-again { font-size: 1rem; padding: 11px 16px; }
}

/* Scare overlay */
#scare-overlay {
  position: fixed; inset: 0;
  background: #000;
  display: none;
  z-index: 1000;
}
#scare-overlay.on { display: block; animation: strobe 0.12s 4 alternate, shake 0.09s 8 linear; }
#scare-overlay .flashframe {
  position: absolute; inset: 0;
  background: #3a0000;
  animation: flashframe 0.07s 1 forwards;
}
@keyframes flashframe { from { opacity: 1; } to { opacity: 0; } }
#scare-face {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: lunge 0.9s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes lunge {
  0% { transform: scale(0.55); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: scale(1.12) translate(6px, -4px); }
  70% { transform: scale(1.06) translate(-8px, 5px); }
  85% { transform: scale(1.14) translate(4px, 3px); }
  100% { transform: scale(1.1); }
}
@keyframes strobe { from { filter: brightness(1.7) contrast(1.2); } to { filter: brightness(0.9); } }
@keyframes shake {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-14px,8px); }
  50%  { transform: translate(14px,-8px); }
  75%  { transform: translate(-10px,-6px); }
  100% { transform: translate(10px,6px); }
}

/* Hush arming countdown: dim red, pointer-events off so the two-finger disarm still reaches .hush-black */
.hush-arming { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; transition: opacity .9s ease; }
.hush-arming.fade { opacity: 0; }
.hush-arming-n { font-family: 'Special Elite', 'Courier New', monospace; font-size: 5.5rem; line-height: 1; color: #9a1220; }
.hush-arming-t { font-family: 'Special Elite', 'Courier New', monospace; font-size: .85rem; letter-spacing: 3px; text-transform: uppercase; color: #7a4a4a; }

/* Menu footer link (Safety & legal) */
.foot-link { background: none; border: none; color: var(--dim); font: inherit; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; padding: 8px 6px; cursor: pointer; }

/* Disclaimer (first-launch gate) */
.legal-box { gap: 14px; }
.legal-text { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; font-size: 0.92rem; line-height: 1.5; color: var(--bone); user-select: auto; -webkit-user-select: auto; }
.legal-text p { margin: 0 0 10px; }
.legal-text ul { margin: 0 0 10px; padding-left: 18px; }
.legal-text li { margin-bottom: 6px; }
.legal-text .legal-h { color: var(--ember); letter-spacing: 2px; text-transform: uppercase; font-size: 0.72rem; margin: 12px 0 6px; }
.legal-text a { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.legal-text b { color: #f0e9dc; }
/* Scroll affordance: bottom fade over the box + a cue line; JS enables the accept button
   only once the text is scrolled to the end (grader round 1, defect 7). */
.legal-cue {
  position: relative;
  margin-top: -60px;
  padding: 44px 0 4px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  background: linear-gradient(180deg, rgba(5,3,4,0), rgba(5,3,4,.94) 55%);
  pointer-events: none;
}
.legal-cue-chevron {
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 8px;
  border-right: 2px solid var(--ember);
  border-bottom: 2px solid var(--ember);
  transform: rotate(45deg) translateY(-2px);
}
.big-btn:disabled { opacity: .45; animation: none; cursor: default; }

/* Sale: price + the full sale screen after the gotcha */
.sale-price { display: flex; gap: 12px; align-items: baseline; justify-content: center; font-size: 1.3rem; }
.sale-price.big { font-size: 1.9rem; gap: 16px; }
.price-now { color: #f0e9dc; font-weight: 400; font-size: 1.35em; text-shadow: 0 0 18px rgba(255,122,26,.35); }
.sale-box { gap: 12px; align-items: center; }
.sale-eyebrow { color: var(--ember); letter-spacing: 4px; text-transform: uppercase; font-size: 0.85rem; }
.sale-title { font-family: 'Creepster', cursive; font-size: 3rem; line-height: 1.05; color: var(--bone); text-shadow: 0 0 24px rgba(255,122,26,.3), 0 4px 0 #1a0d06; animation: neon-flicker 8s infinite; }
.sale-sub { color: var(--bone); font-size: 1.05rem; }
.sale-list { font-size: 0.95rem; text-align: left; }
.sale-ends { color: var(--dim); font-size: 0.85rem; font-style: italic; }
/* 1.0.16: shown only when the STORE reports a price below €1.99 (js/main.js discountFrom). */
.price-was { color: var(--dim); font-size: 0.8em; text-decoration: line-through; }
.price-was[hidden], .sale-countdown[hidden] { display: none; }
.sale-countdown { color: var(--ember); font-size: 0.9rem; letter-spacing: 1px; }
#btn-sale-buy { width: 100%; max-width: 340px; }
/* The decline control carries the same visual weight as the buy button — a glowing red
   accept next to an invisible decline is a dark pattern (grader round 1, defect 6). */
#btn-sale-skip {
  width: 100%; max-width: 340px;
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.1rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--bone);
  background: rgba(10,7,8,.62);
  border: 1px solid rgba(217,210,197,.35);
  border-radius: 14px;
  padding: 14px;
}

/* Checkout preview — a normal in-app panel in the house palette (grader round 2, defect
   r2-06: the old white bottom-sheet wore a payment-processor skin for something whose own
   text says nothing is for sale). Same ids, same dialog semantics, no more costume. */
.checkout { position: fixed; inset: 0; z-index: 900; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.78); padding: 20px; }
.checkout.on { display: flex; }
.checkout-card { width: 100%; max-width: 400px; background: #0d090a; color: var(--bone); border: 1px solid rgba(217,210,197,.28); border-radius: 14px; padding: 18px 20px 20px; box-shadow: 0 12px 48px rgba(0,0,0,.7); animation: checkout-up .28s cubic-bezier(.2,.8,.2,1); }
@keyframes checkout-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.checkout-head { position: relative; text-align: center; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.checkout-close { position: absolute; right: -10px; top: -8px; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--dim); cursor: pointer; padding: 6px 10px; }
.checkout-merchant { font-size: 0.78rem; color: var(--dim); letter-spacing: 2px; text-transform: uppercase; }
.checkout-item { font-size: 1.05rem; color: var(--bone); margin-top: 6px; }
.checkout-amount { font-size: 1.9rem; color: var(--bone); letter-spacing: -0.5px; margin-top: 4px; }
.checkout-discount { display: inline-block; margin-top: 6px; color: var(--ember); border: 1px solid rgba(255,122,26,.4); border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; letter-spacing: 1px; }
.checkout-body { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
/* r5-07: same treatment as every other primary button — uppercase with tracking. */
.checkout-pay { font: inherit; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 3px; background: var(--blood); color: var(--bone); border: 1px solid rgba(217,210,197,.25); border-radius: 10px; padding: 13px; cursor: pointer; margin-top: 4px; }
.checkout-pay:active { transform: scale(0.99); background: #6e0c15; }
.checkout-preview { text-align: center; font-size: 0.95rem; color: var(--ember); border: 1px dashed rgba(255,122,26,.55); border-radius: 8px; padding: 10px 12px; }
.checkout-store { text-align: center; font-size: 0.88rem; color: var(--dim); line-height: 1.5; }
.checkout-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0 6px; text-align: center; }
.checkout-check { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ember); background: rgba(255,122,26,.12); position: relative; }
.checkout-check::after { content: ""; position: absolute; left: 19px; top: 11px; width: 12px; height: 24px; border: solid var(--ember); border-width: 0 4px 4px 0; transform: rotate(45deg); }
.checkout-done-title { font-size: 1.15rem; color: var(--bone); margin-top: 6px; }
.checkout-done-sub { font-size: 0.9rem; color: var(--dim); }
.checkout-done .checkout-pay { width: 100%; margin-top: 10px; }

/* Tester diagnostics on the gotcha screen (tester builds only): which trigger fired Hush / What's That? */
.gotcha-debug { font-size: 0.72rem; color: var(--dim); letter-spacing: 1px; margin-top: 4px; font-family: 'Special Elite', 'Courier New', monospace; }

/* Reduced motion (grader round 1, defect 13): the disclaimer warns about photosensitivity, so the
   product honours the OS preference. Decorative motion goes; the scare face still lands, but as a
   single fade instead of an 8 Hz strobe + shake. */
/* Landscape guard (r1-12, widened r3-06/r3-07): below 500 px of viewport height the static
   screens clip, the candle's CSS flame drifts off its painted wick and the ouija prompt/hint
   run past both edges. The stages are built for portrait (the app and installed PWA lock it),
   so the plea covers EVERY screen including a running stage — only the scare overlay and the
   open checkout dialog stay on top. The two-finger disarm still works through it (the escape
   listener is capture-phase on window). */
.rotate-note { display: none; position: fixed; inset: 0; z-index: 70; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #050304; color: var(--bone); text-align: center; padding: 24px; }
.rotate-note p { font-size: 1.05rem; line-height: 1.5; }
.rotate-note svg { opacity: .85; }
@media (orientation: landscape) and (max-height: 500px) {
  body:has(#view-menu.active) .rotate-note,
  body:has(#view-arm.active) .rotate-note,
  body:has(#view-sale.active) .rotate-note,
  body:has(#view-custom.active) .rotate-note,
  body:has(#view-gotcha.active) .rotate-note,
  body:has(#view-stage.active) .rotate-note,
  body:has(#view-disclaimer.active) .rotate-note { display: flex; }
  body:has(#scare-overlay.on) .rotate-note,
  body:has(#checkout-mock.on) .rotate-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vignette, .title, .gotcha-title, .sale-title, .big-btn, .flame-body, .planchette.moving { animation: none; }
  #scare-overlay.on { animation: none; }
  #scare-overlay .flashframe { animation: none; opacity: 0; }
  #scare-face { animation: lunge-soft 0.7s ease-out forwards; }
}
@keyframes lunge-soft {
  from { transform: scale(1.0); opacity: 0; }
  to   { transform: scale(1.08); opacity: 1; }
}

/* ---- web checkout (Stripe) ---- */
.sale-paynote { font-size: 0.78rem; color: var(--dim); text-align: center; margin: 8px 0 0; line-height: 1.45; }
.sale-error { display: none; font-size: 0.88rem; color: var(--ember); text-align: center; margin: 8px 0 0; line-height: 1.4; }
.sale-error.on { display: block; }
.big-btn[disabled] { opacity: .6; cursor: progress; }
.restore-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: stretch; }
.restore-label { font-size: 0.8rem; color: var(--dim); text-align: center; }
.restore-form input { font: inherit; font-size: 1rem; padding: 10px 12px; background: #0d090a; color: var(--bone); border: 1px solid rgba(217,210,197,.35); border-radius: 8px; text-align: center; }
.restore-form input:focus { outline: 2px solid var(--ember); outline-offset: 1px; }
.restore-go { border: 1px solid rgba(217,210,197,.35); border-radius: 8px; color: var(--bone); }
.restore-msg { display: none; font-size: 0.85rem; color: var(--dim); text-align: center; margin: 0; line-height: 1.4; }
.restore-msg.on { display: block; }
.restore-msg.bad { color: var(--ember); }

/* ---- Spirit Compass — glowing rose, hunting needle, ticked signal readout ---- */
.cp-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.cp-rose {
  position: relative;
  /* l2r2-05: fill the dark — the 320px cap used under half of a tall phone. */
  width: min(82vw, 52vh, 400px);
  aspect-ratio: 1;
  filter: drop-shadow(0 0 26px rgba(255,122,26,.22));
}
.cp-rose svg { width: 100%; height: 100%; display: block; }
.cp-needle {
  position: absolute;
  left: 50%; bottom: 50%;
  width: 6px; height: 40%;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(0deg);
  background: linear-gradient(180deg, #ff3b4a, #8a0f1a 78%, rgba(138,15,26,0));
  border-radius: 3px 3px 1px 1px;
  box-shadow: 0 0 14px rgba(255,59,74,.55);
}
.cp-readout { font-variant-numeric: tabular-nums; margin-top: 6px; }
.cp-readout.cp-locked { color: #fff; text-shadow: 0 0 22px rgba(255,122,26,.7); }
.cp-bar { width: 72%; max-width: 300px; height: 6px; background: #140a0c; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.cp-fill { height: 100%; width: 20%; background: linear-gradient(90deg, #8a0f1a, #ff7a1a); transition: width .25s; }
.cp-flash { position: fixed; inset: 0; background: var(--bone); opacity: 0; pointer-events: none; z-index: 60; }
.cp-flash.on { opacity: 1; }
/* Lock-on epilogue: dead black, dead silent — the half-second of nothing before the payload. */
.cp-wrap.cp-black::after { content: ''; position: fixed; inset: 0; background: #000; z-index: 70; }

/* ---- Zoom Enhance — archival photo viewer: mono strip, grain, vignette, pinch stage ---- */
.ze-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: max(env(safe-area-inset-top), 14px) 14px max(env(safe-area-inset-bottom), 14px);
  background: #000;
}
.ze-strip { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: 2px; color: var(--dim); opacity: .8; font-variant-numeric: tabular-nums; }
.ze-viewport {
  position: relative;
  width: 100%; flex: 1; min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #060504;
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ze-photo { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#ze-img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
#ze-ghost { position: absolute; mix-blend-mode: screen; object-fit: fill; pointer-events: none; }
.ze-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.ze-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0,0,0,.6) 100%); }
#ze-cam { position: absolute; width: 1px; height: 1px; opacity: 0.01; pointer-events: none; }

/* ---- AI Face Analyzer — clinical slate, mirror, cyan mesh, scan line. NOT spooky on purpose. ---- */
.an-wrap {
  position: absolute; inset: 0;
  /* Centred vertically (r1-06): the 62 %-capped mirror left a dead lower third on tall phones. */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: max(env(safe-area-inset-top), 16px) 18px max(env(safe-area-inset-bottom), 16px);
  background: #10151c;
}
.an-label { font-size: .72rem; letter-spacing: 3px; color: #7d8894; }
.an-mirror {
  position: relative;
  width: 100%; max-width: 340px; height: 62%; min-height: 0;
  border-radius: 18px; overflow: hidden;
  background: #05070a;
  border: 1px solid rgba(127,216,208,.18);
}
#an-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
/* l2r2-06: pinned low on a plate so the message never sits inside the animating mesh head. */
.an-nocam { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; text-align: center; color: #5d6874; font-size: .95rem; line-height: 1.6; padding: 12px; pointer-events: none; }
.an-nocam span { background: rgba(5,7,10,.88); border: 1px solid rgba(127,216,208,.18); border-radius: 8px; padding: 8px 14px; }
.an-oval { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.an-mesh { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.an-scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #7fd8d0, transparent);
  opacity: 0; pointer-events: none;
}
.an-scanline.on { opacity: .9; animation-name: an-scan; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes an-scan { from { top: 0; } to { top: calc(100% - 2px); } }
.an-status {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 1.15rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bone); text-align: center; min-height: 2.6em; line-height: 1.3;
}
.an-bar { width: 100%; max-width: 340px; height: 6px; background: #0a0e13; border-radius: 3px; overflow: hidden; }
.an-fill { height: 100%; width: 0; background: #7fd8d0; transition: width .18s; }
.an-fill.an-pulse { animation: an-pulse .7s ease-in-out infinite; }
@keyframes an-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- The Smudge — fake diagnostics screen: amber warning, dashed zone, greasy smear ---- */
.sm-wrap {
  position: absolute; inset: 0;
  /* Centred vertically (l2r2-01, same fix as .an-wrap): the auto-margin bar left a 45 % dead
     band and put the smudge 215 px above the thumb. The cluster sits at screen centre now. */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh;
  padding: max(env(safe-area-inset-top), 16px) 18px max(env(safe-area-inset-bottom), 20px);
  background: #060606;
  /* The whole stage takes the scrub (r1-08); only the zone credits it. */
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sm-label { align-self: flex-start; font-size: .7rem; letter-spacing: 2px; color: #d19b2a; }
.sm-zone {
  position: relative;
  width: min(62vw, 44vh, 300px);
  aspect-ratio: 1;
  border: 1px dashed rgba(217,210,197,.35);
  border-radius: 50%;
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sm-smudge { position: absolute; inset: 10%; pointer-events: none; }
.sm-smudge-pulse {
  width: 100%; height: 100%;
  background:
    radial-gradient(52% 40% at 46% 52%, rgba(207,198,181,.28), transparent 72%),
    radial-gradient(38% 32% at 60% 42%, rgba(207,198,181,.22), transparent 70%),
    radial-gradient(16% 20% at 52% 56%, rgba(60,52,44,.35), transparent 75%);
  filter: blur(1.5px);
  transform: rotate(-14deg);
  animation: sm-pulse 1.6s ease-in-out infinite;
}
@keyframes sm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .85; } }
.sm-hint { color: var(--dim); font-size: .95rem; line-height: 1.5; text-align: center; min-height: 2.9em; }
.sm-bar { position: relative; width: 100%; max-width: 320px; height: 24px; background: #0d0d0d; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sm-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4a3a12, #d19b2a); transition: width .15s; }
.sm-bar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .72rem; letter-spacing: 2px; color: var(--bone); font-variant-numeric: tabular-nums; }
.sm-crack { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; pointer-events: none; z-index: 5; }
.sm-crack.on { display: block; animation: sm-pop 80ms ease-out forwards; }
@keyframes sm-pop { from { transform: scale(.92); } to { transform: scale(1); } }
.sm-wrap.sm-shake { animation: sm-shake .3s linear; }
@keyframes sm-shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-8px, 5px); }
  50% { transform: translate(7px, -6px); }
  75% { transform: translate(-6px, -4px); }
  100% { transform: translate(0, 0); }
}

/* 1.0.16: 3-s looping preview of a locked prank inside the offer (stage art -> the face hits) */
.sale-preview { position: relative; width: 100%; max-width: 300px; height: 112px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,122,26,.35); box-shadow: 0 0 18px rgba(255,122,26,.18); background: #000; flex-shrink: 0; }
.sale-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sale-preview .sp-stage { animation: sp-stage 3s infinite; }
.sale-preview .sp-face { opacity: 0; object-position: center 30%; animation: sp-face 3s infinite; }
.sale-preview .sp-label { position: absolute; left: 8px; bottom: 6px; font-size: 0.72rem; letter-spacing: 1px; color: var(--bone);
  background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 8px; }
@keyframes sp-stage { 0% { transform: scale(1); filter: brightness(.8); } 60% { transform: scale(1.08); filter: brightness(.55); }
  68% { filter: brightness(1.6); } 72%, 100% { transform: scale(1.08); filter: brightness(.3); } }
@keyframes sp-face { 0%, 66% { opacity: 0; transform: scale(1.4); } 70% { opacity: 1; transform: scale(1); }
  92% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .sale-preview .sp-stage, .sale-preview .sp-face { animation: none; } }
