:root {
  --bg: #0c0a08;
  --bg-2: #15110d;
  --panel: #1c1712;
  --line: #3a3026;
  --bone: #eadfc4;
  --text: #d9cfb8;
  --muted: #9a8f7a;
  --lime: #9cc42b;
  --lime-deep: #6f8f17;
  --purple: #9b4dff;
  --purple-deep: #5b23a8;
  --red: #d2382f;
  --gold: #c9a24a;
  --crt: #7dff6a;
  --parchment: #d8c69e;
  --ink: #2a1f14;

  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-crt: "VT323", ui-monospace, monospace;
  --font-type: "Special Elite", "Courier New", monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(155, 77, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(156, 196, 43, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--lime); }
.bone { color: var(--bone); }
.lime { color: var(--lime); }
.red { color: var(--red); }
.dim { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  background: rgba(12, 10, 8, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--red); background: #fff; }
.wordmark { font-family: var(--font-display); font-size: 28px; letter-spacing: 1px; line-height: 1; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a {
  font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  font-size: 15px; color: var(--muted); text-decoration: none;
}
.nav a:hover { color: var(--bone); }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 4px;
  background: var(--red); color: #fff; text-decoration: none;
  font-family: var(--font-label); font-weight: 700; letter-spacing: 1px; font-size: 14px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- shared ---------- */
section { padding: clamp(56px, 8vw, 96px) var(--gutter); }
section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 32px; }
.kicker {
  margin: 0 0 4px;
  font-family: var(--font-label); font-weight: 600; text-transform: uppercase;
  letter-spacing: 3px; font-size: 14px; color: var(--purple);
}
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font-family: var(--font-display); font-size: clamp(44px, 6vw, 68px); line-height: 0.95; color: var(--bone); letter-spacing: 1px; }
.sub { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 4px; border: 2px solid transparent;
  font-family: var(--font-label); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: 1.5px;
  text-decoration: none; cursor: pointer; transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 0 24px rgba(155, 77, 255, .35); }
.btn-primary:hover { background: #a964ff; }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--bone); }
.btn-red { background: var(--red); color: #fff; }
.btn-small { padding: 8px 14px; font-size: 14px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero { padding-top: 24px; padding-bottom: 24px; }
.hero-art {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 6px var(--bg-2);
}
.hero-art img { width: 100%; height: auto; }
.hero-copy { padding-top: 36px; display: grid; gap: 14px; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(48px, 7vw, 92px); line-height: .9; letter-spacing: 1px; color: var(--bone);
  text-shadow: 0 4px 0 rgba(0,0,0,.6);
}
.pillars-line { margin: 0; font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: clamp(16px, 2.2vw, 22px); color: var(--bone); }
.pillars-line i { font-style: normal; color: var(--lime); margin: 0 10px; font-size: .8em; }
.lede { margin: 0; max-width: 62ch; font-size: 19px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- rerun machine ---------- */
.rerun { background: linear-gradient(180deg, transparent, var(--bg-2) 20%, var(--bg-2) 80%, transparent); }
.live-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 12px 16px;
  border: 1px solid var(--red); border-radius: 6px; background: rgba(210, 56, 47, .12); color: var(--bone);
}
.live-banner .dot { background: var(--red); }
.live-banner .btn { margin-left: auto; }

.tv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; }
.tv-bezel {
  padding: clamp(10px, 2vw, 22px);
  border-radius: 22px;
  background: linear-gradient(145deg, #3b3127, #1d1712 60%, #2a221b);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.07), inset 0 -4px 12px rgba(0,0,0,.6), 0 24px 60px rgba(0,0,0,.6);
}
.tv-screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 14px; background: #000;
  box-shadow: inset 0 0 40px rgba(0,0,0,.9), 0 0 0 3px #0a0806;
}
.player, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 80px rgba(0,0,0,.55);
  border-radius: 14px;
}
.static {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}
.static.on { animation: static .7s steps(6) forwards; }
@keyframes static {
  0% { opacity: 1; background-position: 0 0; }
  50% { opacity: .9; background-position: 60px -40px; }
  100% { opacity: 0; background-position: -30px 80px; }
}

.tv-panel {
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px; border-radius: 14px;
  background: linear-gradient(180deg, #221c16, #17120e);
  border: 1px solid var(--line);
}
.osd {
  padding: 14px; border-radius: 8px; background: #050805; border: 1px solid #1e3a1a;
  font-family: var(--font-crt); color: var(--crt); text-shadow: 0 0 6px rgba(125,255,106,.55);
  min-height: 170px;
}
.osd-row { display: flex; justify-content: space-between; font-size: 20px; letter-spacing: 1px; }
.osd-label { opacity: .75; }
.osd-ch { color: var(--bone); text-shadow: 0 0 6px rgba(234,223,196,.5); }
.osd-title { margin: 8px 0 6px; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.osd-meta { margin: 0; font-size: 19px; opacity: .75; line-height: 1.2; }
.tv-controls { display: grid; gap: 10px; }
.tv-controls .btn { width: 100%; }
.knob-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--lime-deep); background: rgba(156,196,43,.10); color: var(--bone);
  font-family: var(--font-label); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 1.5px;
  transition: background .15s;
}
.knob-btn:hover { background: rgba(156,196,43,.2); }
.knob {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6e5f4f, #2a221b 70%);
  box-shadow: 0 2px 4px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .35s cubic-bezier(.3,1.6,.5,1);
}
.knob::after { content: ""; position: absolute; left: 50%; top: 4px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 2px; background: var(--lime); }
.knob-btn:active .knob, .knob-btn:hover .knob { transform: rotate(60deg); }
.status-light { margin: auto 0 0; font-family: var(--font-crt); font-size: 18px; color: var(--muted); line-height: 1.2; }
.status-light b { color: var(--crt); font-weight: 400; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--crt); box-shadow: 0 0 8px var(--crt); margin-right: 6px; vertical-align: middle; }

.guide { margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.guide summary {
  cursor: pointer; padding: 14px 18px;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--bone);
}
.guide-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.guide-list button {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: baseline;
  width: 100%; padding: 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text);
  text-align: left; cursor: pointer; font: inherit;
}
.guide-list button:hover { background: rgba(255,255,255,.04); }
.guide-list li.playing button { background: rgba(156,196,43,.10); }
.guide-list li.playing .g-ch { color: var(--lime); }
.g-ch { font-family: var(--font-crt); font-size: 20px; color: var(--muted); }
.g-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-meta { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* ---------- pillars ---------- */
.pillar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.pillar {
  padding: 22px 18px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--purple);
}
.pillar:nth-child(2) { border-top-color: var(--lime); }
.pillar:nth-child(3) { border-top-color: var(--red); }
.pillar:nth-child(4) { border-top-color: var(--gold); }
.pillar-icon { width: 44px; height: 44px; color: var(--purple); margin-bottom: 14px; }
.pillar-icon.lime { color: var(--lime); }
.pillar-icon.red { color: var(--red); }
.pillar-icon.gold { color: var(--gold); }
.pillar-icon.purple { color: var(--purple); }
.pillar-icon svg { width: 100%; height: 100%; }
.pillar h3 { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 21px; color: var(--bone); line-height: 1.1; }
.pillar p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- quest log ---------- */
.quest-grid { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 16px; align-items: start; }
.terminal {
  padding: 18px 20px; border-radius: 8px; background: #070a06; border: 1px solid #1e3a1a;
  font-family: var(--font-crt); color: var(--crt); font-size: 21px; line-height: 1.25;
}
.terminal h3 { font-size: 26px; margin-bottom: 10px; text-shadow: 0 0 8px rgba(125,255,106,.5); }
.terminal ul { margin: 0; padding: 0; list-style: none; }
.terminal li { padding: 2px 0; }
.terminal li::before { content: "▸ "; opacity: .6; }
.terminal .dim { color: #5f8f57; }
.terminal.done { color: var(--gold); border-color: #3d3216; }
.terminal.done h3 { text-shadow: 0 0 8px rgba(201,162,74,.5); }
.terminal.done li::before { content: "✓ "; }

/* ---------- decrees ---------- */
.parchment {
  position: relative; max-width: 760px;
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.25), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(90,60,20,.35), transparent 50%),
    var(--parchment);
  color: var(--ink); font-family: var(--font-type);
  border-radius: 4px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6), inset 0 0 60px rgba(90,60,20,.45);
  transform: rotate(-0.6deg);
}
.parchment h2 { color: var(--ink); font-size: clamp(40px, 6vw, 60px); }
.decree-sub { margin: 4px 0 20px; font-style: italic; }
.parchment ol { margin: 0; padding-left: 1.6em; font-size: 18px; line-height: 1.75; }
.parchment b { color: #8a1f17; }
.stamp {
  position: absolute; top: 22px; right: 22px; margin: 0;
  padding: 6px 12px; border: 3px solid #a3241c; color: #a3241c;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 14px;
  transform: rotate(8deg); opacity: .8;
}
.footnote { margin: 22px 0 0; font-size: 15px; opacity: .7; }

/* ---------- strength of the order ---------- */
.strength { background: linear-gradient(180deg, transparent, rgba(155, 77, 255, .06) 30%, rgba(155, 77, 255, .06) 70%, transparent); }
.census { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: stretch; }
.census-total {
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px; border-radius: 10px;
  background: radial-gradient(400px 220px at 20% 0%, rgba(155, 77, 255, .22), transparent 70%), var(--panel);
  border: 1px solid var(--purple-deep);
}
.ct-label { margin: 0; font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 15px; color: var(--muted); }
.total-num {
  margin: 0; font-family: var(--font-display); font-size: clamp(72px, 11vw, 128px); line-height: .9; color: var(--bone);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(155, 77, 255, .45);
}
.rank-card { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.rank-now { margin: 0 0 10px; font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.rank-now span { color: var(--lime); font-size: 1.25em; }
.rank-track { height: 12px; border-radius: 6px; background: #0b0908; border: 1px solid var(--line); overflow: hidden; }
.rank-track span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--lime-deep), var(--lime));
  box-shadow: 0 0 12px rgba(156, 196, 43, .6);
  transition: width 1.4s cubic-bezier(.2, .8, .2, 1);
}
.rank-next { margin: 10px 0 0; font-size: 15px; color: var(--text); }
.rank-next b { color: var(--bone); }

.census-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.census-tile {
  --c: var(--purple);
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 20px; border-radius: 10px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c);
  transition: transform .12s, border-color .12s;
}
.census-tile:hover { transform: translateY(-2px); border-color: var(--c); }
.census-tile[data-platform="twitch"] { --c: #9146ff; }
.census-tile[data-platform="youtube"] { --c: #ff3b30; }
.census-tile[data-platform="discord"] { --c: #5865f2; }
.census-tile[data-platform="x"] { --c: #e7e7e7; }
.ct-platform { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; font-size: 15px; color: var(--c); }
.ct-num { font-family: var(--font-display); font-size: 52px; line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.ct-what { font-size: 14px; color: var(--muted); }
.ct-online { font-style: normal; margin-left: 6px; color: var(--crt); }
.ct-online::before { content: "●"; margin-right: 4px; font-size: 10px; vertical-align: 2px; }
.ct-bar { display: block; height: 6px; margin-top: 12px; border-radius: 3px; background: #0b0908; overflow: hidden; }
.ct-bar span { display: block; height: 100%; width: 0; background: var(--c); transition: width 1.4s cubic-bezier(.2, .8, .2, 1); }
.ct-share { margin-top: 6px; font-family: var(--font-label); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.ladder { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ladder summary { cursor: pointer; padding: 14px 18px; font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--bone); }
.rank-ladder { list-style: none; margin: 0; padding: 4px 18px 18px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.rank-ladder li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; opacity: .45; }
.rank-ladder li.reached { opacity: 1; }
.rk-pip { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: #0b0908; }
.rank-ladder li.reached .rk-pip { background: var(--lime-deep); border-color: var(--lime); }
.rank-ladder li.current .rk-pip { background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.rk-name { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; color: var(--bone); line-height: 1.1; }
.rank-ladder li.current .rk-name { color: var(--lime); }
.rk-at { font-family: var(--font-crt); font-size: 17px; color: var(--muted); }
.census-note { margin-top: 14px; font-size: 14px; }

/* ---------- join ---------- */
.link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.link-card {
  display: grid; gap: 4px; padding: 20px; border-radius: 8px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--purple));
  transition: transform .12s, border-color .12s;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--c); }
.lc-name { font-family: var(--font-display); font-size: 32px; letter-spacing: 1px; color: var(--bone); line-height: 1; }
.lc-desc { color: var(--muted); font-size: 15px; }
.link-card.twitch { --c: #9146ff; }
.link-card.discord { --c: #5865f2; }
.link-card.youtube { --c: #ff3b30; }
.link-card.x { --c: #e7e7e7; }
.link-card.kofi { --c: #29abe0; }
.link-card.throne { --c: var(--gold); }
.pc-fund {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
  margin-top: 20px; padding: 18px 20px; border-radius: 8px;
  border: 1px dashed var(--gold); background: rgba(201,162,74,.07);
}
.pc-fund p { margin: 0; flex: 1 1 320px; }
.pc-fund b { color: var(--bone); }

/* ---------- footer ---------- */
.footer { padding: 40px var(--gutter) 56px; text-align: center; border-top: 1px solid var(--line); font-family: var(--font-label); letter-spacing: 1px; }
.footer p { margin: 4px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .tv { grid-template-columns: 1fr; }
  .osd { min-height: 0; }
  .tv-controls { grid-template-columns: 1fr 1fr; }
  .tv-controls .knob-btn { grid-column: 1 / -1; }
  .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:last-child { grid-column: 1 / -1; }
  .quest-grid { grid-template-columns: 1fr; }
  .census { grid-template-columns: 1fr; }
  .rank-ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .live-pill { margin-left: auto; }
  .tv-bezel { border-radius: 14px; }
  .tv-screen, .scanlines { border-radius: 8px; }
  .guide-list button { grid-template-columns: 52px minmax(0, 1fr); }
  .g-meta { grid-column: 2; }
  .link-grid, .pillar-grid { grid-template-columns: 1fr; }
  .census-grid { gap: 10px; }
  .census-tile { padding: 14px; }
  .ct-num { font-size: 40px; }
  .stamp { position: static; display: inline-block; margin-bottom: 12px; }
  .parchment { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
