html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Purple Saga · Minnesota Vikings Fan Page & Trivia</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Big+Shoulders:wght@600..900&family=Instrument+Sans:wght@400..700&family=Instrument+Serif:ital@1&display=swap" rel="stylesheet">
<style>
:root{
  --night:#07060d; --night-2:#0d0a1a; --night-3:#151027;
  --purple:#4F2683; --violet:#9b6bff; --gold:#FFC62F; --gold-2:#ffe08a;
  --ice:#e6eeff; --aurora:#3ef0b8; --red:#ff6b6b;
  --text:#f3efff; --muted:#b9b0d6; --line:rgba(255,198,47,.18); --glass:rgba(255,255,255,.045);
  --display:"Big Shoulders",Impact,sans-serif; --serif:"Instrument Serif",Georgia,serif; --sans:"Instrument Sans",system-ui,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{background:var(--night);color:var(--text);font-family:var(--sans);line-height:1.55;overflow-x:hidden;-webkit-font-smoothing:antialiased}
a{color:inherit}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
:focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:6px}
.wrap{max-width:1200px;margin:0 auto;padding:0 clamp(18px,4vw,40px);position:relative}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
em.s{font-family:var(--serif);font-style:italic;font-weight:400;color:var(--gold);letter-spacing:0}
.eyebrow{display:flex;align-items:center;gap:12px;font-size:.78rem;font-weight:700;letter-spacing:.28em;text-transform:uppercase;color:var(--gold)}
.eyebrow svg{width:14px;height:20px;color:var(--gold)}
.h2{font-family:var(--display);font-weight:900;text-transform:uppercase;font-size:clamp(2.8rem,7vw,5.6rem);line-height:.88;letter-spacing:.005em;margin:.5rem 0 1rem}
.h2 em.s{text-transform:none;font-size:1.02em}
.lead{color:var(--muted);max-width:620px;font-size:1.06rem}
section{position:relative;padding:clamp(80px,12vw,140px) 0}
.reveal{opacity:0;transform:translateY(36px);transition:opacity .9s cubic-bezier(.2,.7,.2,1),transform .9s cubic-bezier(.2,.7,.2,1)}
.reveal.in{opacity:1;transform:none}
.icon{width:20px;height:20px;flex:none}

/* ---------- NAV ---------- */
nav{position:fixed;inset:0 0 auto 0;z-index:50;padding:16px 0;transition:background .4s,padding .4s,border-color .4s;border-bottom:1px solid transparent}
nav.scrolled{background:rgba(7,6,13,.78);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);padding:10px 0;border-color:var(--line)}
nav .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;max-width:1360px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-family:var(--display);font-weight:900;font-size:1.35rem;letter-spacing:.06em;text-transform:uppercase}
.brand svg{width:34px;height:34px}
.brand small{display:block;font-family:var(--sans);font-weight:600;font-size:.62rem;letter-spacing:.22em;color:var(--muted);margin-top:-2px}
.links{display:flex;gap:26px;font-weight:600;font-size:.9rem}
.links a{text-decoration:none;opacity:.8;position:relative;padding:4px 0}
.links a::after{content:"";position:absolute;left:0;right:100%;bottom:-2px;height:2px;background:var(--gold);transition:right .3s}
.links a:hover{opacity:1}.links a:hover::after{right:0}
.sound{display:flex;align-items:center;gap:8px;padding:8px 14px;border:1px solid var(--line);border-radius:999px;font-size:.8rem;font-weight:600;color:var(--muted)}
.sound[aria-pressed="true"]{color:var(--gold);border-color:var(--gold)}
@media (max-width:980px){.links{display:none}}

/* ---------- HERO ---------- */
.hero{position:relative;height:100svh;min-height:680px;overflow:hidden;padding:0}
.scene{position:absolute;inset:0;width:100%;height:100%;display:block}
.veil{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(7,6,13,.86) 0%,rgba(7,6,13,.35) 48%,transparent 70%),linear-gradient(0deg,var(--night) 2%,transparent 26%)}
.hero-copy{position:absolute;left:clamp(20px,6vw,96px);bottom:clamp(96px,13vh,150px);max-width:680px;z-index:3}
.live{display:inline-flex;align-items:center;gap:10px;padding:8px 14px 8px 10px;border-radius:999px;background:rgba(13,10,26,.6);border:1px solid var(--line);backdrop-filter:blur(8px);font-size:.82rem;font-weight:600;color:var(--ice);margin-bottom:22px}
.live .dot{width:9px;height:9px;border-radius:50%;background:var(--aurora);box-shadow:0 0 0 0 rgba(62,240,184,.6);animation:ping 2s infinite}
@keyframes ping{70%,100%{box-shadow:0 0 0 10px rgba(62,240,184,0)}}
.live b{color:var(--gold)}
h1.title{font-family:var(--display);font-weight:900;text-transform:uppercase;line-height:.8;letter-spacing:.01em}
h1.title .the{display:block;font-family:var(--serif);font-style:italic;font-weight:400;text-transform:none;font-size:clamp(1.8rem,3.4vw,2.8rem);color:var(--gold);letter-spacing:0;margin-bottom:.12em;line-height:1}
h1.title .w1{display:block;font-size:clamp(4rem,min(13vw,15.5vh),11rem)}
h1.title .w1 .ch{background:linear-gradient(180deg,#fff 10%,#d7c6ff 55%,#9b6bff 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
h1.title .w2{display:block;font-size:clamp(4rem,min(13vw,15.5vh),11rem);color:transparent;-webkit-text-stroke:2px var(--gold);text-shadow:0 0 40px rgba(255,198,47,.25)}
h1.title .ch{display:inline-block;opacity:0;transform:translateY(.4em) rotate(4deg);animation:chIn .9s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes chIn{to{opacity:1;transform:none}}
.tagline{font-size:clamp(1rem,1.6vw,1.2rem);color:#ddd3f5;max-width:520px;margin:22px 0 28px}
.cta{display:flex;flex-wrap:wrap;gap:12px}
.btn{display:inline-flex;align-items:center;gap:10px;padding:15px 26px;border-radius:999px;font-weight:700;letter-spacing:.02em;text-decoration:none;position:relative;overflow:hidden;transition:transform .25s,box-shadow .25s,background .25s}
.btn-gold{background:var(--gold);color:#140c24;box-shadow:0 10px 40px -10px rgba(255,198,47,.7)}
.btn-gold:hover{transform:translateY(-3px);box-shadow:0 16px 50px -10px rgba(255,198,47,.9)}
.btn-ghost{border:1.5px solid rgba(255,255,255,.3);background:rgba(7,6,13,.35);backdrop-filter:blur(6px)}
.btn-ghost:hover{border-color:var(--gold);transform:translateY(-3px)}
.btn::after{content:"";position:absolute;top:0;left:-80%;width:50%;height:100%;background:linear-gradient(110deg,transparent,rgba(255,255,255,.5),transparent);transform:skewX(-20deg);transition:left .7s}
.btn:hover::after{left:130%}
.scroll-cue{position:absolute;right:clamp(20px,5vw,60px);bottom:110px;z-index:3;writing-mode:vertical-rl;font-size:.7rem;letter-spacing:.35em;text-transform:uppercase;color:var(--muted);display:flex;align-items:center;gap:12px}
.scroll-cue::after{content:"";width:1px;height:70px;background:linear-gradient(var(--gold),transparent);animation:cue 2.2s infinite}
@keyframes cue{0%{transform:scaleY(0);transform-origin:top}50%{transform:scaleY(1);transform-origin:top}51%{transform-origin:bottom}100%{transform:scaleY(0);transform-origin:bottom}}
@media (max-width:760px){
  .hero-copy{top:96px;bottom:auto;right:20px}
  .veil{background:linear-gradient(180deg,rgba(7,6,13,.85) 0%,rgba(7,6,13,.5) 45%,transparent 62%),linear-gradient(0deg,var(--night) 2%,transparent 22%)}
  .scroll-cue{display:none}
  .tagline{margin:16px 0 20px}
}
/* hero svg animation */
.ship-rock{animation:rock 6s ease-in-out infinite;transform-box:fill-box;transform-origin:50% 80%}
@keyframes rock{0%,100%{transform:rotate(-1.6deg) translateY(0)}50%{transform:rotate(1.4deg) translateY(6px)}}
.oar{transform-box:fill-box;transform-origin:100% 0;animation:row 3.2s ease-in-out infinite}
@keyframes row{0%,100%{transform:rotate(-7deg)}50%{transform:rotate(7deg)}}
.aur-drift{animation:aur 26s ease-in-out infinite alternate}
@keyframes aur{to{transform:translateX(-120px)}}
.aur-drift2{animation:aur2 34s ease-in-out infinite alternate}
@keyframes aur2{to{transform:translateX(140px)}}
.tw{animation:tw 3s ease-in-out infinite}
@keyframes tw{50%{opacity:.15}}
.shoot{stroke-dasharray:0 1600;animation:shoot 11s linear infinite}
@keyframes shoot{0%,86%{stroke-dasharray:0 1600;stroke-dashoffset:0;opacity:0}87%{opacity:1}92%{stroke-dasharray:180 1600;stroke-dashoffset:-420}96%,100%{stroke-dasharray:0 1600;stroke-dashoffset:-900;opacity:0}}

/* ticker */
.ticker{position:relative;z-index:4;margin-top:-62px;border-block:1px solid var(--line);background:rgba(7,6,13,.75);backdrop-filter:blur(10px);overflow:hidden;padding:0}
.ticker-track{display:flex;width:max-content;animation:tick 48s linear infinite}
.ticker:hover .ticker-track{animation-play-state:paused}
@keyframes tick{to{transform:translateX(-50%)}}
.ticker span{display:flex;align-items:center;gap:22px;padding:16px 22px;font-family:var(--display);font-weight:800;font-size:1.25rem;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;color:var(--ice)}
.ticker b{color:var(--gold);font-weight:900}
.ticker svg{width:10px;height:14px;color:var(--violet)}

/* ---------- SEASON ---------- */
.season-grid{display:grid;grid-template-columns:1fr 1.25fr;gap:clamp(24px,4vw,56px);align-items:start;margin-top:40px}
@media (max-width:900px){.season-grid{grid-template-columns:1fr}}
.figs{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fig{padding:22px;border-radius:20px;background:linear-gradient(160deg,rgba(79,38,131,.4),rgba(13,10,26,.6));border:1px solid var(--line);position:relative;overflow:hidden}
.fig .v{font-family:var(--display);font-weight:900;font-size:clamp(2.8rem,6vw,4.2rem);line-height:.9;color:var(--gold)}
.fig .k{font-size:.82rem;font-weight:600;color:var(--muted);margin-top:6px}
.fig .n{font-size:.75rem;color:#8f86ad;margin-top:4px}
.fig.wide{grid-column:span 2}
.chart-card{border-radius:24px;border:1px solid var(--line);background:linear-gradient(170deg,rgba(21,16,39,.9),rgba(7,6,13,.9));padding:24px 22px 16px}
.chart-card h3{font-family:var(--display);font-weight:800;font-size:1.5rem;letter-spacing:.04em;text-transform:uppercase}
.chart-card p.sub{color:var(--muted);font-size:.88rem;margin-bottom:8px}
.chart-card svg{width:100%;height:auto;display:block}
.bar{transform-box:fill-box;transform:scaleY(0);transition:transform 1s cubic-bezier(.2,.8,.2,1)}
.bar.up{transform-origin:50% 100%}.bar.down{transform-origin:50% 0}
.chart-card.in .bar{transform:scaleY(1)}
.road{margin-top:44px}
.road h3{font-family:var(--display);font-weight:800;font-size:1.7rem;text-transform:uppercase;letter-spacing:.04em;margin-bottom:14px}
.road-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.game{display:flex;gap:14px;align-items:center;padding:14px 16px;border-radius:16px;background:var(--glass);border:1px solid rgba(255,255,255,.08);transition:border-color .3s,transform .3s}
.game:hover{border-color:var(--gold);transform:translateY(-3px)}
.game .wk{font-family:var(--display);font-weight:900;font-size:1.7rem;color:var(--violet);min-width:2.2ch;text-align:center;line-height:1}
.game .who{font-weight:700}
.game .meta{font-size:.8rem;color:var(--muted)}
.game .tag{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;font-size:.66rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:rgba(255,198,47,.14);color:var(--gold-2);vertical-align:2px}
.game.next{border-color:var(--gold);background:linear-gradient(120deg,rgba(255,198,47,.12),rgba(79,38,131,.2))}
.asof{font-size:.78rem;color:#8f86ad;margin-top:14px}

/* ---------- SAGAS (eras) ---------- */
.sagas-head{display:flex;justify-content:space-between;align-items:end;gap:20px;flex-wrap:wrap}
.arrows{display:flex;gap:10px}
.arrows button{width:48px;height:48px;border-radius:50%;border:1px solid var(--line);display:grid;place-items:center;transition:background .2s,border-color .2s}
.arrows button:hover{background:rgba(255,198,47,.12);border-color:var(--gold)}
.stones{display:flex;gap:22px;overflow-x:auto;scroll-snap-type:x mandatory;padding:40px clamp(18px,4vw,40px) 30px;margin-top:10px;scrollbar-width:thin;scrollbar-color:var(--purple) transparent;cursor:grab}
.stones:active{cursor:grabbing}
.stone{flex:0 0 clamp(260px,30vw,330px);scroll-snap-align:center;position:relative;padding:34px 26px 28px;min-height:430px;border-radius:48% 52% 16px 16px / 20% 24% 10px 10px;
  background:radial-gradient(120% 80% at 30% 0%,#3a3550 0%,#25212f 45%,#17141f 100%);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.08),inset 0 -20px 40px rgba(0,0,0,.4),0 30px 60px -20px rgba(0,0,0,.7);transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.stone::before{content:"";position:absolute;inset:0;border-radius:inherit;opacity:.35;mix-blend-mode:overlay;pointer-events:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>")}
.stone:hover{transform:translateY(-10px) rotate(-.6deg)}
.stone .rune-lg{width:44px;height:64px;color:var(--gold);filter:drop-shadow(0 0 10px rgba(255,198,47,.55));margin:0 auto 6px;display:block}
.stone .yr{font-family:var(--display);font-weight:900;font-size:3.6rem;text-align:center;line-height:1;color:#d9d2ea;text-shadow:0 -1px 0 rgba(0,0,0,.7),0 1px 0 rgba(255,255,255,.12)}
.stone h3{font-family:var(--display);font-weight:800;font-size:1.55rem;text-transform:uppercase;letter-spacing:.04em;text-align:center;color:var(--gold);margin:4px 0 12px;line-height:1.05}
.stone p{font-size:.94rem;color:#cfc8e2}
.stone .stat{margin-top:14px;padding-top:12px;border-top:1px dashed rgba(255,255,255,.14);font-size:.8rem;color:var(--muted)}
.stone .stat b{color:var(--gold-2)}
.knot{position:absolute;left:50%;bottom:-1px;transform:translateX(-50%);width:80%;opacity:.35}

/* ---------- STADIUMS ---------- */
.stad{display:grid;grid-template-columns:1.4fr 1fr;gap:clamp(24px,4vw,56px);align-items:center;margin-top:30px}
@media (max-width:900px){.stad{grid-template-columns:1fr}}
.stad-stage{border-radius:24px;border:1px solid var(--line);background:radial-gradient(120% 90% at 50% 0%,#1d1438,#0a0814 70%);padding:18px;position:relative;overflow:hidden}
.stad-stage svg{width:100%;height:auto;display:block}
.slider{margin-top:16px}
.slider input{width:100%;accent-color:var(--gold);height:28px}
.ticks{display:flex;justify-content:space-between;font-size:.72rem;font-weight:700;letter-spacing:.08em;color:var(--muted);text-transform:uppercase;margin-top:2px}
.ticks button{padding:4px 2px;color:var(--muted)}
.ticks button.on{color:var(--gold)}
.stad-info .years{font-family:var(--display);font-weight:900;font-size:clamp(2.6rem,5vw,3.6rem);color:var(--gold);line-height:1}
.stad-info h3{font-family:var(--display);font-weight:800;font-size:clamp(1.6rem,3vw,2.2rem);text-transform:uppercase;line-height:1;margin:8px 0}
.stad-info .where{display:flex;gap:8px;align-items:center;color:var(--violet);font-weight:600;font-size:.9rem;margin-bottom:12px}
.stad-info p{color:var(--muted)}
.fade-swap{animation:swap .5s ease}
@keyframes swap{from{opacity:0;transform:translateY(8px)}}

/* ---------- BANNERS ---------- */
.rafters{position:relative;margin-top:50px}
.rod{height:10px;border-radius:5px;background:linear-gradient(180deg,#e9d58f,#8b6b12);box-shadow:0 6px 18px rgba(0,0,0,.5)}
.banners{display:grid;grid-template-columns:repeat(6,1fr);gap:clamp(8px,2vw,24px);padding:0 clamp(6px,2vw,24px)}
@media (max-width:760px){.banners{grid-template-columns:repeat(3,1fr);row-gap:30px}}
.banner{position:relative;transform-origin:50% 0;animation:sway 5s ease-in-out infinite;cursor:default}
.banner:nth-child(2n){animation-delay:-1.4s}.banner:nth-child(3n){animation-delay:-2.6s;animation-duration:6s}
@keyframes sway{0%,100%{transform:rotate(-1.6deg)}50%{transform:rotate(1.6deg)}}
.banner svg{width:100%;height:auto;display:block;filter:drop-shadow(0 18px 20px rgba(0,0,0,.5));transition:transform .4s}
.banner:hover svg,.banner:focus-within svg{transform:translateY(8px) scale(1.04)}
.banner .cap{text-align:center;font-size:.78rem;color:var(--muted);margin-top:8px;line-height:1.35}
.banner .cap b{display:block;color:var(--text);font-size:.9rem}

/* ---------- TRIVIA ---------- */
.trial{background:radial-gradient(80% 60% at 50% 0%,rgba(79,38,131,.35),transparent 70%)}
.cats{display:flex;flex-wrap:wrap;gap:10px;margin:26px 0 8px}
.cat{padding:10px 16px;border-radius:999px;border:1px solid rgba(255,255,255,.16);font-weight:600;font-size:.88rem;color:var(--muted);transition:all .2s}
.cat:hover{border-color:var(--gold);color:var(--text)}
.cat[aria-pressed="true"]{background:var(--gold);border-color:var(--gold);color:#140c24}
.cat small{opacity:.7;margin-left:4px}
.arena{margin-top:26px;display:grid;grid-template-columns:300px 1fr;gap:22px;align-items:start}
@media (max-width:900px){.arena{grid-template-columns:1fr}}
.panel{border-radius:26px;border:1px solid var(--line);background:linear-gradient(170deg,rgba(26,18,48,.92),rgba(9,7,17,.96));padding:clamp(20px,3vw,32px);position:relative;overflow:hidden;box-shadow:0 40px 80px -30px rgba(0,0,0,.8)}
.side{display:flex;flex-direction:column;align-items:center;gap:18px;text-align:center}
@media (max-width:900px){.side{display:grid;grid-template-columns:auto 1fr;text-align:left;align-items:center;gap:14px 18px}.side .wide-row{grid-column:1 / -1}}
.timer{position:relative;width:170px;height:170px}
@media (max-width:900px){.timer{width:110px;height:110px;grid-row:span 2}}
.timer svg{width:100%;height:100%;transform:rotate(-90deg)}
.timer .t{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--display);font-weight:900;font-size:clamp(2.4rem,5vw,3.6rem)}
.timer.danger .t{color:var(--red);animation:pulse .5s infinite}
@keyframes pulse{50%{transform:scale(1.1)}}
.mini-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%}
.mini{background:var(--glass);border-radius:14px;padding:10px}
.mini b{display:block;font-family:var(--display);font-weight:900;font-size:1.9rem;line-height:1;color:var(--gold)}
.mini span{font-size:.68rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.runes{display:flex;gap:6px;justify-content:center}
.runes svg{width:26px;height:38px;color:rgba(255,255,255,.14);transition:color .3s,filter .3s,transform .3s}
.runes svg.lit{color:var(--gold);filter:drop-shadow(0 0 8px rgba(255,198,47,.8));transform:translateY(-3px)}
.runes.berserk svg.lit{color:var(--aurora);filter:drop-shadow(0 0 10px rgba(62,240,184,.9))}
.rlabel{font-size:.7rem;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-top:6px}
.lifelines{display:flex;gap:8px;width:100%}
.life{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border-radius:14px;border:1px solid rgba(255,255,255,.12);font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);transition:all .2s}
.life:hover:not(:disabled){border-color:var(--gold);color:var(--gold)}
.life:disabled{opacity:.3;cursor:not-allowed}
.progress{width:100%;height:8px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden}
.progress i{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,var(--violet),var(--gold));transition:width .6s cubic-bezier(.2,.8,.2,1)}
.qhead{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px;font-size:.78rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.diff{display:inline-flex;gap:3px;margin-left:8px;vertical-align:-1px}
.diff i{width:7px;height:7px;transform:rotate(45deg);background:rgba(255,255,255,.18)}
.diff i.on{background:var(--gold)}
.qtext{font-size:clamp(1.3rem,2.6vw,1.85rem);font-weight:700;line-height:1.25;min-height:3.8em}
.opts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}
@media (max-width:600px){.opts{grid-template-columns:1fr}}
.opt{position:relative;text-align:left;padding:16px 16px 16px 58px;border-radius:16px;background:rgba(255,255,255,.045);border:1.5px solid rgba(255,255,255,.12);font-weight:600;font-size:1rem;line-height:1.3;transition:transform .2s,background .2s,border-color .2s,opacity .3s;animation:optIn .5s cubic-bezier(.2,.8,.2,1) both}
@keyframes optIn{from{opacity:0;transform:translateY(14px)}}
.opt:hover:not(:disabled){transform:translateY(-3px);border-color:var(--gold);background:rgba(255,198,47,.07)}
.opt .k{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:rgba(255,255,255,.08);font-family:var(--display);font-weight:900;color:var(--gold)}
.opt.correct{background:rgba(62,240,184,.14);border-color:var(--aurora);box-shadow:0 0 30px -6px rgba(62,240,184,.6)}
.opt.correct .k{background:var(--aurora);color:#07060d}
.opt.wrong{background:rgba(255,107,107,.12);border-color:var(--red);animation:shake .45s}
.opt.wrong .k{background:var(--red);color:#fff}
.opt.gone{opacity:.18;pointer-events:none}
.opt:disabled{cursor:default}
@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(2px)}}
.feedback{margin-top:18px;min-height:52px;font-size:1rem;color:#ddd3f5}
.feedback b{color:var(--gold)}
.feedback .verdict{font-family:var(--display);font-weight:900;font-size:1.5rem;letter-spacing:.04em;text-transform:uppercase;display:block;margin-bottom:2px}
.feedback .verdict.ok{color:var(--aurora)}.feedback .verdict.no{color:var(--red)}
.row-end{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:14px;flex-wrap:wrap}
.hint{font-size:.76rem;color:#8f86ad}
.btn-sm{padding:12px 22px;border-radius:999px;font-weight:700;background:var(--gold);color:#140c24;transition:transform .2s,background .2s}
.btn-sm:hover{transform:translateY(-2px);background:var(--gold-2)}
.btn-sm.ghost{background:transparent;color:var(--text);border:1px solid rgba(255,255,255,.25)}
.btn-sm.ghost:hover{border-color:var(--gold);background:transparent}
.hidden{display:none!important}
.start{text-align:center;padding:12px 0}
.start .big{font-family:var(--display);font-weight:900;text-transform:uppercase;font-size:clamp(2.6rem,6vw,4.4rem);line-height:.9}
.start ul{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 22px;margin:18px 0 26px;color:var(--muted);font-size:.9rem}
.start li{display:flex;align-items:center;gap:8px}
.start li svg{width:18px;height:18px;color:var(--gold)}
.final{text-align:center}
.final .rank{font-family:var(--display);font-weight:900;text-transform:uppercase;font-size:clamp(2rem,5vw,3rem);line-height:1;margin:8px 0 4px}
.final .score{font-family:var(--display);font-weight:900;font-size:clamp(4rem,11vw,7rem);line-height:.9;color:var(--gold)}
.final .shield{width:170px;height:190px;margin:0 auto}
.spin{transform-box:fill-box;transform-origin:center;animation:spin 24s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.stats3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:460px;margin:16px auto}
.review{text-align:left;margin:22px auto 0;max-width:640px;display:grid;gap:8px}
.review div{padding:12px 14px;border-radius:12px;background:var(--glass);font-size:.9rem;color:var(--muted)}
.review div b{color:var(--aurora);font-weight:600}
.review h4{font-family:var(--display);font-weight:800;text-transform:uppercase;letter-spacing:.06em;font-size:1.1rem;color:var(--text)}

/* ---------- SKOL CHANT ---------- */
.chant-grid{display:grid;grid-template-columns:1fr 1fr;gap:clamp(24px,4vw,56px);align-items:center;margin-top:20px}
@media (max-width:900px){.chant-grid{grid-template-columns:1fr}}
.drum-wrap{position:relative;max-width:440px;margin:0 auto;width:100%;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.drum-wrap svg{width:100%;height:auto;display:block}
#drumHit{cursor:pointer}
.judge{position:absolute;left:0;right:0;top:8%;text-align:center;font-family:var(--display);font-weight:900;font-size:2rem;letter-spacing:.06em;text-transform:uppercase;pointer-events:none;opacity:0}
.judge.show{animation:judge .7s ease-out}
@keyframes judge{0%{opacity:0;transform:translateY(10px) scale(.8)}20%{opacity:1;transform:none}100%{opacity:0;transform:translateY(-16px)}}
.beats{display:flex;justify-content:center;gap:14px;margin-top:6px}
.beats span{font-family:var(--display);font-weight:800;letter-spacing:.1em;padding:6px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.14);color:var(--muted);transition:all .12s}
.beats span.on{background:var(--violet);border-color:var(--violet);color:#fff}
.beats span.skol.on{background:var(--gold);border-color:var(--gold);color:#140c24}
.meter{height:14px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;margin:16px 0 6px}
.meter i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--purple),var(--violet),var(--gold));transition:width .25s}
.chant-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}

/* ---------- FOOTER ---------- */
footer{border-top:1px solid var(--line);padding:70px 0 40px;position:relative;overflow:hidden}
.foot-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:40px}
@media (max-width:800px){.foot-grid{grid-template-columns:1fr}}
.foot-mark{font-family:var(--display);font-weight:900;text-transform:uppercase;font-size:clamp(3.4rem,10vw,7rem);line-height:.82;background:linear-gradient(180deg,#fff,#7d5bd0);-webkit-background-clip:text;background-clip:text;color:transparent}
.sources h4{font-family:var(--display);font-weight:800;text-transform:uppercase;letter-spacing:.06em;font-size:1.1rem;margin-bottom:10px}
.sources ol{padding-left:18px;color:var(--muted);font-size:.86rem;display:grid;gap:6px}
.sources a{color:var(--ice);text-decoration-color:rgba(255,198,47,.5);text-underline-offset:3px}
.disclaimer{color:#8f86ad;font-size:.8rem;margin-top:18px;max-width:520px}

#confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:80}
#snow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;opacity:.6}
main,footer{position:relative;z-index:2}
.toast{opacity:0;position:fixed;left:50%;bottom:24px;transform:translate(-50%,160%);z-index:90;background:var(--gold);color:#140c24;font-weight:700;padding:12px 22px;border-radius:999px;transition:transform .45s cubic-bezier(.2,.9,.3,1.3);box-shadow:0 12px 40px rgba(255,198,47,.4)}
.toast.show{transform:translate(-50%,0);opacity:1}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
  .reveal{opacity:1;transform:none}
  h1.title .ch{opacity:1;transform:none}
  .bar{transform:scaleY(1)}
}
</style>
</head>
<body>

<!-- Rune sprite (Elder Futhark-inspired strokes) -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
  <defs>
    <symbol id="r-algiz" viewBox="0 0 20 30"><path d="M10 2V28M10 13L3 3M10 13L17 3" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-tiwaz" viewBox="0 0 20 30"><path d="M10 2V28M10 2L3 10M10 2L17 10" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-fehu" viewBox="0 0 20 30"><path d="M6 2V28M6 11L15 4M6 18L15 11" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-sowilo" viewBox="0 0 20 30"><path d="M14 2L6 12L14 18L6 28" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-dagaz" viewBox="0 0 20 30"><path d="M3 4V26L17 4V26L3 4" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-ingwaz" viewBox="0 0 20 30"><path d="M10 3L17 15L10 27L3 15Z" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linejoin="round"/></symbol>
    <symbol id="r-kenaz" viewBox="0 0 20 30"><path d="M15 4L5 15L15 26" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-othala" viewBox="0 0 20 30"><path d="M10 3L16 10L4 24M10 3L4 10L16 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-uruz" viewBox="0 0 20 30"><path d="M4 28V4L16 10V28" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="r-raido" viewBox="0 0 20 30"><path d="M5 28V3L15 9L5 15L15 28" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></symbol>
    <symbol id="diamond" viewBox="0 0 10 14"><path d="M5 0L10 7L5 14L0 7Z" fill="currentColor"/></symbol>
  </defs>
</svg>

<canvas id="snow" aria-hidden="true"></canvas>
<canvas id="confetti" aria-hidden="true"></canvas>
<div class="toast" id="toast" role="status" aria-live="polite"></div>

<nav id="nav" aria-label="Main">
  <div class="wrap">
    <a class="brand" href="#top" aria-label="The Purple Saga, back to top">
      <svg viewBox="0 0 40 40" aria-hidden="true">
        <defs><linearGradient id="bm" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#9b6bff"/><stop offset="1" stop-color="#4F2683"/></linearGradient></defs>
        <path d="M20 2L36 11V29L20 38L4 29V11Z" fill="url(#bm)" stroke="#FFC62F" stroke-width="1.5"/>
        <path d="M12 28C11 19 16 12 27 9L29 12C21 15 18 20 17 28Z" fill="#FFC62F"/>
        <ellipse cx="28" cy="10.5" rx="3.2" ry="1.6" transform="rotate(-35 28 10.5)" fill="#ffe08a"/>
      </svg>
      <span>The Purple Saga<small>Unofficial Vikings fan page</small></span>
    </a>
    <div class="links">
      <a href="#season">2026 Season</a>
      <a href="#sagas">Sagas</a>
      <a href="#stadiums">Stadiums</a>
      <a href="#rafters">Rafters</a>
      <a href="#trial">Trivia</a>
      <a href="#chant">Skol Chant</a>
    </div>
    <button class="sound" id="soundBtn" aria-pressed="true" aria-label="Toggle sound">
      <svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m2 2l8 8m12-8l-8 8"/><ellipse cx="12" cy="9" rx="10" ry="5"/><path d="M7 13.4v7.9m5-7.3v8m5-8.6v7.9M2 9v8a10 5 0 0 0 20 0V9"/></g></svg>
      <span id="soundLbl">Sound on</span>
    </button>
  </div>
</nav>

<!-- ================= HERO ================= -->
<header class="hero" id="top">
  <svg class="scene" id="scene" viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice" role="img" aria-label="A Viking longship with a purple sail crossing a fjord under the northern lights">
    <defs>
      <linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stop-color="#04030b"/><stop offset=".45" stop-color="#130b2e"/><stop offset=".72" stop-color="#2a155c"/><stop offset="1" stop-color="#1a0f38"/>
      </linearGradient>
      <linearGradient id="curtainA" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stop-color="#9b6bff" stop-opacity="0"/><stop offset=".45" stop-color="#9b6bff" stop-opacity=".35"/><stop offset=".85" stop-color="#3ef0b8" stop-opacity=".75"/><stop offset="1" stop-color="#3ef0b8" stop-opacity="0"/>
      </linearGradient>
      <linearGradient id="curtainB" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stop-color="#ff7ad9" stop-opacity="0"/><stop offset=".5" stop-color="#b07bff" stop-opacity=".35"/><stop offset=".9" stop-color="#FFC62F" stop-opacity=".45"/><stop offset="1" stop-color="#FFC62F" stop-opacity="0"/>
      </linearGradient>
      <linearGradient id="water" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stop-color="#1b1140"/><stop offset=".4" stop-color="#0c0820"/><stop offset="1" stop-color="#05040b"/>
      </linearGradient>
      <linearGradient id="hullG" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stop-color="#3a1f66"/><stop offset="1" stop-color="#120a24"/>
      </linearGradient>
      <linearGradient id="sailG" x1="0" y1="0" x2="1" y2="0">
        <stop offset="0" stop-color="#3b1c6b"/><stop offset=".5" stop-color="#5d2fa3"/><stop offset="1" stop-color="#3b1c6b"/>
      </linearGradient>
      <radialGradient id="moonG" cx=".42" cy=".38" r=".7"><stop offset="0" stop-color="#fff8dc"/><stop offset=".7" stop-color="#ffe08a"/><stop offset="1" stop-color="#d9a91f"/></radialGradient>
      <radialGradient id="moonGlow"><stop offset="0" stop-color="#FFC62F" stop-opacity=".35"/><stop offset="1" stop-color="#FFC62F" stop-opacity="0"/></radialGradient>
      <filter id="warp" x="-20%" y="-30%" width="140%" height="160%">
        <feTurbulence type="fractalNoise" baseFrequency="0.0035 0.022" numOctaves="2" seed="7" result="n">
          <animate attributeName="baseFrequency" dur="40s" values="0.0035 0.022;0.005 0.016;0.0035 0.022" repeatCount="indefinite"/>
        </feTurbulence>
        <feDisplacementMap in="SourceGraphic" in2="n" scale="140" xChannelSelector="R" yChannelSelector="G"/>
        <feGaussianBlur stdDeviation="7"/>
      </filter>
      <filter id="soft" x="-10%" y="-10%" width="120%" height="120%"><feGaussianBlur stdDeviation="3"/></filter>
      <filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="5" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
      <clipPath id="belowWater"><rect x="-200" y="70" width="1000" height="400"/></clipPath>
      <path id="sailShape" d="M150,-236 C210,-246 322,-246 382,-236 L392,-40 C330,-22 202,-22 140,-40 Z">
        <animate attributeName="d" dur="5s" repeatCount="indefinite" calcMode="spline" keySplines=".4 0 .6 1;.4 0 .6 1"
          values="M150,-236 C210,-246 322,-246 382,-236 L392,-40 C330,-22 202,-22 140,-40 Z;M150,-236 C210,-242 322,-242 382,-236 L402,-46 C340,-4 192,-4 130,-46 Z;M150,-236 C210,-246 322,-246 382,-236 L392,-40 C330,-22 202,-22 140,-40 Z"/>
      </path>
      <clipPath id="sailClip"><use href="#sailShape"/></clipPath>
    </defs>

    <rect width="1600" height="900" fill="url(#sky)"/>
    <g id="stars"></g>
    <line class="shoot" x1="1500" y1="60" x2="900" y2="300" stroke="#fff" stroke-width="2" stroke-linecap="round" opacity="0"/>

    <!-- aurora -->
    <g id="lyrAurora" style="mix-blend-mode:screen">
      <g class="aur-drift" filter="url(#warp)" opacity=".85">
        <path d="M-300,430 C100,330 320,470 660,360 S1150,250 1900,390 L1900,70 C1300,-10 900,130 600,50 S100,70 -300,50 Z" fill="url(#curtainA)"/>
      </g>
      <g class="aur-drift2" filter="url(#warp)" opacity=".6">
        <path d="M-200,300 C220,230 520,340 880,250 S1420,170 1900,270 L1900,-20 L-200,-20 Z" fill="url(#curtainB)"/>
      </g>
    </g>

    <!-- moon -->
    <circle cx="1270" cy="170" r="140" fill="url(#moonGlow)"/>
    <circle cx="1270" cy="170" r="44" fill="url(#moonG)"/>
    <circle cx="1256" cy="160" r="7" fill="#e0b84a" opacity=".35"/><circle cx="1284" cy="186" r="5" fill="#e0b84a" opacity=".3"/>

    <!-- mountains -->
    <g id="lyrFar">
      <path d="M-100,640 L60,500 L170,560 L300,430 L420,520 L520,470 L640,560 L780,450 L900,540 L1010,480 L1120,560 L1260,440 L1400,530 L1520,470 L1700,560 L1700,660 L-100,660Z" fill="#2a1a52" opacity=".9"/>
      <path d="M300,430 L270,458 L296,452 L318,470 L330,446Z M780,450 L752,476 L784,468 L806,482 L812,462Z M1260,440 L1228,468 L1262,458 L1286,476 L1292,454Z" fill="#cdbff5" opacity=".35"/>
    </g>
    <g id="lyrMid">
      <path d="M-100,660 L40,560 L150,610 L250,540 L360,620 L470,580 L560,640 L1060,640 L1150,575 L1250,620 L1360,550 L1480,610 L1580,570 L1700,630 L1700,680 L-100,680Z" fill="#160d30"/>
    </g>

    <!-- water -->
    <rect x="0" y="640" width="1600" height="260" fill="url(#water)"/>
    <g opacity=".22" filter="url(#soft)">
      <path d="M-300,640 C100,740 320,660 660,740 S1150,780 1900,700 L1900,900 L-300,900Z" fill="#3ef0b8" opacity=".25"/>
    </g>
    <path d="M1180,650 L1360,650 L1300,900 L1240,900Z" fill="#FFC62F" opacity=".06"/>
    <g stroke="rgba(230,238,255,.12)" stroke-width="1.6" fill="none" stroke-linecap="round">
      <path d="M0,690 Q100,682 200,690 T400,690 T600,690 T800,690 T1000,690 T1200,690 T1400,690 T1600,690">
        <animate attributeName="d" dur="7s" repeatCount="indefinite" values="M0,690 Q100,682 200,690 T400,690 T600,690 T800,690 T1000,690 T1200,690 T1400,690 T1600,690;M0,690 Q100,698 200,690 T400,690 T600,690 T800,690 T1000,690 T1200,690 T1400,690 T1600,690;M0,690 Q100,682 200,690 T400,690 T600,690 T800,690 T1000,690 T1200,690 T1400,690 T1600,690"/>
      </path>
      <path d="M0,760 Q140,750 280,760 T560,760 T840,760 T1120,760 T1400,760 T1680,760" opacity=".7">
        <animate attributeName="d" dur="9s" repeatCount="indefinite" values="M0,760 Q140,750 280,760 T560,760 T840,760 T1120,760 T1400,760 T1680,760;M0,760 Q140,772 280,760 T560,760 T840,760 T1120,760 T1400,760 T1680,760;M0,760 Q140,750 280,760 T560,760 T840,760 T1120,760 T1400,760 T1680,760"/>
      </path>
      <path d="M0,840 Q200,828 400,840 T800,840 T1200,840 T1600,840" opacity=".5">
        <animate attributeName="d" dur="11s" repeatCount="indefinite" values="M0,840 Q200,828 400,840 T800,840 T1200,840 T1600,840;M0,840 Q200,852 400,840 T800,840 T1200,840 T1600,840;M0,840 Q200,828 400,840 T800,840 T1200,840 T1600,840"/>
      </path>
    </g>

    <!-- longship -->
    <g id="shipPos" transform="translate(880,573) scale(.95)">
      <g id="shipPar">
        <g clip-path="url(#belowWater)" opacity=".13"><use href="#shipBody" transform="translate(0,140) scale(1,-1)" filter="url(#soft)"/></g>
        <g id="shipBody" class="ship-rock">
          <!-- oars -->
          <g stroke="#c9a24a" stroke-width="4" stroke-linecap="round">
            <line class="oar" x1="70" y1="120" x2="110" y2="58"/><line class="oar" x1="130" y1="122" x2="170" y2="60" style="animation-delay:-.2s"/>
            <line class="oar" x1="190" y1="124" x2="230" y2="62" style="animation-delay:-.4s"/><line class="oar" x1="250" y1="124" x2="290" y2="62" style="animation-delay:-.6s"/>
            <line class="oar" x1="310" y1="124" x2="350" y2="62" style="animation-delay:-.8s"/><line class="oar" x1="370" y1="122" x2="410" y2="60" style="animation-delay:-1s"/>
          </g>
          <!-- rigging -->
          <g stroke="rgba(255,224,138,.5)" stroke-width="1.5" fill="none"><path d="M266,-262 L22,-32"/><path d="M266,-262 L548,-48"/></g>
          <!-- mast + yard -->
          <rect x="262" y="-262" width="8" height="304" rx="3" fill="#8a6a2a"/>
          <rect x="136" y="-244" width="260" height="7" rx="3.5" fill="#8a6a2a"/>
          <!-- sail -->
          <use href="#sailShape" fill="url(#sailG)"/>
          <g clip-path="url(#sailClip)">
            <rect x="170" y="-260" width="26" height="260" fill="#FFC62F" opacity=".85"/><rect x="250" y="-260" width="32" height="260" fill="#FFC62F" opacity=".85"/><rect x="336" y="-260" width="26" height="260" fill="#FFC62F" opacity=".85"/>
            <rect x="100" y="-120" width="340" height="140" fill="#000" opacity=".12"/>
          </g>
          <use href="#sailShape" fill="none" stroke="#2a144d" stroke-width="3"/>
          <!-- sail emblem: horn -->
          <g transform="translate(266,-146)" filter="url(#glow)">
            <circle r="46" fill="#2a144d" stroke="#FFC62F" stroke-width="3"/>
            <path d="M-26,24 C-30,-6 -8,-28 22,-34 L28,-26 C4,-16 -10,2 -12,26 Z" fill="#FFC62F"/>
            <ellipse cx="25" cy="-30" rx="9" ry="4.5" transform="rotate(-38 25 -30)" fill="#ffe08a"/>
            <path d="M-20,8 L-8,4 M-16,-6 L-2,-12 M-6,-18 L8,-24" stroke="#2a144d" stroke-width="3" stroke-linecap="round"/>
          </g>
          <!-- hull -->
          <path d="M18,40 C0,10 -6,-30 14,-46 C26,-54 36,-42 28,-36 C14,-26 18,4 36,40 Z" fill="#FFC62F"/>
          <path d="M512,40 C520,-10 540,-60 566,-74 C580,-80 590,-66 580,-58 C568,-50 562,-60 556,-52 C546,-36 538,0 532,40 Z" fill="#FFC62F"/>
          <circle cx="574" cy="-68" r="3" fill="#2a144d"/>
          <path d="M18,40 L532,40 C520,82 474,106 404,110 L136,110 C70,106 30,82 18,40 Z" fill="url(#hullG)" stroke="#FFC62F" stroke-width="3"/>
          <path d="M40,64 C120,84 420,84 510,64 M70,86 C160,100 380,100 470,86" stroke="rgba(255,198,47,.35)" stroke-width="2" fill="none"/>
          <!-- shields -->
          <g id="shields"></g>
        </g>
      </g>
    </g>

    <!-- foreground rocks -->
    <path d="M-50,900 L-50,700 L60,660 L150,720 L230,690 L330,760 L360,900Z" fill="#06050b"/>
    <path d="M1650,900 L1650,690 L1540,670 L1450,730 L1380,710 L1300,800 L1280,900Z" fill="#06050b"/>
  </svg>
  <div class="veil"></div>

  <div class="hero-copy">
    <div class="live"><span class="dot"></span><span><b>2026 · 6–1</b> · 1st in NFC North · Next: Bills, Monday Night</span></div>
    <h1 class="title" aria-label="The Purple Saga">
      <span class="the" aria-hidden="true">the</span>
      <span class="w1" data-split aria-hidden="true">Purple</span>
      <span class="w2" data-split aria-hidden="true">Saga</span>
    </h1>
    <p class="tagline">Sixty-six seasons of horns, heartbreak and miracles. A fan-built field guide to the Minnesota Vikings, and a 50-question trivia challenge to test your knowledge.</p>
    <div class="cta">
      <a class="btn btn-gold" href="#trial">Take the trivia
        <svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/></svg></a>
      <a class="btn btn-ghost" href="#season">2026 season</a>
    </div>
  </div>
  <div class="scroll-cue" aria-hidden="true">Scroll the saga</div>
</header>

<div class="ticker" aria-label="Season ticker">
  <div class="ticker-track" id="tickerTrack"></div>
</div>

<main>
<!-- ================= SEASON ================= -->
<section id="season">
  <div class="wrap">
    <div class="reveal">
      <div class="eyebrow"><svg aria-hidden="true"><use href="#r-tiwaz"/></svg>Saga I · The 2026 Season</div>
      <h2 class="h2">Six straight.<br>Then <em class="s">Detroit.</em></h2>
      <p class="lead">With a new general manager (Nolan Teasley) and Kyler Murray signed in March, the Vikings opened 6–0 for the first time since 2009. The defense has held every opponent under 23 points. The first loss came Nov 1 at Ford Field, 19–15.</p>
    </div>

    <div class="season-grid">
      <div class="figs reveal">
        <div class="fig"><div class="v" data-count="6" data-suffix="–1">0</div><div class="k">Record</div><div class="n">1st in NFC North</div></div>
        <div class="fig"><div class="v" data-count="13.3" data-dec="1">0</div><div class="k">Points allowed / game</div><div class="n">93 in 7 games</div></div>
        <div class="fig"><div class="v" data-count="140">0</div><div class="k">Points scored</div><div class="n">20.0 per game</div></div>
        <div class="fig"><div class="v" data-count="47" data-prefix="+">0</div><div class="k">Point differential</div><div class="n">7 games played</div></div>
        <div class="fig wide"><div class="k" style="margin:0 0 6px">The Week 1 comeback</div><div style="font-size:.95rem;color:#ddd3f5">Murray left with a concussion in the first quarter against Green Bay. Carson Wentz came off the bench to throw three TDs, and Minnesota scored <b style="color:var(--gold)">29 unanswered points</b> to win 39–22.</div></div>
      </div>

      <div class="chart-card reveal" id="marginCard">
        <h3>Margin by week</h3>
        <p class="sub">Point margin per game. Bars rise for wins and drop for losses.</p>
        <svg viewBox="0 0 640 270" id="marginChart" role="img" aria-label="Bar chart of 2026 game margins: Week 1 plus 17 vs Green Bay, Week 2 plus 6 at Chicago, Week 3 plus 7 at Tampa Bay, Week 4 plus 5 vs Miami, Week 5 plus 10 at New Orleans, Week 6 bye, Week 7 plus 6 vs Indianapolis, Week 8 minus 4 at Detroit."></svg>
      </div>
    </div>

    <div class="road reveal">
      <h3>The road ahead</h3>
      <div class="road-list" id="roadList"></div>
      <p class="asof">Season data as of Sunday, Nov 8, 2026. All times Central. Source: 2026 Minnesota Vikings season (Wikipedia).</p>
    </div>
  </div>
</section>

<!-- ================= SAGAS ================= -->
<section id="sagas" style="padding-bottom:60px">
  <div class="wrap">
    <div class="sagas-head reveal">
      <div>
        <div class="eyebrow"><svg aria-hidden="true"><use href="#r-raido"/></svg>Saga II · The Rune Stones</div>
        <h2 class="h2">Ten moments<br><em class="s">carved in stone</em></h2>
        <p class="lead">From an expansion upset in 1961 to the 2026 team. Drag or use the arrows to move through the stones.</p>
      </div>
      <div class="arrows">
        <button id="stPrev" aria-label="Previous stone"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 18l-6-6l6-6"/></svg></button>
        <button id="stNext" aria-label="Next stone"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/></svg></button>
      </div>
    </div>
  </div>
  <div class="stones" id="stones" tabindex="0" aria-label="Franchise milestones, scrollable"></div>
</section>

<!-- ================= STADIUMS ================= -->
<section id="stadiums">
  <div class="wrap">
    <div class="reveal">
      <div class="eyebrow"><svg aria-hidden="true"><use href="#r-othala"/></svg>Saga III · The Mead Halls</div>
      <h2 class="h2">Four homes,<br><em class="s">one skyline</em></h2>
      <p class="lead">Drag the slider and watch each stadium silhouette morph into the next.</p>
    </div>
    <div class="stad reveal">
      <div class="stad-stage">
        <svg viewBox="0 0 800 300" id="stadSvg" role="img" aria-label="Morphing stadium silhouette">
          <defs>
            <linearGradient id="stFill" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#7a4fd1"/><stop offset="1" stop-color="#2a1554"/></linearGradient>
            <radialGradient id="stGlow" cx=".5" cy="1" r=".8"><stop offset="0" stop-color="#FFC62F" stop-opacity=".35"/><stop offset="1" stop-color="#FFC62F" stop-opacity="0"/></radialGradient>
            <pattern id="win" width="18" height="14" patternUnits="userSpaceOnUse"><rect x="4" y="4" width="8" height="4" rx="1" fill="#FFC62F" opacity=".22"/></pattern>
          </defs>
          <rect x="0" y="0" width="800" height="300" fill="url(#stGlow)"/>
          <g id="stStars"></g>
          <polygon id="stShape" fill="url(#stFill)" stroke="#FFC62F" stroke-width="2.5" stroke-linejoin="round"/>
          <polygon id="stWin" fill="url(#win)"/>
          <line x1="0" y1="262" x2="800" y2="262" stroke="rgba(255,198,47,.4)" stroke-width="1.5"/>
          <rect x="0" y="262" width="800" height="38" fill="#0a0814"/>
          <text id="stLabel" x="400" y="290" text-anchor="middle" font-family="Big Shoulders, Impact" font-weight="800" font-size="16" letter-spacing="4" fill="#b9b0d6">1961</text>
        </svg>
        <div class="slider">
          <label for="stRange" class="sr">Choose stadium era</label>
          <input type="range" id="stRange" min="0" max="3" step="0.01" value="0">
          <div class="ticks" id="stTicks"></div>
        </div>
      </div>
      <div class="stad-info" id="stInfo" aria-live="polite"></div>
    </div>
  </div>
</section>

<!-- ================= RAFTERS ================= -->
<section id="rafters" style="padding-top:40px">
  <div class="wrap">
    <div class="reveal">
      <div class="eyebrow"><svg aria-hidden="true"><use href="#r-algiz"/></svg>Saga IV · The Rafters</div>
      <h2 class="h2">Six numbers<br><em class="s">no one wears</em></h2>
      <p class="lead">These are the franchise's retired numbers. Randy Moss is in the Hall of Fame, but No. 84 isn't on the list. That fact shows up in the trivia.</p>
    </div>
    <div class="rafters reveal">
      <div class="rod"></div>
      <div class="banners" id="banners"></div>
    </div>
  </div>
</section>

<!-- ================= TRIVIA ================= -->
<section id="trial" class="trial">
  <div class="wrap">
    <div class="reveal">
      <div class="eyebrow"><svg aria-hidden="true"><use href="#r-dagaz"/></svg>Saga V · The Trial of Valhalla</div>
      <h2 class="h2">Fifty questions.<br><em class="s">Twelve per raid.</em></h2>
      <p class="lead">Pick a category or play them all. Each question has a 15-second clock, and harder questions are worth more. Five correct answers in a row puts you in Berserker mode. Keys 1–4 answer and Enter moves on.</p>
    </div>
    <div class="cats reveal" id="cats" role="group" aria-label="Trivia category"></div>

    <div class="arena reveal">
      <aside class="panel side" aria-label="Scoreboard">
        <div class="timer" id="timer">
          <svg viewBox="0 0 200 200" aria-hidden="true">
            <defs><linearGradient id="tg" x1="0" x2="1"><stop offset="0" stop-color="#9b6bff"/><stop offset="1" stop-color="#FFC62F"/></linearGradient></defs>
            <circle cx="100" cy="100" r="86" fill="none" stroke="rgba(255,255,255,.07)" stroke-width="14"/>
            <circle id="tRing" cx="100" cy="100" r="86" fill="none" stroke="url(#tg)" stroke-width="14" stroke-linecap="round" stroke-dasharray="540.4" stroke-dashoffset="0"/>
          </svg>
          <div class="t" id="tNum" aria-label="Seconds left">15</div>
        </div>
        <div class="mini-row">
          <div class="mini"><b id="score">0</b><span>Score</span></div>
          <div class="mini"><b id="qpos">0/12</b><span>Question</span></div>
        </div>
        <div class="wide-row" style="width:100%">
          <div class="runes" id="runes" aria-label="Streak"></div>
          <div class="rlabel" id="rlabel">Streak 0</div>
        </div>
        <div class="lifelines wide-row">
          <button class="life" id="lEye" disabled><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></g></svg>Odin's Eye<span class="sr">: remove two wrong answers</span></button>
          <button class="life" id="lTime" disabled><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 22h14M5 2h14m-2 20v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"/></svg>+10 sec<span class="sr">: add ten seconds</span></button>
          <button class="life" id="lSkip" disabled><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 4v16M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z"/></svg>Bifröst<span class="sr">: skip this question</span></button>
        </div>
        <div class="progress wide-row"><i id="prog"></i></div>
      </aside>

      <div class="panel" id="stage">
        <div id="sStart" class="start">
          <svg width="120" height="132" viewBox="0 0 120 132" aria-hidden="true" style="display:block;margin:0 auto 14px">
            <path d="M60 4L112 22V64C112 96 88 118 60 128C32 118 8 96 8 64V22Z" fill="#2a144d" stroke="#FFC62F" stroke-width="3"/>
            <g class="spin"><circle cx="60" cy="64" r="38" fill="none" stroke="#9b6bff" stroke-width="1.5" stroke-dasharray="3 7"/></g>
            <path d="M42 86C40 62 52 46 76 40L80 46C62 52 54 64 52 86Z" fill="#FFC62F"/>
          </svg>
          <div class="big">Ready, <em class="s" style="text-transform:none">shieldbearer?</em></div>
          <ul>
            <li><svg aria-hidden="true"><use href="#r-tiwaz"/></svg>12 questions</li>
            <li><svg aria-hidden="true"><use href="#r-sowilo"/></svg>15 seconds each</li>
            <li><svg aria-hidden="true"><use href="#r-algiz"/></svg>3 lifelines</li>
            <li><svg aria-hidden="true"><use href="#r-ingwaz"/></svg>Streak bonus</li>
          </ul>
          <button class="btn-sm" id="startBtn">Begin the trial</button>
          <p class="hint" style="margin-top:14px" id="catHint">Category: All sagas (50 questions)</p>
        </div>

        <div id="sQ" class="hidden">
          <div class="qhead"><span id="qCat">Category</span><span id="qDiff"></span></div>
          <div class="qtext" id="qText" aria-live="polite"></div>
          <div class="opts" id="opts"></div>
          <div class="feedback" id="feedback" aria-live="polite"></div>
          <div class="row-end">
            <span class="hint">Keys 1–4 to answer · Enter for next</span>
            <button class="btn-sm hidden" id="nextBtn">Next</button>
          </div>
        </div>

        <div id="sEnd" class="hidden final">
          <svg class="shield" viewBox="0 0 170 190" id="endShield" aria-hidden="true"></svg>
          <div class="rank" id="endRank"></div>
          <div class="score" id="endScore">0</div>
          <div class="stats3">
            <div class="mini"><b id="endAcc">0%</b><span>Accuracy</span></div>
            <div class="mini"><b id="endStreak">0</b><span>Best streak</span></div>
            <div class="mini"><b id="endAvg">0s</b><span>Avg answer</span></div>
          </div>
          <p class="lead" id="endMsg" style="margin:6px auto 18px;text-align:center"></p>
          <div style="display:flex;gap:10px;justify-content:center;flex-wrap:wrap">
            <button class="btn-sm" id="againBtn"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true" style="vertical-align:-4px;margin-right:6px"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></g></svg>Raid again</button>
            <button class="btn-sm ghost" id="copyBtn"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true" style="vertical-align:-4px;margin-right:6px"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></g></svg>Copy result</button>
          </div>
          <div class="review" id="review"></div>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ================= SKOL CHANT ================= -->
<section id="chant">
  <div class="wrap">
    <div class="chant-grid">
      <div class="reveal">
        <div class="eyebrow"><svg aria-hidden="true"><use href="#r-uruz"/></svg>Saga VI · The Skol Chant</div>
        <h2 class="h2">Boom.<br><em class="s">Clap.</em> Skol.</h2>
        <p class="lead">The Skol Chant arrived with U.S. Bank Stadium in 2016. Fans borrowed it from Iceland's supporters at Euro 2016: the drum hits, everyone claps overhead, and the beat gets faster each time. Tap the drum (or press Space) when the gold ring closes. Twelve claps, and the tempo keeps rising.</p>
        <div class="meter" aria-hidden="true"><i id="cMeter"></i></div>
        <div class="hint" id="cHint">Crowd noise</div>
        <div class="chant-stats">
          <div class="mini"><b id="cScore">0</b><span>Score</span></div>
          <div class="mini"><b id="cPerfect">0</b><span>Perfect</span></div>
          <div class="mini"><b id="cBest">0</b><span>Session best</span></div>
        </div>
        <div style="margin-top:18px"><button class="btn-sm" id="cStart">Start the chant</button></div>
      </div>
      <div class="reveal">
        <div class="drum-wrap" id="drumWrap">
          <div class="judge" id="judge"></div>
          <svg viewBox="0 0 400 400" id="drumSvg" aria-hidden="true">
            <defs>
              <radialGradient id="skin" cx=".45" cy=".4" r=".7"><stop offset="0" stop-color="#f6ecd2"/><stop offset=".8" stop-color="#d9c79b"/><stop offset="1" stop-color="#a88f57"/></radialGradient>
              <linearGradient id="rim" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#ffe08a"/><stop offset="1" stop-color="#8b6b12"/></linearGradient>
            </defs>
            <g class="spin" style="animation-duration:60s"><circle cx="200" cy="200" r="186" fill="none" stroke="rgba(155,107,255,.35)" stroke-width="1.5" stroke-dasharray="2 9"/></g>
            <circle id="approach" cx="200" cy="200" r="190" fill="none" stroke="#FFC62F" stroke-width="5" opacity="0"/>
            <g id="drumHit" role="button" aria-label="Drum: tap to clap">
              <circle cx="200" cy="200" r="122" fill="url(#rim)"/>
              <circle cx="200" cy="200" r="110" fill="url(#skin)" id="skinC"/>
              <g stroke="#4F2683" stroke-width="3" fill="none" opacity=".75">
                <circle cx="200" cy="200" r="60" stroke-dasharray="6 6"/>
                <path d="M176 238C172 206 188 180 222 170L228 178C204 188 192 206 190 238Z" fill="#4F2683" stroke="none"/>
              </g>
              <g fill="#5a3a12">
                <circle cx="200" cy="83" r="5"/><circle cx="317" cy="200" r="5"/><circle cx="200" cy="317" r="5"/><circle cx="83" cy="200" r="5"/>
                <circle cx="283" cy="117" r="5"/><circle cx="283" cy="283" r="5"/><circle cx="117" cy="283" r="5"/><circle cx="117" cy="117" r="5"/>
              </g>
            </g>
            <g id="waves"></g>
          </svg>
          <div class="beats" aria-hidden="true"><span id="b1">Boom</span><span id="b2" class="skol">Skol!</span></div>
        </div>
      </div>
    </div>
  </div>
</section>
</main>

<footer>
  <div class="wrap foot-grid">
    <div>
      <div class="foot-mark">Skol,<br>Vikings</div>
      <p class="disclaimer">An unofficial fan page, not affiliated with the Minnesota Vikings or the NFL. Team names belong to their owners. All artwork is original SVG. Facts were checked against the sources listed and are current as of Nov 8, 2026.</p>
    </div>
    <div class="sources">
      <h4>Sources</h4>
      <ol>
        <li><a href="https://en.wikipedia.org/wiki/Minnesota_Vikings" target="_blank" rel="noopener">Minnesota Vikings</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/2026_Minnesota_Vikings_season" target="_blank" rel="noopener">2026 Minnesota Vikings season</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/2025_Minnesota_Vikings_season" target="_blank" rel="noopener">2025 Minnesota Vikings season</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/2024_Minnesota_Vikings_season" target="_blank" rel="noopener">2024 Minnesota Vikings season</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/Justin_Jefferson" target="_blank" rel="noopener">Justin Jefferson</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/Skol,_Vikings" target="_blank" rel="noopener">Skol, Vikings</a>, Wikipedia</li>
        <li><a href="https://en.wikipedia.org/wiki/2022_Indianapolis_Colts%E2%80%93Minnesota_Vikings_game" target="_blank" rel="noopener">2022 Colts–Vikings game</a>, Wikipedia</li>
        <li><a href="https://universitytimes.ie/2025/09/steelers-defeat-vikings-24-21-in-croke-park/" target="_blank" rel="noopener">Steelers defeat Vikings 24–21 in Croke Park</a>, The University Times</li>
      </ol>
    </div>
  </div>
</footer>

<script>
(() => {
const $ = id => document.getElementById(id);
const NS = "http://www.w3.org/2000/svg";
const reduce = matchMedia("(prefers-reduced-motion: reduce)").matches;
const el = (tag, attrs = {}, parent) => { const n = document.createElementNS(NS, tag); for (const k in attrs) n.setAttribute(k, attrs[k]); if (parent) parent.appendChild(n); return n; };
const shuffle = a => { a = a.slice(); for (let i = a.length - 1; i > 0; i--) { const j = Math.random() * (i + 1) | 0; [a[i], a[j]] = [a[j], a[i]]; } return a; };
const toast = msg => { const t = $("toast"); t.textContent = msg; t.classList.add("show"); clearTimeout(t._h); t._h = setTimeout(() => t.classList.remove("show"), 1800); };

/* ---------- Audio ---------- */
let actx = null, soundOn = true;
function ac(){ if (!soundOn) return null; try { actx = actx || new (window.AudioContext || window.webkitAudioContext)(); if (actx.state === "suspended") actx.resume(); return actx; } catch(e){ return null; } }
function noiseBuf(c, dur){ const b = c.createBuffer(1, c.sampleRate * dur, c.sampleRate), d = b.getChannelData(0); for (let i = 0; i < d.length; i++) d[i] = Math.random() * 2 - 1; return b; }
function boom(){ const c = ac(); if (!c) return; const t = c.currentTime, o = c.createOscillator(), g = c.createGain();
  o.type = "sine"; o.frequency.setValueAtTime(110, t); o.frequency.exponentialRampToValueAtTime(42, t + .35);
  g.gain.setValueAtTime(.9, t); g.gain.exponentialRampToValueAtTime(.001, t + .6); o.connect(g).connect(c.destination); o.start(t); o.stop(t + .62); }
function clap(vol = .5){ const c = ac(); if (!c) return; const t = c.currentTime, s = c.createBufferSource(), f = c.createBiquadFilter(), g = c.createGain();
  s.buffer = noiseBuf(c, .3); f.type = "bandpass"; f.frequency.value = 1400; f.Q.value = .8;
  g.gain.setValueAtTime(vol, t); g.gain.exponentialRampToValueAtTime(.001, t + .25); s.connect(f).connect(g).connect(c.destination); s.start(t); }
function horn(){ const c = ac(); if (!c) return; const t = c.currentTime, f = c.createBiquadFilter(), g = c.createGain();
  f.type = "lowpass"; f.frequency.value = 1100; g.gain.setValueAtTime(.0001, t); g.gain.exponentialRampToValueAtTime(.18, t + .08); g.gain.exponentialRampToValueAtTime(.0001, t + 1.2);
  [98, 147].forEach(fr => { const o = c.createOscillator(); o.type = "sawtooth"; o.frequency.setValueAtTime(fr * .8, t); o.frequency.exponentialRampToValueAtTime(fr, t + .2); o.connect(f); o.start(t); o.stop(t + 1.25); });
  f.connect(g).connect(c.destination); }
function chime(ok){ const c = ac(); if (!c) return; const t = c.currentTime;
  (ok ? [523, 659, 784] : [220, 185]).forEach((fr, i) => { const o = c.createOscillator(), g = c.createGain(); o.type = ok ? "triangle" : "square";
    o.frequency.value = fr; g.gain.setValueAtTime(.0001, t + i * .07); g.gain.exponentialRampToValueAtTime(ok ? .12 : .05, t + i * .07 + .02); g.gain.exponentialRampToValueAtTime(.0001, t + i * .07 + .3);
    o.connect(g).connect(c.destination); o.start(t + i * .07); o.stop(t + i * .07 + .32); }); }
$("soundBtn").addEventListener("click", e => { soundOn = !soundOn; e.currentTarget.setAttribute("aria-pressed", soundOn); $("soundLbl").textContent = soundOn ? "Sound on" : "Sound off"; });

/* ---------- Confetti ---------- */
const cc = $("confetti"), cx = cc.getContext("2d"); let parts = [], confOn = false;
function sizeC(){ cc.width = innerWidth * devicePixelRatio; cc.height = innerHeight * devicePixelRatio; cx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0); }
sizeC(); addEventListener("resize", sizeC);
function burst(x, y, n = 60){ if (reduce) return; const cols = ["#FFC62F", "#9b6bff", "#3ef0b8", "#ffffff", "#4F2683"];
  for (let i = 0; i < n; i++){ const a = Math.random() * Math.PI * 2, s = 3 + Math.random() * 8;
    parts.push({x, y, vx: Math.cos(a) * s, vy: Math.sin(a) * s - 4, r: 3 + Math.random() * 5, rot: Math.random() * 6, vr: (Math.random() - .5) * .4, life: 1, c: cols[i % 5], sq: Math.random() < .55}); }
  if (!confOn){ confOn = true; requestAnimationFrame(confTick); } }
function confTick(){ cx.clearRect(0, 0, innerWidth, innerHeight);
  for (const p of parts){ p.vy += .22; p.vx *= .99; p.x += p.vx; p.y += p.vy; p.rot += p.vr; p.life -= .012;
    cx.save(); cx.globalAlpha = Math.max(0, p.life); cx.translate(p.x, p.y); cx.rotate(p.rot); cx.fillStyle = p.c;
    if (p.sq) cx.fillRect(-p.r, -p.r / 2, p.r * 2, p.r); else { cx.beginPath(); cx.arc(0, 0, p.r / 1.6, 0, 7); cx.fill(); } cx.restore(); }
  parts = parts.filter(p => p.life > 0 && p.y < innerHeight + 40);
  if (parts.length) requestAnimationFrame(confTick); else { confOn = false; cx.clearRect(0, 0, innerWidth, innerHeight); } }

/* ---------- Snow ---------- */
(() => { const c = $("snow"), x = c.getContext("2d"); let fl = [];
  function size(){ c.width = innerWidth * devicePixelRatio; c.height = innerHeight * devicePixelRatio; x.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);
    fl = Array.from({length: Math.min(70, innerWidth / 18 | 0)}, () => ({x: Math.random() * innerWidth, y: Math.random() * innerHeight, r: Math.random() * 1.8 + .5, s: Math.random() * .5 + .2, d: Math.random() * 6})); }
  size(); addEventListener("resize", size);
  function f(){ x.clearRect(0, 0, innerWidth, innerHeight); x.fillStyle = "#fff";
    for (const p of fl){ p.d += .01; p.y += p.s; p.x += Math.sin(p.d) * .35; if (p.y > innerHeight + 4){ p.y = -4; p.x = Math.random() * innerWidth; }
      x.globalAlpha = .25 + p.r / 5; x.beginPath(); x.arc(p.x, p.y, p.r, 0, 7); x.fill(); }
    if (!reduce) requestAnimationFrame(f); }
  f(); })();

/* ---------- Hero ---------- */
(() => {
  const stars = $("stars");
  for (let i = 0; i < 150; i++){ const s = el("circle", {cx: Math.random() * 1600, cy: Math.random() * 470, r: (Math.random() ** 2 * 1.6 + .35).toFixed(2), fill: Math.random() < .12 ? "#ffe08a" : "#fff", opacity: (.35 + Math.random() * .65).toFixed(2)}, stars);
    if (i % 5 === 0){ s.classList.add("tw"); s.style.animationDelay = (-Math.random() * 3).toFixed(2) + "s"; } }
  const sh = $("shields");
  for (let i = 0; i < 11; i++){ const x = 70 + i * 40, gold = i % 2 === 0;
    el("circle", {cx: x, cy: 42, r: 16, fill: gold ? "#FFC62F" : "#4F2683", stroke: "#1a0f38", "stroke-width": 2.5}, sh);
    el("path", {d: `M${x - 16},42 H${x + 16} M${x},26 V58`, stroke: gold ? "#4F2683" : "#FFC62F", "stroke-width": 2, opacity: .7}, sh);
    el("circle", {cx: x, cy: 42, r: 4.5, fill: "#e8e2f7"}, sh); }
  // letters
  let k = 0; document.querySelectorAll("[data-split]").forEach(n => { const t = n.textContent; n.textContent = "";
    [...t].forEach(ch => { const s = document.createElement("span"); s.className = "ch"; s.textContent = ch; s.style.animationDelay = (0.15 + k++ * 0.06) + "s"; n.appendChild(s); }); });
  // responsive ship placement
  const ship = $("shipPos"), svg = $("scene");
  function place(){ const r = svg.getBoundingClientRect(), ar = r.width / r.height;
    if (ar < 1.05){ const sc = .72; ship.setAttribute("transform", `translate(${800 - 270 * sc},${640 - 70 * sc}) scale(${sc})`); }
    else if (ar < 1.5){ ship.setAttribute("transform", `translate(800,${640 - 70 * .85}) scale(.85)`); }
    else ship.setAttribute("transform", `translate(880,${640 - 70 * .95}) scale(.95)`); }
  place(); addEventListener("resize", place);
  // parallax
  const L = [["lyrAurora", 14], ["lyrFar", 22], ["lyrMid", 34], ["shipPar", 18]].map(([id, f]) => [$(id), f]);
  let tx = 0, ty = 0, cxp = 0, cyp = 0;
  if (!reduce){
    addEventListener("pointermove", e => { tx = (e.clientX / innerWidth - .5); ty = (e.clientY / innerHeight - .5); });
    (function loop(){ cxp += (tx - cxp) * .05; cyp += (ty - cyp) * .05; const sy = Math.min(scrollY, 900);
      L.forEach(([n, f]) => n.style.transform = `translate(${(-cxp * f).toFixed(2)}px,${(-cyp * f * .5 + sy * f / 120).toFixed(2)}px)`);
      requestAnimationFrame(loop); })();
  } else svg.pauseAnimations && svg.pauseAnimations();
  // pause SMIL when hero offscreen
  new IntersectionObserver(([e]) => { if (reduce) return; e.isIntersecting ? svg.unpauseAnimations() : svg.pauseAnimations(); }).observe(svg);
  // ticker
  const items = ["<b>6–1</b> · 1st in NFC North", "Next: <b>Bills</b> · Mon Nov 9 · 7:15 PM CT · U.S. Bank Stadium", "Nov 22: <b>49ers</b> at Estadio Azteca, Mexico City", "<b>6–0</b> start, the first since 2009", "Week 1: <b>29</b> unanswered points vs Green Bay", "Fewest points allowed in a game: <b>3</b>, at Chicago"];
  const seg = items.map(t => `<span>${t}<svg aria-hidden="true"><use href="#diamond"/></svg></span>`).join("");
  $("tickerTrack").innerHTML = seg + seg;
})();

/* ---------- Nav + reveal + counters ---------- */
addEventListener("scroll", () => $("nav").classList.toggle("scrolled", scrollY > 40), {passive: true});
function countUp(n){ const target = +n.dataset.count, dec = +(n.dataset.dec || 0), pre = n.dataset.prefix || "", suf = n.dataset.suffix || "";
  const fmt = v => pre + v.toFixed(dec) + suf; if (reduce){ n.textContent = fmt(target); return; }
  const t0 = performance.now(); (function f(t){ const p = Math.min(1, (t - t0) / 1600); n.textContent = fmt(target * (1 - Math.pow(1 - p, 4))); if (p < 1) requestAnimationFrame(f); })(t0); }
const io = new IntersectionObserver(es => es.forEach(e => { if (!e.isIntersecting) return; e.target.classList.add("in");
  e.target.querySelectorAll("[data-count]").forEach(countUp); io.unobserve(e.target); }), {threshold: .15});
document.querySelectorAll(".reveal").forEach(n => io.observe(n));

/* ---------- Season chart + road ---------- */
(() => {
  const G = [{w:1,o:"GB",pf:39,pa:22},{w:2,o:"@CHI",pf:9,pa:3},{w:3,o:"@TB",pf:23,pa:16},{w:4,o:"MIA",pf:15,pa:10},{w:5,o:"@NO",pf:23,pa:13},{w:6,o:"BYE"},{w:7,o:"IND",pf:16,pa:10},{w:8,o:"@DET",pf:15,pa:19}];
  const svg = $("marginChart"), base = 140, k = 5.6, bw = 50, gap = 26, x0 = 34;
  const d = el("defs", {}, svg);
  const lg = el("linearGradient", {id: "winG", x1: 0, y1: 1, x2: 0, y2: 0}, d); el("stop", {offset: 0, "stop-color": "#4F2683"}, lg); el("stop", {offset: 1, "stop-color": "#FFC62F"}, lg);
  [10, 0, -10].forEach(v => { const y = base - v * k; el("line", {x1: 24, x2: 630, y1: y, y2: y, stroke: v === 0 ? "rgba(255,255,255,.35)" : "rgba(255,255,255,.07)", "stroke-dasharray": v === 0 ? "" : "4 6"}, svg);
    const t = el("text", {x: 18, y: y + 4, "text-anchor": "end", fill: "#8f86ad", "font-size": 11, "font-family": "Instrument Sans"}, svg); t.textContent = (v > 0 ? "+" : "") + v; });
  G.forEach((g, i) => { const x = x0 + i * (bw + gap) + 8;
    const lab = el("text", {x: x + bw / 2, y: 252, "text-anchor": "middle", fill: "#b9b0d6", "font-size": 13, "font-weight": 700, "font-family": "Instrument Sans"}, svg); lab.textContent = g.o;
    const wk = el("text", {x: x + bw / 2, y: 266, "text-anchor": "middle", fill: "#6f6690", "font-size": 10, "font-family": "Instrument Sans"}, svg); wk.textContent = "WK " + g.w;
    if (g.o === "BYE"){ el("rect", {x, y: base - 14, width: bw, height: 28, rx: 6, fill: "none", stroke: "rgba(255,255,255,.18)", "stroke-dasharray": "4 4"}, svg); return; }
    const m = g.pf - g.pa, h = Math.abs(m) * k, up = m > 0;
    const r = el("rect", {x, y: up ? base - h : base, width: bw, height: h, rx: 6, fill: up ? "url(#winG)" : "#ff6b6b", class: "bar " + (up ? "up" : "down")}, svg);
    r.style.transitionDelay = (i * .08) + "s";
    const sc = el("text", {x: x + bw / 2, y: up ? base - h - 10 : base + h + 18, "text-anchor": "middle", fill: up ? "#ffe08a" : "#ff9a9a", "font-size": 13, "font-weight": 800, "font-family": "Big Shoulders, Impact"}, svg);
    sc.textContent = `${g.pf}–${g.pa}`; });
  const R = [["9","Buffalo Bills","Mon Nov 9 · 7:15 PM · ESPN/ABC","MNF",1],["10","at Green Bay","Sun Nov 15 · Noon · Fox"],["11","vs 49ers (SF home)","Sun Nov 22 · 7:20 PM · NBC · Estadio Azteca","Mexico City"],
    ["12","Atlanta Falcons","Sun Nov 29 · Noon · Fox"],["13","Carolina Panthers","Sun Dec 6 · 3:25 PM · CBS"],["14","at New England","Thu Dec 10 · 7:15 PM · Prime Video","TNF"],
    ["15","Detroit Lions","Sun Dec 20 · 7:20 PM · NBC","SNF"],["16","Washington Commanders","Dec 26/27 · TBD"],["17","at NY Jets","Sun Jan 3 · Noon · MetLife Stadium"]];
  $("roadList").innerHTML = R.map(([w, who, meta, tag, nx]) => `<div class="game${nx ? " next" : ""}"><div class="wk">${w}</div><div><div class="who">${who}${tag ? `<span class="tag">${tag}</span>` : ""}</div><div class="meta">${meta}</div></div></div>`).join("");
})();

/* ---------- Rune stones ---------- */
(() => {
  const S = [
    ["r-fehu","1961","The First Raid","An expansion team in its first-ever game, the Vikings stunned the Bears 37–13. Rookie Fran Tarkenton came off the bench to throw four TD passes and run for a fifth.","Then: <b>7 straight losses</b>, finishing 3–11"],
    ["r-tiwaz","1969","Kings of the NFL","A 12–2 season and a 27–7 win over Cleveland in the last pre-merger NFL Championship Game. Joe Kapp threw seven TDs in a single game that year.","First modern expansion team to win an <b>NFL title game</b>"],
    ["r-algiz","1970s","Four Trips to the Big Game","With the Purple People Eaters up front, Minnesota reached Super Bowls VIII, IX and XI after IV. Alan Page was the 1971 MVP, the first defender ever to win it.","Page, Eller, Marshall, Larsen: <b>the front four</b>"],
    ["r-sowilo","1998","Fifteen and One","Rookie Randy Moss joined Cris Carter in an offense that ran up the best record in franchise history. That mark still stands.","<b>15–1</b>, best in club history"],
    ["r-kenaz","2009","Favre in Purple","Brett Favre, a former Packer, became the first QB to beat all 32 teams. The 12–4 Vikings lost the NFC title game 31–28 in OT at New Orleans.","Record cable audience of <b>21.8M</b> for MNF vs GB"],
    ["r-uruz","2012","All Day","Adrian Peterson ran for 2,097 yards and won MVP, finishing just 8 yards short of Eric Dickerson's single-season record.","Also holds the single-game mark: <b>296 yds</b>"],
    ["r-dagaz","2018","The Minneapolis Miracle","Jan 14, 2018: Case Keenum to Stefon Diggs on the final play against the Saints. It was the first walk-off game-winning touchdown in NFL playoff history.","Named live on KFAN by <b>Paul Allen</b>"],
    ["r-raido","2022","33–0 → 39–36","Down 33–0 at halftime to the Colts, Minnesota came back to win in overtime, the largest comeback in NFL history. They won the division at 13–4.","An NFL-record <b>11 one-score wins</b>"],
    ["r-ingwaz","2024","Darnold's Fourteen","Sam Darnold won 14 games in his first season with the team, the first QB ever to do that. The Vikings became the first 14-win wild card team in league history.","<b>14–3</b>, then a wild-card loss at the Rams"],
    ["r-othala","2026","Six Straight","A new GM, a new rivalries uniform with Nordic knot striping, and a 6–0 start, the first since 2009. The saga continues.","<b>6–1</b> heading into Monday Night"]
  ];
  $("stones").innerHTML = S.map(([r, y, t, p, s]) => `<article class="stone"><svg class="rune-lg" aria-hidden="true"><use href="#${r}"/></svg><div class="yr">${y}</div><h3>${t}</h3><p>${p}</p><div class="stat">${s}</div>
    <svg class="knot" viewBox="0 0 200 20" aria-hidden="true"><path d="M0 10 Q25 0 50 10 T100 10 T150 10 T200 10" stroke="#FFC62F" fill="none" stroke-width="1.5"/><path d="M0 10 Q25 20 50 10 T100 10 T150 10 T200 10" stroke="#9b6bff" fill="none" stroke-width="1.5"/></svg></article>`).join("");
  const sc = $("stones"), step = () => (sc.querySelector(".stone").offsetWidth + 22);
  $("stPrev").onclick = () => sc.scrollBy({left: -step(), behavior: reduce ? "auto" : "smooth"});
  $("stNext").onclick = () => sc.scrollBy({left: step(), behavior: reduce ? "auto" : "smooth"});
  let down = false, sx = 0, sl = 0;
  sc.addEventListener("pointerdown", e => { if (e.pointerType !== "mouse") return; down = true; sx = e.clientX; sl = sc.scrollLeft; sc.style.scrollSnapType = "none"; });
  addEventListener("pointermove", e => { if (down) sc.scrollLeft = sl - (e.clientX - sx); });
  addEventListener("pointerup", () => { if (down){ down = false; sc.style.scrollSnapType = ""; } });
})();

/* ---------- Stadium morph ---------- */
(() => {
  const N = 48, X0 = 40, X1 = 760, B = 262;
  const prof = fn => Array.from({length: N}, (_, i) => { const x = X0 + (X1 - X0) * i / (N - 1); return [x, B - fn(x)]; });
  const SH = [
    prof(x => (Math.abs(x - 101) < 8 || Math.abs(x - 699) < 8) ? 200 : (x >= 112 && x <= 380 ? (x > 160 && x < 330 ? 96 : 70) : (x >= 430 && x <= 690 ? 56 : 10))),
    prof(x => { const u = (x - 400) / 335; return Math.abs(u) <= 1 ? 50 + 96 * Math.sqrt(1 - u * u) : 10; }),
    prof(x => x < 70 || x > 735 ? 10 : (x >= 200 && x <= 390 ? 172 : (x < 560 ? 116 : 62))),
    prof(x => x < 70 || x > 742 ? 10 : (x > 700 ? 64 : 48 + 186 * Math.pow((x - 70) / 630, 1.2)))
  ];
  const D = [
    {y:"1961–1981", n:"Metropolitan Stadium", w:"Bloomington", p:"An open-air ballpark in the suburbs and home of the Purple People Eaters' cold-weather reputation. Capacity grew from 40,800 to 47,900. It hosted the 1969 NFL Championship win over Cleveland."},
    {y:"1982–2013", n:"Hubert H. Humphrey Metrodome", w:"Minneapolis", p:"A fabric-roofed dome. In December 2010, 17 inches of snow collapsed the roof, and the Giants game moved to Detroit's Ford Field. The final game was a 14–13 win over the Lions on Dec 29, 2013."},
    {y:"2014–2015", n:"TCF Bank Stadium", w:"Minneapolis (now Huntington Bank Stadium)", p:"A two-season outdoor stopgap. Before the January 2016 playoff game against Seattle, the subzero cold cracked the original Gjallarhorn. Blair Walsh's 27-yard miss ended that game 10–9."},
    {y:"2016–present", n:"U.S. Bank Stadium", w:"Downtown East, Minneapolis", p:"Angular, glass-roofed and very loud. The Skol Chant started here, and the stadium hosted Super Bowl LII after the Vikings fell one game short of playing in it."}
  ];
  const shape = $("stShape"), win = $("stWin"), rng = $("stRange"), info = $("stInfo"), lbl = $("stLabel");
  const st = $("stStars"); for (let i = 0; i < 40; i++) el("circle", {cx: Math.random() * 800, cy: Math.random() * 150, r: Math.random() * 1.2 + .3, fill: "#fff", opacity: Math.random() * .6 + .2}, st);
  $("stTicks").innerHTML = D.map((d, i) => `<button data-i="${i}">${d.y.slice(0, 4)}</button>`).join("");
  const ease = t => t < .5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
  let cur = -1;
  function draw(v){ const i = Math.min(2, Math.floor(v)), t = ease(v - i), A = SH[i], Bp = SH[Math.min(3, i + 1)];
    const pts = A.map((p, j) => [p[0], p[1] + (Bp[j][1] - p[1]) * t]);
    const s = `${X0},${B} ` + pts.map(p => p[0].toFixed(1) + "," + p[1].toFixed(1)).join(" ") + ` ${X1},${B}`;
    shape.setAttribute("points", s); win.setAttribute("points", s);
    const idx = Math.round(v); if (idx !== cur){ cur = idx; const d = D[idx];
      info.innerHTML = `<div class="fade-swap"><div class="years">${d.y}</div><h3>${d.n}</h3><div class="where"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/></g></svg>${d.w}</div><p>${d.p}</p></div>`;
      lbl.textContent = d.n.toUpperCase();
      document.querySelectorAll("#stTicks button").forEach((b, j) => b.classList.toggle("on", j === idx)); } }
  let anim;
  function goTo(target){ cancelAnimationFrame(anim); const from = +rng.value, t0 = performance.now(), dur = reduce ? 1 : 900;
    (function f(t){ const p = Math.min(1, (t - t0) / dur), v = from + (target - from) * ease(p); rng.value = v; draw(v); if (p < 1) anim = requestAnimationFrame(f); })(t0); }
  rng.addEventListener("input", () => draw(+rng.value));
  rng.addEventListener("change", () => goTo(Math.round(+rng.value)));
  $("stTicks").addEventListener("click", e => { const b = e.target.closest("button"); if (b) goTo(+b.dataset.i); });
  draw(0);
  // autoplay once when visible
  let played = false;
  new IntersectionObserver(([e]) => { if (e.isIntersecting && !played && !reduce){ played = true; let i = 0; const h = setInterval(() => { if (++i > 3){ clearInterval(h); return; } goTo(i); }, 1500); } }, {threshold: .5}).observe($("stadSvg"));
})();

/* ---------- Banners ---------- */
(() => {
  const B = [["10","Fran Tarkenton","QB · 1961–66, 72–78"],["53","Mick Tingelhoff","C · 1962–78"],["70","Jim Marshall","DE · 1961–79"],["77","Korey Stringer","OT · 1995–2000"],["80","Cris Carter","WR · 1990–2001"],["88","Alan Page","DT · 1967–78"]];
  $("banners").innerHTML = B.map(([n, name, pos], i) => `<div class="banner" tabindex="0" aria-label="Number ${n}, ${name}, ${pos}">
    <svg viewBox="0 0 120 210" aria-hidden="true">
      <defs><linearGradient id="bg${i}" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5d2fa3"/><stop offset="1" stop-color="#2a144d"/></linearGradient></defs>
      <path d="M4 0H116V196L60 172L4 196Z" fill="url(#bg${i})" stroke="#FFC62F" stroke-width="3"/>
      <path d="M12 8H108V184L60 164L12 184Z" fill="none" stroke="rgba(255,198,47,.4)" stroke-width="1"/>
      <text x="60" y="104" text-anchor="middle" font-family="Big Shoulders, Impact" font-weight="900" font-size="68" fill="#FFC62F">${n}</text>
      <rect x="30" y="118" width="60" height="2" fill="#FFC62F" opacity=".6"/>
      <text x="60" y="140" text-anchor="middle" font-family="Big Shoulders, Impact" font-weight="800" font-size="13" letter-spacing="1.5" fill="#e6eeff">${name.split(" ").pop().toUpperCase()}</text>
      <use href="#r-${["fehu","tiwaz","algiz","othala","sowilo","ingwaz"][i]}" x="52" y="30" width="16" height="24" color="#9b6bff" style="color:#c7a8ff"/>
    </svg>
    <div class="cap"><b>${name}</b>${pos}</div></div>`).join("");
})();

/* ---------- TRIVIA ---------- */
const CATS = {legends: "Legends & History", records: "Records", lore: "Lore & Culture", miracles: "Miracles & Heartbreak", modern: "Modern Era"};
// o[0] is always the correct answer; options are shuffled on display.
const Q = [
 {c:"legends",d:1,q:"Who was the Vikings' first head coach in 1961?",o:["Norm Van Brocklin","Bud Grant","Jerry Burns","Dennis Green"],f:"Van Brocklin had just won the 1960 NFL title as the Eagles' QB. The Vikings hired him on Jan 18, 1961."},
 {c:"legends",d:2,q:"How did the Vikings fare in their very first regular-season game?",o:["Beat the Bears 37–13","Lost to the Packers 28–10","Tied the Lions 17–17","Lost to the Colts 24–7"],f:"Rookie Fran Tarkenton came off the bench to throw four TD passes and run for another. Then the team lost its next seven."},
 {c:"legends",d:2,q:"Bud Grant came to Minnesota after winning four Grey Cups with which CFL team?",o:["Winnipeg Blue Bombers","BC Lions","Toronto Argonauts","Montreal Alouettes"],f:"Grant coached the Vikings 1967–83 and again in 1985. He entered the Pro Football Hall of Fame in 1994."},
 {c:"legends",d:1,q:"Which of these players was NOT one of the Purple People Eaters?",o:["John Randle","Alan Page","Carl Eller","Jim Marshall"],f:"The front four was Page, Eller, Marshall and Gary Larsen. John Randle starred in the 1990s and is a Hall of Famer too."},
 {c:"legends",d:2,q:"In 1971, Alan Page became the first defensive player to win which award?",o:["AP NFL MVP","Defensive Player of the Year","Walter Payton Man of the Year","Super Bowl MVP"],f:"Page's No. 88 is one of six numbers the franchise has retired."},
 {c:"legends",d:1,q:"Fran Tarkenton's retired number is…",o:["10","9","14","12"],f:"Tarkenton played for Minnesota 1961–66 and 1972–78. No. 10 was retired on Oct 7, 1979."},
 {c:"legends",d:2,q:"Which of these numbers has the team NOT retired?",o:["84 (Randy Moss)","80 (Cris Carter)","53 (Mick Tingelhoff)","77 (Korey Stringer)"],f:"The retired numbers are 10, 53, 70, 77, 80 and 88. Moss entered the Hall of Fame in 2018, but No. 84 isn't on the list."},
 {c:"legends",d:3,q:"In 1969, Joe Kapp set an NFL record by throwing how many TD passes in one game?",o:["7","6","5","8"],f:"He did it against the Baltimore Colts, then turned down the team MVP award: \"There are 40 most valuable Vikings!\""},
 {c:"legends",d:2,q:"The Vikings won the last pre-merger NFL Championship Game. Who did they beat?",o:["Cleveland Browns, 27–7","Dallas Cowboys, 21–10","Los Angeles Rams, 23–20","Baltimore Colts, 24–14"],f:"It was Jan 4, 1970, at Metropolitan Stadium. Minnesota became the first modern expansion team to win an NFL title game."},
 {c:"legends",d:3,q:"Who designed the Vikings' horned helmet and original uniforms?",o:["Karl Hubenthal, a newspaper cartoonist","Charles Schulz","LeRoy Neiman","Norman Rockwell"],f:"Hubenthal drew for the Los Angeles Examiner. He also designed the original Norseman logo."},

 {c:"records",d:1,q:"How many rushing yards did Adrian Peterson gain in his 2012 MVP season?",o:["2,097","1,987","2,105","1,760"],f:"He finished 8 yards short of Eric Dickerson's single-season record. The 1,760 option was his total from 2008."},
 {c:"records",d:2,q:"As a rookie, Peterson set the NFL single-game rushing record of 296 yards against…",o:["San Diego Chargers","Chicago Bears","Green Bay Packers","Detroit Lions"],f:"That broke the record Jamal Lewis set in 2003."},
 {c:"records",d:1,q:"What was the 1998 Vikings' regular-season record, still the franchise best?",o:["15–1","14–2","13–3","14–3"],f:"Rookie Randy Moss and Cris Carter powered the offense. The 2024 team (14–3) came closest to matching it."},
 {c:"records",d:2,q:"Justin Jefferson led the NFL in 2022 with how many receiving yards?",o:["1,809","1,623","1,964","1,712"],f:"He also caught 128 passes. At 23 he was the youngest player ever to lead the league in both, and he won Offensive Player of the Year."},
 {c:"records",d:2,q:"Where did the Vikings take Justin Jefferson in the 2020 draft?",o:["22nd overall","5th overall","12th overall","34th overall"],f:"He came from national champion LSU. No one has more receiving yards through their first five seasons."},
 {c:"records",d:1,q:"In Dec 2022 the Vikings pulled off the largest comeback in NFL history. How far behind the Colts were they at halftime?",o:["33–0","28–3","35–7","31–0"],f:"They won 39–36 in overtime at U.S. Bank Stadium on Dec 17, 2022."},
 {c:"records",d:2,q:"The 2022 Vikings set an NFL record for most wins in one-score games. How many?",o:["11","9","10","12"],f:"They went 13–4 and won the NFC North in Kevin O'Connell's first season."},
 {c:"records",d:3,q:"The longest play in franchise history is a 99-yard TD pass in 2008. Gus Frerotte threw it to…",o:["Bernard Berrian","Sidney Rice","Visanthe Shiancoe","Percy Harvin"],f:"The play came against the Bears in Week 13."},
 {c:"records",d:2,q:"The Vikings' all-time record is the best of any franchise that has never…",o:["won a Super Bowl","hosted a Super Bowl","had a losing season","drafted first overall"],f:"They are 537–438–11 all-time. They did host a Super Bowl (LII), and their first-ever pick, Tommy Mason, went 1st overall."},

 {c:"lore",d:1,q:"\"Skol\" comes from the Scandinavian word skål. What does it mean?",o:["Cheers!","Victory!","Charge!","Brothers!"],f:"The word is an anglicization from Swedish, Danish and Norwegian. The fight song plays after every score."},
 {c:"lore",d:1,q:"The Skol Chant came from fans of which national team at Euro 2016?",o:["Iceland","Norway","Denmark","Sweden"],f:"To introduce it, the Vikings brought in Iceland midfielder Aron Gunnarsson and strongman Hafþór Björnsson."},
 {c:"lore",d:2,q:"What is the name of the Vikings' current mascot, introduced in 2007?",o:["Viktor the Viking","Ragnar","Bjorn the Bold","Erik the Red"],f:"Viktor wears a No. 1 jersey. Ragnar was a live mascot from 1994 to 2015."},
 {c:"lore",d:2,q:"How did Ragnar, the live mascot from 1994 to 2015, make his entrance?",o:["On a motorcycle","On a snowmobile","On a longship float","On horseback"],f:"A cheerleader used to ride in on a snowmobile. Ragnar was based on the legendary Ragnar Lodbrok."},
 {c:"lore",d:1,q:"In Norse myth, which god sounds the Gjallarhorn?",o:["Heimdall","Thor","Odin","Loki"],f:"The Vikings have blown their own Gjallarhorn before home games since 2007."},
 {c:"lore",d:2,q:"What happened to the original Gjallarhorn before the January 2016 playoff game against Seattle?",o:["It cracked in the subzero cold","It was stolen","It was too quiet to hear","It was gifted to Iceland"],f:"That game was played outdoors at TCF Bank Stadium and was one of the coldest in NFL playoff history."},
 {c:"lore",d:1,q:"After Prince died in 2016, which of his hits became the Vikings' touchdown song?",o:["Let's Go Crazy","Purple Rain","1999","Kiss"],f:"Prince grew up in Minneapolis and was a lifelong fan. He recorded \"Purple and Gold\" for the team in 2010."},
 {c:"lore",d:2,q:"What are \"Helga hats\"?",o:["Purple hats with white horns and blonde braids","Knit caps with the horn logo","Gold helmets worn by cheerleaders","Fur hats sold at Met Stadium"],f:"The original Helga hats are still assembled by hand in the Twin Cities."},
 {c:"lore",d:3,q:"Who wrote the fight song \"Skol, Vikings\" around 1961?",o:["James \"Red\" McLeod","Prince","Bob Dylan","Garrison Keillor"],f:"McLeod was from Edina. He also wrote or arranged many University of Minnesota fight songs."},
 {c:"lore",d:3,q:"The purple-and-gold Vikings name has roots in which team linked to co-owner Ole Haugsrud?",o:["His high school in Superior, Wis.","The Norwegian national team","The University of Minnesota","The Duluth Eskimos"],f:"The teams at Central High School in Superior were also called the Vikings and wore similar purple and yellow."},

 {c:"miracles",d:1,q:"Who caught the Minneapolis Miracle touchdown on Jan 14, 2018?",o:["Stefon Diggs","Adam Thielen","Kyle Rudolph","Jerick McKinnon"],f:"Case Keenum threw it, and it became the first walk-off game-winning TD in NFL playoff history."},
 {c:"miracles",d:2,q:"Which radio announcer named it the \"Minneapolis Miracle\" on the air?",o:["Paul Allen","Al Michaels","Joe Buck","Jim Nantz"],f:"Allen made the call on KFAN 100.3, and he still calls Vikings games."},
 {c:"miracles",d:1,q:"Which team beat Minnesota in Super Bowl IV?",o:["Kansas City Chiefs","Miami Dolphins","Pittsburgh Steelers","Oakland Raiders"],f:"The heavily favored Vikings lost 23–7. They went on to reach Super Bowls VIII, IX and XI as well."},
 {c:"miracles",d:2,q:"Blair Walsh's miss sealed a 10–9 playoff loss to Seattle in January 2016. How long was the kick?",o:["27 yards","32 yards","41 yards","22 yards"],f:"It was the third-coldest game in NFL playoff history."},
 {c:"miracles",d:2,q:"Snow collapsed the Metrodome roof in December 2010. Where was the Giants game moved?",o:["Ford Field, Detroit","Lambeau Field","TCF Bank Stadium","Soldier Field"],f:"Later that month a blizzard pushed the Eagles game to a Tuesday, the NFL's first Tuesday game since 1964."},
 {c:"miracles",d:2,q:"Where was Metropolitan Stadium, the team's home from 1961 to 1981?",o:["Bloomington","St. Paul","Eden Prairie","Downtown Minneapolis"],f:"Its capacity grew from 40,800 to 47,900 before the move to the Metrodome."},
 {c:"miracles",d:1,q:"U.S. Bank Stadium hosted Super Bowl LII. How close did the 2017 Vikings come to playing in it?",o:["Lost the NFC title game to the Eagles","Lost in the divisional round","Missed the playoffs","Lost the Super Bowl"],f:"Philadelphia won 38–7 and went on to win the Super Bowl in Minneapolis."},
 {c:"miracles",d:2,q:"What was the score when the Vikings lost the 2009 NFC Championship in overtime at New Orleans?",o:["31–28","27–24","24–21","34–31"],f:"Brett Favre's 2009 team went 12–4. That season he became the first QB to beat all 32 teams."},
 {c:"miracles",d:3,q:"Since 1978, how many NFC Championship Game appearances in a row have the Vikings lost?",o:["6","4","5","7"],f:"Their most recent conference title came in the 1976 season."},

 {c:"modern",d:1,q:"Who quarterbacked the Vikings to a 14–3 record in 2024?",o:["Sam Darnold","Kirk Cousins","J.J. McCarthy","Nick Mullens"],f:"He became the first QB to win 14 games in his first season with a team."},
 {c:"modern",d:2,q:"The 2024 Vikings became the first 14-win team in NFL history to…",o:["enter the playoffs as a wild card","miss the playoffs","win the division by 5 games","go unbeaten at home"],f:"Detroit won the NFC North, and the Rams beat Minnesota 27–9 in the wild-card round."},
 {c:"modern",d:2,q:"The 2024 \"Winter Warrior\" uniform introduced a franchise first. What was it?",o:["A white helmet","Gold pants","A black jersey","A chrome facemask"],f:"The all-white look has a metallic gray stripe inspired by the metal strips on Viking helmets."},
 {c:"modern",d:2,q:"Where did the Vikings play in the first NFL regular-season game in Ireland, in September 2025?",o:["Croke Park, Dublin","Aviva Stadium, Dublin","Thomond Park, Limerick","Páirc Uí Chaoimh, Cork"],f:"The Steelers won 24–21 on Sept 28, 2025."},
 {c:"modern",d:2,q:"Which Viking made first-team All-Pro after the 2025 season?",o:["Will Reichard (K)","Justin Jefferson (WR)","Brian O'Neill (OT)","Harrison Smith (S)"],f:"Long snapper Andrew DePaola made second team. The 2025 Vikings went 9–8 after winning their last five games."},
 {c:"modern",d:1,q:"Kevin O'Connell was hired in 2022 after winning a Super Bowl as offensive coordinator of…",o:["the Los Angeles Rams","the Kansas City Chiefs","the Tampa Bay Buccaneers","the San Francisco 49ers"],f:"He is the franchise's 10th head coach and was hired Feb 16, 2022."},
 {c:"modern",d:2,q:"Who did the Vikings draft 10th overall in 2024?",o:["J.J. McCarthy","Dallas Turner","Bo Nix","Michael Penix Jr."],f:"A knee injury cost McCarthy his rookie year. He was traded to the Giants on Sept 28, 2026."},
 {c:"modern",d:1,q:"The 2026 Vikings opened 6–0 for the first time since…",o:["2009","1998","2016","1975"],f:"The first loss came Nov 1 at Detroit, 19–15."},
 {c:"modern",d:2,q:"Who came off the bench to throw three TD passes in the 2026 opener, a 39–22 win over Green Bay?",o:["Carson Wentz","Max Brosmer","Kyler Murray","Sam Howell"],f:"Kyler Murray left with a concussion in the first quarter, and Minnesota went on to score 29 unanswered points. It echoed Tarkenton in 1961."},
 {c:"modern",d:2,q:"Where will the Vikings play the 49ers on Nov 22, 2026?",o:["Estadio Azteca, Mexico City","Wembley Stadium, London","Allianz Arena, Munich","Croke Park, Dublin"],f:"It's Sunday Night Football on NBC, with San Francisco as the designated home team."},
 {c:"modern",d:3,q:"Who became the Vikings' general manager in 2026?",o:["Nolan Teasley","Rob Brzezinski","Kwesi Adofo-Mensah","Ryan Grigson"],f:"Rob Brzezinski served as interim GM through the 2026 draft."},
 {c:"modern",d:2,q:"What position does Caleb Banks, the Vikings' 2026 first-round pick, play?",o:["Defensive line","Wide receiver","Quarterback","Cornerback"],f:"He went 18th overall out of Florida."}
];
const POINTS = {1: 100, 2: 150, 3: 200}, TIME = 15, CIRC = 540.4, RUNE_IDS = ["r-fehu","r-uruz","r-raido","r-kenaz","r-tiwaz"];
let cat = "all", S = null, best = 0;

// category chips
const counts = Object.keys(CATS).reduce((a, k) => (a[k] = Q.filter(q => q.c === k).length, a), {});
$("cats").innerHTML = `<button class="cat" data-c="all" aria-pressed="true">All sagas<small>${Q.length}</small></button>` +
  Object.entries(CATS).map(([k, v]) => `<button class="cat" data-c="${k}" aria-pressed="false">${v}<small>${counts[k]}</small></button>`).join("");
$("cats").addEventListener("click", e => { const b = e.target.closest(".cat"); if (!b) return; cat = b.dataset.c;
  document.querySelectorAll(".cat").forEach(x => x.setAttribute("aria-pressed", x === b));
  $("catHint").textContent = `Category: ${cat === "all" ? "All sagas" : CATS[cat]} (${cat === "all" ? Q.length : counts[cat]} questions)`;
  if (S && !S.over){ clearInterval(S.timer); S = null; show("sStart"); resetSide(); } });
$("runes").innerHTML = RUNE_IDS.map(r => `<svg viewBox="0 0 20 30"><use href="#${r}"/></svg>`).join("");

function show(id){ ["sStart", "sQ", "sEnd"].forEach(s => $(s).classList.toggle("hidden", s !== id)); }
function resetSide(){ $("score").textContent = 0; $("qpos").textContent = "0/12"; $("prog").style.width = "0%"; setRunes(0); renderTimer(TIME);
  ["lEye", "lTime", "lSkip"].forEach(id => $(id).disabled = true); }
function setRunes(n){ const r = $("runes"); [...r.children].forEach((s, i) => s.classList.toggle("lit", i < Math.min(n, 5))); r.classList.toggle("berserk", n >= 5);
  $("rlabel").textContent = n >= 5 ? `Berserker! ×${(1 + .1 * Math.min(n - 1, 5)).toFixed(1)}` : `Streak ${n}`; }
function renderTimer(t){ const f = Math.max(0, t) / TIME; $("tRing").style.strokeDashoffset = CIRC * (1 - Math.min(1, f));
  $("tRing").style.stroke = f < .34 ? "#ff6b6b" : "url(#tg)"; $("tNum").textContent = Math.ceil(Math.max(0, t)); $("timer").classList.toggle("danger", f < .34 && t > 0); }

function start(){
  const pool = shuffle(Q.filter(q => cat === "all" || q.c === cat));
  S = {qs: pool.slice(0, 12), extra: pool.slice(12), i: 0, score: 0, streak: 0, best: 0, correct: 0, answered: 0, times: [], missed: [], life: {eye: 1, time: 1, skip: 1}, over: false};
  ac(); horn(); show("sQ"); load();
}
function load(){
  const q = S.qs[S.i]; S.done = false; S.t = TIME; S.opts = shuffle(q.o.map((t, k) => ({t, ok: k === 0})));
  $("qCat").textContent = CATS[q.c]; $("qDiff").innerHTML = `${POINTS[q.d]} pts<span class="diff">${[1, 2, 3].map(n => `<i class="${n <= q.d ? "on" : ""}"></i>`).join("")}</span>`;
  $("qText").textContent = q.q; $("feedback").innerHTML = ""; $("nextBtn").classList.add("hidden");
  $("opts").innerHTML = S.opts.map((o, k) => `<button class="opt" data-k="${k}" style="animation-delay:${k * .06}s"><span class="k">${k + 1}</span>${o.t}</button>`).join("");
  $("qpos").textContent = `${S.i + 1}/${S.qs.length}`; $("prog").style.width = (S.i / S.qs.length * 100) + "%";
  $("lEye").disabled = !S.life.eye; $("lTime").disabled = !S.life.time; $("lSkip").disabled = !S.life.skip;
  clearInterval(S.timer); const t0 = performance.now(); S.base = TIME;
  S.timer = setInterval(() => { S.t = S.base - (performance.now() - t0) / 1000; renderTimer(S.t); if (S.t <= 0){ clearInterval(S.timer); resolve(-1); } }, 50);
  renderTimer(TIME);
}
function resolve(k){
  if (S.done) return; S.done = true; clearInterval(S.timer);
  const q = S.qs[S.i], btns = [...document.querySelectorAll("#opts .opt")], ci = S.opts.findIndex(o => o.ok), left = Math.max(0, S.t);
  btns.forEach(b => b.disabled = true); ["lEye", "lTime", "lSkip"].forEach(id => $(id).disabled = true);
  S.answered++; S.times.push(Math.min(TIME, TIME - left + (S.base - TIME)));
  const ok = k === ci; let html;
  if (ok){ S.streak++; S.best = Math.max(S.best, S.streak); S.correct++;
    const mult = 1 + .1 * Math.min(S.streak - 1, 5), pts = Math.round(POINTS[q.d] * (1 + .5 * Math.min(1, left / TIME)) * mult);
    S.score += pts; btns[k].classList.add("correct"); const r = btns[k].getBoundingClientRect(); burst(r.left + r.width / 2, r.top + r.height / 2, S.streak >= 5 ? 90 : 45);
    chime(true); if (S.streak === 5) horn();
    html = `<span class="verdict ok">Skol! +${pts}</span>${q.f}`;
  } else { S.streak = 0; if (k >= 0) btns[k].classList.add("wrong"); btns[ci].classList.add("correct"); chime(false);
    S.missed.push({q: q.q, a: q.o[0]});
    html = `<span class="verdict no">${k < 0 ? "Time's up" : "Not quite"}</span>The answer is <b>${q.o[0]}</b>. ${q.f}`; }
  $("feedback").innerHTML = html; $("score").textContent = S.score; setRunes(S.streak);
  $("prog").style.width = ((S.i + 1) / S.qs.length * 100) + "%";
  const nb = $("nextBtn"); nb.textContent = S.i === S.qs.length - 1 ? "See your rank" : "Next"; nb.classList.remove("hidden"); nb.focus({preventScroll: true});
}
function next(){ if (!S || !S.done) return; S.i++; if (S.i >= S.qs.length) finish(); else load(); }
$("opts").addEventListener("click", e => { const b = e.target.closest(".opt"); if (b && S && !S.done) resolve(+b.dataset.k); });
$("nextBtn").addEventListener("click", next);
$("startBtn").addEventListener("click", start);
$("againBtn").addEventListener("click", start);
$("lEye").addEventListener("click", () => { if (!S || S.done || !S.life.eye) return; S.life.eye = 0; $("lEye").disabled = true;
  const btns = [...document.querySelectorAll("#opts .opt")]; shuffle(S.opts.map((o, k) => k).filter(k => !S.opts[k].ok)).slice(0, 2).forEach(k => { btns[k].classList.add("gone"); btns[k].disabled = true; }); });
$("lTime").addEventListener("click", () => { if (!S || S.done || !S.life.time) return; S.life.time = 0; $("lTime").disabled = true; S.base += 10; toast("+10 seconds"); });
$("lSkip").addEventListener("click", () => { if (!S || S.done || !S.life.skip) return; S.life.skip = 0; clearInterval(S.timer);
  if (S.extra.length){ S.qs[S.i] = S.extra.shift(); toast("Bifröst: a new question"); load(); }
  else { S.done = true; S.i++; toast("Bifröst: skipped"); S.i >= S.qs.length ? finish() : load(); } });

function finish(){
  S.over = true; clearInterval(S.timer); show("sEnd"); $("prog").style.width = "100%";
  const acc = S.answered ? Math.round(S.correct / S.answered * 100) : 0;
  const R = acc >= 90 ? ["Valhalla Bound", "#3ef0b8", "Odin himself would buy you a mead. That's a near-perfect run."] :
            acc >= 70 ? ["Jarl of the Purple", "#FFC62F", "A true chieftain of fandom. You know the lore and the box scores."] :
            acc >= 50 ? ["Shieldbearer", "#9b6bff", "A solid raid. A few more seasons in the mead hall and you'll make jarl."] :
            acc >= 30 ? ["Longship Rower", "#c7a8ff", "You're on the boat and you're pulling your weight. Keep rowing."] :
                        ["Suspected Packers Spy", "#ff6b6b", "The Gjallarhorn calls everyone home eventually. Try another raid."];
  $("endRank").textContent = R[0]; $("endRank").style.color = R[1]; $("endMsg").textContent = R[2] + (S.score > best && best > 0 ? " New session best!" : "");
  best = Math.max(best, S.score);
  $("endAcc").textContent = acc + "%"; $("endStreak").textContent = S.best;
  $("endAvg").textContent = (S.times.reduce((a, b) => a + b, 0) / Math.max(1, S.times.length)).toFixed(1) + "s";
  const t0 = performance.now(), tgt = S.score; (function f(t){ const p = Math.min(1, (t - t0) / 1400); $("endScore").textContent = Math.round(tgt * (1 - Math.pow(1 - p, 3))).toLocaleString(); if (p < 1) requestAnimationFrame(f); })(t0);
  // shield
  const sh = $("endShield"), runes = ["fehu","uruz","tiwaz","algiz","sowilo","dagaz","ingwaz","othala"];
  sh.innerHTML = `<defs><linearGradient id="shG" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${R[1]}"/><stop offset="1" stop-color="#2a144d"/></linearGradient></defs>
    <g class="spin">${runes.map((r, i) => { const a = i / runes.length * Math.PI * 2; return `<use href="#r-${r}" x="${85 + Math.cos(a) * 74 - 6}" y="${95 + Math.sin(a) * 74 - 9}" width="12" height="18" style="color:${R[1]}" opacity=".7"/>`; }).join("")}</g>
    <path d="M85 26L136 44V88C136 120 114 142 85 154C56 142 34 120 34 88V44Z" fill="url(#shG)" stroke="#FFC62F" stroke-width="3"/>
    <path d="M85 26V154M34 70H136" stroke="rgba(7,6,13,.35)" stroke-width="6"/>
    <circle cx="85" cy="78" r="16" fill="#e8e2f7" stroke="#2a144d" stroke-width="3"/>
    <text x="85" y="136" text-anchor="middle" font-family="Big Shoulders, Impact" font-weight="900" font-size="22" fill="#fff">${acc}%</text>`;
  $("review").innerHTML = S.missed.length ? `<h4>Answers to remember</h4>` + S.missed.map(m => `<div>${m.q}<br><b>${m.a}</b></div>`).join("") : `<h4 style="text-align:center;color:var(--aurora)">A flawless raid. Nothing to review.</h4>`;
  burst(innerWidth / 2, innerHeight * .4, 140); setTimeout(() => burst(innerWidth * .2, innerHeight * .5, 70), 250); setTimeout(() => burst(innerWidth * .8, innerHeight * .5, 70), 500);
  horn(); $("againBtn").focus({preventScroll: true});
}
$("copyBtn").addEventListener("click", async () => { if (!S) return;
  const txt = `I scored ${S.score.toLocaleString()} in The Purple Saga Vikings trivia: ${$("endRank").textContent}, ${S.correct}/${S.answered} correct, best streak ${S.best}. Skol!`;
  try { await navigator.clipboard.writeText(txt); toast("Result copied. Skol!"); } catch(e){ toast("Copy isn't available here"); } });
resetSide();

/* ---------- SKOL CHANT ---------- */
(() => {
  const ap = $("approach"), skin = $("skinC"), waves = $("waves"), judge = $("judge");
  let C = null, bestC = 0;
  function judgeShow(txt, col){ judge.textContent = txt; judge.style.color = col; judge.classList.remove("show"); void judge.offsetWidth; judge.classList.add("show"); }
  function shock(col){ const c = el("circle", {cx: 200, cy: 200, r: 120, fill: "none", stroke: col, "stroke-width": 6}, waves);
    if (reduce){ setTimeout(() => c.remove(), 200); return; }
    const t0 = performance.now(); (function f(t){ const p = (t - t0) / 600; c.setAttribute("r", 120 + p * 90); c.setAttribute("opacity", 1 - p); if (p < 1) requestAnimationFrame(f); else c.remove(); })(t0); }
  function pulseSkin(){ skin.setAttribute("r", 104); setTimeout(() => skin.setAttribute("r", 110), 90); }
  function startC(){
    ac(); const now = performance.now(); let gap = 1150, t = now + 900; const ev = [];
    for (let i = 0; i < 12; i++){ ev.push({drum: t, target: t + gap, gap, hit: false, judged: false, drummed: false}); t += gap * 2; gap = Math.max(330, gap * .86); }
    C = {ev, score: 0, perfect: 0, meter: 0, end: t, running: true}; $("cStart").disabled = true; $("cStart").textContent = "Chanting…";
    $("cScore").textContent = 0; $("cPerfect").textContent = 0; $("cMeter").style.width = "0%"; $("cHint").textContent = "Wait for the drum…";
    requestAnimationFrame(loop);
  }
  function loop(now){
    if (!C || !C.running) return;
    let active = null;
    for (const e of C.ev){
      if (!e.drummed && now >= e.drum){ e.drummed = true; boom(); pulseSkin(); flash("b1"); $("cHint").textContent = "Clap when the ring closes!"; }
      if (!e.judged && now > e.target + 230){ e.judged = true; judgeShow("Miss", "#ff6b6b"); }
      if (!active && !e.judged && now >= e.drum - 50) active = e;
    }
    if (active){ const p = Math.min(1, Math.max(0, (now - active.drum) / active.gap)); ap.setAttribute("r", 196 - p * 74); ap.setAttribute("opacity", .25 + p * .75); }
    else ap.setAttribute("opacity", 0);
    if (now > C.end + 300){ endC(); return; }
    requestAnimationFrame(loop);
  }
  function flash(id){ const b = $(id); b.classList.add("on"); setTimeout(() => b.classList.remove("on"), 160); }
  function tap(){
    if (!C || !C.running){ return; }
    const now = performance.now(); clap(.45); flash("b2");
    const e = C.ev.find(e => !e.judged && Math.abs(now - e.target) < 230);
    if (!e){ judgeShow("Early!", "#c7a8ff"); return; }
    e.judged = true; const d = Math.abs(now - e.target); let pts, txt, col;
    if (d < 70){ pts = 100; txt = "Perfect"; col = "#3ef0b8"; C.perfect++; shock("#3ef0b8"); }
    else if (d < 140){ pts = 70; txt = "Great"; col = "#FFC62F"; shock("#FFC62F"); }
    else { pts = 40; txt = "Good"; col = "#9b6bff"; shock("#9b6bff"); }
    C.score += pts; C.meter = Math.min(100, C.meter + pts / 12);
    $("cScore").textContent = C.score; $("cPerfect").textContent = C.perfect; $("cMeter").style.width = C.meter + "%"; judgeShow(txt, col); pulseSkin();
  }
  function endC(){
    C.running = false; ap.setAttribute("opacity", 0); bestC = Math.max(bestC, C.score); $("cBest").textContent = bestC;
    $("cStart").disabled = false; $("cStart").textContent = "Chant again";
    const pct = Math.round(C.score / 1200 * 100);
    $("cHint").textContent = pct >= 85 ? `${pct}%: U.S. Bank Stadium is shaking!` : pct >= 55 ? `${pct}%: Loud. The opponent is calling a timeout.` : `${pct}%: The upper deck didn't hear you. Try again!`;
    if (pct >= 55){ const r = $("drumSvg").getBoundingClientRect(); burst(r.left + r.width / 2, r.top + r.height / 2, 120); horn(); }
  }
  $("cStart").addEventListener("click", startC);
  $("drumHit").addEventListener("pointerdown", e => { e.preventDefault(); if (!C || !C.running){ clap(.3); pulseSkin(); return; } tap(); });
  addEventListener("keydown", e => { if (C && C.running && (e.code === "Space" || e.key === " ")){ e.preventDefault(); tap(); } }, true);
  window.__chantRunning = () => C && C.running;
})();

/* ---------- Trivia keyboard ---------- */
addEventListener("keydown", e => {
  if (!S || S.over || $("sQ").classList.contains("hidden") || (window.__chantRunning && window.__chantRunning())) return;
  if (e.target.closest && e.target.closest("input")) return;
  const r = $("stage").getBoundingClientRect(); if (r.bottom < 0 || r.top > innerHeight) return;
  if (!S.done && /^[1-4]$/.test(e.key)){ const b = document.querySelector(`#opts .opt[data-k="${+e.key - 1}"]`); if (b && !b.disabled) resolve(+e.key - 1); }
  else if (S.done && e.key === "Enter" && document.activeElement !== $("nextBtn")){ e.preventDefault(); next(); }
});
})();
</script>
</body>
</html>