/* SLOP core: the TV frame that holds every era. Eras own everything inside their <section>. */
:root {
  --ink: #050508;
  --osd: #f4f4f0;
  --osd-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  --vcr-blue: #0b18c4;
  --guide-row: #1b2f9f;
  --guide-ch: #0a1462;
  --guide-yellow: #ffe23a;
  --osd-font: 'VT323', 'Courier New', monospace;
  --px: 0;
  --py: 0;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--osd); overflow-x: hidden; }
img, video { display: block; max-width: none; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--guide-yellow); outline-offset: 2px; }
#stack { position: relative; overflow-x: clip; }
section.era { position: relative; overflow: clip; isolation: isolate; }

/* ---------------------------------------------------------------- HUD (VCR on-screen display) */
#hud {
  position: fixed; inset: 0 0 auto 0; z-index: 9500; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  font-family: var(--osd-font); color: var(--osd); text-shadow: var(--osd-shadow);
  letter-spacing: 0.04em;
}
#hud button { pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer; text-shadow: inherit; letter-spacing: inherit; font-family: inherit; }
.hud-ch { display: grid; text-align: left; line-height: 0.9; }
.hud-num { font-size: clamp(30px, 4.2vw, 50px); }
.hud-name { font-size: clamp(16px, 1.8vw, 22px); opacity: 0.95; }
.hud-right { display: flex; gap: 14px; align-items: baseline; font-size: clamp(18px, 1.9vw, 24px); }
.hud-count.bump { animation: hudbump 0.35s steps(2); }
@keyframes hudbump { 50% { color: var(--guide-yellow); } }
.hud-toast {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + clamp(34px, 4.6vw, 56px)); right: max(14px, env(safe-area-inset-right));
  font-size: clamp(18px, 2vw, 26px); color: var(--guide-yellow); opacity: 0; transition: opacity 0.15s steps(2);
}
.hud-toast.show { opacity: 1; }
@media (max-width: 600px) { .hud-name { max-width: 46vw; } .intro-guide { padding-top: 84px; } }

#static {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9400; pointer-events: none;
  image-rendering: pixelated; opacity: 0; mix-blend-mode: screen;
}
#static.on { opacity: 0.55; }

/* ---------------------------------------------------------------- shared era helpers */
.slop-pl { translate: calc(var(--px) * var(--d, 1) * -28px) calc(var(--py) * var(--d, 1) * -18px); will-change: translate; }
.slop-yt { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; overflow: hidden; }
.slop-yt img { width: 100%; height: 100%; object-fit: cover; }
.slop-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.era-offair { min-height: 100svh; display: grid; place-content: center; text-align: center; font: 48px var(--osd-font); text-shadow: var(--osd-shadow); background: #111; }
.era-offair p { margin: 0; }

/* ---------------------------------------------------------------- CH 00 intro */
.intro { position: relative; background: var(--ink); }
.intro-screen { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.intro-burst { position: absolute; inset: -4%; }
.burst-item {
  position: absolute; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  animation: burstin 0.18s steps(3) both;
}
@keyframes burstin { from { scale: 1.35; opacity: 0; } }
.intro-scan {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(5, 5, 8, 0.55) 0%, rgba(5, 5, 8, 0.1) 45%, rgba(5, 5, 8, 0.75) 100%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
}
.intro-title {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 16px;
  font-family: var(--osd-font); text-shadow: 4px 4px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.intro-title h1 { margin: 0; font-weight: 400; font-size: clamp(140px, 30vw, 400px); line-height: 0.78; letter-spacing: 0.02em; }
.intro-sub { margin: 0.2em 0 0; font-size: clamp(26px, 3.4vw, 46px); }
.intro-hint { margin: 0.5em auto 0; max-width: 30ch; font-size: clamp(19px, 2vw, 26px); color: var(--guide-yellow); }

.intro-guide { padding: 36px max(16px, 4vw) 72px; background: #070b2e; }
.guide-head {
  display: flex; justify-content: space-between; margin: 0 auto 8px; max-width: 1100px;
  font: 22px var(--osd-font); color: var(--guide-yellow); letter-spacing: 0.08em;
}
.guide { list-style: none; margin: 0 auto; padding: 0; max-width: 1100px; display: grid; gap: 4px; }
.guide-row {
  width: 100%; display: grid; grid-template-columns: 72px 1fr auto; grid-template-areas: 'ch title years' 'ch blurb blurb';
  gap: 2px 16px; align-items: center; text-align: left; cursor: pointer;
  background: linear-gradient(to bottom, #2a44c4, var(--guide-row)); border: 0; border-top: 2px solid #5c77ff; padding: 10px 16px 12px 0;
  font-family: 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif; font-weight: 700; color: #fff;
}
.guide-row:hover, .guide-row:focus-visible { background: linear-gradient(to bottom, #3d58e0, #2438b8); }
.guide-ch {
  grid-area: ch; align-self: stretch; display: grid; place-content: center; margin: -10px 0 -12px;
  background: var(--guide-ch); font: 40px var(--osd-font); color: var(--guide-yellow);
}
.guide-title { grid-area: title; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: 0.01em; }
.guide-years { grid-area: years; font: 22px var(--osd-font); color: #cfd8ff; }
.guide-blurb { grid-area: blurb; font-weight: 400; font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #dfe5ff; }
.guide-row--end { background: linear-gradient(to bottom, #7a1f8f, #561066); border-top-color: #c35ad9; }

/* ---------------------------------------------------------------- CH 99 finale (VCR blue screen) */
.finale {
  min-height: 100svh; background: var(--vcr-blue); padding: 96px max(16px, 5vw) 80px;
  font-family: var(--osd-font); text-shadow: var(--osd-shadow); display: grid; justify-items: center; align-content: start; gap: 26px;
}
.finale-osd { text-align: center; }
.finale-play { margin: 0; font-size: 30px; letter-spacing: 0.1em; }
.finale h2 { margin: 0; font-weight: 400; font-size: clamp(44px, 7vw, 92px); line-height: 0.9; }
.pack-stats { margin: 10px 0 0; font-size: clamp(20px, 2.2vw, 26px); color: var(--guide-yellow); }
.pack-print { width: min(860px, 100%); min-height: 200px; }
.pack-print img { width: 100%; height: auto; background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); rotate: -0.6deg; }
.finale-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.osd-btn {
  font: 26px var(--osd-font); letter-spacing: 0.06em; text-shadow: var(--osd-shadow); cursor: pointer;
  background: rgba(0, 0, 0, 0.25); border: 2px solid var(--osd); padding: 6px 18px 4px;
}
.osd-btn:hover { background: var(--osd); color: var(--vcr-blue); text-shadow: none; }
.finale-foot { margin: 8px 0 0; font-size: 20px; opacity: 0.8; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  .slop-pl { translate: none; }
}
