/* Not My Event: Cake Stack Panic (public/templates/cake-stack-panic.html). The Midnight Birthday Bakery.
   Only transform and opacity ever animate (the fast-and-reactive rule); nothing moves under the pointer; the scenes are flat pictures. */
:root {
  --plum: #21142F; --deep: #100D1C; --rasp: #FF4F91; --gold: #FFD166; --mint: #62E6C1; --blue: #6C8CFF; --grape: #A66BEE; --tang: #FF9F6B; --cream: #FFF3DF; --lav: #C8B9D5;
  --display: 'Rammetto One', 'Arial Black', system-ui, sans-serif; --script: 'Yellowtail', 'Brush Script MT', cursive; --ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; --num: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  --stage: 0.5; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--plum); color: var(--cream); font: 500 16px/1.45 var(--ui); -webkit-text-size-adjust: 100%; }
body { min-height: 100svh; overflow-x: hidden; }
body[data-scr="open"], body[data-scr="film"], body[data-scr="game"] { overflow: hidden; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 9100; background: var(--cream); color: var(--plum); padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.small { font-size: 14px; color: var(--lav); }
.faint { background: none; border: 0; padding: 8px 10px; color: rgba(255, 243, 223, .62); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link { background: none; border: 0; padding: 6px 4px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; min-height: 50px; padding: 10px 22px; border-radius: 999px; border: 0; background: var(--rasp); color: #fff; font: 700 16px/1.15 var(--ui); letter-spacing: .04em; cursor: pointer; text-decoration: none; text-align: center; box-shadow: 0 6px 0 #b8326a, 0 12px 24px rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8326a, 0 8px 16px rgba(0, 0, 0, .35); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { min-height: 62px; font-size: 18px; padding: 12px 30px; }
.btn small { font-size: 11px; letter-spacing: .14em; opacity: .85; font-weight: 700; }
.btn.ghost { background: rgba(255, 243, 223, .08); color: var(--cream); box-shadow: inset 0 0 0 2px rgba(255, 243, 223, .35); }
.btn.ghost:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px rgba(255, 243, 223, .5); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.row2 { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.row2.quiet { gap: 2px 14px; }

/* the Invitation button: top left, on every screen but the first and the invitation itself */
#b-inv { position: fixed; z-index: 9000; top: max(10px, var(--safe-t)); left: max(10px, env(safe-area-inset-left, 0px)); height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid rgba(255, 255, 255, .55); background: rgba(20, 12, 36, .8); color: #fff; font: 700 14px var(--ui); letter-spacing: .04em; cursor: pointer; }

/* ---------------- the screens ---------------- */
.scr.fixed { position: fixed; inset: 0; overflow: hidden; }
.scr.doc { position: relative; min-height: 100svh; padding: calc(70px + var(--safe-t)) 16px calc(70px + var(--safe-b)); }
.stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 1600px; transform: translate(-50%, -50%) scale(var(--stage)); pointer-events: none; }
.cam { position: absolute; inset: 0; will-change: transform; transform: scale(1); }
.ly { position: absolute; }
.veil { position: absolute; inset: 0; background: #0B0618; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.veil.on { opacity: 1; }
.cap { position: fixed; z-index: 40; left: 50%; bottom: calc(15svh + var(--safe-b)); width: min(92vw, 640px); margin: 0; transform: translate(-50%, 14px); opacity: 0; text-align: center; font: 700 clamp(20px, 4.6vw, 34px)/1.25 var(--ui); color: var(--cream); text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 24px rgba(0, 0, 0, .8); pointer-events: none; transition: opacity .5s ease, transform .5s ease; }
.cap.on { opacity: 1; transform: translate(-50%, 0); }

/* 1. the bakery at night */
#ext-img { width: 1600px; height: 1600px; }
.win-glow { width: 270px; height: 360px; opacity: .85; animation: flicker 3.2s steps(1) infinite; }
.win-glow.alarm { animation: flicker 3.2s steps(1) infinite, none; }
@keyframes flicker { 0%, 100% { opacity: .85; } 6% { opacity: .2; } 8% { opacity: .9; } 30% { opacity: .78; } 31% { opacity: .3; } 33% { opacity: .85; } 70% { opacity: .9; } 71% { opacity: .5; } 72% { opacity: .88; } }
.sign { margin: 0; text-align: center; font: 400 70px/76px var(--script); color: #FFE7F1; text-shadow: 0 0 6px #FF4F91, 0 0 18px #FF4F91, 0 0 42px rgba(255, 79, 145, .7); white-space: nowrap; animation: sign 6s steps(1) infinite; }
@keyframes sign { 0%, 100% { opacity: 1; } 48% { opacity: 1; } 49% { opacity: .55; } 50% { opacity: 1; } 52% { opacity: .7; } 53% { opacity: 1; } }
#cam-ext { transition: transform 5s cubic-bezier(.5, 0, .7, 1); }
#cam-ext.go { transform: scale(3.6); }
#o-tap { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(96px + var(--safe-b)); }
.o-cue { font: 700 clamp(17px, 4.4vw, 22px) var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--cream); padding: 12px 22px; border-radius: 999px; background: rgba(16, 13, 28, .66); box-shadow: inset 0 0 0 2px rgba(255, 209, 102, .7); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.o-foot { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; justify-content: center; gap: 10px; }
body.filming .o-cue, body.filming .o-foot { opacity: 0; transition: opacity .3s; pointer-events: none; }
body.filming #o-tap { pointer-events: none; }

/* 2. the machine wakes up */
#int-img { width: 1600px; height: 1600px; }
.gear { will-change: transform; }
.machine-on .gear { animation: spin 7s linear infinite; }
.machine-on #int-g2, .machine-on #gg2 { animation-direction: reverse; animation-duration: 5s; }
.machine-off .gear { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.beltwrap { height: 44px; overflow: hidden; border-radius: 12px; }
#int-belt { width: 1280px; height: 44px; will-change: transform; }
.machine-on #int-belt { animation: belt 1.6s linear infinite; }
@keyframes belt { to { transform: translateX(-60px); } }
.arm { transform-origin: 40px 40px; will-change: transform; }
.machine-on .arm { animation: arm 2.4s ease-in-out infinite; }
@keyframes arm { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(14deg); } }
.warn { width: 80px; height: 80px; opacity: 0; }
.warn.blink { animation: blink .7s steps(1) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
#drops { overflow: hidden; }
.drop { position: absolute; will-change: transform; animation: dropin .7s cubic-bezier(.5, 0, 1, 1) forwards; }
@keyframes dropin { to { transform: translateY(var(--to)); } }
#cam-int { transition: transform 1.6s cubic-bezier(.4, 0, .2, 1); }
#cam-int.wake { transform: scale(1.12); }
#cam-int.swing { transform: scale(1.55); }
.title-card { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(70px + var(--safe-t)) 18px calc(40px + var(--safe-b)); text-align: center; background: radial-gradient(ellipse at center, rgba(16, 13, 28, .55), rgba(16, 13, 28, .9)); animation: fade .7s ease both; }
.title-card.still { animation: none; }
@keyframes fade { from { opacity: 0; } }
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .95; font-family: var(--display); font-weight: 400; }
.logo span { font-size: clamp(34px, 10vw, 76px); color: var(--cream); letter-spacing: .02em; text-shadow: 0 5px 0 #3a2552; }
.logo b { font-weight: 400; font-size: clamp(58px, 18vw, 136px); color: var(--rasp); letter-spacing: .03em; text-shadow: 0 6px 0 #8a1f4e, 0 0 40px rgba(255, 79, 145, .45); }
.title-card:not(.still) .logo { animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both .1s; }
@keyframes rise { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.plate { margin: 0; padding: 6px 16px; border-radius: 6px; background: var(--gold); color: var(--plum); font: 700 clamp(13px, 3.6vw, 17px) var(--ui); letter-spacing: .16em; }
.how { margin: 0; max-width: 30ch; font-size: clamp(16px, 4.2vw, 20px); color: var(--lav); }
.corner { position: absolute; z-index: 6; right: 12px; bottom: calc(12px + var(--safe-b)); }

/* 3. the game */
#s-game { display: flex; flex-direction: column; background: var(--deep); }
#game-bg { position: absolute; left: 50%; top: 50%; width: max(100vw, 100vh); height: max(100vw, 100vh); transform: translate(-50%, -50%); opacity: .38; pointer-events: none; }
.hud { position: relative; z-index: 3; display: flex; align-items: stretch; justify-content: center; gap: 8px; padding: calc(62px + var(--safe-t)) 12px 6px; }
.hd { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 86px; padding: 4px 10px; border-radius: 12px; background: rgba(16, 13, 28, .78); box-shadow: inset 0 0 0 1.5px rgba(201, 154, 91, .6); }
.hd .lab { font: 700 10px var(--ui); letter-spacing: .18em; color: var(--lav); white-space: nowrap; }
.hd .num { font: 700 21px/1.15 var(--num); font-variant-numeric: tabular-nums; color: var(--cream); }
#hd-score { min-width: 112px; }
#h-time.low { color: var(--rasp); }
#h-next { display: flex; align-items: flex-end; gap: 6px; height: 28px; padding: 0 6px 3px; border-radius: 6px; background: repeating-linear-gradient(115deg, #5b4470 0 8px, #3d2a4f 8px 12px); background-size: 100% 6px; background-repeat: no-repeat; background-position: bottom; }
#h-next img { height: 24px; width: auto; }
#h-next img.later { height: 17px; opacity: .7; }
.well { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.side { position: absolute; width: 150px; height: 150px; opacity: .8; pointer-events: none; display: none; }
#gg1 { left: calc(50% - var(--fw, 300px) / 2 - 170px); top: 18%; }
#gg2 { width: 110px; height: 110px; right: calc(50% - var(--fw, 300px) / 2 - 140px); bottom: 16%; }
@media (min-width: 721px) { .side { display: block; } }
body[data-round="2"].machine-on .gear { animation-duration: 4.5s; }
body[data-round="3"].machine-on .gear { animation-duration: 2.6s; }
.frame { position: relative; border-radius: 10px; box-shadow: 0 0 0 6px #7d5a3a, 0 0 0 12px #C99A5B, 0 0 0 15px #5c3f27, 0 22px 60px rgba(0, 0, 0, .6); background: var(--deep); }
.frame canvas { display: block; border-radius: 10px; }
.frame::after { content: ""; position: absolute; left: -18px; right: -18px; bottom: -30px; height: 16px; border-radius: 6px; background: #5a3a26; box-shadow: inset 0 0 0 3px #C99A5B; pointer-events: none; }
.glass { position: absolute; inset: var(--mouth, 0) 0 0; border-radius: 0 0 10px 10px; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, .09) 0 8%, transparent 8% 60%, rgba(255, 255, 255, .04) 60% 64%, transparent 64%); }
.lamp { position: absolute; top: calc(var(--mouth, 0px) - 12px); width: 18px; height: 18px; border-radius: 50%; background: #5c2742; box-shadow: 0 0 0 4px #C99A5B; }
.lamp.l { left: -4px; } .lamp.r { right: -4px; }
.lamp::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 79, 145, .9), rgba(255, 79, 145, 0) 70%); opacity: 0; }
body.danger .lamp { background: var(--rasp); }
body.danger .lamp::after { animation: blink .55s steps(1) infinite; }
body[data-round="3"] .lamp::after { opacity: .35; }
.danger-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 42%, rgba(255, 40, 90, .38) 100%); opacity: 0; transition: opacity .5s ease; }
body.danger .danger-glow { opacity: 1; }
#pops { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pop { position: absolute; transform: translate(-50%, -50%); font: 700 18px var(--num); color: var(--cream); text-shadow: 0 2px 0 rgba(0, 0, 0, .6); white-space: nowrap; animation: pop 1s ease-out forwards; }
.pop.big { font-size: 26px; color: var(--gold); }
.pop.gold { color: var(--gold); font-size: 15px; }
.pop.item { font-size: 13px; color: var(--mint); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
.msg { position: absolute; left: 50%; top: 22%; width: max-content; max-width: 94%; margin: 0; padding: 8px 14px; border-radius: 12px; background: rgba(16, 13, 28, .82); transform: translate(-50%, 10px); opacity: 0; font: 700 clamp(15px, 4vw, 19px)/1.25 var(--ui); text-align: center; pointer-events: none; transition: opacity .25s, transform .25s; }
.msg.on { opacity: 1; transform: translate(-50%, 0); }
.msg.gold { color: var(--plum); background: var(--gold); font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.msg.warn { color: #fff; background: rgba(200, 30, 80, .88); }
.hint { position: absolute; left: 50%; bottom: 12px; width: max-content; max-width: 92%; margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(255, 209, 102, .95); color: var(--plum); font: 700 15px var(--ui); transform: translate(-50%, 8px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.hint.on { opacity: 1; transform: translate(-50%, 0); }
.pad { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 8px 12px calc(10px + var(--safe-b)); max-width: 560px; width: 100%; margin: 0 auto; }
.pad button { height: 58px; border-radius: 16px; border: 0; background: rgba(255, 243, 223, .1); box-shadow: inset 0 0 0 2px rgba(255, 243, 223, .25), 0 4px 0 rgba(0, 0, 0, .35); font-size: 24px; color: var(--cream); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.pad button.on { background: rgba(255, 79, 145, .45); transform: translateY(2px); }
.pad button[data-c="H"] { background: rgba(255, 79, 145, .3); }
#b-pause { position: absolute; z-index: 4; right: calc(max(10px, env(safe-area-inset-right, 0px)) + 54px); top: max(10px, var(--safe-t)); width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(20, 12, 36, .8); font-size: 14px; cursor: pointer; }
.over { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(16, 13, 28, .74); animation: fade .25s ease both; }
.over.soft { background: rgba(16, 13, 28, .5); }
#g-count { flex-direction: column; gap: 6px; background: rgba(16, 13, 28, .35); pointer-events: none; }
#cnt { font: 400 clamp(80px, 26vw, 160px)/1 var(--display); color: var(--gold); text-shadow: 0 8px 0 #8a6a1f; }
#cnt.beat { animation: beat .7s ease-out; }
@keyframes beat { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
#cnt-sub { font: 700 15px var(--ui); letter-spacing: .2em; color: var(--cream); }
.ocard { width: min(100%, 420px); padding: 26px 22px; border-radius: 22px; background: #2a1a3c; box-shadow: inset 0 0 0 2px rgba(201, 154, 91, .55), 0 20px 50px rgba(0, 0, 0, .5); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ocard.wide { width: min(100%, 480px); }
.ocard h2 { margin: 0; font: 400 34px var(--display); }
.ocard p { margin: 0; }
.bw-a { font: 700 clamp(19px, 5vw, 24px)/1.3 var(--ui); }
.bw-b { min-height: 1.3em; font: 400 clamp(19px, 5vw, 24px)/1.3 var(--display); color: var(--gold); opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.bw-b.on { opacity: 1; transform: none; }
.tally { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.tally > div { padding: 8px 10px; border-radius: 12px; background: rgba(255, 243, 223, .06); display: flex; flex-direction: column; gap: 2px; }
.tally span, .tally dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--lav); }
.tally b, .tally dd { margin: 0; font: 700 18px var(--num); font-variant-numeric: tabular-nums; }
.kick { margin: 0; font: 700 13px var(--ui); letter-spacing: .24em; color: var(--gold); }
.score-big { margin: 0; font: 900 clamp(46px, 13vw, 72px)/1 var(--num); font-variant-numeric: tabular-nums; color: var(--cream); }

/* 4. the reveal and the invitation */
#s-invite { display: flex; flex-direction: column; align-items: center; background: radial-gradient(ellipse at 50% 0, #3a2147, var(--plum) 60%); }
.rv { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; }
.rv-on .rv { opacity: 1; pointer-events: auto; cursor: pointer; }
.rv-line { position: absolute; left: 50%; width: min(92vw, 640px); margin: 0; text-align: center; transform: translate(-50%, 12px); opacity: 0; transition: opacity .6s, transform .6s; }
#rv-1 { top: calc(12svh + var(--safe-t)); font: 400 clamp(26px, 7vw, 44px)/1.15 var(--display); color: var(--cream); }
#rv-2 { top: calc(12svh + var(--safe-t) + clamp(40px, 10vw, 62px)); font: 700 clamp(18px, 4.8vw, 26px)/1.25 var(--ui); color: var(--gold); }
.rv-l1 #rv-1, .rv-l2 #rv-2 { opacity: 1; transform: translate(-50%, 0); }
.rv-card #rv-1, .rv-card #rv-2 { opacity: 0; }
.rv-belt { position: absolute; left: 0; right: 0; top: 64svh; height: 44px; overflow: hidden; }
#rv-belt { width: 1800px; height: 44px; will-change: transform; }
.rv-on #rv-belt { animation: belt 1.4s linear infinite; }
.rv-open #rv-belt { animation-play-state: paused; }
.cake { position: relative; z-index: 3; width: min(62vw, 300px); aspect-ratio: 600 / 640; margin: 0 auto -18px; will-change: transform; }
.cake > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cake .band { position: absolute; left: 15%; width: 70%; top: 62%; height: 28%; overflow: hidden; border-radius: 0 0 22% 22% / 0 0 30% 30%; opacity: .9; }
#cake-band { height: 100%; width: auto; max-width: none; will-change: transform; animation: turn 9s linear infinite; }
@keyframes turn { to { transform: translateX(-50%); } }
#cake-flames { animation: flame 1.1s ease-in-out infinite alternate; transform-origin: 50% 16%; }
@keyframes flame { 0% { opacity: .85; transform: scale(1, .97); } 100% { opacity: 1; transform: scale(1, 1.03); } }
/* during the reveal the cake rides the conveyor in, from the left, at the height of the belt */
.rv-on .cake { position: fixed; left: 50%; top: calc(64svh - min(62vw, 300px) * 1.0667 + 8px); margin: 0; transform: translateX(-160vw); transition: transform 2.3s cubic-bezier(.2, .7, .3, 1); }
.rv-on.rv-cake .cake { transform: translateX(-50%); }
.rv-on .card { position: fixed; left: 50%; top: 100svh; width: min(92vw, 560px); transform: translate(-50%, 0); transition: transform 1.3s cubic-bezier(.2, .8, .3, 1); }
.rv-on.rv-card .card { transform: translate(-50%, calc(-100svh + 9svh + var(--safe-t))); }
.rv-on .card .card-in > :not(.kick):not(h2) { opacity: 0; }
.rv-on.rv-open .card .card-in > :not(.kick):not(h2) { opacity: 1; }
.rv-done .cake, .rv-done .card { animation: fade .5s ease both; }
.rv-on .chal, .rv-on #b-again-chal { display: none; }
.card { position: relative; z-index: 2; width: min(100%, 560px); border-radius: 22px; background: #FFF8EC; color: var(--plum); box-shadow: 0 26px 60px rgba(0, 0, 0, .45); perspective: 1400px; }
.card-in { position: relative; padding: 36px 22px 26px; text-align: center; }
.card-in > * { transition: opacity .6s ease; }
.flap { position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 230px; transform-origin: 50% 0; transform: rotateX(0deg); transition: transform .9s cubic-bezier(.5, 0, .3, 1); backface-visibility: hidden; -webkit-backface-visibility: hidden; pointer-events: none; }
.flap-face { position: absolute; inset: 0; border-radius: 22px 22px 6px 6px; background: linear-gradient(180deg, #FF4F91, #c23a6e); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 26px; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
.flap-face span { font: 400 26px var(--display); color: #fff; letter-spacing: .03em; }
.rv-open .flap, .rv-done .flap { transform: rotateX(-178deg); }
.rv-done .flap { display: none; }
.card .kick { color: var(--rasp); }
#inv-name { margin: 6px 0 0; font: 400 clamp(54px, 15vw, 88px)/1.02 var(--script); color: var(--plum); overflow-wrap: anywhere; }
.age { margin: 2px 0 10px; font: 700 18px var(--ui); color: #5a476b; }
.age b { font: 400 30px var(--display); color: var(--rasp); }
.about { margin: 0 auto 16px; max-width: 40ch; font-size: 17px; color: #3a2a4c; }
.det { margin: 0 0 14px; display: grid; gap: 8px; text-align: left; }
.det > div { display: grid; grid-template-columns: 106px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #F6E9D6; }
.det dt { font: 700 12px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #8a5a70; padding-top: 2px; }
.det dd { margin: 0; font-weight: 700; color: var(--plum); overflow-wrap: anywhere; }
.det small { display: block; font-weight: 500; color: #5a476b; }
#s-home .det > div, #dlg-det .det > div { background: rgba(255, 243, 223, .07); }
#dlg-det .det dt { color: var(--lav); } #dlg-det .det dd { color: var(--cream); } #dlg-det .det small { color: var(--lav); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.card .btn.ghost { color: var(--plum); background: #F6E9D6; box-shadow: inset 0 0 0 2px #d9c2a6; min-height: 44px; font-size: 15px; }
.host-msg { margin: 6px auto 16px; max-width: 42ch; font: 400 clamp(20px, 5.6vw, 26px)/1.3 var(--script); color: #5a2f4a; }
.rsvp { margin-top: 10px; padding-top: 16px; border-top: 2px solid #eedcc4; text-align: left; }
.rsvp h3 { margin: 0 0 4px; text-align: center; font: 400 26px var(--display); color: var(--plum); }
.rsvp .small { color: #6a5878; text-align: center; margin: 4px 0 10px; }
.going { text-align: center; margin: 0 0 6px; font-weight: 700; color: #5a476b; }
.f { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-weight: 700; font-size: 15px; }
.f input[type="text"], .f textarea, .f select { font: 500 17px var(--ui); padding: 12px 14px; border-radius: 12px; border: 2px solid #d9c2a6; background: #fff; color: var(--plum); width: 100%; }
.f.inl { flex-direction: row; align-items: center; gap: 10px; }
.f.inl select { width: auto; }
.ans { border: 0; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.ans label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #F6E9D6; font-weight: 700; cursor: pointer; }
.ans input { width: 20px; height: 20px; accent-color: var(--rasp); }
.step { display: inline-flex; align-items: center; gap: 12px; }
.step button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--plum); color: var(--cream); font-size: 22px; cursor: pointer; }
.step output { min-width: 2ch; text-align: center; font: 700 22px var(--num); }
#err { min-height: 1.2em; margin: 6px 0; color: #5a476b; font-weight: 700; }
#err.bad { color: #c2185b; }
#r-send { width: 100%; }
#done { text-align: center; padding: 6px 0; }
#done-t { margin: 0 0 6px; font: 400 26px var(--display); color: var(--rasp); }
#done p { margin: 0 0 8px; }
.card .link { color: #c2185b; }
.chal { position: relative; z-index: 2; width: min(100%, 560px); margin: 22px auto 0; padding: 24px 20px; border-radius: 22px; text-align: center; background: linear-gradient(180deg, #2a1a3c, #1b1030); box-shadow: inset 0 0 0 2px rgba(255, 79, 145, .55), 0 20px 50px rgba(0, 0, 0, .4); }
.chal.in { animation: chal .7s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes chal { from { opacity: 0; transform: translateY(30px); } }
.chal h2 { margin: 0 0 8px; font: 400 clamp(24px, 6.4vw, 34px)/1.15 var(--display); color: var(--cream); }
.chal > p { margin: 0 auto 14px; max-width: 36ch; color: var(--lav); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 0 0 16px; }
.stats > div { padding: 10px 8px; border-radius: 14px; background: rgba(255, 243, 223, .07); display: flex; flex-direction: column; gap: 2px; }
.stats span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--lav); }
.stats b { font: 700 19px var(--num); font-variant-numeric: tabular-nums; color: var(--gold); }
#ch-go, #hm-play, #rs-again { width: 100%; }
#b-again-chal { margin: 18px auto 0; }

/* 5 to 7. the arcade, the board, the end of a shift */
.panel { width: min(100%, 560px); margin: 0 auto; text-align: center; }
.panel h2 { margin: 0 0 14px; font: 400 clamp(30px, 8vw, 46px)/1.1 var(--display); color: var(--cream); }
.ann { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 209, 102, .14); box-shadow: inset 0 0 0 2px rgba(255, 209, 102, .5); font-weight: 700; color: var(--gold); }
.board { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.board li { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 243, 223, .06); }
.board li.lead { background: rgba(255, 209, 102, .14); box-shadow: inset 0 0 0 2px rgba(255, 209, 102, .55); }
.board li.you { box-shadow: inset 0 0 0 2px var(--rasp); }
.board li.empty { display: block; text-align: center; color: var(--lav); }
.board .rk { font: 700 17px var(--num); text-align: center; color: var(--lav); }
.board .rk i { font-style: normal; color: var(--gold); font-size: 20px; }
.board .nm { font-weight: 700; overflow-wrap: anywhere; }
.board .nm em { font-style: normal; font-weight: 500; color: var(--lav); }
.board .rd { font-size: 12px; color: var(--lav); }
.board .sc { font: 700 17px var(--num); font-variant-numeric: tabular-nums; }
.champ { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 14px; border-radius: 16px; background: linear-gradient(180deg, #FFD166, #E0A93A); color: var(--plum); }
.champ b { font: 400 14px var(--display); letter-spacing: .1em; }
.champ span:first-of-type { font: 400 40px/1.1 var(--script); }
.champ span:last-of-type { font: 700 20px var(--num); }
.review { margin: 16px 0; text-align: left; }
.review ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.review li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 10px; background: rgba(255, 243, 223, .06); }
.review li.dq { opacity: .6; }
.review small { display: block; color: var(--lav); }
.review button { border: 0; border-radius: 999px; padding: 8px 12px; background: rgba(255, 79, 145, .3); color: var(--cream); cursor: pointer; font-weight: 700; }
.terms { margin-top: 18px; text-align: left; color: var(--lav); font-size: 14px; }
.terms summary { cursor: pointer; font-weight: 700; color: var(--cream); }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto 8px; animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both; }
.trophy svg { width: 120px; height: 150px; }
.trophy span { font: 700 13px var(--ui); letter-spacing: .2em; color: var(--gold); }
.rs-a { margin: 0; font: 700 clamp(18px, 4.8vw, 22px)/1.3 var(--ui); }
.rs-b { margin: 4px 0 14px; min-height: 1.3em; font: 400 clamp(18px, 4.8vw, 22px)/1.3 var(--display); color: var(--gold); }
#rs-tally { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.status { margin: 12px 0; font-weight: 700; color: var(--mint); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 9060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 6, 24, .72); }
.sheet-in { width: min(100%, 440px); max-height: calc(100svh - 32px); overflow: auto; padding: 22px; border-radius: 20px; background: #2a1a3c; box-shadow: inset 0 0 0 2px rgba(201, 154, 91, .5); display: flex; flex-direction: column; gap: 10px; }
.sheet-in.wide { width: min(100%, 860px); }
.sheet-in h2 { margin: 0; font: 400 24px var(--display); }
.sheet .f input[type="text"], .sheet .f select { background: #1b1030; color: var(--cream); border-color: rgba(255, 243, 223, .3); }
.tg { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 243, 223, .06); font-weight: 700; cursor: pointer; }
.tg input { width: 22px; height: 22px; accent-color: var(--rasp); }
input[type="range"] { width: 100%; accent-color: var(--rasp); }
.cert-box { width: 100%; }
.cert svg { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
#print-root { display: none; }

/* motion */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-height: 640px) { .pad button { height: 48px; } .hd .num { font-size: 18px; } }

/* printing a certificate: only the certificate, on one landscape page */
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #print-root { display: flex !important; align-items: center; justify-content: center; width: 100%; height: 100vh; }
  body.printing #print-root .cert { width: 100%; }
  body.printing #print-root svg { width: 100%; height: auto; max-height: 100vh; box-shadow: none; }
}
