/* Terminal of Terror · Channel 13 house style
   Dark by design: a late-night broadcast doesn't have a light mode. */

:root {
  --bg: #0d0a12;
  --bg-2: #130f1b;
  --panel: #1a1425;
  --panel-2: #221a30;
  --line: #2f2740;
  --ink: #ece8e1;
  --ink-dim: #a39cb3;
  --ink-faint: #938ca6; /* 6.1:1 on --bg, 5.6:1 on --panel */
  --orange: #ff7a1a;
  --orange-2: #ffa34d;
  --purple: #bd93f9;
  --teal: #2a9d8f;
  --mint: #50fa7b;
  --blood: #c1121f;
  --red: #ff5555;
  --gold: #ffd700;
  --sky: #8be9fd;
  --m-primary: var(--orange);
  --m-text: var(--orange);
  --m-accent: var(--purple);
  --font-display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-host: "Special Elite", "Courier New", monospace;
  --radius: 10px;
  --max: 1100px;
  --gutter: 16px;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse at 50% -20%, #2a1a3a 0%, var(--bg) 55%) no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--orange-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }
code, kbd, pre { font-family: var(--font-mono); }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; font-size: 0.9em; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
kbd { display: inline-block; background: #0a0810; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; padding: 0 0.45em; font-size: 0.8em; color: var(--sky); line-height: 1.6; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.04em; line-height: 1.05; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); color: var(--m-primary); text-shadow: 0 0 18px color-mix(in srgb, var(--m-primary) 55%, transparent), 2px 0 0 rgba(255, 60, 60, 0.35), -2px 0 0 rgba(60, 200, 255, 0.35); }
h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); color: var(--orange); }
h3 { font-size: 1.5rem; color: var(--purple); }
.h-emoji { font-family: var(--font-body); font-size: 0.8em; margin-right: 0.15em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
em { font-style: italic; }
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
details summary { cursor: pointer; color: var(--orange-2); font-weight: 600; }
details summary:hover { color: var(--gold); }
blockquote { margin: 1em 0; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--purple); color: var(--ink-dim); font-family: var(--font-host); }
blockquote p { margin-bottom: 0.4em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--orange); color: #000; padding: 0.5em 1em; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---- CRT ---- */
.scanlines {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 50;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.18) 3px, rgba(0, 0, 0, 0) 4px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: multiply;
}
.tuning {
  position: fixed; inset: 0; z-index: 60;
  background-color: #111;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.8 0 0 0 0 0.8 0 0 0 0 0.8 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  display: none;
  align-items: center; justify-content: center;
  animation: static-shift 0.12s steps(2) infinite;
}
.tuning.on { display: flex; }
.tuning.off { animation: tune-out 0.45s ease-in forwards; }
.tuning-label { font-family: var(--font-mono); color: #fff; background: rgba(0, 0, 0, 0.6); padding: 0.4em 1em; letter-spacing: 0.3em; font-size: 1.1rem; text-shadow: 0 0 8px #fff; }
@keyframes static-shift {
  0% { background-position: 0 0; }
  50% { background-position: 37px 113px; }
  100% { background-position: -71px 29px; }
}
@keyframes tune-out {
  0% { opacity: 1; transform: scaleY(1); }
  60% { opacity: 1; transform: scaleY(0.02); filter: brightness(3); }
  100% { opacity: 0; transform: scaleY(0.001); }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.6; }
  94% { opacity: 1; }
  97% { opacity: 0.8; }
}

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1.2em;
  padding: 0.6em var(--gutter);
  background: rgba(13, 10, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7em; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.06em; }
.brand-name { color: var(--orange); }
.onair { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--red); border: 1px solid var(--red); border-radius: 4px; padding: 0.15em 0.5em; display: inline-flex; align-items: center; gap: 0.4em; }
.onair .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.6s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.topnav { display: flex; gap: 0.2em 1.1em; flex-wrap: wrap; margin-left: auto; }
.topnav a { color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.2em 0; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); }
.clock { font-family: var(--font-mono); color: var(--mint); font-size: 0.95rem; letter-spacing: 0.1em; text-shadow: 0 0 6px var(--mint); }

main { max-width: var(--max); margin: 0 auto; padding: 1.5rem var(--gutter) 3rem; }
main > section, main > header { margin: 3.5rem 0; scroll-margin-top: 4.5rem; }
main > section:first-child, main > header:first-child { margin-top: 1rem; }

/* ---- shared bits ---- */
.kicker { font-family: var(--font-mono); color: var(--teal); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.8rem; margin-bottom: 0.3em; }
.lede { font-size: 1.15rem; color: var(--ink-dim); max-width: 60ch; }
.small { font-size: 0.9rem; color: var(--ink-dim); }
.host-line { font-family: var(--font-host); color: var(--ink-dim); font-size: 1.05rem; }
.host-line em { color: var(--ink); }
.note { background: var(--panel); border-left: 3px solid var(--teal); padding: 0.6em 0.9em; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; }
.warning { background: #2a0c10; border: 1px solid var(--blood); border-radius: var(--radius); padding: 0.7em 1em; font-size: 0.95rem; margin-top: 1.2em; }
.chip { font-size: 0.7em; vertical-align: middle; color: var(--teal); }
h2 .chip, h3 .chip { font-size: 0.45em; letter-spacing: 0; }
.btn { display: inline-block; padding: 0.55em 1.1em; border-radius: 6px; border: 1px solid var(--orange); color: var(--orange-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; background: transparent; cursor: pointer; font-family: var(--font-body); transition: transform 0.1s, background 0.15s; }
.btn:hover { background: rgba(255, 122, 26, 0.12); transform: translateY(-1px); color: var(--gold); }
.btn.primary { background: var(--orange); color: #16090a; border-color: var(--orange); box-shadow: 0 0 18px rgba(255, 122, 26, 0.35); }
.btn.primary:hover { background: var(--orange-2); color: #16090a; }
.btn.ghost { border-color: var(--line); color: var(--ink-dim); }
.btn.small { padding: 0.35em 0.8em; font-size: 0.85rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.6em; }

table.plain { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 0.95rem; }
@media (max-width: 560px) { table.plain { display: block; overflow-x: auto; } }
table.plain th, table.plain td { text-align: left; padding: 0.45em 0.6em; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { color: var(--purple); font-weight: 600; white-space: nowrap; }
table.plain thead th { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; }

.term {
  position: relative;
  background: #07060b;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1em 1.1em;
  margin: 0.8em 0 1.2em;
  overflow-x: auto;
  color: #d9f7e3;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: inset 0 0 40px rgba(80, 250, 123, 0.04);
}
.term::before { content: "● ● ●"; position: absolute; top: 0.35em; right: 0.8em; color: var(--ink-faint); font-size: 0.65em; letter-spacing: 0.2em; }
.term .c { color: var(--ink-faint); font-style: italic; }
.term.small { font-size: 0.8rem; padding: 0.7em 0.9em; }
.copy { position: absolute; top: 0.5em; right: 3.2em; font: 600 0.7rem var(--font-mono); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); padding: 0.2em 0.6em; border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.term:hover .copy, .copy:focus { opacity: 1; }
.copy:hover { color: var(--ink); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
/* Grid children default to min-width:auto, which lets a wide <pre> stretch the page. */
.hero > *, .split > *, .games > *, .rituals > *, .monster-body > *, .course-layout > *, .tonight-strip > *, .weeks > * { min-width: 0; }
.table-wrap { overflow-x: auto; }
.shot { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem; align-items: center; }
/* Block glyphs (▀█▄) aren't in IBM Plex Mono; the fallback the browser picks for them
   is taller than its line, so the rows collide. Use faces that have them. */
.logo { font-family: Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace; font-weight: 400; letter-spacing: 0; font-size: clamp(0.55rem, 1.6vw, 0.95rem); line-height: 1.15; color: var(--orange); text-shadow: 0 0 14px rgba(255, 122, 26, 0.6); margin: 0 0 0.8em; animation: flicker 7s infinite; white-space: pre; overflow-x: auto; }
.tagline { font-family: var(--font-display); font-size: 1.6rem; color: var(--purple); letter-spacing: 0.05em; margin: 0 0 0.6em; }
.hero .lede { margin-top: 0.8em; }
.typewriter .untyped { visibility: hidden; }
/* An empty inline drawn by its border, with no net width, so it neither pushes the hidden text along nor
   gives the line somewhere new to break. */
.typewriter .caret { border-left: 0.55em solid var(--ink); margin-right: -0.55em; animation: blink 0.9s steps(1) infinite; }

.tv { background: linear-gradient(160deg, #3a2a1e, #1c130c); border-radius: 22px; padding: 18px 18px 12px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.tv-screen { background: #000; border-radius: 16px / 22px; padding: 6px; overflow: hidden; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 0 3px #0a0806; }
.tv-screen img { border-radius: 12px / 18px; width: 100%; height: auto; filter: saturate(1.1) contrast(1.05); }
.tv figcaption { display: flex; align-items: center; gap: 10px; padding-top: 10px; }
.knob { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a6a4a, #2b1d12); box-shadow: 0 1px 2px #000; }
.tv-brand { margin-left: auto; font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.3em; color: #a88a6a; }

/* ---- tonight strip ---- */
.tonight-strip { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 1rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1em 1.1em; display: flex; flex-direction: column; gap: 0.1em; min-height: 120px; position: relative; }
.tile-emoji { font-size: 1.6rem; }
.tile-big { font-family: var(--font-display); font-size: 2.4rem; color: var(--orange); line-height: 1; }
.tile-label { font-size: 0.85rem; color: var(--ink-dim); }
.tile-fact { font-size: 1.05rem; margin-top: 0.3em; }
.tile-link { font-size: 0.85rem; margin-top: auto; }
.tile.wide { border-color: var(--teal); }

/* ---- schedule ---- */
.schedule { width: 100%; border-collapse: collapse; font-size: 1rem; }
.schedule td { padding: 0.5em 0.6em; border-bottom: 1px dashed var(--line); }
.schedule .time { font-family: var(--font-mono); color: var(--teal); white-space: nowrap; width: 7em; }
.schedule a { text-decoration: none; font-weight: 600; }

/* ---- tabs ---- */
.tab-list { display: flex; gap: 0.3em; border-bottom: 1px solid var(--line); margin-bottom: 1em; }
.tab-list button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--ink-dim); font: 600 0.95rem var(--font-body); padding: 0.5em 0.9em; cursor: pointer; margin-bottom: -1px; }
.tab-list button[aria-selected="true"] { color: var(--orange); border-bottom-color: var(--orange); }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6em; margin: 0.8em 0; }
.dl { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.6em 0.8em; text-decoration: none; color: var(--ink); font-weight: 600; }
.dl small { color: var(--ink-dim); font-weight: 400; }
.dl:hover { border-color: var(--orange); color: var(--ink); }

/* ---- games / rituals ---- */
.games, .rituals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.game, .rituals article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1em; display: flex; flex-direction: column; }
.game img { border-radius: 8px; margin-bottom: 0.8em; border: 1px solid var(--line); }
.game h3, .rituals h3 { font-size: 1.4rem; }
.game .term, .rituals .term { margin-top: auto; }
.rituals img { margin-top: 0.6em; }

/* ---- badges ---- */
.badges { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.7em; }
.badge { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.7em 0.9em; display: grid; grid-template-columns: auto 1fr; gap: 0 0.7em; margin: 0; }
.badge-emoji { font-size: 1.6rem; grid-row: span 2; align-self: center; }
.badge-name { font-weight: 600; color: var(--gold); }
.badge-how { font-size: 0.85rem; color: var(--ink-dim); }

/* ---- roster cards ---- */
.cards { list-style: none; padding: 0; margin: 0 0 1.5em; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.8em; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1em; }
.cards li { margin: 0; }
.card {
  display: flex; flex-direction: column; gap: 0.15em; height: 100%;
  background: linear-gradient(170deg, color-mix(in srgb, var(--m-primary) 14%, var(--panel)), var(--panel) 65%);
  border: 1px solid color-mix(in srgb, var(--m-primary) 40%, var(--line));
  border-radius: var(--radius); padding: 0.9em 1em; text-decoration: none; color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 24px color-mix(in srgb, var(--m-primary) 35%, transparent); color: var(--ink); }
.card-emoji { font-size: 2rem; line-height: 1; margin-bottom: 0.2em; }
.card-name { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: 0.04em; color: var(--m-text); line-height: 1.05; }
.card-meta { font-size: 0.82rem; color: var(--ink-dim); }
.card-film { font-size: 0.85rem; color: var(--m-accent); }
.card-desc { font-size: 0.85rem; color: var(--ink-dim); margin-top: 0.4em; }
.card.silent { filter: grayscale(1); }
.card.silent .card-emoji::after { content: " 🎞️"; font-size: 0.6em; }

/* ---- weeks ---- */
.weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1em; }
.week { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1em; }
.week h3 { font-size: 1.3rem; }
.week ol { padding-left: 1.6em; font-size: 0.92rem; }
.week a { text-decoration: none; }

/* ---- page heads ---- */
.page-head { margin-bottom: 1rem; }
.pack { margin: 2.5rem 0; }

/* ---- monster page ---- */
.monster-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1em; align-items: center; font-size: 0.9rem; margin: 0.5rem 0 1.5rem; }
.monster-nav a { text-decoration: none; color: var(--ink-dim); }
.monster-nav a:hover { color: var(--ink); }
.monster-nav .next { text-align: right; }
.monster-nav .gallery { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--teal); border: 1px solid var(--line); border-radius: 999px; padding: 0.3em 0.9em; }
.monster-nav.bottom { margin-top: 3rem; }
.monster-head { margin-bottom: 1.5rem; }
.title-emoji { font-family: var(--font-body); font-size: 0.8em; text-shadow: none; }
.aliases { font-size: 0.9rem; color: var(--ink-dim); }
.aliases span { color: var(--m-accent); }
.section-tabs { display: flex; flex-wrap: wrap; gap: 0.3em; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.5em 0; margin-bottom: 1.5rem; position: sticky; top: 3.4rem; background: rgba(13, 10, 18, 0.92); backdrop-filter: blur(8px); z-index: 30; }
.section-tabs a { text-decoration: none; color: var(--ink-dim); font-size: 0.85rem; font-weight: 600; padding: 0.3em 0.7em; border-radius: 999px; }
.section-tabs a:hover, .section-tabs a.active { background: color-mix(in srgb, var(--m-primary) 20%, transparent); color: var(--ink); }
.section-tabs kbd { font-size: 0.7em; margin-right: 0.2em; }
.monster-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 2rem; align-items: start; }
.portrait-col { position: sticky; top: 7rem; }
.portrait {
  margin: 0 0 1em; padding: 0.8em; overflow-x: auto;
  font-size: clamp(0.5rem, 1.1vw, 0.72rem); line-height: 1.1;
  color: var(--m-text); text-shadow: 0 0 10px color-mix(in srgb, var(--m-primary) 70%, transparent);
  background: #07060b; border: 1px solid color-mix(in srgb, var(--m-primary) 35%, var(--line)); border-radius: var(--radius);
}
.dossier { display: grid; grid-template-columns: auto 1fr; gap: 0.25em 0.8em; font-size: 0.9rem; margin: 0 0 1em; }
.dossier dt { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; padding-top: 0.2em; }
.dossier dd { margin: 0; }
.sections section { margin: 0 0 2.5rem; scroll-margin-top: 7.5rem; }
.sections h2 { font-size: 2rem; color: var(--m-primary); border-bottom: 1px solid color-mix(in srgb, var(--m-primary) 30%, var(--line)); padding-bottom: 0.15em; }
.sections h3 { font-size: 1.2rem; color: var(--m-accent); }
.facts li { margin: 0.45em 0; }
.facts li::marker { content: "💀 "; }
.credits th { width: 7em; }
.myth-list { list-style: none; padding: 0; display: grid; gap: 0.6em; }
.myth { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0.8em 1em; color: var(--ink); transition: border-color 0.15s; }
.myth:hover { border-color: var(--m-accent); }
.myth .claim { font-weight: 600; color: var(--ink); list-style: none; cursor: pointer; }
.myth .claim::-webkit-details-marker { display: none; }
.myth .claim::before { content: "❓ "; }
.myth[open] .claim::before { content: "💡 "; }
.myth .verdict { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.1em; margin: 0.4em 0 0.1em; }
.myth[data-true="true"] .verdict { color: var(--mint); }
.myth[data-true="false"] .verdict { color: var(--red); }
.myth[open][data-true="true"] { border-color: var(--mint); }
.myth[open][data-true="false"] { border-color: var(--red); }
.myth .explain { color: var(--ink-dim); font-size: 0.95rem; margin: 0; }
.quote { background: var(--panel); border-left: 3px solid var(--m-primary); border-radius: 0 var(--radius) var(--radius) 0; padding: 0.8em 1em; }
.quote p { font-size: 1.1rem; color: var(--ink); }
.quote footer { font-size: 0.85rem; color: var(--ink-dim); font-family: var(--font-body); }
.statbars { margin: 0 0 1.2em; }
.statrow { display: grid; grid-template-columns: 6em 1fr; gap: 0.8em; align-items: center; margin: 0.4em 0; }
.statrow dt { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); }
.statrow dd { margin: 0; display: flex; align-items: center; gap: 0.7em; }
.bar { flex: 1; height: 14px; background: #07060b; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar .fill { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--m-accent), var(--m-primary)); box-shadow: 0 0 10px color-mix(in srgb, var(--m-primary) 70%, transparent); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.pending .fill { width: 0; }
.bar.v1 { --v: 10%; } .bar.v2 { --v: 20%; } .bar.v3 { --v: 30%; } .bar.v4 { --v: 40%; } .bar.v5 { --v: 50%; }
.bar.v6 { --v: 60%; } .bar.v7 { --v: 70%; } .bar.v8 { --v: 80%; } .bar.v9 { --v: 90%; } .bar.v10 { --v: 100%; }
.num { font-family: var(--font-mono); color: var(--m-text); width: 1.6em; text-align: right; }
.keys-hint { text-align: center; margin-top: 1.5rem; }

/* silent-era monsters: black and white, with grain and a title card */
.monster.silent { filter: grayscale(1) contrast(1.08); position: relative; }
.monster.silent::after {
  content: ""; pointer-events: none; position: absolute; inset: 0; z-index: 1; opacity: 0.08; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: grain 0.4s steps(3) infinite;
}
@keyframes grain { 0% { background-position: 0 0; } 50% { background-position: 60px 40px; } 100% { background-position: -40px 90px; } }
.intertitle { border: 4px double #d6d6d6; padding: 1em 1.5em; text-align: center; margin-bottom: 1em; animation: flicker 3s infinite; }
.intertitle h1 { font-family: var(--font-host); font-size: clamp(1.8rem, 5vw, 3rem); color: #f5f5f5; text-shadow: none; letter-spacing: 0.02em; }
.orn { display: block; color: #bdbdbd; font-size: 1.2rem; }

/* ---- course ---- */
.course-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }
.course-side { position: sticky; top: 4.5rem; max-height: calc(100vh - 5rem); overflow-y: auto; }
.coursenav { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8em 1em; font-size: 0.9rem; }
.coursenav-title { display: block; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.05em; text-decoration: none; margin-bottom: 0.5em; }
.coursenav details { margin: 0.3em 0; }
.coursenav summary { font-size: 0.9rem; }
.coursenav ol { padding-left: 1.8em; margin: 0.3em 0 0.6em; }
.coursenav li { margin: 0.15em 0; }
.coursenav a { text-decoration: none; color: var(--ink-dim); }
.coursenav a:hover { color: var(--ink); }
.coursenav a[aria-current="page"] { color: var(--orange); font-weight: 600; }
.prose { max-width: 75ch; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.prose h2 { font-size: 1.9rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.4em; }
.prose h4 { font-size: 1.1rem; color: var(--purple); margin: 1.2em 0 0.4em; }
.prose pre { background: #07060b; border: 1px solid var(--line); border-radius: var(--radius); padding: 1em 1.1em; overflow-x: auto; font-size: 0.86rem; line-height: 1.5; }
.prose pre code.hljs { background: none; padding: 0; overflow: visible; }
/* The theme's comment colour is too dim to read on the code background. */
.prose .hljs-comment { color: var(--ink-faint); }
.prose pre:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.45em 0.6em; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--purple); }
.prose blockquote { background: var(--panel); border-left-color: var(--orange); border-radius: 0 var(--radius) var(--radius) 0; padding: 0.6em 1em; font-size: 1.02rem; }
.prose blockquote em { color: var(--ink); }
.prose img { border-radius: var(--radius); }
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }
.lesson-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1em; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
.lesson-nav a { text-decoration: none; }
.lesson-nav .next { text-align: right; }

/* ---- 404 test card ---- */
.testcard { text-align: center; padding: 3rem 0; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); height: 90px; max-width: 560px; margin: 0 auto 2rem; border: 2px solid #000; }
.bars span:nth-child(1) { background: #c0c0c0; } .bars span:nth-child(2) { background: #c0c000; } .bars span:nth-child(3) { background: #00c0c0; } .bars span:nth-child(4) { background: #00c000; } .bars span:nth-child(5) { background: #c000c0; } .bars span:nth-child(6) { background: #c00000; } .bars span:nth-child(7) { background: #0000c0; }

/* ---- footer ---- */
.signoff { border-top: 1px solid var(--line); padding: 2rem var(--gutter) 3rem; text-align: center; max-width: var(--max); margin: 0 auto; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero, .split, .games, .rituals, .monster-body, .course-layout { grid-template-columns: 1fr; }
  .tonight-strip { grid-template-columns: 1fr 1fr; }
  .tile.wide { grid-column: span 2; }
  /* The top bar can wrap to two rows here, so nothing else sticks under it. */
  .portrait-col, .course-side, .section-tabs { position: static; max-height: none; }
  .topbar .clock { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .tonight-strip { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; }
  .monster-nav { grid-template-columns: 1fr 1fr; }
  .monster-nav .gallery { grid-column: span 2; justify-self: center; order: -1; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav .next { text-align: left; }
  .topnav { margin-left: 0; width: 100%; }
  .brand-name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tuning, .logo, .intertitle, .onair .dot, .monster.silent::after, .typewriter .caret { animation: none !important; }
  .tuning { display: none !important; }
  .bar .fill { transition: none; }
}
