/* Not My Event: the look of "Friendsgiving: The Friendship Audit" (public/templates/friendsgiving-friendship-audit.html). One lamp in a dark office: near-black and
   amber, alert red, manila and cream paper, courtroom wood and brass. Typewriter for the documents, tall poster capitals for the alerts and the verdict.
   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: #F2A93B; --ac2: #FFE2A6; --night: #14100C; --dusk: #3A2A1C; --plum: #3A2A1C; --cran: #B3261E; --red: #D8362B; --cream: #FBF3E0; --ink: #1B140E; --ed: Georgia, 'Times New Roman', serif; --sans: 'DM Sans', 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(20, 16, 12, .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(20, 16, 12, .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(20, 16, 12, .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(20, 16, 12, .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(20, 16, 12, .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(20, 16, 12, .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(20, 16, 12, .8); }
.plate { font-weight: 900; letter-spacing: .16em; font-size: clamp(11px, 3.1vw, 14px); padding: 8px 16px; border-radius: 20px; background: rgba(20, 16, 12, .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, 217, 138, .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(20, 16, 12, .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, #6B4A2A, #3A2A1C); color: #fff; font-weight: 900; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.2; letter-spacing: .05em; box-shadow: 0 5px 0 #14100C, 0 0 24px rgba(255, 217, 138, .35); touch-action: manipulation; max-width: 100%; }
.btn-big:active { transform: translateY(3px); box-shadow: 0 2px 0 #14100C; }
.btn-big.champ { background: linear-gradient(180deg, #FFE2A6, #F2A93B); color: var(--ink); border-color: var(--ink); box-shadow: 0 5px 0 #6B4A2A; }
.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(91, 59, 43, .92), rgba(20, 16, 12, .96)); border: 1px solid rgba(255, 233, 168, .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 #F2A93B, 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, #F2A93B, 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: #1D1711; 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: #3A2A1C; 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; }

/* ---------- this design's own pieces ---------- */
.beat.short { min-height: 56vh; }
a.linkish { display: inline-flex; align-items: center; }
.btn-big:disabled { opacity: .5; }
/* typewritten lines, the red alert, the verdict */
.typed { font-family: 'Special Elite', 'Courier New', monospace; font-weight: 400; font-size: clamp(15px, 4.1vw, 19px); line-height: 1.35; max-width: 30em; padding: 8px 14px 6px; border-radius: 6px; background: rgba(20, 16, 12, .86); color: var(--cream); overflow-wrap: anywhere; }
.typed.big { font-size: clamp(18px, 5vw, 26px); line-height: 1.25; max-width: 22em; }
.typed:empty { display: none; }
.typed.red { color: #FFB4A8; }
.alert { font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-size: clamp(26px, 8.4vw, 54px); line-height: 1; letter-spacing: .06em; padding: 9px 18px 7px; background: var(--red); color: #fff; animation: alert 1.8s ease-in-out infinite alternate; }
@keyframes alert { from { box-shadow: 0 0 0 3px #14100C, 0 0 10px rgba(216, 54, 43, .4); } to { box-shadow: 0 0 0 3px #14100C, 0 0 44px rgba(216, 54, 43, .95); } }
.guilty { font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-weight: 400; font-size: clamp(30px, 9vw, 64px); line-height: 1.04; letter-spacing: .02em; color: #fff; max-width: 12em; padding: 11px 16px 8px; background: var(--red); transform: rotate(-2deg); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.v-title { font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-size: clamp(24px, 7vw, 44px); line-height: 1.05; color: var(--ac); padding: 8px 16px 5px; background: rgba(20, 16, 12, .92); border-radius: 6px; margin: 10px auto 8px; width: max-content; max-width: 100%; }
#v-pre, #v-post { display: grid; justify-items: center; gap: 8px; }
#v-post .guilty { animation: slam .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes slam { from { opacity: 0; transform: rotate(-2deg) scale(2.2); } }

/* ---------- 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; }
@supports (height: 100svh) { .full { height: max(100svh, 640px); } }
.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 summons: the case file is the thing to touch; its page unfolds below */
.filebtn { position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; transform: translate(-50%, -50%); }
.filebtn svg { display: block; width: 100%; height: auto; overflow: visible; }
.filebtn .d-cover { transition: transform .8s cubic-bezier(.3, 1.2, .5, 1); transform-box: fill-box; transform-origin: 50% 0; }
.filebtn.open .d-cover { transform: scaleY(-.42); }
.filebtn:not(.open) { animation: breathe 2.4s ease-in-out infinite alternate; }
@keyframes breathe { from { filter: drop-shadow(0 0 0 rgba(255, 226, 166, 0)); } to { filter: drop-shadow(0 0 14px rgba(255, 226, 166, .95)); } }
.filewrap { pointer-events: auto; display: grid; justify-items: center; padding: 10px 12px 60px; background: linear-gradient(180deg, #2A1A0E, #14100C); }
.sheet { position: relative; width: 100%; max-width: 600px; display: grid; gap: 14px; padding: clamp(26px, 7vw, 44px) clamp(16px, 5vw, 36px); background: linear-gradient(180deg, #FBF3E0, #EFE3C4); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: unfold .7s ease both; transform-origin: 50% 0; text-align: left; }
@keyframes unfold { from { transform: scaleY(.2); opacity: 0; } }
.sheet .typed { background: none; color: var(--ink); padding: 0; max-width: none; }
.sheet .typed.red { color: #B3261E; min-height: 1.3em; }
.sheet-h { font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-weight: 400; font-size: clamp(30px, 9vw, 48px); letter-spacing: .04em; line-height: 1; }
.stamp { justify-self: start; font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; letter-spacing: .14em; padding: 7px 10px 3px; border: 3px solid #B3261E; color: #B3261E; transform: rotate(-3deg); }
.s-field { display: grid; gap: 8px; font-family: 'Special Elite', 'Courier New', monospace; font-size: 13.5px; letter-spacing: .06em; color: #5A4A30; }
.s-field input { width: 100%; min-height: 50px; padding: 10px 12px 6px; border: 0; border-bottom: 3px solid var(--ink); border-radius: 4px 4px 0 0; background: rgba(27, 20, 14, .07); font: inherit; font-size: 20px; letter-spacing: .04em; color: var(--ink); text-transform: uppercase; }
.offs { display: grid; gap: 8px; }
/* button.off, never a bare .off: a scene that is off the screen also carries the class "off" (audit.js), and a bare rule laid whole scenes out like these buttons */
button.off { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 12px; text-align: left; border: 2px solid var(--ink); border-radius: 4px; background: transparent; color: var(--ink); font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(15px, 4.2vw, 18px); line-height: 1.25; touch-action: manipulation; }
button.off .box { flex: none; width: 24px; height: 24px; border: 2px solid var(--ink); display: grid; place-items: center; }
button.off[aria-pressed="true"] { background: rgba(179, 38, 30, .1); border-color: #B3261E; }
button.off[aria-pressed="true"] .box::after { content: '✕'; color: #B3261E; font-weight: 900; font-size: 20px; line-height: 1; }

/* 2. the interrogation: the room is the pinned picture; the meter, the question and the answers stand in front of it */
#interro { gap: 12px; }
.meter { width: min(72vw, 400px); filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); --n: 8; }
.meter svg { display: block; width: 100%; height: auto; }
.meter .needle { transform-origin: 180px 190px; transform: rotate(calc((var(--n) - 50) * 1.8deg)); transition: transform 1s cubic-bezier(.3, 1.6, .5, 1); }
.meter.spike .needle { animation: jitter .9s ease; }
@keyframes jitter { 0% { transform: rotate(-80deg); } 30% { transform: rotate(88deg); } 55% { transform: rotate(calc((var(--n) - 64) * 1.8deg)); } 80% { transform: rotate(calc((var(--n) - 44) * 1.8deg)); } }
.meter .pulse { stroke-dasharray: 30 70; animation: pulse 2.4s linear infinite; }
@keyframes pulse { to { stroke-dashoffset: -100; } }
.readout { width: 100%; max-width: 560px; min-height: 3.4em; display: grid; align-items: center; font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.3; padding: 10px 14px 7px; background: #0C1410; color: #6CE08A; border: 1px solid #2E6B40; border-radius: 6px; }
.readout.hot { color: #FFD9A0; border-color: var(--ac); background: #1B140E; }
.q-top { display: flex; align-items: center; gap: 10px; }
.q-count { font-weight: 900; font-size: 12.5px; letter-spacing: .14em; color: var(--ac2); padding: 5px 11px; background: rgba(20, 16, 12, .88); border-radius: 10px; }
.q-dots { display: flex; }
.q-dot { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; }
.q-dot::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ac2); background: rgba(20, 16, 12, .8); }
.q-dot.done::before { background: var(--ac); border-color: var(--ac); }
.q-dot[aria-current="true"]::before { box-shadow: 0 0 0 4px rgba(255, 226, 166, .4); }
.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 7px; border-radius: 8px; border: 2px solid rgba(255, 226, 166, .55); background: rgba(20, 16, 12, .92); color: #fff; font-family: 'Special Elite', 'Courier New', monospace; 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); }
.swing { animation: swing 5s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

/* 3. the evidence room: the cork board is the pinned picture; each exhibit is pinned up as it is scrolled to, with red string to the next */
.exb { min-height: 88vh; }
.exh { --r: -2.5deg; position: relative; width: min(86vw, 440px); margin: 0; display: grid; padding: 12px 12px 14px; background: #FBF7EC; color: var(--ink); text-align: left; box-shadow: 0 16px 30px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(40px) rotate(calc(var(--r) * 3)); transition: opacity .6s ease, transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.exh[data-e="1"], .exh[data-e="3"] { --r: 2.5deg; }
.exh.in { opacity: 1; transform: rotate(var(--r)); }
.exh::before { content: ''; position: absolute; left: 50%; top: -10px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FF8A7A, #B3261E 60%); box-shadow: 0 4px 6px rgba(0, 0, 0, .4); z-index: 2; }
.exh::after { content: ''; position: absolute; left: 50%; top: 100%; width: 3px; height: 34vh; background: #D8362B; transform-origin: 50% 0; transform: rotate(calc(var(--r) * -2)); pointer-events: none; }
.ex-pic svg { display: block; width: 100%; height: auto; }
.exh figcaption { display: grid; gap: 6px; padding-top: 10px; font-family: 'Special Elite', 'Courier New', monospace; }
.ex-tag { font-weight: 400; font-size: 13px; letter-spacing: .08em; color: #B3261E; }
.ex-cap { font-size: clamp(15px, 4.2vw, 18px); line-height: 1.3; }
.ex-note { position: relative; z-index: 3; justify-self: end; max-width: 80%; margin: 12px -16px -40px 0; padding: 10px 12px; background: #F6E27A; color: var(--ink); font-family: 'Caveat', Georgia, serif; font-weight: 700; font-size: clamp(20px, 5.2vw, 24px); line-height: 1.05; transform: rotate(3deg); box-shadow: 0 8px 14px rgba(0, 0, 0, .4); }
.closed { display: grid; justify-items: center; gap: 16px; }
.c-stamp { --sr: -6deg; position: relative; font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-size: clamp(38px, 12vw, 84px); line-height: 1; letter-spacing: .04em; padding: 13px 20px 8px; border: 6px solid #D8362B; color: #D8362B; background: rgba(251, 243, 224, .95); opacity: 0; transform: rotate(var(--sr)); }
.c-stamp.no { --sr: 4deg; background: #D8362B; color: #fff; border-color: #fff; }
@keyframes stampin { from { opacity: 0; transform: rotate(var(--sr)) scale(2.4); } to { opacity: 1; transform: rotate(var(--sr)) scale(1); } }
.closed.in #c-q { animation: stampin .45s cubic-bezier(.2, 1.3, .4, 1) .2s both; }
.closed.in #c-a { animation: stampin .45s cubic-bezier(.2, 1.3, .4, 1) 1.9s both; }
#c-q::after { content: ''; position: absolute; left: -4%; right: -4%; top: 50%; height: 8px; margin-top: -4px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.closed.in #c-q::after { transition: transform .3s ease 1.5s; transform: scaleX(1); }

/* 4. the verdict: the gavel is the thing to touch; the poster is below */
.gavelbtn { position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; transform: translate(-50%, -100%); }
.gavelbtn svg { display: block; width: 100%; height: auto; overflow: visible; }
.gavelbtn .g-move { transform-origin: 236px 152px; transform: rotate(16deg); }
#court.banged .gavelbtn .g-move { transform: rotate(0deg); }
.gavelbtn.bang .g-move { animation: bang .6s ease-in; }
@keyframes bang { 0% { transform: rotate(16deg); } 35% { transform: rotate(38deg); } 62% { transform: rotate(-2deg); } 78% { transform: rotate(7deg); } 100% { transform: rotate(0deg); } }
.gavelbtn .g-bang { opacity: 0; } .gavelbtn.bang .g-bang { animation: flash .6s ease .3s; }
@keyframes flash { 30% { opacity: 1; } }
#court:not(.banged) .gavelbtn { animation: breathe 2.4s ease-in-out infinite alternate; }
.posterwrap { pointer-events: auto; display: grid; justify-items: center; gap: 16px; padding: 30px 14px 70px; background: linear-gradient(180deg, #3A2415, #14100C 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, 248, 234, .2); }
.charges dt { font-weight: 900; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ac); }
.charges dd { font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(16px, 4.4vw, 19px); overflow-wrap: anywhere; }
.name-ok { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; border-radius: 12px; border: 1px solid rgba(255, 248, 234, .4); font-size: 15px; cursor: pointer; overflow-wrap: anywhere; }
.name-ok input { width: 22px; height: 22px; accent-color: var(--ac); flex: none; }
.posterwrap .typed { background: none; padding: 0; white-space: pre-line; }

/* 5. the doors open on the dining room; then the order to appear */
#hall .door { transform-box: fill-box; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1) .5s; }
#hall .dl { transform-origin: 0 50%; } #hall .dr { transform-origin: 100% 50%; }
#s5.open #hall .door, body.rm #hall .door { transform: scaleX(.06); }
.invite { background: linear-gradient(180deg, #FBF3E0, #EFE3C4); border-radius: 4px; }
#t-title { font-family: 'Anton', Impact, 'Arial Black', sans-serif; font-style: normal; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(30px, 8.6vw, 48px); }
.invite .msg { font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(16px, 4.4vw, 19px); line-height: 1.35; max-width: 26em; }
.invite .msg:empty { display: none; }
.invite .closing { font-family: 'Special Elite', 'Courier New', monospace; font-style: normal; font-weight: 400; font-size: clamp(14px, 3.9vw, 16px); }
#s5.open .invite { animation: bloom 1.2s ease .2s both; }
@keyframes bloom { from { opacity: 0; transform: translateY(16px); } }

/* ---------- the small motion in the pictures (slow, and never a strobe) ---------- */
.tw { animation: shimmer 3.4s ease-in-out infinite alternate; }
@keyframes shimmer { from { opacity: 1; } to { opacity: .5; } }
.flick { animation: flick 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flick { from { transform: scale(1, 1); } 50% { transform: scale(.94, 1.06); } to { transform: scale(1.03, .96); } }
.steam { animation: steam 4s ease-in-out infinite; } .steam.s1 { animation-delay: -2s; }
@keyframes steam { from { opacity: 0; transform: translateY(4px); } 40% { opacity: .8; } to { opacity: 0; transform: translateY(-10px); } }
.scan { animation: scan 5s linear infinite; }
@keyframes scan { to { transform: translateY(8px); } }
/* 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 camera and the performances go ---------- */
body.rm *, body.rm *::before, body.rm *::after { animation: none !important; transition: none !important; }
body.rm .ov { display: none; }
body.rm .c-stamp { opacity: 1; } body.rm #c-q::after { transform: scaleX(1); }
@media (max-width: 420px) { .beat { padding-left: 10px; padding-right: 10px; } .full-head { top: 62px; gap: 6px; } }
