:root {
  --paper: #f6f3ea;
  --ink: #1d1f24;
  --gold: #ffd84a;
  --red: #c8372d;
  --green: #2f8a4b;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: transparent; overflow: hidden; font-family: var(--font); color: #fff; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; }
img { -webkit-user-drag: none; }

/* One vertical 9:16 stage, scaled to fit wherever it is shown. */
.stage { position: absolute; left: 50%; top: 50%; width: 900px; height: 1600px; transform-origin: center; overflow: hidden; background: #000; border-radius: 28px; cursor: pointer; }
.frame { position: absolute; inset: 0; isolation: isolate; }
.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; will-change: transform; }
.shot.on { opacity: 1; }
/* Slow camera drift on every shot, so nothing sits still. */
.shot.in { animation: var(--move) var(--dur, 7s) linear both; }
@keyframes zoomin { from { transform: scale(1.02); } to { transform: scale(1.14); } }
@keyframes zoomout { from { transform: scale(1.16); } to { transform: scale(1.03); } }
@keyframes panl { from { transform: scale(1.12) translateX(2.5%); } to { transform: scale(1.12) translateX(-2.5%); } }
@keyframes panr { from { transform: scale(1.12) translateX(-2.5%); } to { transform: scale(1.12) translateX(2.5%); } }
@keyframes tiltup { from { transform: scale(1.12) translateY(-3%); } to { transform: scale(1.12) translateY(2.5%); } }
@keyframes punch { 0% { transform: scale(1.45); } 12% { transform: scale(1.08); } 100% { transform: scale(1.16); } }
@keyframes shake { 0%, 100% { translate: 0 0; } 20% { translate: -14px 6px; } 40% { translate: 12px -8px; } 60% { translate: -8px -4px; } 80% { translate: 8px 6px; } }
.frame.shake { animation: shake .32s linear; }
.flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .28s ease-out; }
@keyframes flash { from { opacity: .75; } to { opacity: 0; } }


/* ---------- Captions: a few words at a time, in step with the voice ---------- */
/* ---------- The dialogue box: chunky, like an old browser game ---------- */
.box { position: absolute; left: 34px; right: 34px; bottom: 40px; min-height: 250px; padding: 44px 40px 40px; background: #fff8ea; border: 8px solid var(--ink); border-radius: 40px; box-shadow: 0 12px 0 var(--ink); color: var(--ink); opacity: 0; transform: translateY(40px); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1); cursor: default; }
.box.show { opacity: 1; transform: none; }
.who { position: absolute; left: 34px; top: -40px; height: 64px; padding: 0 26px; display: none; align-items: center; background: var(--tab, var(--ink)); color: #fff; border: 8px solid var(--ink); border-radius: 22px; font-size: 28px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.who.show { display: flex; }
.cap { margin: 0; font-size: 46px; font-weight: 700; line-height: 1.22; letter-spacing: -.01em; }
.cap.char::before { content: "\201C"; } .cap.char.full::after { content: "\201D"; }

/* ---------- Things drawn over a shot ---------- */
#overlays { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#overlays > * { position: absolute; translate: -50% -50%; pointer-events: none; }
.tag { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 12px 28px 16px; text-align: center; white-space: nowrap; box-shadow: 0 10px 0 rgba(0, 0, 0, .28); rotate: var(--tilt, -4deg); animation: pop .32s cubic-bezier(.3, 1.7, .5, 1) both; }
.tag.gold { background: var(--gold); }
.tag small { display: block; font-size: 24px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; opacity: .65; }
.tag b { display: block; font-size: 92px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
@keyframes pop { from { opacity: 0; scale: .2; } }
.stamp { border: 10px solid currentColor; border-radius: 14px; padding: 10px 26px; font-size: 84px; font-weight: 900; letter-spacing: .08em; background: rgba(246, 243, 234, .94); rotate: var(--tilt, -8deg); white-space: nowrap; animation: slam .3s cubic-bezier(.5, 0, .9, .4) both; }
.stamp.red { color: var(--red); } .stamp.green { color: var(--green); }
@keyframes slam { from { opacity: 0; scale: 3.2; } 70% { opacity: 1; } }
.big { font-size: 112px; font-weight: 900; color: #fff; white-space: nowrap; text-shadow: 0 8px 0 rgba(0, 0, 0, .5); animation: pop .3s cubic-bezier(.3, 1.7, .5, 1) both; }
.big em { font-style: normal; color: var(--gold); }
.chip { background: var(--ink); color: var(--gold); font-size: 34px; font-weight: 800; letter-spacing: .04em; padding: 12px 22px; border-radius: 999px; white-space: nowrap; rotate: var(--tilt, 0deg); animation: pop .28s cubic-bezier(.3, 1.7, .5, 1) both; }
.chalk { font-family: "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive; font-size: 62px; color: #f4f1e4; white-space: nowrap; rotate: -3deg; animation: write .9s steps(14) both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Opening panel ---------- */
.opener { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; }
.opener.gone { opacity: 0; }
.quote { position: absolute; left: 56px; right: 56px; top: 120px; background: #fff; color: var(--ink); border: 8px solid var(--ink); border-radius: 46px; padding: 40px 46px 46px; font-size: 68px; font-weight: 800; line-height: 1.08; letter-spacing: -.015em; box-shadow: 14px 14px 0 var(--ink); rotate: -1.5deg; }
.quote em { font-style: italic; color: var(--red); }
.quote::after { content: ""; position: absolute; left: 44%; bottom: -74px; border: 38px solid transparent; border-top-color: var(--ink); border-right-width: 10px; }
.hint { position: absolute; left: 0; right: 0; bottom: 120px; text-align: center; font-size: 34px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; animation: blink 1.4s ease-in-out infinite; text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .shot.in, .frame.shake, .flash.go { animation: none !important; } }

/* ---------- Charts, drawn in the page for the leaderboard part ---------- */
.chart { position: absolute; inset: 0; z-index: 3; display: none; padding: 150px 60px 0; background: #fff8ea; color: var(--ink); background-image: radial-gradient(rgba(29, 31, 36, .12) 3px, transparent 3.5px); background-size: 44px 44px; }
.chart.on { display: block; animation: chartin .3s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes chartin { from { scale: 1.12; opacity: 0; } }
.chart h2 { margin: 0 0 12px; font-size: 76px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.chart h3 { margin: 0 0 46px; font-size: 32px; font-weight: 700; opacity: .65; }
.chart .note { position: absolute; left: 60px; top: 1130px; font-size: 22px; font-weight: 600; opacity: .5; }
.rows { display: grid; gap: 16px; }
.rows div { display: flex; align-items: center; gap: 22px; padding: 15px 28px; background: #fff; border: 7px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); font-size: 48px; font-weight: 800; animation: rowin .35s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * .22s + .15s); }
.rows div i { flex: none; width: 66px; height: 50px; background: var(--gold); clip-path: polygon(0 100%, 0 20%, 25% 60%, 50% 0, 75% 60%, 100% 20%, 100% 100%); }
.rows div b { margin-left: auto; font-size: 26px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--gold); padding: 8px 14px; border-radius: 12px; }
@keyframes rowin { from { opacity: 0; transform: translateX(-70px) scale(.8); } }
.bars { position: relative; height: 760px; display: flex; align-items: flex-end; gap: 22px; padding: 0 6px; border-bottom: 8px solid var(--ink); }
.bars .ceil { position: absolute; left: -10px; right: -10px; top: 0; border-top: 8px dashed var(--red); }
.bars .ceil span { position: absolute; right: 0; top: -52px; font-size: 30px; font-weight: 900; color: var(--red); letter-spacing: .06em; }
.bars div.bar { flex: 1; height: var(--h); background: var(--c); border: 7px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0; position: relative; transform-origin: bottom; animation: grow var(--t, 1.6s) cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * .08s + .2s); }
.bars div.bar b { position: absolute; left: 0; right: 0; top: 14px; text-align: center; font-size: 40px; font-weight: 900; color: #fff; animation: fadein .3s both; animation-delay: calc(var(--i) * .08s + 1.5s); }
.bars div.bar u { position: absolute; left: 0; right: 0; bottom: -62px; text-align: center; font-size: 30px; font-weight: 800; text-decoration: none; }
@keyframes grow { from { transform: scaleY(.04); } }
@keyframes fadein { from { opacity: 0; } }
.line { display: block; width: 100%; height: 760px; overflow: visible; }
.line .curve { fill: none; stroke: var(--ink); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: drawline 1.5s .2s ease-out forwards; }
@keyframes drawline { to { stroke-dashoffset: 0; } }
/* Captured for video: square corners, no tap hint. */
body.render .stage { border-radius: 0; }
body.render .hint { display: none; }
