@font-face { font-family: 'Press Start 2P'; src: url(fonts/press-start-2p.woff2) format('woff2'); }
@font-face { font-family: 'VT323'; src: url(fonts/vt323.woff2) format('woff2'); }

:root {
  --bg: #12051f;
  --pink: #ff2e88;
  --gold: #ffc93c;
  --teal: #2de2e6;
  --peach: #ff8a5b;
  --idle: #6b5b8a;
  --ink: #f4e9ff;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'VT323', monospace; }

#stage canvas { position: fixed; inset: 0; width: 100vw !important; height: 100vh !important; image-rendering: pixelated; }

.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6) 100%);
}

.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: space-between;
  padding: 18px 28px; font-family: 'Press Start 2P'; font-size: 12px; color: var(--gold); text-shadow: 2px 2px 0 #000;
}
.hud.bottom { top: auto; bottom: 0; color: var(--idle); font-size: 10px; }

section {
  position: fixed; z-index: 4; left: 4vw; top: 50%; width: min(46vw, 760px);
  transform: translateY(-50%); display: none;
  background: rgba(18, 5, 31, .86); padding: 32px 36px;
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px #000, 8px 8px 0 4px var(--pink);
  font-size: clamp(20px, 1.7vw, 30px); line-height: 1.25;
}
section.active { display: block; animation: boot .35s steps(5) both; }
section.center { left: 50%; transform: translate(-50%, -50%); text-align: center; width: min(88vw, 1100px); background: transparent; border: 0; box-shadow: none; }
section.center.active { animation: none; }
@keyframes boot { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

h1 {
  font-family: 'Press Start 2P'; font-size: clamp(18px, 2vw, 34px); line-height: 1.3; margin-bottom: 20px;
  color: var(--gold); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #000;
}
h1.mega { font-size: clamp(28px, 4.6vw, 80px); color: var(--ink); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--teal), 12px 12px 0 #000; margin: 24px 0 32px; }
h2 { font-family: 'Press Start 2P'; font-size: clamp(14px, 1.2vw, 20px); color: var(--teal); margin-bottom: 14px; }
p { margin: 10px 0; }
ul, ol { padding-left: 0; list-style: none; counter-reset: n; }
li { margin: 8px 0; padding-left: 1.4em; position: relative; }
ul li::before { content: '\25B6'; position: absolute; left: 0; color: var(--pink); font-size: .7em; top: .3em; }
ol li { counter-increment: n; }
ol li::before { content: counter(n); position: absolute; left: 0; color: var(--gold); font-family: 'Press Start 2P'; font-size: .55em; top: .45em; }

pre {
  font-family: 'VT323', monospace; font-size: .9em; color: #7dff8a; background: #000;
  border: 2px solid var(--idle); padding: 12px 16px; margin: 14px 0; white-space: pre-wrap;
}
.quote { border-left: 6px solid var(--gold); padding-left: 14px; font-style: italic; }
.kicker { font-family: 'Press Start 2P'; font-size: clamp(10px, 1vw, 16px); color: var(--teal); letter-spacing: 2px; }
.small { font-size: .75em; color: var(--idle); }
.gold { color: var(--gold); } .pink { color: var(--pink); } .teal { color: var(--teal); }
b { font-weight: normal; }

.blink { font-family: 'Press Start 2P'; font-size: clamp(12px, 1.1vw, 18px); margin-top: 28px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.legend { display: flex; gap: 12px; align-items: center; font-size: .85em; }
.dot { display: inline-block; width: 14px; height: 14px; }
.teal-bg { background: var(--teal); } .gold-bg { background: var(--gold); } .idle-bg { background: var(--idle); }

table { border-collapse: collapse; width: 100%; font-size: .85em; }
th { font-family: 'Press Start 2P'; font-size: .45em; color: var(--teal); text-align: left; padding: 8px; }
td { padding: 8px; border-top: 2px dashed var(--idle); }
td:first-child { color: var(--gold); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { border: 3px solid var(--teal); padding: 16px; background: #000a; font-size: .85em; }

@media (max-width: 800px) {
  section { left: 16px; right: 16px; width: auto; }
  .cards { grid-template-columns: 1fr; }
}

#progress { position: fixed; z-index: 6; left: 0; bottom: 0; height: 6px; background: var(--pink); box-shadow: 0 -2px 0 var(--gold); transition: width .3s steps(6); }

.shot { display: block; width: 100%; max-height: 30vh; object-fit: cover; object-position: top; margin: 6px 0 14px; border: 3px solid var(--teal); box-shadow: 4px 4px 0 #000; }
.bar { display: block; width: 100%; margin: 10px 0; border: 2px solid var(--idle); image-rendering: pixelated; }
.split { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.qr { margin: 6px 0 0; text-align: center; font-size: .7em; color: var(--gold); }
.qr img { width: clamp(140px, 13vw, 240px); display: block; border: 4px solid var(--gold); image-rendering: pixelated; }
.countdown { font-family: 'Press Start 2P'; font-size: clamp(14px, 1.4vw, 24px); color: var(--gold); margin-top: 18px; }
.credits li { font-size: .8em; margin: 4px 0; }
.card .shot { max-height: 18vh; }
section:has(.cards) { width: min(60vw, 1000px); }

/* fallback backdrop when WebGL is unavailable */
body.nogl {
  background:
    linear-gradient(transparent 62%, rgba(255,46,136,.25) 62.3%, transparent 62.6%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(91,26,138,.6) 79px 81px),
    radial-gradient(circle at 70% 52%, #ffc93c 0 9%, #ff8a5b 9.5% 11%, transparent 11.5%),
    linear-gradient(#12051f 0 62%, #1d0b33 62%);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.pig { width: clamp(110px, 12vw, 200px); image-rendering: pixelated; filter: drop-shadow(6px 6px 0 #000); animation: bob 2s steps(4) infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
ol.big li { font-size: 1.15em; margin: 18px 0; }
