/* Not My Event: the look of "The Birthday Emergency" (public/templates/birthday-emergency.html). One page that scrolls DOWN through five places of one investigation. Each scene is a section
   with a pinned picture behind it (.stage, drawn by emergency-art.js for the size of the screen) and its words and toys in front (.flow), which simply scroll: nothing is ever clipped on a
   small phone, and nothing has to be finished to go on. The scroll frame in emergency.js writes only transform and opacity on a few layers. Five palettes: navy and green (alert), mint and
   cream (lab), walnut and amber (office), violet and gold (party), black and ivory (summons). */
:root { --ac: #D9B25A; --ac2: #FFF0B8; --mint: #5CFFB0; --red: #FF4D5E; --mono: 'Share Tech Mono', ui-monospace, Menlo, Consolas, monospace; --head: 'Anton', 'Arial Narrow', Impact, sans-serif; --type: 'Special Elite', 'Courier New', monospace; --serif: 'Playfair Display', Georgia, serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #0A1024; color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.45; overflow-x: clip; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 9100; background: #fff; color: #000; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid #FFD36A; outline-offset: 3px; }

/* ---------- the two controls at the top, the details pill, the sound hint ---------- */
#menu-wrap { position: fixed; left: 10px; top: 10px; z-index: 9040; }
#b-menu { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(8, 10, 24, .78); color: #fff; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
#menu { margin-top: 8px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(8, 10, 24, .95); border: 1px solid rgba(255, 255, 255, .25); min-width: 210px; }
#menu button { min-height: 44px; text-align: left; padding: 0 12px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; font-size: 15px; }
#menu button[aria-pressed="true"] { background: var(--mint); color: #04130C; }
#ev-pill { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9030; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(8, 10, 24, .8); color: #fff; font-size: 13px; letter-spacing: .04em; }
#snd-hint { position: fixed; left: 50%; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 48px); transform: translateX(-50%); z-index: 9030; padding: 6px 12px; border-radius: 14px; background: rgba(8, 10, 24, .8); font-size: 12px; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
#snd-hint.gone { opacity: 0; }
.bub { position: fixed; z-index: 9020; transform: translate(-50%, -110%); max-width: 240px; padding: 9px 12px; border-radius: 12px; background: #fff; color: #16121E; font-size: 14px; line-height: 1.3; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); animation: bub 2.5s ease both; pointer-events: none; }
@keyframes bub { 0% { opacity: 0; transform: translate(-50%, -90%); } 10%, 85% { opacity: 1; transform: translate(-50%, -110%); } 100% { opacity: 0; } }

/* ---------- a scene: a pinned picture, and the words in front ---------- */
.sc { position: relative; }
#s1 { background: #060A18; } #s2 { background: #BFEBD6; } #s3 { background: #1E1108; } #s4 { background: #1C0838; } #s5 { background: #0B0A0A; }
.stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; z-index: 0; }
.flow { position: relative; z-index: 1; margin-top: -100vh; margin-top: -100lvh; }
/* the words lie over the picture, but only the words take taps: the gaps between them let a tap through to the things in the picture */
.flow, .beat { pointer-events: none; }
.beat > * { pointer-events: auto; }
.ly, .ov { position: absolute; inset: 0; pointer-events: none; }
.ly svg { display: block; width: 100%; height: 100%; }
.ov { opacity: 0; }
.hit { pointer-events: auto; cursor: pointer; }
.hit:focus-visible { outline: 3px solid #FFD36A; }
.beat { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 76px 16px 70px; text-align: center; }
.beat.out { min-height: 70vh; justify-content: flex-end; padding-bottom: 22vh; }
.cue { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 7px 14px; border-radius: 16px; background: rgba(8, 10, 24, .7); color: #DDE6F5; }
.cue::after { content: '  ↓'; }
.cue.light { background: rgba(255, 255, 255, .14); }
.linkish { background: none; border: 0; padding: 10px 8px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; color: inherit; opacity: .9; }
.linkish.light { color: #fff; }
.minor { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.fine { font-size: 12px; opacity: .75; }
.status { font-family: var(--mono); font-size: 14px; letter-spacing: .06em; }
.unit { width: 100%; max-width: 580px; padding: 22px 18px 14px; border-radius: 18px; display: grid; gap: 14px; justify-items: center; }
.unit h2 { font-family: var(--head); font-weight: 400; font-size: clamp(26px, 7vw, 38px); letter-spacing: .03em; line-height: 1.05; text-transform: uppercase; }
.head { font-family: var(--head); font-weight: 400; font-size: clamp(30px, 8.4vw, 60px); line-height: 1.04; letter-spacing: .02em; text-transform: uppercase; max-width: 15em; }
.lede { font-size: clamp(16px, 4.4vw, 20px); max-width: 30em; }

/* ---------- 1. the Emergency Alert ---------- */
#s1 .kick { font-family: var(--mono); font-size: clamp(12px, 3.5vw, 16px); letter-spacing: .14em; color: #FFC857; max-width: 26em; }
.monitor { width: 100%; max-width: 700px; padding: 10px 12px 8px; border-radius: 18px; background: linear-gradient(180deg, #8E9BB4, #4A5672 46%, #5E6B88 54%, #2A3350); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .5); }
.m-top, .m-bot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: #0A1024; padding: 0 4px 7px; }
.m-bot { padding: 7px 4px 0; justify-content: flex-start; font-size: 10px; color: #101936; }
.m-bot span { margin-left: auto; opacity: .8; }
.dot, .lamp { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); vertical-align: baseline; animation: blink 2s steps(2, jump-none) infinite; }
.lamp.g { background: #2BD98B; animation-delay: -.6s; } .lamp.y { background: #FFC857; animation-delay: -1.2s; } .lamp.r { animation-delay: -.3s; }
@keyframes blink { from { opacity: 1; } to { opacity: .3; } }
.screen { position: relative; aspect-ratio: 16 / 9; min-height: 190px; max-height: 52vh; width: 100%; border-radius: 10px; overflow: hidden; background: #03130C; box-shadow: inset 0 0 0 2px #06080F, inset 0 0 40px rgba(0, 0, 0, .8); }
#ecg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(92, 255, 176, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 255, 176, .1) 1px, transparent 1px), linear-gradient(rgba(92, 255, 176, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 255, 176, .05) 1px, transparent 1px); background-size: 100% 25%, 12.5% 100%, 100% 5%, 2.5% 100%; }
.readout { position: absolute; left: 4%; top: 6%; max-width: 78%; text-align: left; font-family: var(--mono); color: var(--mint); font-size: clamp(12px, 3.3vw, 18px); letter-spacing: .08em; line-height: 1.5; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; padding: 6px 9px; border-radius: 8px; background: rgba(3, 19, 12, .78); }
.monitor.found .readout { opacity: 1; transform: none; }
.readout .big span { display: inline-block; font-family: var(--head); font-size: clamp(22px, 7vw, 44px); letter-spacing: .05em; line-height: 1.1; color: #fff; background: var(--red); padding: 2px 10px 3px; border-radius: 6px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
.readout b { color: #fff; font-weight: 400; overflow-wrap: anywhere; }
.standby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(2, 8, 6, .92); transition: opacity .5s; padding: 10px; }
.standby .in { font-family: var(--mono); font-size: 13px; letter-spacing: .2em; color: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.monitor.live .standby { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.btn-alert { min-height: 52px; padding: 8px 22px; border-radius: 12px; border: 2px solid #fff; background: var(--red); color: #fff; font-family: var(--head); font-size: clamp(18px, 5vw, 24px); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 5px 0 #8E1220; }
.btn-alert:active { transform: translateY(3px); box-shadow: 0 2px 0 #8E1220; }
.btn-alert.big { font-size: clamp(21px, 6.2vw, 32px); padding: 12px 22px; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.standby .linkish { color: #B7C3DA; }
.caption { max-width: 32em; font-size: clamp(15px, 4.2vw, 19px); padding: 9px 14px; border-radius: 12px; background: rgba(8, 10, 24, .78); opacity: 0; transition: opacity .5s; }
.caption .who { font-family: var(--mono); font-size: .8em; letter-spacing: .1em; color: #FFC857; }
.hero.said .caption { opacity: 1; }
#cue1 { opacity: 0; transition: opacity .5s; } .hero.said #cue1 { opacity: 1; }
.unit.dark { background: rgba(10, 16, 36, .92); border: 2px solid #4A5672; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.unit .how { font-size: 15px; color: #C6D0E6; }
.panels { display: grid; gap: 10px; width: 100%; grid-template-columns: 1fr; }
@media (min-width: 600px) { .panels { grid-template-columns: repeat(3, 1fr); } }
.panel { border-radius: 12px; border: 2px solid #2A3766; background: #050914; padding: 8px; display: grid; gap: 7px; align-content: start; transition: border-color .3s; }
.p-btn { min-height: 54px; width: 100%; border-radius: 9px; border: 0; background: #121A3A; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-family: var(--mono); letter-spacing: .06em; text-align: left; }
.p-name { font-size: 14px; color: #fff; }
.p-state { font-size: 11px; padding: 3px 7px; border-radius: 8px; background: #2A3766; color: #B7C3DA; white-space: nowrap; }
.p-bar { height: 6px; border-radius: 3px; background: #121A3A; overflow: hidden; }
.p-bar i { display: block; height: 100%; background: var(--mint); transform: scaleX(0); transform-origin: 0 50%; }
.panel.run .p-bar i { animation: fill 1.5s cubic-bezier(.3, 0, .6, 1) forwards; }
.panel.run .p-state { background: #FFC857; color: #1A1200; }
.panel.ok { border-color: var(--mint); }
.panel.ok .p-bar i { transform: none; }
.panel.ok .p-state { background: var(--mint); color: #04130C; }
@keyframes fill { to { transform: none; } }
.p-out { font-family: var(--mono); font-size: 14px; line-height: 1.35; color: var(--mint); text-align: left; min-height: 1.35em; }
.done-line { font-family: var(--mono); color: #FFC857; font-size: 15px; }

/* ---------- 2. the Age Verification Lab ---------- */
#s2 { color: #1D2B33; }
#s2 .cue { background: rgba(255, 253, 244, .88); color: #1D2B33; }
.plate { font-family: var(--mono); letter-spacing: .2em; font-size: clamp(12px, 3.4vw, 15px); padding: 8px 16px; border-radius: 8px; background: linear-gradient(180deg, #F4F8FA, #AEBBC6 50%, #7E8C99 56%, #D5DEE5); color: #1D2B33; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
#s2 .head { color: #17695B; text-shadow: 0 2px 0 #fff; }
#s2 .lede { background: rgba(255, 253, 244, .86); padding: 8px 14px; border-radius: 12px; }
.unit.lab { background: #FFFDF4; border: 3px solid #1F8A78; box-shadow: 0 8px 0 #63D6B4, 0 20px 40px rgba(20, 80, 60, .25); }
.unit.lab h2 { color: #17695B; }
.conf { display: grid; justify-items: center; gap: 2px; }
.dial { width: min(210px, 60vw); }
.dial svg { display: block; width: 100%; height: auto; }
#dx-needle { transform: rotate(-88deg); transition: transform .9s cubic-bezier(.3, 1.5, .5, 1); }
.conf-t { font-family: var(--mono); font-size: 14px; letter-spacing: .05em; }
.conf-t b { color: #C8412E; }
#quiz-run { display: grid; gap: 12px; width: 100%; justify-items: center; }
.q-count { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #5A6B74; }
.q-text { font-size: clamp(18px, 5vw, 23px); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.q-text:focus { outline: none; }
.answers { display: grid; gap: 9px; width: 100%; grid-template-columns: 1fr; }
@media (min-width: 540px) { .answers { grid-template-columns: 1fr 1fr; } }
.ans-b { min-height: 54px; padding: 9px 12px; border-radius: 12px; border: 2px solid #1F8A78; background: #F1FBF6; color: #1D2B33; font-size: 16px; line-height: 1.25; box-shadow: 0 4px 0 #1F8A78; transition: transform .12s, box-shadow .12s, background .2s; }
.ans-b:active { transform: translateY(3px); box-shadow: 0 1px 0 #1F8A78; }
.ans-b[aria-pressed="true"] { background: #FF7A66; border-color: #9C2F1E; color: #fff; box-shadow: 0 1px 0 #9C2F1E; transform: translateY(3px) rotate(-1deg); animation: thunk .3s ease; }
.ans-b:disabled:not([aria-pressed="true"]) { opacity: .45; box-shadow: none; }
@keyframes thunk { 0% { transform: scale(1.12) rotate(-3deg); } 100% { transform: translateY(3px) rotate(-1deg); } }
.q-fb { min-height: 2.6em; font-size: 16px; color: #17695B; font-weight: 600; max-width: 28em; }
.btn-lab { min-height: 50px; padding: 8px 24px; border-radius: 25px; border: 0; background: #1F8A78; color: #fff; font-family: var(--head); font-size: 20px; letter-spacing: .05em; text-transform: uppercase; box-shadow: 0 4px 0 #125848; }
#quiz-end { width: 100%; display: grid; justify-items: center; overflow: hidden; padding-bottom: 6px; }
.slot { width: min(100%, 440px); height: 14px; border-radius: 7px; background: linear-gradient(180deg, #33414D, #7E8C99); position: relative; z-index: 2; }
.report { position: relative; width: min(94%, 410px); margin-top: -4px; padding: 20px 16px 14px; background: #fff; border: 1px solid #D5DEE5; border-top: 0; text-align: left; font-family: var(--type); box-shadow: 0 8px 18px rgba(0, 0, 0, .12); animation: print 1.1s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes print { from { transform: translateY(-100%); } to { transform: none; } }
.report h3 { font-size: 19px; font-weight: 400; margin-bottom: 8px; padding-right: 6px; }
.report h3:focus { outline: none; }
.report dl { display: grid; gap: 7px; font-size: 14.5px; line-height: 1.35; }
.report dt { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #5A6B74; }
.report dd { overflow-wrap: anywhere; }
.report .fine { margin-top: 10px; font-family: system-ui, sans-serif; }
/* the stamp lands under the findings, never on top of the words */
.report { display: flex; flex-direction: column; }
.report .fine { order: 3; }
.stamp { order: 2; align-self: center; margin: 14px 0 2px; font-family: var(--head); font-size: clamp(20px, 6vw, 27px); letter-spacing: .06em; color: #C8242F; border: 4px solid #C8242F; border-radius: 8px; padding: 0 9px; transform: rotate(-11deg); opacity: .88; animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) 1s both; background: rgba(255, 255, 255, .75); z-index: 1; }
@keyframes stamp { from { opacity: 0; transform: rotate(-11deg) scale(2.6); } to { opacity: .88; transform: rotate(-11deg) scale(1); } }
.sheet { opacity: 1; }
.sheet i, .sheet b { position: absolute; left: 50%; top: 0; width: min(74vw, 440px); height: 62%; margin-left: calc(min(74vw, 440px) / -2); border-radius: 4px; }
.sheet i { background: repeating-linear-gradient(180deg, transparent 0 26px, #D5DEE5 26px 28px) #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.sheet b { background: #D9B46E; border-radius: 4px 14px 4px 4px; box-shadow: inset 0 0 0 3px #C9A15A; opacity: 0; }
.sheet b::before { content: 'CASE FILE'; position: absolute; left: 10%; top: 16%; font: 400 clamp(18px, 5vw, 28px) var(--type); color: #7A1E24; border: 3px solid #7A1E24; padding: 2px 10px; transform: rotate(-6deg); }
.sheet { transform: translateY(-110%); }

/* ---------- 3. the Birthday Investigation ---------- */
#s3 { color: #F3E6C8; }
.casetag { font-family: var(--type); font-size: clamp(12px, 3.4vw, 15px); letter-spacing: .1em; padding: 6px 12px; background: #F3E6C8; color: #7A1E24; transform: rotate(-1.5deg); }
#s3 .head { font-family: var(--type); text-transform: none; font-size: clamp(25px, 6.6vw, 46px); line-height: 1.16; max-width: 17em; color: #FFE9BF; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
#s3 .lede { background: rgba(30, 17, 8, .78); padding: 8px 14px; border-radius: 10px; }
#s3 .cue { background: rgba(30, 17, 8, .82); color: #F3E6C8; }
.board { width: 100%; max-width: 780px; padding: 20px 14px 14px; border: 12px solid #5E3A20; border-radius: 8px; background: radial-gradient(circle at 20% 30%, rgba(90, 58, 30, .35) 0 2px, transparent 3px) 0 0 / 34px 30px, radial-gradient(circle at 70% 60%, rgba(255, 226, 170, .25) 0 2px, transparent 3px) 0 0 / 28px 36px, #B98A55; box-shadow: 0 16px 40px rgba(0, 0, 0, .55), inset 0 0 0 2px #3A2110, inset 0 6px 18px rgba(0, 0, 0, .35); display: grid; gap: 14px; }
.cards { display: grid; gap: 16px 12px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (min-width: 680px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.cards li { position: relative; display: grid; gap: 6px; }
.cards li:nth-child(odd) .ev { transform: rotate(-1.6deg); } .cards li:nth-child(even) .ev { transform: rotate(1.3deg); }
.cards li.wide { grid-column: 1 / -1; justify-items: center; }
.ev { position: relative; width: 100%; max-width: 330px; min-height: 120px; padding: 16px 8px 9px; border: 0; border-radius: 3px; background: #F3E6C8; color: #2E1A0E; box-shadow: 0 5px 12px rgba(0, 0, 0, .4); display: grid; gap: 4px; justify-items: center; font-family: var(--type); font-size: 14px; line-height: 1.2; transition: transform .2s; }
.ev::before { content: ''; position: absolute; left: 50%; top: -6px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FF9AA2, #C8242F 55%, #7A1016); box-shadow: 0 3px 4px rgba(0, 0, 0, .4); }
.ev svg { width: min(100%, 150px); height: auto; display: block; }
.ev .tag { font-size: 10px; letter-spacing: .12em; color: #7A1E24; }
.ev[aria-expanded="true"] { background: #FFF6DE; outline: 3px solid #C8242F; outline-offset: 0; }
.cards li:nth-child(n) .ev:hover, .cards li:nth-child(n) .ev[aria-expanded="true"] { transform: rotate(0) scale(1.02); }
.ev-cap { font-family: var(--type); font-size: 14.5px; line-height: 1.35; color: #2E1A0E; background: #FFE27A; padding: 9px 10px; border-radius: 2px; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); text-align: left; animation: capin .3s ease both; overflow-wrap: anywhere; }
@keyframes capin { from { opacity: 0; transform: translateY(-8px) rotate(-2deg); } }
.plan { margin-top: 8px; padding-top: 8px; border-top: 2px dashed #7A1E24; display: grid; gap: 4px; font-size: 13.5px; }
.red { background: #15110E; color: transparent; border-radius: 2px; user-select: none; }
.plan .go { color: #7A1E24; font-weight: 700; }
#s3 .status { color: #2E1A0E; background: rgba(243, 230, 200, .85); justify-self: center; padding: 4px 12px; border-radius: 3px; font-family: var(--type); }
.lampglow { transition: opacity .3s; } #s3.dim .lampglow { opacity: 0; }
.strings, .streams { opacity: 0; }
.strings svg, .streams svg { display: block; width: 100%; height: 100%; }

/* ---------- 4. the Emergency Celebration Protocol ---------- */
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#s4 .dark { background: #0B0A0A; }
#s4 .file { opacity: 0; }
.machine { font-family: var(--mono); font-size: clamp(17px, 5vw, 30px); letter-spacing: .08em; line-height: 1.25; padding: 12px 16px; border-radius: 10px; max-width: 22em; opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s; }
.m1 { background: rgba(8, 10, 24, .88); color: var(--red); border: 2px solid var(--red); }
.m2 { background: rgba(8, 10, 24, .88); color: #FFD36A; border: 2px solid #FFD36A; }
#s4.go1 .m1, #s4.go2 .m2 { opacity: 1; transform: none; }
.auth { opacity: 0; transform: rotate(-5deg) scale(2.4); }
.auth span { display: inline-block; font-family: var(--head); font-size: clamp(27px, 8.4vw, 64px); letter-spacing: .05em; line-height: 1.05; color: #fff; border: 5px solid #fff; border-radius: 12px; padding: 4px 16px 6px; background: rgba(224, 64, 154, .82); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
#s4.go3 .auth { opacity: 1; transform: rotate(-5deg) scale(1); transition: opacity .2s, transform .38s cubic-bezier(.2, 1.5, .4, 1); }
.unit.party { background: rgba(28, 8, 56, .9); border: 2px solid #FFD36A; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); }
.unit.party h2 { color: #FFD36A; }
#sum-list { width: 100%; display: grid; gap: 8px; text-align: left; }
#sum-list div { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; padding-bottom: 7px; border-bottom: 1px dashed rgba(255, 255, 255, .25); }
#sum-list dt { font-size: 15px; } #sum-list dd { font-family: var(--mono); color: #FFD36A; font-size: 15px; text-align: right; }

/* ---------- 5. the Official Party Summons ---------- */
#s5 .beat { padding-top: 90px; }
.doc { width: 100%; max-width: 580px; perspective: 1400px; color: #1A1612; font-family: var(--serif); filter: none; }
.fold { background: linear-gradient(90deg, rgba(120, 96, 40, .07), transparent 12%, transparent 88%, rgba(120, 96, 40, .09)), repeating-linear-gradient(0deg, rgba(120, 96, 40, .035) 0 1px, transparent 1px 4px), #F6EFDD; padding: 20px clamp(16px, 5vw, 38px); border-left: 3px double #B88A2A; border-right: 3px double #B88A2A; display: grid; gap: 9px; justify-items: center; transform-origin: 50% 0; backface-visibility: hidden; }
.f1 { border-top: 3px double #B88A2A; border-radius: 6px 6px 0 0; padding-top: 26px; }
.f3 { border-bottom: 3px double #B88A2A; border-radius: 0 0 6px 6px; padding-bottom: 26px; box-shadow: 0 24px 50px rgba(0, 0, 0, .6); }
.f2 { box-shadow: inset 0 9px 9px -9px rgba(60, 40, 0, .28), inset 0 -9px 9px -9px rgba(60, 40, 0, .28); }
.doc.fold .f2, .doc.fold .f3 { transform: rotateX(-86deg); opacity: 0; }
.doc.fold.open .f2 { transform: none; opacity: 1; transition: transform 1s cubic-bezier(.3, .7, .3, 1) .15s, opacity .3s .15s; }
.doc.fold.open .f3 { transform: none; opacity: 1; transition: transform 1s cubic-bezier(.3, .7, .3, 1) .75s, opacity .3s .75s; }
.seal { width: 84px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.seal svg { display: block; width: 100%; height: auto; }
#t-title { font-weight: 800; font-size: clamp(22px, 6.4vw, 36px); letter-spacing: .08em; line-height: 1.12; color: #6B4F12; overflow-wrap: anywhere; }
.sum1 { font-family: var(--mono); font-size: clamp(11px, 3.1vw, 14px); letter-spacing: .16em; }
.doc .who { font-weight: 800; font-size: clamp(34px, 10.5vw, 62px); line-height: 1.02; overflow-wrap: anywhere; }
.doc .age { font-style: italic; font-size: 17px; }
.doc .rule { width: 60%; height: 3px; background: linear-gradient(90deg, transparent, #B88A2A, transparent); }
.doc .when { font-weight: 600; font-size: clamp(17px, 4.8vw, 21px); }
.doc .where { font-size: clamp(15px, 4.3vw, 18px); overflow-wrap: anywhere; }
.doc .with { font-size: 15px; font-style: italic; }
.doc .quip { font-style: italic; font-size: clamp(16px, 4.6vw, 20px); color: #6B4F12; overflow-wrap: anywhere; }
.acts, .row-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.btn { min-height: 48px; padding: 8px 22px; border-radius: 26px; border: 2px solid var(--ac); background: var(--ac); color: #14100A; font-weight: 700; font-size: 16px; letter-spacing: .03em; font-family: system-ui, sans-serif; }
.btn.ghost { background: transparent; color: var(--ac); }
.doc .btn { border-color: #1A1612; background: #1A1612; color: #FFF0B8; } .doc .btn.ghost { background: transparent; color: #1A1612; }
.btn:disabled { opacity: .5; }

/* ---------- the details, the reply, the certificate ---------- */
.after { position: relative; z-index: 2; background: #0B0A0A; color: #F6EFDD; padding: 30px 16px calc(96px + env(safe-area-inset-bottom)); display: grid; gap: 34px; justify-items: center; }
.after section { width: 100%; max-width: 560px; display: grid; gap: 14px; }
.after h2 { font-family: var(--serif); font-weight: 800; font-size: 28px; color: var(--ac); }
.det { display: grid; gap: 11px; }
.det div { display: grid; gap: 1px; padding-bottom: 10px; border-bottom: 1px solid rgba(217, 178, 90, .25); }
.det dt { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ac); }
.det dd { font-size: 17px; overflow-wrap: anywhere; }
.row-acts { justify-content: flex-start; }
.going { font-family: var(--mono); font-size: 14px; color: var(--ac2); }
#rsvp-form { display: grid; gap: 14px; }
.f { display: grid; gap: 6px; font-size: 14px; color: #D8CFB8; }
.f input[type="text"], .f textarea { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(217, 178, 90, .6); background: #16130F; color: #fff; font: inherit; font-size: 16px; }
.ans { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ans label { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(217, 178, 90, .45); background: #16130F; font-size: 16px; cursor: pointer; }
.ans label:has(input:checked) { border-color: var(--ac); background: #241C0C; box-shadow: inset 0 0 0 1px var(--ac); }
.ans input { width: 20px; height: 20px; accent-color: var(--ac); flex: none; }
.ans b { color: var(--ac2); }
.step { display: flex; align-items: center; gap: 14px; }
.step button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--ac); background: transparent; color: var(--ac); font-size: 22px; }
.step output { min-width: 1.5em; text-align: center; font-size: 20px; color: #fff; }
#err { min-height: 1.3em; font-size: 14px; color: #D8CFB8; } #err.err { color: #FF9AA2; }
#done { display: grid; gap: 8px; padding: 18px; border-radius: 14px; border: 1px solid var(--ac); background: #16130F; }
#done-t { font-family: var(--head); font-weight: 400; font-size: 30px; letter-spacing: .04em; color: var(--ac2); } #done-t:focus { outline: none; }
#r-closed { padding: 14px; border-radius: 12px; background: #16130F; }
#cert { text-align: center; justify-items: center; padding: 24px 16px; border: 3px double var(--ac); border-radius: 10px; background: radial-gradient(ellipse at 50% 0, rgba(217, 178, 90, .16), transparent 70%), #12100C; }
#cert .c-top { font-family: var(--mono); letter-spacing: .24em; font-size: 12px; color: var(--ac); }
#cert h2 { font-size: clamp(26px, 7.4vw, 36px); line-height: 1.1; }
.c-rank { font-size: 18px; } .c-rank b { color: var(--ac2); } .c-why { font-style: italic; color: #D8CFB8; max-width: 26em; }
.foot { font-size: 12px; opacity: .6; text-align: center; max-width: 30em; }

/* ---------- the small motion in the pictures (slow, and never a strobe) ---------- */
.bcn { animation: breathe 2.6s ease-in-out infinite; } .bcn.b1 { animation-delay: -1.3s; }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.led.a { animation: blink 1.8s steps(2, jump-none) infinite; } .led.b { animation: blink 2.6s steps(2, jump-none) -1s infinite; }
.swp { animation: turn 4s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.ring.r1 ellipse { animation: dash 2.4s linear infinite; } .ring.r2 { animation: turn 9s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -44; } }
.ndl { animation: wander 3.2s ease-in-out infinite alternate; } .ndl.n1 { animation-duration: 4.1s; animation-delay: -2s; }
@keyframes wander { from { transform: rotate(-70deg); } to { transform: rotate(64deg); } }
.bbl { animation: rise 2.2s ease-in infinite; } .bbl.d { animation-delay: -1.1s; }
@keyframes rise { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-16px); opacity: 0; } }
.stm { animation: rise 3s ease-out infinite; } .stm.d { animation-delay: -1.5s; }
.blb.a { animation: blink 1.2s steps(2, jump-none) infinite; } .blb.b { animation: blink 1.2s steps(2, jump-none) -.6s infinite; }
.spot { animation: sway 7s ease-in-out infinite alternate; } .spot.s1 { animation-duration: 9s; animation-delay: -3s; } .spot.s2 { animation-duration: 8s; animation-delay: -5s; } .spot.s3 { animation-duration: 10s; animation-delay: -1s; }
@keyframes sway { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.flm { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .5s ease-in-out infinite alternate; } .flm.d { animation-delay: -.25s; }
@keyframes flick { from { transform: scale(.9, .94); } to { transform: scale(1.06, 1.1); } }
.flt { animation: float 5s ease-in-out infinite alternate; } .flt.d { animation-delay: -2.5s; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-14px); } }
.hit.tap { animation: tap .4s ease; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes tap { 40% { transform: scale(1.08); } }
/* a scene off the screen rests */
.sc.off .stage *, .sc.off .flow * { animation-play-state: paused !important; }

/* ---------- reduced motion: every word and control stays, the sweeping and bursting goes ---------- */
body.rm *, body.rm *::before, body.rm *::after { animation: none !important; transition: none !important; }
body.rm .ov, body.rm #s4 .file, body.rm #confetti { display: none; }
body.rm .machine, body.rm .auth { opacity: 1; transform: none; }
body.rm .auth { transform: rotate(-5deg); }
body.rm .caption, body.rm #cue1 { opacity: 1; }
body.rm .doc.fold .f2, body.rm .doc.fold .f3 { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (max-width: 380px) { .beat { padding-left: 10px; padding-right: 10px; } .unit { padding: 18px 12px 12px; } .board { padding: 16px 8px 10px; border-width: 9px; } }
