/* Not My Event: the look of "The Last Brain Cell" (public/templates/the-last-brain-cell.html). A tiny control room at night: ink black, warm cream, one electric
   coral (the cell itself, the alarms) and a muted mint (the instruments). Heavy block capitals for the alarms, an italic serif for the narrator, handwriting for the sticky note.
   The frame (controls, scenes, invitation, details, reply) is shared with the other five-scene invitations; this design's own pieces are at the end. */
:root { --ac: #FF5A4E; --ac2: #9FD8C4; --night: #17130F; --dusk: #3A2E24; --plum: #3A2E24; --cran: #B3261E; --red: #D8362B; --cream: #FBF3E0; --ink: #17130F; --ed: 'DynaPuff', Georgia, serif; --sans: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--cream); font-family: var(--sans); line-height: 1.45; overflow-x: clip; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { 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 #7FD4F5; 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, 248, 234, .4); background: rgba(23, 19, 15, .92); color: #fff; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
#menu { margin-top: 8px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(23, 19, 15, .98); border: 1px solid rgba(255, 248, 234, .25); min-width: 230px; }
#menu button { min-height: 44px; text-align: left; padding: 0 12px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; font-size: 15px; }
#menu button[aria-pressed="true"] { background: var(--ac); color: var(--ink); }
#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, 248, 234, .45); background: rgba(23, 19, 15, .94); 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(23, 19, 15, .94); color: #fff; font-size: 12px; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
#snd-hint.gone { opacity: 0; }

/* ---------- a scene: a pinned picture, and the words in front ---------- */
.sc { position: relative; background: var(--night); }
.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; }
.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%; overflow: visible; }
.ov { opacity: 0; z-index: 4; }
.beat { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 76px 16px 96px; text-align: center; }
.beat.tall { min-height: 120vh; justify-content: flex-start; padding-top: 15vh; }
.beat.top { justify-content: flex-start; padding-top: 84px; }
.beat.out { min-height: 26vh; justify-content: flex-end; padding-top: 0; padding-bottom: 9vh; } /* the next scene begins just under the cue: no empty screen between scenes */
.cue { font-weight: 900; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; padding: 7px 14px; border-radius: 16px; background: rgba(23, 19, 15, .9); color: #fff; }
.cue::after { content: '  ↓'; }
.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; background: rgba(23, 19, 15, .85); border-radius: 12px; }
.minor { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; }
.fine { font-size: 12.5px; opacity: .85; }
.fine.light { padding: 4px 12px; border-radius: 12px; background: rgba(23, 19, 15, .8); }
.plate { font-weight: 900; letter-spacing: .16em; font-size: clamp(11px, 3.1vw, 14px); padding: 8px 16px; border-radius: 20px; background: rgba(23, 19, 15, .9); color: var(--ac2); border: 1px solid var(--ac); }
.pre { font-family: var(--ed); font-weight: 600; letter-spacing: .5em; font-size: clamp(14px, 4vw, 20px); color: var(--ac2); margin-bottom: -10px; padding-left: .5em; }
.order { font-family: var(--ed); font-weight: 700; font-size: clamp(44px, 13vw, 104px); line-height: .98; max-width: 8em; color: var(--ac2); text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 34px rgba(255, 90, 78, .55); overflow-wrap: anywhere; }
/* the storyteller's lines */
.narr { font-family: var(--ed); font-style: italic; font-weight: 500; font-size: clamp(19px, 5.2vw, 26px); line-height: 1.25; max-width: 24em; padding: 9px 16px; border-radius: 14px; background: rgba(23, 19, 15, .8); color: var(--cream); overflow-wrap: anywhere; }
.narr.big { font-size: clamp(24px, 6.8vw, 40px); font-weight: 600; line-height: 1.15; max-width: 16em; }
.narr:empty { display: none; }
body.nonarr .narr:not(.key) { display: none; }
.btn-big { min-height: 56px; padding: 10px 26px; border-radius: 30px; border: 2px solid var(--ac2); background: linear-gradient(180deg, #4A3C30, #3A2E24); color: #fff; font-weight: 900; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.2; letter-spacing: .05em; box-shadow: 0 5px 0 #17130F, 0 0 24px rgba(255, 90, 78, .35); touch-action: manipulation; max-width: 100%; }
.btn-big:active { transform: translateY(3px); box-shadow: 0 2px 0 #17130F; }
.btn-big.champ { background: linear-gradient(180deg, #9FD8C4, #FF5A4E); color: var(--ink); border-color: var(--ink); box-shadow: 0 5px 0 #4A3C30; }
.unit { width: 100%; max-width: 520px; padding: 20px 14px 14px; border-radius: 20px; display: grid; gap: 12px; justify-items: center; }
.unit h2 { font-family: var(--ed); font-weight: 700; font-size: clamp(25px, 6.6vw, 34px); line-height: 1.1; color: var(--ac2); }
.unit.glass { background: linear-gradient(180deg, rgba(58, 46, 36, .92), rgba(23, 19, 15, .96)); border: 1px solid rgba(255, 90, 78, .5); box-shadow: 0 16px 44px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* ---------- 5. the invitation ---------- */
#s5 .beat { padding-top: 120px; }
.invite { position: relative; width: 100%; max-width: 600px; padding: clamp(50px, 11vw, 62px) clamp(16px, 5vw, 40px) clamp(20px, 5vw, 34px); display: grid; gap: 11px; justify-items: center; color: var(--ink); background: linear-gradient(180deg, #FFFDF6, #F4E8CE); border-radius: 8px; box-shadow: inset 0 0 0 2px #FFFDF6, inset 0 0 0 4px #FF5A4E, inset 0 0 0 7px #FFFDF6, inset 0 0 0 8px #B3261E, 0 26px 50px rgba(0, 0, 0, .55); }
.s-seal { position: absolute; left: 50%; top: -62px; width: 92px; margin-left: -46px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); transform-origin: 50% 0; } .s-seal svg { display: block; width: 100%; height: auto; }
#s5.open .s-seal { animation: hang 1.8s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes hang { from { transform: translateY(-120px) rotate(-18deg); opacity: 0; } 55% { transform: rotate(8deg); opacity: 1; } 80% { transform: rotate(-4deg); } to { transform: none; } }
#s5.open .invite { animation: bloom 1.1s ease .2s both; }
@keyframes bloom { from { opacity: 0; transform: scale(.94); } }
.s-top { font-weight: 900; font-size: clamp(11px, 3.1vw, 13px); letter-spacing: .22em; color: var(--cran); }
#t-title { font-family: var(--ed); font-style: italic; font-weight: 700; font-size: clamp(27px, 7.6vw, 42px); line-height: 1.08; overflow-wrap: anywhere; }
.invite .rule { width: 60%; height: 3px; background: linear-gradient(90deg, transparent, #FF5A4E, transparent); }
.invite .event { font-family: var(--ed); font-weight: 700; font-size: clamp(22px, 6vw, 30px); line-height: 1.15; overflow-wrap: anywhere; min-height: 1.1em; }
.invite .when { font-weight: 900; font-size: clamp(16px, 4.6vw, 20px); }
.invite .where { font-size: clamp(15px, 4.3vw, 18px); overflow-wrap: anywhere; }
.invite .dress, .invite .with { font-size: 15px; overflow-wrap: anywhere; }
.invite .note { font-family: var(--ed); font-style: italic; font-size: clamp(17px, 4.6vw, 20px); line-height: 1.3; max-width: 26em; overflow-wrap: anywhere; }
.invite .closing { font-family: var(--ed); font-style: italic; font-weight: 600; font-size: clamp(18px, 5vw, 22px); color: var(--cran); overflow-wrap: anywhere; }
.acts, .row-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 22px; border-radius: 24px; border: 2px solid var(--ac); background: var(--ac); color: var(--ink); font-weight: 900; font-size: 15px; letter-spacing: .03em; }
.btn.ghost { background: transparent; color: var(--ac); }
.invite .btn { border-color: var(--plum); background: var(--plum); color: var(--cream); } .invite .btn.ghost { background: transparent; color: var(--plum); }
.btn:disabled { opacity: .5; }

/* ---------- the details, the reply, the keepsake card ---------- */
.after { position: relative; z-index: 2; background: #120E0A; color: var(--cream); 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(--ed); font-weight: 700; font-size: 30px; color: var(--ac); }
.det { display: grid; gap: 11px; }
.det div { display: grid; gap: 1px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 248, 234, .2); }
.det dt { font-weight: 900; 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-size: 14px; color: var(--ac2); }
#rsvp-form { display: grid; gap: 14px; }
.f { display: grid; gap: 6px; font-size: 14px; color: #F1E4C8; }
.f input[type="text"], .f textarea { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 248, 234, .5); background: var(--night); 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: 54px; padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(255, 248, 234, .35); background: var(--night); font-size: 15px; cursor: pointer; overflow-wrap: anywhere; }
.ans label:has(input:checked) { border-color: var(--ac); background: #3A2E24; 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: #F1E4C8; } #err.err { color: #FFB0B8; }
#done { display: grid; gap: 8px; padding: 18px; border-radius: 14px; border: 1px solid var(--ac); background: var(--night); justify-items: start; }
#done-t { font-family: var(--ed); font-weight: 700; font-size: 28px; color: var(--ac2); } #done-t:focus { outline: none; }
#r-closed { padding: 14px; border-radius: 10px; background: var(--night); }
#card { text-align: center; justify-items: center; padding: 24px 16px; border-radius: 22px; background: var(--night); border: 1px solid var(--ac); }
#card .c-top { font-weight: 900; letter-spacing: .2em; font-size: 12.5px; color: var(--ac); }
.after .c-h { font-family: var(--ed); font-style: italic; font-weight: 700; font-size: clamp(28px, 8vw, 40px); line-height: 1.1; color: #fff; max-width: 12em; overflow-wrap: anywhere; }
#card-cv { display: block; width: min(100%, 300px); height: auto; border-radius: 14px; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
.c-acts { justify-content: center; }
.foot { font-size: 12px; opacity: .65; text-align: center; max-width: 30em; }


/* ---------- pieces shared with the other five-scene invitations ---------- */
.mono { font-family: 'Share Tech Mono', 'Courier New', monospace; font-weight: 500; font-size: clamp(13px, 3.6vw, 16px); line-height: 1.4; max-width: 34em; padding: 6px 12px; border-radius: 6px; background: rgba(23, 19, 15, .88); color: var(--cream); overflow-wrap: anywhere; }
.mono.lime { color: var(--ac); }
.mono.pre { white-space: pre-line; background: none; padding: 0; }
.mono:empty { display: none; }
.huge { font-family: 'DynaPuff', Impact, 'Arial Black', sans-serif; font-weight: 400; font-size: clamp(38px, 12vw, 92px); line-height: 1; letter-spacing: .01em; color: #fff; text-shadow: 0 3px 0 var(--night), 0 0 30px rgba(23, 19, 15, .9); max-width: 12em; overflow-wrap: anywhere; }
.huge.sm { font-size: clamp(28px, 8vw, 56px); line-height: 1.05; max-width: 15em; }
.huge .fr { color: var(--ac); }
.huge .el { display: inline-block; animation: ell 1.4s steps(4, end) infinite; clip-path: inset(0 0 0 0); }
@keyframes ell { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 -10% 0 0); } }
.ticker { font-weight: 900; font-size: clamp(11px, 3.1vw, 13.5px); letter-spacing: .14em; text-transform: uppercase; padding: 7px 14px; background: var(--ac); color: var(--ink); border-radius: 3px; }
.narr { font-family: 'Gluten', Georgia, serif; font-style: italic; font-weight: 600; font-size: clamp(17px, 4.7vw, 24px); line-height: 1.3; max-width: 24em; padding: 8px 14px; border-radius: 8px; background: rgba(23, 19, 15, .86); color: var(--cream); overflow-wrap: anywhere; }
body.nonarr .narr { display: none; }
.plate.warm { color: #FFE9B0; border-color: #F2B45A; }
.btn-big { background: linear-gradient(180deg, #FF8A7A, #FF5A4E); color: var(--ink); border-color: var(--ink); box-shadow: 0 5px 0 #A32A22, 0 0 24px rgba(255, 90, 78, .35); }
.btn-big:active { box-shadow: 0 2px 0 #A32A22; }
.btn-big:disabled { opacity: .5; }
.beat.short { min-height: 56vh; }

/* ---------- a scene whose picture fills the screen, with what can be touched laid over it exactly where it is drawn ---------- */
.full { position: relative; width: 100%; height: max(100vh, 640px); overflow: hidden; pointer-events: auto; }
.full-art, .full-art svg { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.full-head { position: absolute; left: 0; right: 0; top: 70px; z-index: 4; display: grid; justify-items: center; gap: 8px; padding: 0 14px; pointer-events: none; text-align: center; }
.full-head > * { pointer-events: auto; }

/* 1. the three dots: the bubble on the phone is the thing to touch */
.dotsbtn { position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; transform: translate(-50%, -50%); min-width: 96px; }
.dotsbtn svg, .msgbtn svg { display: block; width: 100%; height: auto; overflow: visible; }
.ty-d { transform-box: fill-box; transform-origin: 50% 50%; animation: dot 1.2s ease-in-out infinite; }
.ty-d.d1 { animation-delay: .18s; } .ty-d.d2 { animation-delay: .36s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-22%); opacity: 1; } }
.dotsbtn.checked { animation: nudge .5s ease; }
@keyframes nudge { 30% { transform: translate(-50%, -50%) scale(1.08); } }
.prog { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: max(86px, 12vh); width: min(78vw, 300px); display: grid; gap: 6px; justify-items: center; }
.bar { width: 100%; height: 12px; border-radius: 6px; background: rgba(23, 19, 15, .9); border: 1px solid rgba(255, 255, 255, .4); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--ac); transform-origin: 0 50%; transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.bar.big { height: 20px; border-radius: 10px; max-width: 560px; }
.bar.big i { transition: none; }
.prog .mono { text-align: center; }
.ty-const { transition: transform 1.6s cubic-bezier(.2, .8, .2, 1); }
#sky.grown .ty-const { transform: scale(1.22); }
.ty-star { animation: shimmer 3.2s ease-in-out infinite alternate; } .ty-star.s1 { animation-delay: .8s; } .ty-star.s2 { animation-delay: 1.6s; }
@keyframes shimmer { from { opacity: 1; } to { opacity: .55; } }

/* 2. the forecast center */
.answers { width: 100%; max-width: 560px; display: grid; gap: 9px; }
@media (min-width: 700px) { .answers { grid-template-columns: 1fr 1fr; } }
.ansb { min-height: 54px; padding: 10px 14px; border-radius: 22px 22px 22px 6px; border: 2px solid rgba(255, 90, 78, .55); background: rgba(23, 19, 15, .94); color: #fff; font-weight: 700; font-size: clamp(15px, 4.3vw, 18px); line-height: 1.25; text-align: left; touch-action: manipulation; }
.ansb[aria-pressed="true"] { background: var(--ac); color: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 2px var(--ac); }
.ansb:disabled { opacity: .55; }
.ansb[aria-pressed="true"]:disabled { opacity: 1; }
.dash { width: 100%; max-width: 560px; display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: rgba(15, 12, 9, .96); border: 2px solid var(--ac); text-align: left; animation: bloom .5s ease both; }
@keyframes bloom { from { opacity: 0; transform: translateY(16px); } }
.dash-prop svg { display: block; width: 92px; height: 92px; }
.dash-body { display: grid; gap: 6px; }
.dash .mono { background: none; padding: 0; }
.dash-wx { font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(20px, 5.6vw, 28px); line-height: 1.08; color: #fff; }
.ty-scr0 { animation: shimmer 2.6s steps(2) infinite alternate; } .ty-scr1 { animation: shimmer 3.4s steps(2) .6s infinite alternate; }

/* 3. life support for three dots */
.life { display: flex; gap: clamp(14px, 5vw, 34px); padding: clamp(18px, 5vw, 30px) clamp(26px, 8vw, 54px); border-radius: 999px 999px 999px 40px; background: #E2DCCB; border: 5px solid var(--ink); box-shadow: 0 0 60px rgba(255, 90, 78, .35); }
.ld { display: block; width: clamp(40px, 13vw, 84px); height: clamp(40px, 13vw, 84px); border-radius: 50%; background: var(--ink); will-change: transform, opacity; }
.life.idle .ld { animation: dot 1.2s ease-in-out infinite; } .life.idle .d1 { animation-delay: .18s; } .life.idle .d2 { animation-delay: .36s; }
.vitals { width: 100%; max-width: 560px; display: grid; gap: 6px; justify-items: center; }
.interrupt { min-height: 2.9em; font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(19px, 5.4vw, 30px); line-height: 1.1; color: #FFB4A8; text-shadow: 0 2px 0 #17130F; max-width: 16em; }
.interrupt.pop { animation: slam .35s ease both; }
@keyframes slam { from { opacity: 0; transform: scale(1.6); } }
.title-won { font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(22px, 6.4vw, 36px); line-height: 1.1; padding: 12px 18px; background: var(--ac); color: var(--ink); border-radius: 4px; transform: rotate(-1.5deg); max-width: 16em; }

/* 4. the message: the great sealed bubble on the stage is the thing to touch */
.msgbtn { position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; transform: translate(-50%, -100%); }
.msgbtn .msg-art { display: block; }
.msg-words { position: absolute; left: 8%; right: 8%; top: 12%; height: 58%; display: grid; place-items: center; font-family: 'Rubik', system-ui, sans-serif; font-weight: 900; font-size: clamp(40px, 12vw, 76px); line-height: 1; color: var(--ink); opacity: 0; overflow-wrap: anywhere; text-align: center; }
.msg-words.long { font-size: clamp(22px, 6.4vw, 38px); }
#hallm.sent .msg-words { opacity: 1; } #hallm.sent .ty-seal { display: none; }
#hallm:not(.sent):not(.counting) .msgbtn { animation: breathe 2.4s ease-in-out infinite alternate; }
@keyframes breathe { from { filter: drop-shadow(0 0 0 rgba(255, 90, 78, 0)); } to { filter: drop-shadow(0 0 16px rgba(255, 90, 78, .95)); } }
.count { font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(64px, 22vw, 170px); line-height: .9; color: var(--ac); text-shadow: 0 4px 0 var(--night); }
.count.word { font-size: clamp(24px, 7vw, 46px); line-height: 1.1; color: #fff; max-width: 12em; }
.count.pop { animation: slam .3s ease both; }
.bub2 { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: max(26px, 5vh); max-width: min(86vw, 420px); padding: 12px 18px; border-radius: 22px 22px 22px 6px; background: #E2DCCB; color: var(--ink); font-weight: 900; font-size: clamp(18px, 5.2vw, 26px); border: 3px solid var(--ink); animation: bloom .4s ease both; }
.ty-beam { animation: sway 7s ease-in-out infinite alternate; } .ty-beam.b1, .ty-beam.b3 { animation-direction: alternate-reverse; animation-duration: 9s; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
#hallm.counting .ty-beam { animation-duration: 1.2s; }
.posterwrap { pointer-events: auto; display: grid; justify-items: center; gap: 16px; padding: 30px 14px 70px; background: linear-gradient(180deg, #241D17, #17130F 30%); text-align: left; }
#poster-cv { display: block; width: min(92vw, 440px); height: auto; border: 4px solid #FBF3E0; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.charges { width: 100%; max-width: 560px; display: grid; gap: 10px; }
.charges div { display: grid; gap: 2px; padding-bottom: 9px; border-bottom: 1px solid rgba(255, 255, 255, .2); }
.charges dt { font-weight: 900; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ac); }
.charges dd { font-family: 'Share Tech Mono', 'Courier New', monospace; font-size: clamp(15px, 4.2vw, 18px); overflow-wrap: anywhere; }
.s-field { width: 100%; max-width: 440px; display: grid; gap: 8px; font-size: 13.5px; color: var(--cream); }
.s-field input { width: 100%; min-height: 50px; padding: 10px 12px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 10px; background: rgba(255, 255, 255, .08); font: inherit; font-size: 18px; color: #fff; }

/* 5. the invitation: one clean message that actually sent */
.plate { border-radius: 3px; }
.invite { background: #FBF3E0; border-radius: 26px 26px 26px 6px; box-shadow: inset 0 0 0 3px var(--ink), 0 26px 50px rgba(0, 0, 0, .5); }
.invite .s-top { font-family: 'Share Tech Mono', monospace; font-weight: 700; letter-spacing: .14em; font-size: 12px; background: var(--ac); color: var(--ink); padding: 5px 12px; border-radius: 3px; }
.invite h1 { font-family: 'DynaPuff', Impact, sans-serif; font-weight: 400; font-size: clamp(34px, 10vw, 58px); line-height: 1; overflow-wrap: anywhere; }
.invite .msg { font-family: 'Gluten', Georgia, serif; font-style: italic; font-size: clamp(17px, 4.6vw, 21px); line-height: 1.3; max-width: 26em; }
.invite .msg:empty { display: none; }
.invite .rule { background: var(--ink); height: 3px; }
.invite .closing { font-family: 'Share Tech Mono', monospace; font-style: normal; font-weight: 700; font-size: clamp(13px, 3.7vw, 15px); color: #6B5A4A; }
.invite .btn { border-color: var(--ink); background: var(--ink); color: #fff; } .invite .btn.ghost { background: transparent; color: var(--ink); }
.tiny-typing { font-size: 12px; opacity: .7; display: flex; gap: 4px; align-items: center; }
.tiny-typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1.2s ease-in-out infinite; } .tiny-typing i:nth-child(3) { animation-delay: .18s; } .tiny-typing i:nth-child(4) { animation-delay: .36s; }
.tiny-typing .fr { margin-right: 0; }
.ty-lt0 { animation: shimmer 2.8s ease-in-out infinite alternate; } .ty-lt1 { animation: shimmer 3.6s ease-in-out .9s infinite alternate; }

/* ---------- paused when off screen; reduced motion: every word and control stays, the performances go ---------- */
.sc.off .stage *, .sc.off .flow * { animation-play-state: paused !important; }
body.rm *, body.rm *::before, body.rm *::after { animation: none !important; transition: none !important; }
body.rm .ov { display: none; }
body.rm .huge .el { clip-path: none; }
@media (max-width: 420px) { .beat { padding-left: 10px; padding-right: 10px; } .full-head { top: 62px; gap: 6px; } .dash { grid-template-columns: 64px 1fr; } .dash-prop svg { width: 64px; height: 64px; } }

/* ---------- The Last Brain Cell: the cell, its speech bubble, its panel, the meters, the relay, the sticky note ---------- */
.huge { font-family: 'DynaPuff', Impact, 'Arial Black', sans-serif; font-size: clamp(27px, 7.6vw, 70px); line-height: 1.02; letter-spacing: 0; }
.huge.sm { font-size: clamp(24px, 6.4vw, 48px); }
.huge.warn { padding: 10px 18px 8px; background: var(--ac); color: var(--ink); text-shadow: none; animation: warn 1.8s ease-in-out infinite alternate; }
@keyframes warn { from { box-shadow: 0 0 0 3px #17130F, 0 0 10px rgba(255, 90, 78, .4); } to { box-shadow: 0 0 0 3px #17130F, 0 0 44px rgba(255, 90, 78, .95); } }
.btn-big { font-family: 'Rubik', system-ui, sans-serif; }
.btn-big.dark { background: linear-gradient(180deg, #4A3C30, #2A2119); color: #fff; border-color: var(--ac2); box-shadow: 0 5px 0 #0F0C09; }
.btn-big[aria-pressed="true"] { outline: 3px solid #fff; outline-offset: 2px; }
.full-head .acts { gap: 10px; }
.cellbtn { position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; transform: translate(-50%, -50%); min-width: 110px; }
.cellbtn svg, .cellspot svg, .relay-cell svg, .talk-cell svg { display: block; width: 100%; height: auto; overflow: visible; }
.cellbtn .cell-art, .cellspot { display: block; animation: breath 3.2s ease-in-out infinite alternate; }
@keyframes breath { from { transform: scale(1); } to { transform: scale(1.035); } }
.cellbtn.hop, .relay-cell.hop { animation: hop .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hop { 0% { translate: 0 0; } 40% { translate: 0 -22%; } 100% { translate: 0 0; } }
.br-flag { transform-box: fill-box; transform-origin: 0 100%; animation: flag 1.1s ease-in-out infinite alternate; }
@keyframes flag { from { transform: rotate(-9deg); } to { transform: rotate(11deg); } }
.br-steam { animation: steam 2.4s ease-in-out infinite; } .br-zz { animation: steam 2.8s ease-in-out infinite; } .br-zz.z2 { animation-delay: .9s; }
@keyframes steam { from { opacity: 0; transform: translateY(4px); } 40% { opacity: .9; } to { opacity: 0; transform: translateY(-10px); } }
.br-alarm { animation: shimmer 1.4s ease-in-out infinite alternate; }
.br-scr0 { animation: shimmer 2.6s steps(2) infinite alternate; } .br-scr1 { animation: shimmer 3.4s steps(2) .6s infinite alternate; }
.br-lt0 { animation: shimmer 2.8s ease-in-out infinite alternate; } .br-lt1 { animation: shimmer 3.6s ease-in-out .9s infinite alternate; }
/* what the cell says: a speech bubble right at the cell, never a caption somewhere else */
.say { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(88vw, 420px); padding: 10px 16px; border-radius: 18px; background: var(--cream); color: var(--ink); font-weight: 700; font-size: clamp(14px, 3.9vw, 17px); line-height: 1.3; text-align: center; border: 3px solid var(--ink); translate: 0 -100%; }
.say::after { content: ''; position: absolute; left: 50%; bottom: -13px; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.say.in { position: relative; left: auto; transform: none; translate: none; width: auto; max-width: none; text-align: left; }
.say.in::after { left: -13px; bottom: 50%; margin: 0 0 -9px; border: 9px solid transparent; border-right-color: var(--ink); border-left: 0; }
.say:empty { display: none; }
.console { position: absolute; z-index: 3; left: 0; right: 0; bottom: max(64px, 8vh); display: flex; justify-content: center; gap: 8px; padding: 0 10px; }
.key { flex: 0 1 150px; min-height: 48px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--ink); background: linear-gradient(180deg, #BFE9D8, #9FD8C4); color: var(--ink); font-weight: 900; font-size: clamp(10px, 2.7vw, 12.5px); letter-spacing: .04em; line-height: 1.15; box-shadow: 0 4px 0 #0F0C09; touch-action: manipulation; }
.key.red { background: linear-gradient(180deg, #FF8A7A, #FF5A4E); }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #0F0C09; }
/* 2. the three meters and the situation */
.meters { width: 100%; max-width: 560px; display: grid; gap: 7px; padding: 12px 14px; border-radius: 12px; background: rgba(15, 12, 9, .94); border: 2px solid var(--ac2); }
.meter { display: grid; grid-template-columns: 8.2em 1fr 2.4em; align-items: center; gap: 8px; font-weight: 900; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.meter b { font-family: 'Share Tech Mono', monospace; text-align: right; }
.meter .bar i { background: var(--ac2); transition: transform .6s cubic-bezier(.2, .8, .2, 1); } .meter .bar i.low { background: var(--ac); }
.q-top { display: flex; align-items: center; gap: 12px; }
.q-count { font-weight: 900; font-size: 12px; letter-spacing: .14em; padding: 5px 10px; border-radius: 4px; background: rgba(15, 12, 9, .9); }
.q-dots { display: flex; gap: 4px; }
.q-dot { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; position: relative; }
.q-dot::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; border: 2px solid #fff; background: transparent; }
.q-dot.done::after { background: var(--ac2); border-color: var(--ac2); } .q-dot[aria-current="true"]::after { inset: 11px; border-color: var(--ac); }
.sit { font-family: 'DynaPuff', Impact, sans-serif; font-weight: 400; font-size: clamp(19px, 5.2vw, 30px); line-height: 1.15; max-width: 20em; padding: 12px 16px; border-radius: 10px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); }
.answers.two { grid-template-columns: 1fr; } @media (min-width: 700px) { .answers.two { grid-template-columns: 1fr 1fr; } }
.ansb { border-radius: 12px; border-color: rgba(159, 216, 196, .7); }
.talk { width: 100%; max-width: 560px; display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: center; animation: bloom .4s ease both; }
.talk-cell { display: block; width: 84px; }
/* 3. the relay: four friends, four places, one thought bubble each */
.urgent { font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(17px, 4.7vw, 26px); line-height: 1.15; max-width: 22em; min-height: 2.4em; padding: 10px 14px; border-radius: 8px; background: var(--ac); color: var(--ink); }
.places { width: 100%; max-width: 620px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place { position: relative; min-height: 150px; padding: 8px 8px 10px; display: grid; grid-template-rows: 64px auto auto; justify-items: center; align-items: end; gap: 2px; border-radius: 16px; border: 3px solid rgba(251, 243, 224, .35); background: rgba(15, 12, 9, .92); color: #fff; touch-action: manipulation; }
.place b { font-size: clamp(12px, 3.3vw, 14.5px); line-height: 1.15; }
.place .pl-art { display: block; width: min(46%, 104px); } .place .pl-art svg { display: block; width: 100%; height: auto; }
.place .sock { width: 64px; height: 64px; border-radius: 50%; border: 3px dashed rgba(251, 243, 224, .45); display: grid; place-items: center; }
.place.hot { border-color: var(--ac); animation: hot 1s ease-in-out infinite alternate; } .place.hot .sock { border-color: var(--ac); }
@keyframes hot { from { box-shadow: 0 0 0 0 rgba(255, 90, 78, .0); } to { box-shadow: 0 0 22px 2px rgba(255, 90, 78, .85); } }
.place:disabled { opacity: 1; cursor: default; }
.relay-cell { display: block; width: 78px; margin: -8px; }
.after-line { min-height: 2.7em; font-family: 'Gluten', Georgia, serif; font-style: italic; font-weight: 600; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.3; max-width: 26em; padding: 6px 12px; border-radius: 8px; background: rgba(15, 12, 9, .88); }
.after-line:empty { background: none; }
/* 4. the final thought */
.cellspot { position: absolute; z-index: 3; transform: translate(-50%, -50%); pointer-events: none; }
#dimroom .br-cone { opacity: .55; transition: opacity 1.2s; } #dimroom.lit .br-cone { opacity: 1; } #dimroom.counting .br-cone { animation: shimmer .5s steps(2) infinite alternate; }
.sticky { position: absolute; z-index: 4; left: 50%; width: min(64vw, 250px); padding: 22px 16px 26px; background: #FFE066; color: var(--ink); font-family: 'Reenie Beanie', 'Comic Sans MS', cursive; font-weight: 700; font-size: clamp(28px, 8vw, 40px); line-height: 1; text-align: center; box-shadow: 0 10px 22px rgba(0, 0, 0, .5); transform: translate(-50%, -100%) rotate(-4deg); animation: stick .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes stick { from { opacity: 0; transform: translate(-50%, -130%) rotate(8deg) scale(1.4); } }
.count.word { color: var(--cream); }
.invite { border-radius: 6px; box-shadow: inset 0 0 0 3px var(--ink), 8px 8px 0 var(--ac2), 0 26px 50px rgba(0, 0, 0, .5); }
.invite h1 { font-family: 'DynaPuff', Impact, sans-serif; font-size: clamp(28px, 8vw, 46px); line-height: 1.04; }
.invite .closing { font-family: 'Reenie Beanie', cursive; font-weight: 700; font-size: clamp(24px, 6.6vw, 32px); color: var(--ink); background: #FFE066; padding: 6px 16px; transform: rotate(-2deg); }
body.rm .cellbtn .cell-art, body.rm .cellspot { animation: none; }
@media (max-width: 420px) { .talk { grid-template-columns: 62px 1fr; } .talk-cell { width: 62px; } .place { min-height: 138px; } .console { bottom: 58px; } }
/* the lettering: DynaPuff (soft and overinflated, like the cell), Gluten (a narrator who cannot quite sit still), Share Tech Mono (the control room), Reenie Beanie (the cell's handwriting) */
.huge, .count, .title-won, .dash-wx, .sit, .urgent, .invite h1 { font-weight: 700; }
.narr, .after-line, .invite .msg { font-style: normal; font-weight: 500; }
.say { font-family: 'Gluten', system-ui, sans-serif; font-weight: 600; }
.sticky { font-weight: 400; font-size: clamp(36px, 10vw, 52px); } .invite .closing { font-weight: 400; font-size: clamp(30px, 8.4vw, 40px); line-height: .9; }
.mono, .charges dd, .meter b { font-weight: 400; letter-spacing: .02em; }
