/* Not My Event: the look of "Thanksgiving Is Cooked" (public/templates/thanksgiving-is-cooked.html), a neon, game-show Friendsgiving invitation that begins as a group chat.
   Five scenes on one fixed stage: the chat, character select, the potluck draft, the group vote, the party room. The stage (#world) is only paint; every word and button is real
   page text. Only transform and opacity are animated, no big blurs, and nothing flashes. */
:root {
  --orange: #FF7538; --pink: #F05BA8; --purple: #8B46E8; --lime: #D9FF62; --plum: #24143C; --ivory: #FFF6E6; --gold: #FFD23F; --red: #F0405A;
  --ink: #FFF6E6; --muted: #D8C9EE; --glass: rgba(255, 246, 230, .1); --edge: rgba(255, 246, 230, .24);
  --sky1: #1A0F33; --sky2: #3A1B6B; --sky3: #24143C;
  --disp: 'Bowlby One', 'Arial Black', Impact, sans-serif;
  --body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --top: calc(86px + env(safe-area-inset-top, 0px));
}
body[data-theme="candy"] { --sky1: #43185E; --sky2: #A8337F; --sky3: #4A1A6B; --purple: #B06BFF; }
body[data-theme="night"] { --sky1: #0E1030; --sky2: #26307F; --sky3: #14123A; --pink: #FF7AB6; --purple: #6B7BFF; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.rm { scroll-behavior: auto; }
body { margin: 0; min-height: 100vh; background: var(--sky1); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; overflow-x: hidden; }
body.modal { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 12px; background: var(--lime); color: var(--plum); font-weight: 800; text-decoration: none; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

/* ---------- The stage: sky, stars, light beams, a neon floor and a few snacks floating by ---------- */
#world { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--sky1); }
.sky { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.sky.s1 { background: radial-gradient(120% 80% at 50% 105%, #4B2390 0%, var(--sky1) 60%); }
.sky.s2 { background: radial-gradient(90% 70% at 50% 18%, #C13C93 0%, var(--sky2) 52%, var(--sky3) 100%); }
.sky.s3 { background: radial-gradient(100% 70% at 50% 90%, #FF7538 0%, #8B2F6B 44%, var(--sky3) 100%); }
.sky.s4 { background: radial-gradient(90% 60% at 50% 30%, #F05BA8 0%, #6A2BC4 55%, var(--sky3) 100%); }
.sky.s5 { background: radial-gradient(110% 70% at 50% 20%, #5B2AA8 0%, var(--sky3) 62%, #130A26 100%); }
body[data-scene="chat"] .sky.s1, body[data-scene="cast"] .sky.s2, body[data-scene="draft"] .sky.s3, body[data-scene="wheel"] .sky.s4, body[data-scene="rsvp"] .sky.s5 { opacity: 1; }
.w-stars { position: absolute; inset: 0; opacity: .8; background-image: radial-gradient(2px 2px at 12% 18%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 32% 8%, #fff, transparent 60%), radial-gradient(2px 2px at 58% 22%, #fff, transparent 60%), radial-gradient(1.5px 1.5px at 78% 12%, #fff, transparent 60%), radial-gradient(2px 2px at 90% 30%, #fff, transparent 60%), radial-gradient(1.4px 1.4px at 22% 40%, #fff, transparent 60%), radial-gradient(1.8px 1.8px at 68% 46%, #fff, transparent 60%), radial-gradient(1.5px 1.5px at 44% 34%, #fff, transparent 60%); }
.w-beams { position: absolute; left: 50%; top: -30%; width: 220vmax; height: 220vmax; margin-left: -110vmax; opacity: 0; transition: opacity 1.2s ease; background: conic-gradient(from 0deg, transparent 0 8%, rgba(240, 91, 168, .22) 10% 14%, transparent 16% 30%, rgba(217, 255, 98, .16) 32% 36%, transparent 38% 55%, rgba(139, 70, 232, .26) 57% 62%, transparent 64% 80%, rgba(255, 117, 56, .2) 82% 86%, transparent 88%); animation: beams 60s linear infinite; }
body[data-scene="rsvp"] .w-beams { opacity: 1; }
@keyframes beams { to { transform: rotate(360deg); } }
.w-grid { position: absolute; left: -50%; right: -50%; bottom: -6%; height: 46%; opacity: 0; transition: opacity 1s ease; transform: perspective(520px) rotateX(62deg); transform-origin: 50% 100%; background-image: linear-gradient(rgba(217, 255, 98, .55) 2px, transparent 2px), linear-gradient(90deg, rgba(217, 255, 98, .55) 2px, transparent 2px); background-size: 64px 64px; animation: grid 6s linear infinite; mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); }
body:not([data-scene="chat"]) .w-grid { opacity: .55; }
@keyframes grid { to { background-position: 0 64px; } }
.w-orbit { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; transform: translate3d(0, calc(var(--u, 0) * -120px), 0); }
body:not([data-scene="chat"]) .w-orbit { opacity: .5; }
.orb { position: absolute; width: clamp(54px, 9vw, 96px); aspect-ratio: 1; animation: bob var(--t, 7s) ease-in-out var(--dl, 0s) infinite alternate; filter: drop-shadow(0 6px 0 rgba(36, 20, 60, .35)); }
.orb svg { display: block; width: 100%; height: 100%; transform: rotate(var(--r, 0deg)); }
@keyframes bob { from { transform: translate3d(0, -14px, 0) rotate(-4deg); } to { transform: translate3d(0, 14px, 0) rotate(5deg); } }

/* the match-cut between scenes: a soft ring of the next scene's colour opens and fades */
#cut { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, transparent 0 30%, var(--cutc, #F05BA8) 62%, transparent 63%); clip-path: circle(0% at 50% 50%); }
#cut.go { animation: iris .8s ease-out; }
@keyframes iris { 0% { clip-path: circle(0% at 50% 50%); opacity: 0; } 35% { opacity: .5; } 100% { clip-path: circle(90% at 50% 50%); opacity: 0; } }

/* ---------- The always-there bits: title, sound, details, progress, skip ---------- */
.hud { position: fixed; z-index: 50; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); display: grid; gap: 7px; background: linear-gradient(rgba(20, 10, 40, .78), rgba(20, 10, 40, 0)); }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { font-family: var(--disp); font-size: 13px; letter-spacing: .02em; text-transform: uppercase; color: var(--lime); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hud-r { display: flex; gap: 8px; flex: none; }
.hbtn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--edge); background: rgba(36, 20, 60, .72); color: var(--ivory); font-size: 14px; font-weight: 700; }
.hbtn[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--plum); }
.prog { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.prog button { flex: 1; height: 26px; padding: 0; border: 0; background: none; position: relative; }
.prog button i { position: absolute; left: 0; right: 0; top: 11px; height: 5px; border-radius: 4px; background: rgba(255, 246, 230, .26); transition: background .3s; }
.prog button[aria-current="true"] i { background: var(--lime); box-shadow: 0 0 10px rgba(217, 255, 98, .7); }
.prog button.done i { background: var(--pink); }
.prog button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.jump { flex: none; color: var(--ivory); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
#cap { position: fixed; z-index: 55; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; width: min(560px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 18px; background: rgba(20, 10, 40, .94); border: 1.5px solid var(--edge); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); font-size: 16px; }
#cap[hidden] { display: none; }
#cap b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }
#cap.in { animation: capin .35s ease-out; }
@keyframes capin { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
#resume { position: fixed; z-index: 52; left: 50%; top: calc(var(--top) + 6px); translate: -50% 0; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--lime); color: var(--plum); font-weight: 700; font-size: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, .4); }
#resume[hidden] { display: none; }
#resume button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--plum); color: var(--lime); font-weight: 800; }

/* ---------- Shared pieces ---------- */
#story { position: relative; z-index: 2; }
.scene { position: relative; }
.wrap { width: min(1080px, 100%); margin: 0 auto; padding: calc(var(--top) + 28px) max(18px, env(safe-area-inset-right, 0px)) 72px max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 18px; min-height: 100svh; align-content: start; }
.kick { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
h2 { font-family: var(--disp); font-weight: 400; font-size: clamp(30px, 6.4vw, 56px); line-height: 1.04; text-transform: uppercase; text-shadow: 0 3px 0 var(--plum), 0 0 24px rgba(240, 91, 168, .4); }
.lead { font-size: clamp(17px, 2.4vw, 20px); color: var(--ivory); max-width: 40em; text-shadow: 0 1px 0 rgba(36, 20, 60, .6); }
.note { font-size: 14px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 28px; border: 0; border-radius: 999px; background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%), var(--lime); color: var(--plum); font-family: var(--disp); font-size: 16px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; box-shadow: inset 0 -4px 0 rgba(36, 20, 60, .22), 0 6px 0 var(--plum), 0 12px 26px rgba(0, 0, 0, .35); transition: transform .12s; }
.btn:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgba(36, 20, 60, .22), 0 2px 0 var(--plum); }
.btn.hot { background: linear-gradient(rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%), var(--orange); }
.btn.big { min-height: 64px; padding: 0 34px; font-size: clamp(16px, 4.4vw, 22px); }
.btn.ghost { background: rgba(36, 20, 60, .6); color: var(--ivory); box-shadow: inset 0 0 0 2px var(--edge); }
.btn[disabled] { opacity: .55; cursor: default; }
.linkish { padding: 8px 4px; border: 0; background: none; color: var(--ivory); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.glass { border-radius: 26px; border: 2px solid var(--edge); background: linear-gradient(160deg, rgba(255, 246, 230, .16), rgba(255, 246, 230, .05)); box-shadow: 0 18px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .25); }
.field { display: grid; gap: 6px; }
.field label, .flabel, legend { font-size: 14px; font-weight: 800; color: var(--ivory); padding: 0; }
.field input[type="text"], .field input[type="number"], .field select, .field textarea { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--edge); background: rgba(20, 10, 40, .7); color: var(--ivory); font-size: 16px; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lime); outline: none; }
.err { padding: 10px 14px; border-radius: 14px; background: rgba(240, 64, 90, .22); border: 1.5px solid var(--red); font-weight: 700; }
.err[hidden], [hidden] { display: none !important; }
.react { min-height: 28px; font-family: var(--disp); font-size: clamp(18px, 3.4vw, 26px); color: var(--lime); text-transform: uppercase; text-shadow: 0 2px 0 var(--plum); }

/* entry animations play once, when a scene is first reached (the replay button removes .seen and puts it back) */
.scene [data-a] { opacity: 0; transform: translateY(26px) scale(.96); transition: opacity .6s ease, transform .7s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0ms); }
.scene.seen [data-a] { opacity: 1; transform: none; }
.rm .scene [data-a], .scene.always [data-a] { opacity: 1; transform: none; transition: none; }

/* ---------- Scene 1: the group chat ---------- */
.s-chat { height: 230svh; }
.pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; padding-top: var(--top); }
.phone-wrap { position: absolute; inset: var(--top) 0 0 0; display: grid; place-items: center; transform: scale(calc(1 + var(--p, 0) * 5.5)); opacity: calc(1 - var(--p, 0) * 1.5); transform-origin: 50% 46%; }
.phone { position: relative; width: min(88vw, 370px); height: min(68svh, 610px); border-radius: 38px; background: #0F0E17; border: 7px solid #2D2A44; box-shadow: 0 0 0 2px #000, 0 28px 60px rgba(0, 0, 0, .55), 0 0 60px rgba(139, 70, 232, .45); display: flex; flex-direction: column; overflow: hidden; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.phone.shake { animation: shake .5s linear; }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translate(-6px, 2px) rotate(-1deg); } 30% { transform: translate(6px, -2px) rotate(1deg); } 45% { transform: translate(-5px, 1px) rotate(-.8deg); } 60% { transform: translate(5px, -1px) rotate(.8deg); } 80% { transform: translate(-2px, 0); } }
.phone.glitch .ph-feed { transform: skewX(-3deg); }
.ph-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #191827; border-bottom: 1px solid #2D2A44; }
.ph-name { flex: 1; min-width: 0; padding: 4px 0; border: 0; background: none; color: #fff; font-size: 16px; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-count { font-size: 12px; color: #9C98C2; }
.ph-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; overflow: hidden; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 94%; text-align: left; border: 0; background: none; padding: 0; color: inherit; animation: bub .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bub { from { transform: translateY(14px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--plum); background: var(--c, var(--pink)); }
.bub { position: relative; padding: 9px 14px 10px; border-radius: 20px 20px 20px 6px; background: #2A2940; color: #fff; font-size: 16px; line-height: 1.3; }
.bub small { display: block; font-size: 11px; font-weight: 700; color: var(--c, #9C98C2); margin-bottom: 1px; }
button.msg { cursor: pointer; }
button.msg:active .bub { filter: brightness(1.2); }
.msg.blown { animation: fly .95s ease-in forwards; }
@keyframes fly { to { transform: translate(var(--dx, 0), var(--dy, -300px)) rotate(var(--rot, 20deg)) scale(1.2); opacity: 0; } }
.msg.frozen .bub { background: linear-gradient(160deg, #E8F8FF, #9FDCFF); color: #0B3A5B; box-shadow: 0 0 18px rgba(127, 214, 255, .8); }
.msg.frozen .bub small { color: #0B3A5B; }
.aside { align-self: center; max-width: 92%; display: grid; justify-items: center; gap: 4px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #CFCBEF; font-size: 13px; text-align: center; font-style: italic; animation: bub .35s ease-out; }
.aside .egg-svg, .aside .fd { width: 64px; height: auto; }
.ph-type { display: flex; gap: 4px; padding: 0 16px 12px; }
.ph-type i { width: 8px; height: 8px; border-radius: 50%; background: #8E8AB5; animation: dot 1s ease-in-out infinite; }
.ph-type i:nth-child(2) { animation-delay: .15s; } .ph-type i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: none; opacity: .5; } 50% { transform: translateY(-4px); opacity: 1; } }
.ph-skip { margin: 0 12px 12px; align-self: flex-end; min-height: 34px; padding: 0 14px; border: 1px solid #3a3760; border-radius: 999px; background: none; color: #B5B1DC; font-size: 13px; font-weight: 600; }
.burst { position: absolute; inset: var(--top) 0 0 0; display: grid; place-items: center; pointer-events: none; }
.bird { pointer-events: auto; width: min(56vw, 240px); aspect-ratio: 1; padding: 0; border: 0; background: none; transform: scale(.05) rotate(-25deg); opacity: 0; filter: drop-shadow(0 10px 0 rgba(36, 20, 60, .4)); margin-top: -22svh; }
.bird.pop { animation: birdpop .9s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.bird.set { transform: none; opacity: 1; }
.bird .tk { width: 100%; height: 100%; display: block; }
.bird.scream { animation: scream .9s ease-in-out; }
@keyframes birdpop { 0% { transform: scale(.05) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.18) rotate(6deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes scream { 0%, 100% { transform: none; } 12% { transform: scale(1.18) rotate(-5deg); } 28% { transform: scale(1.12) rotate(5deg); } 44% { transform: scale(1.18) rotate(-4deg); } 62% { transform: scale(1.08) rotate(3deg); } }
.hero { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 max(18px, env(safe-area-inset-left, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; justify-items: center; text-align: center; opacity: calc(1 - var(--p, 0) * 3); }
.hero.in { animation: heroin .8s cubic-bezier(.16, 1, .3, 1); }
@keyframes heroin { from { transform: translateY(40px); opacity: 0; } }
.hero h2 { font-size: clamp(28px, 7.4vw, 62px); text-wrap: balance; }
.hero2 { font-family: var(--disp); font-size: clamp(15px, 3.6vw, 24px); text-transform: uppercase; color: var(--lime); text-shadow: 0 2px 0 var(--plum); }
.fine { font-size: 13px; color: var(--muted); max-width: 32em; }

/* ---------- Scene 2: character select ---------- */
.cast-grid { display: grid; gap: 18px; }
.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.role { position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 4px; padding: 10px 8px 12px; border-radius: 22px; border: 2.5px solid var(--edge); background: linear-gradient(165deg, rgba(255, 246, 230, .2), rgba(255, 246, 230, .05)); text-align: center; box-shadow: 0 8px 0 rgba(36, 20, 60, .5), inset 0 1px 0 rgba(255, 255, 255, .3); animation: floaty 5s ease-in-out var(--dl, 0s) infinite alternate; }
.role .r-av { width: min(62%, 96px); }
.role .r-av .tk { width: 100%; display: block; }
.role b { font-size: 15px; line-height: 1.15; }
.role span.p { font-size: 12.5px; line-height: 1.25; color: var(--muted); }
.role[aria-pressed="true"] { border-color: var(--ac, var(--lime)); background: linear-gradient(165deg, color-mix(in srgb, var(--ac, #D9FF62) 55%, transparent), rgba(255, 246, 230, .08)); box-shadow: 0 0 0 3px var(--ac, var(--lime)), 0 0 30px color-mix(in srgb, var(--ac, #D9FF62) 70%, transparent), 0 8px 0 rgba(36, 20, 60, .5); animation: none; transform: translateY(-4px) scale(1.03); }
.role:active { transform: translateY(3px); }
@keyframes floaty { from { transform: translateY(-3px) rotate(-.7deg); } to { transform: translateY(3px) rotate(.7deg); } }
.cprev { min-width: 0; }
.pc { position: relative; display: grid; gap: 10px; justify-items: center; text-align: center; padding: 16px 16px 18px; border-radius: 30px; border: 3px solid var(--ac, var(--lime)); background: linear-gradient(170deg, color-mix(in srgb, var(--ac, #D9FF62) 40%, #2a1650), #2a1650 70%); box-shadow: 0 0 0 4px var(--plum), 0 0 36px color-mix(in srgb, var(--ac, #D9FF62) 55%, transparent), 0 18px 40px rgba(0, 0, 0, .4); overflow: hidden; }
.pc::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .22) 48%, transparent 58%); transform: translateX(-120%); }
.pc.shine::before { animation: shine 1.1s ease-out; }
@keyframes shine { to { transform: translateX(120%); } }
.pc-top { width: 100%; display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ac, var(--lime)); }
.pc-av { width: min(54vw, 190px); }
.pc-av .tk { width: 100%; display: block; }
.pc-av.anim .prop { transform-box: fill-box; transform-origin: 50% 90%; animation: propwiggle 1.3s ease-in-out infinite alternate; }
@keyframes propwiggle { from { transform: rotate(-6deg); } to { transform: rotate(6deg) translateY(-3px); } }
.pc h3 { font-family: var(--disp); font-weight: 400; font-size: clamp(22px, 5.4vw, 30px); text-transform: uppercase; line-height: 1.05; text-shadow: 0 2px 0 var(--plum); }
.pc-punch { font-size: 17px; font-weight: 600; }
.pc-stats { width: 100%; display: grid; gap: 8px; margin: 0; text-align: left; }
.pc-stats div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
.pc-stats dt { font-size: 13px; font-weight: 700; }
.pc-stats dd { margin: 0; font-family: var(--disp); font-size: 15px; color: var(--ac, var(--lime)); }
.pc-stats i { grid-column: 1 / -1; display: block; height: 9px; border-radius: 6px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.pc-stats i::after { content: ""; display: block; height: 100%; width: var(--v, 50%); border-radius: 6px; background: var(--ac, var(--lime)); transform-origin: 0 50%; animation: fill .9s cubic-bezier(.16, 1, .3, 1) var(--sd, .2s) backwards; }
@keyframes fill { from { transform: scaleX(0); } }
.pc-in { width: 100%; text-align: left; }
.pc.ghost { border-style: dashed; border-color: var(--edge); background: rgba(255, 246, 230, .06); box-shadow: none; min-height: 260px; align-content: center; }
.pc.ghost .pc-av { opacity: .35; filter: grayscale(1) brightness(.6); }
.pc.flip { animation: cardflip .8s ease-in forwards; }
@keyframes cardflip { 0% { transform: perspective(900px) rotateY(0); } 50% { transform: perspective(900px) rotateY(90deg) scale(1.05); } 100% { transform: perspective(900px) rotateY(0) scale(1.08); } }
.pc.back .pc-body { display: none; }
.pc.back { align-content: center; }
.pc-back { display: none; }
.pc.back .pc-back { display: grid; gap: 8px; justify-items: center; }
.pc-back .fd { width: 120px; }

/* ---------- Scene 3: the potluck draft ---------- */
.draft-top { display: grid; gap: 12px; align-items: end; }
.meter { font-weight: 800; color: var(--lime); }
.meter small { display: block; font-weight: 600; color: var(--muted); }
.loot { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lc { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; padding: 12px 8px 12px; border-radius: 22px; border: 2.5px solid var(--edge); background: linear-gradient(165deg, rgba(255, 246, 230, .22), rgba(255, 246, 230, .05)); text-align: center; box-shadow: 0 8px 0 rgba(36, 20, 60, .5), inset 0 1px 0 rgba(255, 255, 255, .3); }
.lc .lc-art { width: min(72%, 92px); animation: spin3d 6s ease-in-out var(--dl, 0s) infinite alternate; }
.lc .fd { width: 100%; display: block; }
@keyframes spin3d { from { transform: rotate(-6deg) scale(1); } to { transform: rotate(6deg) scale(1.06); } }
.lc b { font-size: 16px; line-height: 1.15; }
.lc .cat { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.lc .st { font-size: 13px; color: var(--muted); }
.lc[aria-pressed="true"] { border-color: var(--lime); background: linear-gradient(165deg, rgba(217, 255, 98, .4), rgba(255, 246, 230, .08)); box-shadow: 0 0 0 3px var(--lime), 0 0 30px rgba(217, 255, 98, .55), 0 8px 0 rgba(36, 20, 60, .5); }
.lc[aria-pressed="true"] .st { color: var(--ivory); font-weight: 700; }
.lc.sold { opacity: .6; }
.lc.sold .lc-art { animation: none; filter: grayscale(1); }
.lc.sold::after { content: "CLAIMED"; position: absolute; top: 12px; right: -6px; transform: rotate(10deg); padding: 2px 10px; border-radius: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.lc.full::after { content: "SOLD OUT"; }
.lc:active { transform: translateY(3px); }
.lc.land { animation: land .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes land { 0% { transform: scale(.8) rotate(-4deg); } 100% { transform: none; } }
.custom { display: grid; gap: 10px; padding: 16px; border-radius: 22px; }
.custom .row { display: grid; gap: 10px; }
.counter { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; border-radius: 22px; min-height: 96px; align-items: flex-start; }
.counter p { color: var(--muted); align-self: center; }
.ct { display: grid; justify-items: center; gap: 2px; width: 76px; font-size: 12px; text-align: center; line-height: 1.15; }
.ct .fd { width: 54px; }
.ct.me { color: var(--lime); font-weight: 800; }
.ct.pop { animation: land .6s cubic-bezier(.3, 1.6, .5, 1); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Scene 4: the group vote ---------- */
.privacy { padding: 12px 16px; border-radius: 16px; background: rgba(20, 10, 40, .6); border: 1.5px dashed var(--edge); font-size: 15px; }
.game { display: grid; gap: 18px; align-items: center; }
.wheelbox { width: min(78vw, 360px); margin: 0 auto; }
.wheel-svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 12px 0 rgba(36, 20, 60, .45)); }
.wheel-rot { transition: transform 3.2s cubic-bezier(.12, .7, .1, 1); }
.wheelbox.intro .wheel-rot { animation: wheelin 1.4s cubic-bezier(.16, 1, .3, 1); }
@keyframes wheelin { from { transform: rotate(-540deg) scale(.1); } }
.round { padding: 18px; border-radius: 26px; display: grid; gap: 12px; }
.r-count { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }
.r-q { font-family: var(--disp); font-weight: 400; font-size: clamp(20px, 4.6vw, 30px); line-height: 1.12; text-transform: uppercase; text-shadow: 0 2px 0 var(--plum); }
.opts { display: grid; gap: 10px; }
.opt { position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px 8px 8px; border-radius: 18px; border: 2.5px solid var(--edge); background: rgba(20, 10, 40, .55); text-align: left; font-weight: 700; overflow: hidden; }
.opt .ltr { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-family: var(--disp); color: var(--plum); background: var(--c); }
.opt .bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: color-mix(in srgb, var(--c) 36%, transparent); transition: width .9s cubic-bezier(.16, 1, .3, 1); z-index: 0; }
.opt > * { position: relative; z-index: 1; }
.opt .pct { font-family: var(--disp); font-size: 15px; color: var(--ivory); }
.opt[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 3px var(--c), 0 0 22px color-mix(in srgb, var(--c) 60%, transparent); }
.opt:active { transform: translateY(2px); }
.opt[disabled] { opacity: .6; }
.r-res { font-weight: 700; min-height: 24px; }
.r-res small { display: block; font-weight: 500; color: var(--muted); }
.r-res b, .res-q .top b { color: var(--lime); }
.res-q .top { margin: 0; font-weight: 800; }
.r-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Scene 5: the party room, the reply, the ID ---------- */
.s-party .wrap { padding-top: calc(var(--top) + 8px); }
.discobox { position: relative; height: clamp(120px, 24vw, 190px); display: flex; justify-content: center; margin: -6px 0 -28px; pointer-events: none; }
.discobox .disco-svg { width: clamp(110px, 24vw, 170px); height: auto; transform-origin: 50% 0; animation: sway 6s ease-in-out infinite alternate; }
.s-party.seen .discobox .disco-svg { animation: dropin 1.3s cubic-bezier(.3, 1.3, .5, 1), sway 6s ease-in-out 1.3s infinite alternate; }
@keyframes dropin { from { transform: translateY(-120%); } }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.spark { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
.partyroom { position: relative; display: grid; justify-items: center; gap: 0; min-height: 190px; }
.pr-bird { width: min(46vw, 190px); animation: dance 1.2s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.pr-bird .tk { width: 100%; display: block; }
@keyframes dance { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-8px); } }
.pr-table { width: min(100%, 560px); margin-top: -26px; padding: 22px 14px 12px; border-radius: 120px / 40px; border: 3px solid var(--pink); background: linear-gradient(rgba(240, 91, 168, .35), rgba(36, 20, 60, .6)); box-shadow: 0 0 28px rgba(240, 91, 168, .65), inset 0 0 26px rgba(240, 91, 168, .35); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; min-height: 64px; }
.pr-table .ct { width: 62px; font-size: 11px; }
.pr-table .ct .fd { width: 44px; }
.pr-table p { color: var(--ivory); font-size: 14px; align-self: center; }
.milestone { text-align: center; font-weight: 700; color: var(--lime); }
.paper { padding: 20px 18px; border-radius: 28px; display: grid; gap: 14px; }
.paper .form { display: grid; gap: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: grid; place-items: center; min-height: 56px; padding: 8px 12px; border-radius: 16px; border: 2.5px solid var(--edge); background: rgba(20, 10, 40, .6); font-weight: 800; text-align: center; }
.choice input:checked + span { border-color: var(--lime); background: rgba(217, 255, 98, .22); box-shadow: 0 0 0 3px var(--lime); }
.choice input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 3px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--edge); background: rgba(20, 10, 40, .6); font-size: 26px; font-weight: 800; line-height: 1; }
.stepper output { min-width: 34px; text-align: center; font-family: var(--disp); font-size: 26px; }
.consent { font-size: 13px; color: var(--muted); }
.result { display: grid; gap: 10px; justify-items: center; text-align: center; }
.result h3 { font-family: var(--disp); font-weight: 400; font-size: clamp(22px, 5vw, 34px); text-transform: uppercase; text-shadow: 0 2px 0 var(--plum); }
.idwrap { display: grid; gap: 16px; justify-items: center; }
.idcard { position: relative; width: min(100%, 360px); aspect-ratio: 9 / 14.2; display: grid; grid-template-rows: auto auto auto auto 1fr auto; gap: 8px; justify-items: center; align-content: start; text-align: center; padding: 18px 18px 16px; border-radius: 28px; border: 4px solid var(--plum); background: linear-gradient(170deg, color-mix(in srgb, var(--ac, #D9FF62) 55%, #8B46E8), #2a1650 62%, #1a0f33); box-shadow: 0 0 0 4px var(--ac, var(--lime)), 0 0 44px color-mix(in srgb, var(--ac, #D9FF62) 55%, transparent), 0 20px 44px rgba(0, 0, 0, .45); overflow: hidden; }
.idcard::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, .22) 48%, transparent 60%); transform: translateX(-120%); animation: shine 1.4s ease-out .4s forwards; pointer-events: none; }
.id-top { width: 100%; display: flex; justify-content: space-between; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.id-av { width: 58%; }
.id-av .tk { width: 100%; display: block; }
.id-name { font-family: var(--disp); font-size: clamp(22px, 6vw, 28px); line-height: 1; text-transform: uppercase; text-shadow: 0 2px 0 var(--plum); overflow-wrap: anywhere; }
.id-role { font-weight: 800; color: var(--ac, var(--lime)); font-size: 15px; }
.id-punch { font-size: 13px; opacity: .92; }
.id-stats { width: 100%; display: grid; gap: 5px; margin: 0; align-self: start; }
.id-stats div { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 5px 10px; border-radius: 10px; background: rgba(0, 0, 0, .32); }
.id-stats dt { font-weight: 700; } .id-stats dd { margin: 0; font-weight: 900; color: var(--ac, var(--lime)); }
.id-foot { width: 100%; display: grid; gap: 3px; font-size: 12.5px; }
.id-status { display: inline-block; justify-self: center; padding: 4px 14px; border-radius: 999px; background: var(--ac, var(--lime)); color: var(--plum); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.after { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }

/* ---------- Sheets: event details and group results ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; background: rgba(10, 4, 24, .72); }
.overlay[hidden] { display: none; }
.sheet { position: relative; width: min(560px, 100%); max-height: 90vh; max-height: 90dvh; overflow: auto; display: grid; gap: 14px; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); border-radius: 28px 28px 0 0; background: #261447; border: 2px solid var(--edge); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
.sheet h2 { font-size: clamp(24px, 6vw, 32px); }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--edge); background: none; font-size: 24px; line-height: 1; }
.f-rows { display: grid; gap: 8px; margin: 0; }
.f-rows div { display: grid; grid-template-columns: 7.2em 1fr; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 246, 230, .07); }
.f-rows dt { font-weight: 800; color: var(--lime); font-size: 14px; } .f-rows dd { margin: 0; overflow-wrap: anywhere; }
.f-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.f-actions .btn { min-height: 46px; padding: 0 20px; font-size: 13px; }
.res-q { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(255, 246, 230, .07); }
.res-q h3 { font-size: 16px; line-height: 1.25; }

/* ---------- Wider screens ---------- */
@media (min-width: 700px) {
  .roles { grid-template-columns: repeat(3, 1fr); }
  .loot { grid-template-columns: repeat(3, 1fr); }
  .draft-top { grid-template-columns: minmax(0, 360px) 1fr; }
  .custom .row { grid-template-columns: 1fr 200px auto; align-items: end; }
  .overlay { place-items: center; }
  .sheet { border-radius: 28px; border-bottom: 2px solid var(--edge); }
}
@media (min-width: 1000px) {
  .cast-grid { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
  .cprev { position: sticky; top: calc(var(--top) + 8px); }
  .roles { grid-template-columns: repeat(4, 1fr); }
  .loot { grid-template-columns: repeat(4, 1fr); }
  .game { grid-template-columns: minmax(280px, 400px) 1fr; }
  .rsvp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 22px; align-items: start; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .phone { height: 74svh; }
  .bird { margin-top: -10svh; width: 30vh; }
  .hero { padding-bottom: 12px; gap: 6px; }
}

/* ---------- Calmer: for people who asked for less motion, and for phones that are struggling ---------- */
.rm *, .rm *::before, .rm *::after, .lite *, .lite *::before, .lite *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.lite .w-beams, .lite .orb { display: none; }
.lite .role { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .phone-wrap { transform: none !important; opacity: 1 !important; }
  .hero { opacity: 1 !important; }
}

/* ---------- The lock screen, the bird bursting out, and the calm layout ---------- */
.lock { position: absolute; inset: 0; z-index: 5; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: linear-gradient(#1A1245, #0F0E17); color: #fff; }
.lock[hidden] { display: none; }
.lk-time { font-size: 68px; font-weight: 200; line-height: 1; letter-spacing: -.02em; }
.lk-date { font-size: 16px; color: #C9C4F2; margin-bottom: 14px; }
.lk-note { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .16); color: #fff; text-align: left; font-family: inherit; animation: ring 1.4s ease-in-out infinite alternate; }
.lk-note b { display: block; font-size: 16px; }
.lk-note small { display: block; font-size: 14px; color: #D8D4F5; line-height: 1.3; }
.lock .av { background: var(--red); color: #fff; }
.lock .fine { color: #B5B1DC; }
.lock .linkish { color: #D8D4F5; font-size: 14px; }
@keyframes ring { from { transform: scale(1); } to { transform: scale(1.04) rotate(-.6deg); } }
.burst { transform: scale(calc(1 + var(--p, 0) * 2)); opacity: calc(1 - var(--p, 0) * 1.6); }
.shards i { position: absolute; left: 50%; top: 40%; width: 44px; height: 26px; margin: -13px 0 0 -22px; border-radius: 13px; background: var(--c); animation: shard .9s ease-out forwards; }
@keyframes shard { from { transform: translate(0, 0) scale(.2); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 0; } }
.phone.dim .ph-feed, .phone.dim .ph-bar { opacity: .55; }
.pc.back .pc-body { display: none !important; }
.rm .s-chat { height: auto; }
.rm .pin { position: relative; height: auto; min-height: 100svh; }
.rm .phone-wrap, .rm .burst { transform: none !important; opacity: 1 !important; }
.rm .phone-wrap { position: relative; inset: auto; padding-top: 8px; }
.rm .burst { position: relative; inset: auto; }
.rm .bird { margin-top: 0; }
.rm .hero { opacity: 1 !important; position: relative; padding-top: 12px; }
.rm .pin { display: grid; align-content: start; gap: 12px; }
.hero { padding-top: 70px; background: linear-gradient(rgba(20, 10, 40, 0), rgba(20, 10, 40, .88) 40%); }
.rm .hero { background: none; }
