/* Mystery portrait gallery (see gallery.js). Frames size from the viewport so a full wall fits the projector. */
.mg { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 2vh; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.mg-wall { --w: min(calc((88vw - (var(--cols) - 1) * 2.4vw) / var(--cols)), 30vh); display: grid; grid-template-columns: repeat(var(--cols), var(--w)); gap: 3vh 2.4vw; justify-content: center; align-content: center; }
.gf { margin: 0; display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 1.2vh; animation: gf-in .7s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * .12s) both; }
@keyframes gf-in { from { opacity: 0; transform: translateY(4vh) rotate(-4deg) scale(.9); } }
.gf-frame { position: relative; width: var(--w); aspect-ratio: 3 / 4; padding: calc(var(--w) * .075); border-radius: .6vh; transition: filter .4s, box-shadow .4s;
    background: linear-gradient(135deg, #7a5a18, #f3d27a 22%, #fff1c2 30%, #b88a2e 48%, #f3d27a 70%, #7a5a18);
    box-shadow: 0 1.6vh 3.2vh rgba(0, 0, 0, .6), inset 0 0 0 .35vh rgba(90, 60, 10, .7), inset 0 0 0 .9vh rgba(255, 230, 160, .35); }
.gf-frame::before { content: ""; position: absolute; inset: calc(var(--w) * .045); border: .3vh solid rgba(90, 60, 10, .55); border-radius: .3vh; pointer-events: none; }
.gf-canvas { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: .3vh; perspective: 60vh;
    background: radial-gradient(ellipse at 50% 35%, #3a1f4e, #1a0d24 60%, #0b0610); box-shadow: inset 0 0 3vh rgba(0, 0, 0, .9); }
.gf-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.gf-face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gf-q { font-family: var(--display, Rubik), Inter, sans-serif; font-weight: 900; font-size: calc(var(--w) * .62); line-height: 1;
    background: linear-gradient(180deg, #fff6c8, #e8c24a 55%, #a8741a); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 .6vh 1.2vh rgba(0, 0, 0, .8)); }
.gf-sil { transform: rotateY(180deg); font-size: calc(var(--w) * .5); filter: brightness(0) drop-shadow(0 0 1.4vh rgba(232, 194, 74, .9)); }
.gf-photo { position: absolute; inset: 0; display: grid; place-items: center; }
.gf-photo img, .gf-photo .sigil, .gf-photo > * { width: 100%; height: 100%; object-fit: cover; font-size: calc(var(--w) * .45); display: grid; place-items: center; }
.gf-crown { position: absolute; left: 50%; top: 2%; z-index: 3; font-size: calc(var(--w) * .22); transform: translate(-50%, -30%); opacity: 0; filter: drop-shadow(0 .4vh .8vh rgba(0, 0, 0, .7)); }
.gf.is-won .gf-crown { opacity: 1; animation: gf-bob 2.4s ease-in-out infinite; }
.gf-glint { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .22) 48%, transparent 60%) 0 0 / 260% 100%; animation: gf-glint 5s ease-in-out calc(var(--i) * .5s) infinite; }
@keyframes gf-glint { 0% { background-position: 140% 0; } 55%, 100% { background-position: -40% 0; } }
.gf-plaque { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4vh; box-sizing: border-box; width: calc(var(--w) * 1.08); padding: .8vh .8vw; border-radius: .6vh; text-align: center;
    background: linear-gradient(180deg, #d9b25a, #8f6a22); color: #1f1405; box-shadow: 0 .5vh 1vh rgba(0, 0, 0, .5), inset 0 .2vh 0 rgba(255, 240, 190, .7); }
.gf-plaque b { font-family: var(--display, Rubik), Inter, sans-serif; font-weight: 900; font-size: calc(var(--w) * .085); line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.gf-emoji { font-size: 1.1em; }
.gf-plaque em { width: 100%; font-style: normal; font-weight: 800; font-size: calc(var(--w) * .07); color: #3a1206; }
.mg-cap { padding: 1vh 2.6vw; border-radius: 99px; font-family: var(--display, Rubik), Inter, sans-serif; font-weight: 900; font-size: 4vh; color: #1a1206; background: linear-gradient(180deg, #fff3b0, #ffc23a); box-shadow: 0 0 3vh rgba(255, 194, 58, .5); animation: mg-cap .6s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes mg-cap { from { transform: translateY(2vh) scale(.6); opacity: 0; } }
@keyframes gf-bob { 50% { transform: translate(-50%, -45%) rotate(-6deg); } }

/* routine: a spotlight sweeps the wall and each frame lights as it passes */
.g-spot .gf-frame { animation: gf-lit 6.5s ease-in-out both; animation-delay: calc(var(--i) * (5.5s / var(--n))); }
@keyframes gf-lit { 0%, 30%, 100% { filter: brightness(.85); } 12% { filter: brightness(1.35); box-shadow: 0 0 5vh rgba(255, 230, 150, .8), 0 1.6vh 3.2vh rgba(0, 0, 0, .6); } }
/* routine: the "?" card flips to tease a costume silhouette, one frame after another */
.g-flip .gf-card { animation: gf-flip 6.5s ease-in-out both; animation-delay: calc(var(--i) * (4s / var(--n))); }
@keyframes gf-flip { 0%, 12%, 62%, 100% { transform: rotateY(0); } 22%, 52% { transform: rotateY(180deg); } }
/* routine: a glow chases around the wall like marquee lights */
.g-chase .gf-frame { animation: gf-chase 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * (1.6s / var(--n))); }
@keyframes gf-chase { 0%, 60%, 100% { box-shadow: 0 1.6vh 3.2vh rgba(0, 0, 0, .6), inset 0 0 0 .35vh rgba(90, 60, 10, .7); } 25% { box-shadow: 0 0 4vh #ffd84a, 0 0 1.2vh #fff, inset 0 0 0 .35vh rgba(90, 60, 10, .7); } }
/* routine: a crown hovers over each empty frame in turn */
.g-crown .gf:not(.is-won) .gf-crown { animation: gf-crownvisit 6.5s ease-in-out both; animation-delay: calc(var(--i) * (5.5s / var(--n))); }
@keyframes gf-crownvisit { 0%, 100% { opacity: 0; transform: translate(-50%, -120%) scale(.6); } 8% { opacity: 1; transform: translate(-50%, -30%) scale(1.1); } 16% { opacity: 1; transform: translate(-50%, -30%) scale(1); } 24% { opacity: 0; transform: translate(-50%, -140%) scale(.7); } }
/* routine: portraits wobble and the question marks pulse */
.g-shimmer .gf-frame { animation: gf-wobble 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); transform-origin: 50% 0; }
@keyframes gf-wobble { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.g-shimmer .gf-q { animation: gf-pulse 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
@keyframes gf-pulse { 50% { transform: scale(1.08); filter: drop-shadow(0 0 2vh rgba(255, 216, 74, .8)); } }

/* phones: a compact wall inside the Vote tab */
.mg.compact { height: auto; gap: 1rem; }
.mg.compact .mg-wall { --w: min(calc((100% - 1.4rem) / 3), 7.2rem); width: 100%; grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr)); gap: 1rem .7rem; }
.mg.compact .gf-frame, .mg.compact .gf-plaque { width: 100%; max-width: none; }
.mg.compact .gf-frame { padding: .45rem; }
.mg.compact .gf-q { font-size: 3.4rem; }
.mg.compact .gf-sil { font-size: 2.6rem; }
.mg.compact .gf-plaque { padding: .25rem .35rem; }
.mg.compact .gf-plaque b { font-size: .72rem; }
.mg.compact .gf-emoji { font-size: 1.05em; }
.mg.compact .gf-crown { font-size: 1.6rem; }
@media (prefers-reduced-motion: reduce) { .mg *, .mg { animation: none !important; } }

.mg-cap { justify-self: center; width: max-content; max-width: 90%; }
.race > .mg, .scene > .mg { flex: 1; }
.race-head[hidden] { display: none; }

/* ---------- waiting stages (waitstage.js) ---------- */
.wt { position: relative; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 2vh; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.wt-cap { justify-self: center; width: max-content; max-width: 90%; padding: 1vh 2.6vw; border-radius: 99px; font-family: var(--display, Rubik), Inter, sans-serif; font-weight: 900; font-size: 4vh; color: #1a1206; background: linear-gradient(180deg, #fff3b0, #ffc23a); box-shadow: 0 0 3vh rgba(255, 194, 58, .5); animation: mg-cap .6s cubic-bezier(.2, 1.5, .4, 1) both; }
/* podium */
.wt-board { position: relative; display: grid; justify-items: center; }
.wt-trophy { font-size: 12vh; animation: wt-trophy 3s ease-in-out infinite; filter: drop-shadow(0 0 3vh rgba(255, 216, 74, .7)); }
@keyframes wt-trophy { 0%, 100% { transform: translateY(0) rotateY(0); } 50% { transform: translateY(-2vh) rotateY(180deg); } }
.wt-podium { display: flex; align-items: flex-end; gap: 1vw; }
.wt-step { display: grid; justify-items: center; gap: 1vh; }
.wt-who { display: grid; place-items: center; width: 12vh; height: 12vh; border-radius: 50%; font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 8vh; color: #fff; background: radial-gradient(circle at 35% 30%, #6b3fa0, #2a1245); box-shadow: 0 0 0 .5vh rgba(255, 255, 255, .15); animation: wt-hop 1.4s cubic-bezier(.3, 0, .6, 1) infinite; }
.wt-step.p1 .wt-who { animation-delay: .15s; box-shadow: 0 0 0 .5vh #ffd84a, 0 0 3vh #ffd84a; } .wt-step.p3 .wt-who { animation-delay: .3s; }
@keyframes wt-hop { 0%, 100% { transform: translateY(0) scale(1.05, .95); } 40% { transform: translateY(-3vh) scale(.95, 1.05); } }
.wt-block { display: grid; place-items: start center; width: 22vh; padding-top: 1.4vh; border-radius: 1vh 1vh 0 0; background: linear-gradient(180deg, #e8c24a, #8f6a22); box-shadow: inset 0 .3vh 0 rgba(255, 240, 190, .7); }
.wt-step.p1 .wt-block { height: 26vh; } .wt-step.p2 .wt-block { height: 19vh; background: linear-gradient(180deg, #e4e8ee, #8b93a1); } .wt-step.p3 .wt-block { height: 14vh; background: linear-gradient(180deg, #e8a36a, #8a4f24); }
.wt-block b { font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 8vh; color: rgba(0, 0, 0, .45); }
/* polaroids */
.wt-photos { position: relative; width: 70vh; height: 52vh; }
.wt-pol { position: absolute; left: 50%; top: 50%; width: 26vh; padding: 1.4vh 1.4vh 5vh; background: #fbf8f1; box-shadow: 0 1.5vh 3vh rgba(0, 0, 0, .55); transform: translate(-50%, -50%) rotate(var(--t)); animation: wt-drop 9s cubic-bezier(.2, 1.2, .4, 1) calc(var(--i) * 1.2s) infinite both; }
.wt-pic { display: grid; place-items: center; aspect-ratio: 1; font-size: 12vh; background: radial-gradient(circle at 50% 40%, #3a1f4e, #120a1a); filter: saturate(.8); }
@keyframes wt-drop { 0% { transform: translate(-50%, -160%) rotate(calc(var(--t) * 3)) scale(1.3); opacity: 0; } 8% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--t)) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--t)); } 92%, 100% { opacity: 0; transform: translate(-50%, 60%) rotate(calc(var(--t) * -2)); } }
.wt-flash { position: absolute; inset: -40vh; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .25) 25%, transparent 55%); opacity: 0; animation: wt-flash 12s ease-out infinite; pointer-events: none; }
@keyframes wt-flash { 0%, 97% { opacity: 0; } 98% { opacity: .45; } 100% { opacity: 0; } }
.wt-cam { position: absolute; right: -4vh; bottom: -2vh; font-size: 9vh; animation: wt-snap 4.5s ease-in-out infinite; }
@keyframes wt-snap { 0%, 90%, 100% { transform: rotate(-8deg); } 95% { transform: rotate(4deg) scale(1.15); } }
/* runway */
.wt-parade { position: relative; width: 100%; height: 100%; overflow: hidden; }
.wt-runway { position: absolute; left: 6%; right: 6%; bottom: 8%; height: 3vh; display: flex; justify-content: space-between; align-items: center; padding: 0 2vw; border-radius: 1vh; background: linear-gradient(180deg, #5a1a2e, #2a0a16); box-shadow: 0 0 4vh rgba(200, 16, 46, .5); }
.wt-runway i { width: 1.6vh; height: 1.6vh; border-radius: 50%; background: #ffd84a; box-shadow: 0 0 1.4vh #ffd84a; animation: wt-foot 1.4s steps(1) infinite; }
.wt-runway i:nth-child(odd) { animation-delay: .7s; }
@keyframes wt-foot { 50% { opacity: .2; box-shadow: none; } }
.wt-walkers { position: absolute; left: 0; right: 0; bottom: 12%; height: 22vh; }
.wt-walk { position: absolute; bottom: 0; left: -12vh; font-size: 18vh; line-height: 1; animation: wt-strut 12s linear calc(var(--i) * -2s) infinite; filter: drop-shadow(0 1vh 1vh rgba(0, 0, 0, .6)); }
@keyframes wt-strut { 0% { transform: translateX(0) rotate(-4deg); } 45% { transform: translateX(55vw) rotate(4deg); } 50% { transform: translateX(58vw) scale(1.15); } 55% { transform: translateX(62vw) rotate(-4deg); } 100% { transform: translateX(110vw) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .wt *, .wt { animation: none !important; } }
.lb-wait { flex: 1; display: flex; width: 100%; align-self: stretch; min-height: 0; }
#ss > .wt, #sc-parade > .wt { flex: 1; }

/* ---------- vote waiting: ballot box with category ballots dropping in ---------- */
.wt-ballot { position: relative; width: 100%; height: 100%; display: grid; place-items: end center; padding-bottom: 4vh; }
.wt-box { position: relative; width: 36vh; height: 30vh; border-radius: 1.6vh; display: grid; place-items: center; align-content: center; gap: .6vh;
    background: linear-gradient(180deg, color-mix(in srgb, var(--violet) 75%, #fff) 0, var(--violet) 30%, color-mix(in srgb, var(--violet) 55%, #000)); box-shadow: 0 3vh 6vh rgba(0, 0, 0, .55), inset 0 .5vh 0 rgba(255, 255, 255, .35), inset 0 -1.5vh 3vh rgba(0, 0, 0, .35); }
.wt-slot { position: absolute; top: 2.4vh; left: 50%; width: 20vh; height: 1.6vh; margin-left: -10vh; border-radius: 99px; background: #0a0610; box-shadow: 0 0 2.4vh color-mix(in srgb, var(--gold) 80%, transparent), inset 0 .4vh .6vh rgba(0, 0, 0, .8); animation: wt-slotglow 1.6s ease-in-out infinite; }
@keyframes wt-slotglow { 50% { box-shadow: 0 0 5vh var(--gold), inset 0 .4vh .6vh rgba(0, 0, 0, .8); } }
.wt-box-star { font-size: 9vh; line-height: 1; color: var(--gold); text-shadow: 0 0 2vh color-mix(in srgb, var(--gold) 70%, transparent); animation: wt-trophy 4s ease-in-out infinite; }
.wt-box-word { font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 4.4vh; letter-spacing: .3em; color: #fff; }
.wt-card { position: absolute; left: 50%; bottom: calc(4vh + 27vh); width: 30vh; margin-left: -15vh; padding: 1vh 1.2vh; border-radius: .8vh; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8vh;
    background: #fbf8f1; color: #1a1206; box-shadow: 0 1vh 2vh rgba(0, 0, 0, .45); opacity: 0; animation: wt-ballot 8s cubic-bezier(.3, .6, .4, 1) calc(var(--i) * 1s) infinite; }
.wt-card em { font-style: normal; font-size: 3vh; } .wt-card b { font-weight: 900; font-size: 1.8vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wt-card i { font-style: normal; font-weight: 900; font-size: 2.6vh; color: var(--ecto); }
@keyframes wt-ballot { 0% { opacity: 0; transform: translate(calc(var(--from) * 45vw), -30vh) rotate(calc(var(--from) * -40deg)); } 4% { opacity: 1; } 11% { transform: translate(calc(var(--from) * 6vw), -12vh) rotate(calc(var(--from) * 10deg)); } 15% { opacity: 1; transform: translate(0, -2vh) rotate(0); } 19%, 100% { opacity: 0; transform: translate(0, 4vh) scaleY(.2); } }

/* ---------- winner waiting: a sealed gold envelope on a velvet cushion ---------- */
.wt-env { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.wt-envwrap { position: relative; z-index: 2; animation: wt-envfloat 3.4s ease-in-out infinite; }
.wt-envelope { position: relative; z-index: 2; width: 58vh; height: 36vh; border-radius: 1vh; background: linear-gradient(160deg, #fff3c4, #e8c24a 45%, #b8801a); box-shadow: 0 3vh 6vh rgba(0, 0, 0, .55), inset 0 0 0 .4vh rgba(255, 255, 255, .35); }
@keyframes wt-envfloat { 50% { transform: translateY(-2vh) rotate(-1.5deg); } }
.wt-flap { position: absolute; inset: 0 0 45% 0; background: linear-gradient(180deg, #f7dc86, #d4a238); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 .6vh .6vh rgba(0, 0, 0, .25)); }
.wt-seal { position: absolute; left: 50%; top: 55%; width: 9vh; height: 9vh; margin: -4.5vh 0 0 -4.5vh; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--blood) 60%, #fff), var(--blood) 45%, color-mix(in srgb, var(--blood) 60%, #000)); box-shadow: 0 .6vh 1.2vh rgba(0, 0, 0, .5); animation: wt-seal 1.7s ease-in-out infinite; }
.wt-seal::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 4.4vh; color: color-mix(in srgb, var(--blood) 40%, #fff); }
@keyframes wt-seal { 50% { transform: scale(1.08); box-shadow: 0 0 3vh color-mix(in srgb, var(--blood) 80%, transparent); } }
.wt-label { position: absolute; left: 0; right: 0; bottom: 2vh; height: 8vh; text-align: center; }
.wt-label span { position: absolute; inset: 0; font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 3.6vh; color: #3a2006; opacity: 0; transform: translateY(1vh); transition: opacity .5s, transform .5s; display: flex; align-items: flex-end; justify-content: center; padding: 0 3vh; line-height: 1.05; text-wrap: balance; }
.wt-label span.on { opacity: 1; transform: none; }
.wt-cushion { position: absolute; z-index: 1; bottom: 12%; left: 50%; width: 76vh; height: 12vh; margin-left: -38vh; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--blood) 70%, #fff) 0, var(--blood) 40%, color-mix(in srgb, var(--blood) 50%, #000)); box-shadow: 0 2vh 4vh rgba(0, 0, 0, .6); }
.wt-sparks { position: absolute; inset: 0; }
.wt-sparks b { position: absolute; bottom: 20%; width: .9vh; height: .9vh; border-radius: 50%; background: var(--gold); box-shadow: 0 0 1.4vh var(--gold); opacity: 0; animation: wt-spark 4s ease-out calc(var(--i) * .3s) infinite; }
@keyframes wt-spark { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50vh) translateX(3vh); } }
@media (prefers-reduced-motion: reduce) { .wt-card, .wt-envelope, .wt-seal, .wt-sparks b, .wt-slot { animation: none !important; } }

/* the winner card peeks out of the top of the envelope, wiggles, and tucks back in */
.wt-peek { position: absolute; z-index: 1; left: 50%; top: 2vh; width: 48vh; height: 30vh; margin-left: -24vh; border-radius: 1vh; padding-top: 1.6vh; display: grid; justify-items: center; align-content: start; gap: .6vh;
    background: linear-gradient(180deg, #fffdf6, #f3ead2); box-shadow: 0 0 0 .5vh var(--gold), 0 1vh 2vh rgba(0, 0, 0, .35); animation: wt-peek 7s cubic-bezier(.3, 1.3, .5, 1) infinite; }
.wt-peek b { font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 3.8vh; letter-spacing: .08em; color: var(--blood); }
.wt-peek span { font-weight: 900; font-size: 2.6vh; color: #3a2006; }
@keyframes wt-peek { 0%, 18% { transform: translateY(0); } 34%, 52% { transform: translateY(-14vh); } 56% { transform: translateY(-14vh) rotate(-2deg); } 60% { transform: translateY(-15vh) rotate(2deg); } 64% { transform: translateY(-14vh) rotate(0); } 80%, 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .wt-peek, .wt-envwrap { animation: none; } }

/* ---------- the ballot box's life cycle ---------- */
.wt-ballot .wt-box { transform: scale(var(--grow, 1)); transform-origin: 50% 100%; transition: transform .6s cubic-bezier(.2, 1.4, .4, 1), filter .4s; }
.wt-ballot:not(.ph-drop) .wt-card { visibility: hidden; }
/* charge: the box glows hotter and shakes */
.wt-ballot.ph-charge .wt-box { animation: wt-charge .12s linear infinite; filter: brightness(1.5) drop-shadow(0 0 4vh #fff3b0); }
@keyframes wt-charge { 25% { transform: scale(var(--grow, 1)) translate(.5vh, -.3vh) rotate(1deg); } 75% { transform: scale(var(--grow, 1)) translate(-.5vh, .3vh) rotate(-1deg); } }
/* supernova: flash, shockwaves, debris; the box blows apart */
.wt-nova, .wt-galaxy, .wt-debris { position: absolute; left: 50%; bottom: 19vh; width: 0; height: 0; pointer-events: none; }
.wt-nova i, .wt-galaxy i, .wt-debris b { position: absolute; display: block; }
.wt-ballot.ph-nova .wt-box { transform: scale(0) rotate(20deg); filter: brightness(4); transition: transform .35s ease-in, filter .2s; }
.wt-nova .flash { left: -60vmax; top: -60vmax; width: 120vmax; height: 120vmax; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 245, 210, .8) 18%, rgba(255, 180, 80, .35) 35%, transparent 60%); opacity: 0; }
.wt-ballot.ph-nova .wt-nova .flash { animation: wt-novaflash 1.4s ease-out both; }
@keyframes wt-novaflash { 0% { opacity: 0; transform: scale(.1); } 12% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.4); } }
.wt-nova .ring { left: -10vh; top: -10vh; width: 20vh; height: 20vh; border-radius: 50%; border: 1vh solid #fff3b0; box-shadow: 0 0 4vh #ffd84a, inset 0 0 3vh #ffd84a; opacity: 0; }
.wt-ballot.ph-nova .wt-nova .ring { animation: wt-ring 1.3s ease-out both; } .wt-ballot.ph-nova .wt-nova .ring.r2 { animation-delay: .25s; border-color: #b98ce0; box-shadow: 0 0 4vh #b14fe0; }
@keyframes wt-ring { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }
.wt-debris b { width: 1.4vh; height: 1.4vh; margin: -.7vh; border-radius: 50%; background: var(--c); box-shadow: 0 0 1.6vh var(--c); opacity: 0; }
.wt-ballot.ph-nova .wt-debris b { animation: wt-debris 1.5s cubic-bezier(.1, .8, .3, 1) both; }
@keyframes wt-debris { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: .9; transform: rotate(var(--a)) translateY(var(--r)); } }
/* galaxy: the debris swirls into a spinning spiral */
.wt-ballot.ph-galaxy .wt-debris b { opacity: .9; transform: rotate(var(--a)) translateY(var(--r)); animation: wt-orbit 5.2s linear both; }
@keyframes wt-orbit { from { transform: rotate(var(--a)) translateY(var(--r)); } to { transform: rotate(calc(var(--a) + 540deg)) translateY(calc(var(--r) * .3)); opacity: .3; } }
.wt-galaxy { opacity: 0; transition: opacity .8s; }
.wt-ballot.ph-galaxy .wt-galaxy { opacity: 1; }
.wt-galaxy .arm { left: -34vh; top: -34vh; width: 68vh; height: 68vh; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 10%, rgba(185, 140, 224, .75) 20%, transparent 32%, transparent 50%, rgba(49, 198, 255, .6) 70%, transparent 82%);
    -webkit-mask: radial-gradient(circle, transparent 6%, #000 20%, #000 45%, transparent 70%); mask: radial-gradient(circle, transparent 6%, #000 20%, #000 45%, transparent 70%); filter: blur(.6vh); animation: wt-spin 3s linear infinite; }
.wt-galaxy .arm.b { transform: scale(.7); animation-duration: 2.2s; background: conic-gradient(from 90deg, transparent 0 15%, rgba(255, 216, 74, .7) 25%, transparent 38%, transparent 55%, rgba(255, 79, 216, .55) 72%, transparent 85%); }
@keyframes wt-spin { to { transform: rotate(360deg); } }
.wt-galaxy .arm.b { animation-name: wt-spinb; } @keyframes wt-spinb { from { transform: scale(.7) rotate(0); } to { transform: scale(.7) rotate(360deg); } }
.wt-galaxy .core { left: -6vh; top: -6vh; width: 12vh; height: 12vh; border-radius: 50%; background: radial-gradient(circle, #fff, #ffe58a 30%, rgba(255, 180, 60, .4) 60%, transparent 72%); animation: wt-core 1.2s ease-in-out infinite alternate; }
@keyframes wt-core { to { transform: scale(1.3); filter: brightness(1.3); } }
/* reborn: the galaxy collapses and a bigger box forms */
.wt-ballot.ph-reborn .wt-galaxy { opacity: 0; transform: scale(.1); transition: opacity .8s, transform .8s ease-in; }
.wt-ballot.ph-reborn .wt-box { animation: wt-reborn 2s cubic-bezier(.3, 1.3, .4, 1) both; }
@keyframes wt-reborn { 0%, 52% { transform: translate(0, 0) scale(.02) rotate(0deg); filter: brightness(4); } 64% { transform: translate(0, 0) scale(calc(var(--grow, 1) * 1.25)) rotate(0deg); filter: brightness(2.4) drop-shadow(0 0 6vh #fff3b0); } 100% { transform: translate(0, 0) scale(var(--grow, 1)) rotate(0deg); filter: none; } }
/* five box styles, one per rebirth */
.wt-ballot.s1 .wt-box { background: linear-gradient(180deg, #fff3b0, #e8c24a 35%, #8a5a14); } .wt-ballot.s1 .wt-box-word { color: #3a2006; } .wt-ballot.s1 .wt-box-star { color: #fff; }
.wt-ballot.s2 .wt-box { background: rgba(20, 10, 40, .6); box-shadow: 0 0 0 .5vh #31c6ff, 0 0 4vh #31c6ff, inset 0 0 4vh rgba(49, 198, 255, .6); } .wt-ballot.s2 .wt-box-star { color: #31c6ff; }
.wt-ballot.s3 .wt-box { background: linear-gradient(135deg, rgba(220, 240, 255, .9), rgba(150, 200, 255, .55) 50%, rgba(200, 230, 255, .85)); box-shadow: 0 3vh 6vh rgba(0, 0, 0, .5), inset 0 0 3vh #fff; } .wt-ballot.s3 .wt-box-word { color: #1a3a6a; } .wt-ballot.s3 .wt-box-star { color: #fff; }
.wt-ballot.s4 .wt-box { background: radial-gradient(circle at 30% 30%, #ff4fd8, #6a2bb8 45%, #140a30); box-shadow: 0 0 5vh rgba(255, 79, 216, .6), inset 0 0 4vh rgba(255, 255, 255, .25); }
@media (prefers-reduced-motion: reduce) { .wt-ballot .wt-box, .wt-nova *, .wt-debris b, .wt-galaxy * { animation: none !important; transition: none !important; } }
.wt-ballot.ph-galaxy .wt-box { transform: scale(0); transition: none; }

/* cosmic events play on a canvas; the box is gone while they run */
.wt-ballot.ph-event .wt-box { animation: wt-absorb 1.1s cubic-bezier(.4, 0, .7, .6) both; }
@keyframes wt-absorb { 0% { transform: translate(0, 0) scale(var(--grow, 1)) rotate(0deg); filter: brightness(1.4); } 60% { filter: brightness(3) drop-shadow(0 0 6vh #fff); } 100% { transform: translate(var(--fromx, 0px), var(--fromy, 0px)) scale(.02) rotate(540deg); filter: brightness(5); } }
/* the rebirth: a shockwave ring bursts out of the spot as the new, bigger box flies out */
.wt-ballot.ph-reborn .wt-box::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10vh; height: 10vh; margin: -5vh; border-radius: 50%; box-shadow: 0 0 0 .8vh rgba(255, 243, 176, .9), 0 0 6vh rgba(255, 216, 74, .8); animation: wt-rebornring 2s ease-out both; pointer-events: none; }
@keyframes wt-rebornring { 0%, 52% { transform: scale(.2); opacity: 0; } 55% { opacity: 1; } 100% { transform: scale(6); opacity: 0; } }
.hv-cosmos { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; clip-path: inset(13vh 0 0 0); pointer-events: none; opacity: 0; transition: opacity .5s; }
.hv-cosmos.on { opacity: 1; }

/* bloom: a quarter-size copy of the cosmos canvas, blurred and screened on top */
.hv-cosmos.bloom { z-index: 0; filter: blur(14px) brightness(1.5) saturate(1.2); mix-blend-mode: screen; }
/* camera shake for big impacts */
.hv-quake body { animation: hv-quake .65s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes hv-quake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-7px, 3px); } 40%, 60% { transform: translate(7px, -3px); } }
@media (prefers-reduced-motion: reduce) { .hv-quake body { animation: none; } .hv-cosmos.bloom { display: none; } }

/* fireworks canvas: behind the content, below the header */
.hv-fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; clip-path: inset(13vh 0 0 0); opacity: 0; transition: opacity .6s; }
.hv-fireworks.on { opacity: 1; }

/* ---------- the QR card: the voting screen and every game lobby. A big QR on white, the address, and the caption ---------- */
/* one set of sizes: the white QR tile, the card's padding, the column that holds the card, and how far a show's backdrop
   runs past its own area to reach the screen's right edge (the column, the 2vw gap, and the scene's side padding) */
:root { --wt-qrs: 38vh; --wt-qrpad: 2vh; --wt-col: calc(var(--wt-qrs) + 2 * var(--wt-qrpad)); --wt-bleed: calc(var(--wt-col) + 2vw + 4vw); }
.wt.wt-qrside { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) var(--wt-col); justify-items: stretch; align-items: stretch; gap: 2vw; }
/* game lobbies that keep the card in their last column: that column is exactly the card's width */
:is(.wf-wait, .bl-wait, .sd-wait, .fy-wrap, .dc-wait, .cp-wait, .mo-wait, .sv-wait, .sv-surv, .sk-wait, .rpt-wait, .bd-wait, .wy-wait):has(> .wt-qr) { grid-template-columns: minmax(0, 1fr) var(--wt-col); }
.wt-main { position: relative; min-width: 0; min-height: 0; display: grid; }
.wt-main > .vs, .wt-main > * { min-height: 0; }
/* the card never grows past its column; the QR, the address and the caption all stay inside it */
.wt-qr { position: relative; z-index: 50; box-sizing: border-box; justify-self: center; align-self: center; width: min(100%, var(--wt-col)); max-width: 100%;
    display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 1.6vh; padding: var(--wt-qrpad); border-radius: 3vh; clip-path: none; -webkit-mask: none; mask: none;
    background: linear-gradient(180deg, rgba(20, 12, 36, .9), rgba(10, 6, 20, .94)); box-shadow: inset 0 0 0 .3vh rgba(255, 216, 74, .45), 0 2vh 5vh rgba(0, 0, 0, .6); }
/* the QR: always square, on white with a quiet margin, as big as the card allows */
.wt-qrbox { box-sizing: border-box; width: var(--wt-qrs); max-width: 100%; height: auto; aspect-ratio: 1; padding: 2.2vh; border-radius: 1.6vh; background: #fff;
    box-shadow: 0 0 0 .5vh var(--gold, #e8c24a), 0 0 5vh rgba(255, 216, 74, .45); animation: wt-qrglow 2.4s ease-in-out infinite alternate; }
.wt-qrbox canvas, .wt-qrbox img { width: 100% !important; height: 100% !important; display: block; border-radius: 0; }
@keyframes wt-qrglow { to { box-shadow: 0 0 0 .5vh var(--gold, #e8c24a), 0 0 8vh rgba(255, 216, 74, .7); } }
/* the address stays on one line; waitstage.js shrinks it if a long address would run past the card */
.wt-url { box-sizing: border-box; width: 0; min-width: 100%; font-family: var(--display, Rubik), sans-serif; font-weight: 900; font-size: 3vh; line-height: 1.15; color: var(--gold, #e8c24a);
    text-shadow: 0 .3vh 1vh rgba(0, 0, 0, .7); white-space: nowrap; text-align: center; }
/* in QR mode, the shows' full-bleed backdrops run under the QR panel to the screen edge */
.wt-qrside .nn-wall, .wt-qrside .nn-wash, .wt-qrside .lab-wall, .wt-qrside .lab-floor, .wt-qrside .lab-flash, .wt-qrside .ck-sky, .wt-qrside .ck-ground,
.wt-qrside .og-nave, .wt-qrside .grn-fog, .wt-qrside .mky-dim, .wt-qrside .eyz-black { right: calc(-1 * var(--wt-bleed)) !important; }

/* the star that flies out of the explosion and becomes the box */
.wt-starfly { position: absolute; z-index: 9; width: 10vh; height: 10vh; margin: -5vh 0 0 -5vh; display: grid; place-items: center; font-style: normal; font-size: 8vh; line-height: 1; color: #fff3b0;
    text-shadow: 0 0 2vh #ffd84a, 0 0 6vh #ff9a2e; animation: wt-starfly 1.15s cubic-bezier(.3, .1, .3, 1) both; pointer-events: none; }
@keyframes wt-starfly {
    0% { transform: translate(var(--fx), var(--fy)) scale(.2) rotate(0deg); opacity: 0; }
    12% { opacity: 1; }
    80% { transform: translate(0, 0) scale(3.2) rotate(620deg); opacity: 1; }
    100% { transform: translate(0, 0) scale(5) rotate(720deg); opacity: 0; }
}
/* the claw's winner backdrop runs to the screen's right edge behind the QR card (which stays on top), while the
   padding on that side keeps the winner itself centered in the show's own area */
.wt-qrside .vs-claw2 .cm2-win { right: calc(-1 * var(--wt-bleed)); padding-right: calc(var(--wt-bleed) - 12vw); border-radius: 0; }

/* the caption in the QR panel wraps within the panel instead of pushing past it */
.wt-qr .wt-cap { justify-self: stretch; width: auto; max-width: 100%; box-sizing: border-box; font-size: 2.9vh; white-space: normal; text-wrap: balance; text-align: center; line-height: 1.15; padding: 1vh 1.8vh; }
/* the QR panel sits in front of everything in the show: the show's own layers stay beneath it */
.wt-qrside .wt-main { position: relative; z-index: 1; }
.wt-qrside .wt-qr { z-index: 50; }
/* in QR mode the rocket's countdown fits the narrower animation area */
.wt-qrside .rk-count { left: 64%; font-size: min(20vh, 7.4vw); white-space: nowrap; }
/* carousel: more than five frames show as pages that slide past */
.mg.is-paged { grid-template-rows: minmax(0, 1fr) auto auto; }
.mg-pages { display: grid; justify-self: stretch; align-self: stretch; width: 100%; height: 100%; min-height: 0; place-items: center; }
.mg-pages > .mg-page { grid-area: 1 / 1; opacity: 0; transform: translateX(8vw); transition: opacity .9s ease, transform .9s ease; pointer-events: none; }
.mg-pages > .mg-page.on { opacity: 1; transform: none; }
.mg-pages > .mg-page.out { opacity: 0; transform: translateX(-8vw); }
.mg-dots { display: flex; gap: 1vw; justify-content: center; }
.mg-dots i { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: background .4s, transform .4s; }
.mg-dots i.on { background: var(--gold, #e6b422); transform: scale(1.4); }
