:root {
  color-scheme: dark;
  --ink: #14071f;
  --house: #0b0311;
  --wine: #8d123e;
  --red: #ea1f5e;
  --pink: #ff4cad;
  --orange: #ff7a31;
  --yellow: #ffe75e;
  --mint: #58f3c2;
  --blue: #3d4cff;
  --violet: #7528c7;
  --cream: #fff8d8;
  --white: #fffdf5;
  --shadow: rgba(7, 1, 12, 0.72);
  --stage-bottom: 17.5dvh;
  font-family: "Arial Black", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--house);
}

button,
input,
textarea,
select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

body {
  min-height: 100dvh;
  color: var(--white);
  overscroll-behavior: none;
}

.theatre {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 231, 94, 0.23), transparent 36%),
    linear-gradient(180deg, #32104b 0 8%, #16071f 8% 78%, #08020d 78% 100%);
}

.house-ceiling {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 8dvh;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-inline: 7vw;
  background: linear-gradient(180deg, #09020d, #2a0b39);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.house-ceiling span,
.proscenium-bulbs::before,
.proscenium-bulbs::after {
  width: clamp(7px, 0.8vw, 13px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px 5px rgba(255, 231, 94, 0.58);
}

.proscenium {
  position: absolute;
  z-index: 3;
  inset: 6.2dvh 2.4vw calc(var(--stage-bottom) - 1dvh);
  pointer-events: none;
  border: clamp(12px, 1.6vw, 25px) solid #e12d68;
  border-bottom-width: clamp(18px, 2vw, 32px);
  border-radius: 48% 48% 1.1rem 1.1rem / 10% 10% 1.1rem 1.1rem;
  box-shadow:
    inset 0 0 0 5px #ff8a38,
    inset 0 0 0 9px #5c123f,
    0 0 0 3px #25051e,
    0 2.5dvh 5dvh rgba(0, 0, 0, 0.5);
}

.proscenium-bulbs {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle, var(--yellow) 0 3px, transparent 4px) 0 0 / 34px 34px repeat-x,
    radial-gradient(circle, var(--yellow) 0 3px, transparent 4px) 0 100% / 34px 34px repeat-x,
    radial-gradient(circle, var(--yellow) 0 3px, transparent 4px) 0 0 / 34px 34px repeat-y,
    radial-gradient(circle, var(--yellow) 0 3px, transparent 4px) 100% 0 / 34px 34px repeat-y;
  filter: drop-shadow(0 0 6px rgba(255, 231, 94, 0.74));
}

.stage {
  position: absolute;
  z-index: 2;
  inset: 7.5dvh 3.7vw var(--stage-bottom);
  overflow: hidden;
  border-radius: 45% 45% 0.7rem 0.7rem / 8% 8% 0.7rem 0.7rem;
  background: #d8558e;
  box-shadow: inset 0 -8dvh 8dvh rgba(29, 4, 44, 0.42);
}

.stage::before {
  content: "";
  position: absolute;
  z-index: 18;
  inset: auto -5% -9% -5%;
  height: 29%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 7vw),
    linear-gradient(180deg, #8c2f63 0, #4e1748 60%, #210b2a 100%);
  transform: perspective(520px) rotateX(58deg);
  transform-origin: bottom;
  border-top: 3px solid rgba(255, 255, 255, 0.22);
}

.sky {
  position: absolute;
  z-index: 0;
  inset: 0 0 16%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 244, 190, 0.65), transparent 8%),
    linear-gradient(145deg, #ff766e 0 18%, #bd45ac 49%, #4a2db3 100%);
  transition: background 700ms ease;
}

.theatre[data-scene="act2"] .sky {
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.7), transparent 9%),
    linear-gradient(145deg, #22c5d3 0 22%, #504be3 48%, #e648ab 100%);
}

.theatre[data-scene="act3"] .sky,
.theatre[data-scene="finale"] .sky {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 239, 123, 0.84), transparent 10%),
    linear-gradient(145deg, #f13d85 0 20%, #ff8e3d 45%, #ffe45f 100%);
}

.cloud {
  position: absolute;
  width: clamp(90px, 13vw, 190px);
  height: clamp(26px, 4vw, 58px);
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.88);
  filter: drop-shadow(0 10px 0 rgba(96, 30, 128, 0.16));
  transition: transform 750ms cubic-bezier(.2, .85, .2, 1);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 22%;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { left: 17%; width: 34%; aspect-ratio: 1; }
.cloud::after { right: 16%; width: 42%; aspect-ratio: 1; }
.cloud-one { left: 7%; top: 18%; transform: rotate(-4deg); }
.cloud-two { right: 6%; top: 28%; transform: rotate(6deg) scale(0.82); }

.show-moon {
  position: absolute;
  z-index: 2;
  right: 17%;
  top: 10%;
  width: clamp(62px, 9vw, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  border: clamp(5px, 0.7vw, 10px) solid var(--cream);
  box-shadow: 0 0 45px rgba(255, 231, 94, 0.72);
  transition: transform 850ms cubic-bezier(.19, .9, .25, 1.2), right 850ms ease, top 850ms ease;
}

.show-moon i {
  position: absolute;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 18%;
  top: 24%;
  background: rgba(165, 90, 77, 0.18);
  box-shadow: 2.2em 1.1em 0 rgba(165, 90, 77, 0.15);
}

.sunrise {
  position: absolute;
  left: 44%;
  bottom: -18%;
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff0a2;
  box-shadow: 0 0 0 12px rgba(255, 232, 92, 0.24), 0 0 60px 24px rgba(255, 120, 49, 0.52);
  transition: transform 850ms ease;
}

.theatre[data-cue="1"] .sunrise,
.theatre[data-scene="act2"] .sunrise,
.theatre[data-scene="act3"] .sunrise,
.theatre[data-scene="finale"] .sunrise { transform: translateY(-78%); }

.spotlight {
  position: absolute;
  z-index: 7;
  top: -11%;
  width: 32%;
  height: 102%;
  opacity: 0.12;
  background: linear-gradient(180deg, rgba(255, 255, 220, 0.95), rgba(255, 255, 220, 0));
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 450ms ease, transform 650ms ease;
}

.spotlight-left { left: 3%; transform: rotate(8deg); }
.spotlight-right { right: 3%; transform: rotate(-8deg); }
.spotlight-center { left: 34%; width: 32%; opacity: 0.06; }
.theatre[data-cue="2"] .spotlight-left,
.theatre[data-cue="2"] .spotlight-right,
.theatre[data-cue="4"] .spotlight-center { opacity: 0.55; }
.theatre[data-scene="finale"] .spotlight { opacity: 0.68; }

.turntable {
  position: absolute;
  z-index: 4;
  bottom: 16%;
  width: 27%;
  height: 54%;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(.18, .83, .2, 1);
}

.turntable-left { left: 4%; transform: rotate(-7deg); }
.turntable-right { right: 4%; transform: rotate(7deg); }

.set-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: clamp(5px, 0.7vw, 11px) solid #361149;
  box-shadow: 0 1.5dvh 0 #321042, 0 2.4dvh 3dvh rgba(28, 4, 39, 0.34);
  transition: opacity 550ms ease, transform 850ms ease;
}

.town-face {
  background:
    linear-gradient(100deg, transparent 0 46%, rgba(255,255,255,.14) 47% 49%, transparent 50%),
    linear-gradient(155deg, #5cf0bf, #3153df 72%);
}

.wedding-face {
  opacity: 0;
  transform: rotateY(90deg) scaleX(0.78);
  background:
    radial-gradient(circle at 18% 18%, #ff65ae 0 4%, transparent 4.5%),
    radial-gradient(circle at 82% 26%, #ffd84f 0 4%, transparent 4.5%),
    linear-gradient(150deg, #fff5d3, #ff9dc8 68%, #f45a99);
}

.window {
  position: absolute;
  width: 23%;
  aspect-ratio: .7;
  top: 24%;
  background: var(--yellow);
  border: 5px solid #2c1550;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.33);
}

.window-one { left: 15%; }
.window-two { right: 15%; top: 48%; }

.roofline {
  position: absolute;
  left: -10%;
  top: -2%;
  width: 120%;
  height: 26%;
  background: #ff557a;
  clip-path: polygon(0 80%, 22% 10%, 46% 72%, 69% 0, 100% 75%, 100% 100%, 0 100%);
}

.flower {
  position: absolute;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 16px 4px 0 var(--yellow), 7px 17px 0 var(--mint);
}

.flower-one { left: 10%; top: 15%; }
.flower-two { right: 18%; top: 28%; transform: scale(.8); }
.flower-three { left: 40%; bottom: 15%; transform: scale(1.15); }

.theatre[data-scene="act2"] .turntable-left { transform: translateX(6vw) rotate(4deg); }
.theatre[data-scene="act2"] .turntable-right { transform: translateX(-6vw) rotate(-4deg); }
.theatre[data-scene="act3"] .turntable { transform: rotateY(180deg) rotate(0deg) scaleX(.9); }
.theatre[data-scene="finale"] .turntable-left { transform: translateX(-8%) rotateY(180deg) rotate(-7deg) scaleX(.9); }
.theatre[data-scene="finale"] .turntable-right { transform: translateX(8%) rotateY(180deg) rotate(7deg) scaleX(.9); }
.theatre[data-scene="act3"] .town-face,
.theatre[data-scene="finale"] .town-face { opacity: 0; transform: rotateY(-90deg); }
.theatre[data-scene="act3"] .wedding-face,
.theatre[data-scene="finale"] .wedding-face { opacity: 1; transform: rotateY(180deg) scaleX(1); }

.garden {
  position: absolute;
  z-index: 5;
  inset: auto 0 14% 0;
  height: 18%;
  opacity: 0;
  transform: translateY(60%);
  transition: opacity 650ms ease, transform 650ms ease;
}

.garden span {
  position: absolute;
  bottom: 0;
  width: clamp(42px, 6vw, 92px);
  aspect-ratio: 1;
  border-radius: 55% 45% 54% 46%;
  background: var(--mint);
  border: 6px solid #184d54;
}

.garden span:nth-child(1) { left: 5%; }
.garden span:nth-child(2) { left: 23%; transform: scale(.7); }
.garden span:nth-child(3) { left: 47%; transform: scale(1.15); }
.garden span:nth-child(4) { right: 21%; transform: scale(.78); }
.garden span:nth-child(5) { right: 4%; }

.wedding-arch {
  position: absolute;
  z-index: 8;
  left: 34%;
  bottom: 14%;
  width: 32%;
  height: 56%;
  opacity: 0;
  transform: translateY(40%) scale(.8);
  border: clamp(8px, 1vw, 15px) solid var(--cream);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 0 0 5px #ef4b93;
  transition: opacity 650ms ease, transform 800ms cubic-bezier(.18,.87,.22,1.08);
}

.arch-flower {
  position: absolute;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 10px 3px 0 var(--yellow), 4px 11px 0 var(--mint);
}

.arch-flower-one { left: -13%; top: 18%; }
.arch-flower-two { right: -11%; top: 9%; transform: scale(.76); }
.arch-flower-three { left: 37%; top: -8%; transform: scale(1.1); }

.theatre[data-scene="act3"] .garden,
.theatre[data-scene="finale"] .garden,
.theatre[data-scene="act3"] .wedding-arch,
.theatre[data-scene="finale"] .wedding-arch {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.trap-ribbon {
  position: absolute;
  z-index: 9;
  left: 10%;
  bottom: 17%;
  width: 24%;
  height: 7%;
  opacity: 0;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 14px, var(--pink) 14px 28px);
  transform: rotate(-7deg) translateY(200%);
  transition: opacity 450ms ease, transform 650ms ease;
}

.theatre.has-mishaps .trap-ribbon,
.theatre[data-scene="finale"] .trap-ribbon { opacity: 1; transform: rotate(-7deg) translateY(0); }

.grand-drape {
  position: absolute;
  z-index: 24;
  top: 4.5dvh;
  bottom: calc(var(--stage-bottom) - 1dvh);
  width: 20vw;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 5%, rgba(255,255,255,.18) 6% 8%, transparent 9% 19%, rgba(255,255,255,.13) 20% 22%, transparent 23%),
    repeating-linear-gradient(90deg, #80133d 0 12%, #df1e5b 12% 25%, #9b1649 25% 38%);
  box-shadow: inset 0 0 30px rgba(45, 4, 27, .7);
  transition: transform 950ms cubic-bezier(.18,.82,.18,1);
}

.grand-drape-left { left: -1vw; border-radius: 0 0 55% 0; }
.grand-drape-right { right: -1vw; transform: scaleX(-1); border-radius: 0 0 55% 0; }

.valance {
  position: absolute;
  z-index: 25;
  left: 1.5vw;
  right: 1.5vw;
  top: 3.2dvh;
  height: 14dvh;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, #89123f 0 8%, #dd1c5a 8% 16%, #9e1649 16% 24%);
  clip-path: polygon(0 0,100% 0,100% 55%,94% 76%,88% 52%,82% 77%,76% 53%,70% 78%,64% 54%,58% 79%,52% 55%,46% 79%,40% 54%,34% 78%,28% 53%,22% 77%,16% 52%,10% 76%,4% 55%,0 58%);
  filter: drop-shadow(0 9px 7px rgba(25, 1, 18, .48));
  transition: transform 900ms ease;
}

.theatre[data-scene="intro"] .grand-drape-left { transform: translateX(-64%); }
.theatre[data-scene="intro"] .grand-drape-right { transform: translateX(64%) scaleX(-1); }
.theatre:not([data-scene="intro"]) .grand-drape-left { transform: translateX(-91%); }
.theatre:not([data-scene="intro"]) .grand-drape-right { transform: translateX(91%) scaleX(-1); }
.theatre:not([data-scene="intro"]) .valance { transform: translateY(-35%); }
.theatre:not([data-scene="intro"]) .intro { display: none; }

.company {
  position: absolute;
  z-index: 12;
  inset: 24% 6% 15%;
  pointer-events: none;
}

.actor {
  --x: 50;
  --y: 70;
  --fx: 50;
  --fy: 70;
  --tilt: 0deg;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: clamp(16px, 2.05vw, 31px);
  height: clamp(52px, 8.5vw, 118px);
  transform: translate(-50%, -50%) rotate(var(--tilt));
  transform-origin: 50% 88%;
  transition: left 850ms cubic-bezier(.18,.87,.22,1), top 850ms cubic-bezier(.18,.87,.22,1), transform 650ms ease, filter 400ms ease;
  filter: drop-shadow(0 0.8dvh 0.5dvh rgba(31, 5, 42, 0.32));
}

.actor-body {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 23%;
  bottom: 5%;
  border-radius: 47% 47% 16% 16%;
  background: var(--costume, var(--mint));
  border: max(2px, .18vw) solid #24103b;
}

.actor-body::before,
.actor-body::after {
  content: "";
  position: absolute;
  top: 18%;
  width: 28%;
  height: 64%;
  border-radius: 999px;
  background: inherit;
  border: inherit;
  transform-origin: top center;
}

.actor-body::before { left: -25%; transform: rotate(16deg); }
.actor-body::after { right: -25%; transform: rotate(-16deg); }

.actor-head {
  position: absolute;
  z-index: 2;
  left: 23%;
  top: 0;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--skin, #7d3d37);
  border: max(2px, .18vw) solid #24103b;
}

.actor-head::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: -20%;
  height: 48%;
  border-radius: 80% 80% 35% 35%;
  background: var(--hair, #24103b);
}

.actor-lead .actor-body { border-radius: 50% 50% 36% 36%; }
.actor-stagehand { filter: saturate(.55) drop-shadow(0 .8dvh .5dvh rgba(31,5,42,.32)); }
.actor-villain { z-index: 14; width: clamp(20px, 2.5vw, 38px); }
.actor-villain .actor-body { background: #29113e; clip-path: polygon(18% 0,82% 0,100% 100%,50% 84%,0 100%); }
.actor-villain .actor-head::after {
  content: "";
  position: absolute;
  left: 8%;
  top: -45%;
  width: 84%;
  height: 42%;
  background: var(--yellow);
  clip-path: polygon(0 100%,12% 0,35% 62%,50% 0,66% 62%,88% 0,100% 100%);
}

.theatre[data-scene="act1"] .actor:nth-child(3n) { transform: translate(-50%, -50%) rotate(-7deg); }
.theatre[data-scene="act1"] .actor:nth-child(4n) { transform: translate(-50%, -50%) rotate(8deg); }
.theatre[data-scene="act2"] .actor:nth-child(odd) { transform: translate(-50%, -57%) rotate(-4deg); }
.theatre[data-scene="act2"] .actor:nth-child(even) { transform: translate(-50%, -43%) rotate(5deg); }
.theatre[data-scene="act3"] .actor:nth-child(5n) { transform: translate(-50%, -62%) rotate(10deg); }

.theatre.outcome-wrong .actor:nth-child(3n + 1) { transform: translate(-50%, -78%) rotate(15deg); }
.theatre.outcome-wrong .show-moon { transform: translate(-33vw, 33vh) rotate(32deg) scale(.72); }
.theatre.outcome-correct .actor:nth-child(4n + 2) { transform: translate(-50%, -65%) rotate(-6deg); }

.theatre[data-scene="finale"] .actor {
  left: calc(var(--fx) * 1%);
  top: calc(var(--fy) * 1%);
  transform: translate(-50%, -50%) rotate(var(--frot, 0deg)) scale(var(--fscale, 1));
  filter: drop-shadow(0 1.1dvh .6dvh rgba(31,5,42,.42));
}

.theatre[data-scene="finale"] .actor-stair { z-index: 21; }
.theatre[data-scene="finale"] .actor-stair .actor-body::before { transform: rotate(84deg); }
.theatre[data-scene="finale"] .actor-stair .actor-body::after { transform: rotate(-84deg); }
.theatre[data-scene="finale"] .actor-carrier { z-index: 22; }
.theatre[data-scene="finale"] .actor-carrier .actor-body::before { transform: translateY(-10%) rotate(-58deg); }
.theatre[data-scene="finale"] .actor-carrier .actor-body::after { transform: translateY(-10%) rotate(58deg); }
.theatre[data-scene="finale"] .actor-bow { transform: translate(-50%, -45%) rotate(var(--frot, 0deg)) scale(var(--fscale, 1), .78); }
.theatre[data-scene="finale"] .actor-bow .actor-head { transform: translateY(54%); }
.theatre[data-scene="finale"] .actor-villain { z-index: 24; }

.intro,
.cue-panel,
.outcome,
.curtain-call {
  position: absolute;
  z-index: 31;
  text-shadow: 0 4px 18px rgba(39, 6, 50, 0.48);
}

.intro {
  left: 9%;
  top: 13%;
  width: min(610px, 72%);
}

.eyebrow,
.act-label,
.outcome-kicker,
.control-guide,
.start-note {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: clamp(.66rem, 1vw, .82rem);
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1.25;
  text-transform: uppercase;
}

.intro h1,
.cue-panel h2,
.outcome h2,
.curtain-call h2 {
  margin: .1em 0;
  color: var(--cream);
  font-size: clamp(3.8rem, 9.4vw, 9.5rem);
  font-weight: 1000;
  letter-spacing: -.085em;
  line-height: .75;
  text-transform: uppercase;
}

.intro h1 span { color: var(--yellow); }

.premise,
.cue-direction,
.outcome p,
.finale-summary {
  max-width: 42rem;
  margin: 1rem 0 1.3rem;
  font-family: system-ui, sans-serif;
  font-size: clamp(.94rem, 1.55vw, 1.18rem);
  font-weight: 680;
  line-height: 1.43;
}

.marquee-button,
.ribbon-button {
  min-width: 44px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: .92rem 1.25rem;
  cursor: pointer;
  color: #1d0a27;
  background: var(--yellow);
  box-shadow: 0 .42rem 0 #8d4b2c, 0 .85rem 1.4rem rgba(27, 4, 36, .28);
  font-size: clamp(.88rem, 1.2vw, 1rem);
  font-weight: 1000;
  letter-spacing: .02em;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.marquee-button:hover,
.ribbon-button:hover { transform: translateY(-2px); box-shadow: 0 .55rem 0 #8d4b2c, 0 1rem 1.6rem rgba(27,4,36,.3); }
.marquee-button:active,
.ribbon-button:active { transform: translateY(.32rem); box-shadow: 0 .1rem 0 #8d4b2c; }
.start-note { margin-top: 1rem; letter-spacing: .06em; opacity: .78; }

.cue-panel {
  left: 6%;
  top: 10%;
  width: min(670px, 58%);
}

.cue-panel h2 { font-size: clamp(3rem, 7.2vw, 7.5rem); }
.cue-call {
  display: inline-flex;
  margin: .25rem 0 0;
  padding: .55rem .75rem;
  border: 2px solid rgba(255,255,255,.62);
  border-radius: 999px;
  background: rgba(24, 5, 34, .48);
  font-family: system-ui, sans-serif;
  font-size: clamp(.75rem, 1.2vw, .95rem);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.outcome {
  left: 6%;
  top: 12%;
  width: min(610px, 58%);
}

.outcome h2 { font-size: clamp(3rem, 7vw, 7.2rem); }
.outcome-kicker { color: var(--yellow); }

.curtain-call {
  left: 5%;
  top: 7%;
  width: min(410px, 31%);
}

.curtain-call h2 { color: var(--yellow); font-size: clamp(3.1rem, 5.7vw, 6rem); }

.mishap-garland {
  position: absolute;
  z-index: 29;
  right: 2.5%;
  top: 12%;
  width: min(23rem, 27%);
  display: grid;
  gap: .42rem;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.mishap-garland li {
  justify-self: end;
  max-width: 100%;
  padding: .42rem .62rem;
  transform: rotate(var(--tag-tilt, 1deg));
  border: 2px solid #2a0d36;
  background: var(--yellow);
  color: #2a0d36;
  box-shadow: .35rem .35rem 0 rgba(39, 8, 44, .3);
  font-family: system-ui, sans-serif;
  font-size: clamp(.63rem, .9vw, .78rem);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.mishap-garland li:nth-child(even) { --tag-tilt: -2deg; background: var(--mint); }
.mishap-garland li:nth-child(3n) { --tag-tilt: 2deg; background: #ff9fd0; }

.apron {
  position: absolute;
  z-index: 19;
  left: 10%;
  right: 10%;
  bottom: 7.5%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 235, 118, .35), transparent 66%);
}

.footlights {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: max(1.2dvh, env(safe-area-inset-bottom));
  width: min(760px, 92vw);
  min-height: calc(var(--stage-bottom) - 2.2dvh);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: .55rem .7rem;
  transform: translateX(-50%);
  transition: opacity 350ms ease, transform 350ms ease;
}

.theatre[data-scene="intro"] .footlights,
.theatre[data-scene="finale"] .footlights {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 35%);
}

.control-guide {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: center;
  letter-spacing: .08em;
  text-align: center;
  opacity: .78;
}

.department {
  --department: var(--pink);
  position: relative;
  min-width: 44px;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  gap: .45rem;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.42);
  border-radius: 18px;
  padding: .65rem .75rem;
  cursor: pointer;
  touch-action: none;
  color: var(--white);
  background: linear-gradient(180deg, #3b174b, #1b0a26);
  box-shadow: 0 .5rem 0 #08030d, 0 .85rem 1.4rem rgba(0,0,0,.38);
  font-size: clamp(.78rem, 1.2vw, 1rem);
  font-weight: 1000;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 180ms ease, color 180ms ease;
}

.department::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--department);
  transition: opacity 160ms ease;
}

.department > * { position: relative; z-index: 1; }
.department-cast { --department: var(--pink); }
.department-scenery { --department: var(--mint); }
.department-lights { --department: var(--yellow); }

.department kbd {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #1c0a28;
  box-shadow: inset 0 -3px 0 rgba(42, 13, 54, .2);
  font-family: system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 1000;
}

.department .lamp {
  position: absolute;
  right: .75rem;
  top: .55rem;
  width: .56rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}

.department.is-held,
.department.is-selected,
.department[aria-pressed="true"] {
  color: #180823;
  transform: translateY(.36rem);
  box-shadow: 0 .14rem 0 #08030d;
}

.department.is-held::before,
.department.is-selected::before,
.department[aria-pressed="true"]::before { opacity: 1; }
.department.is-held .lamp,
.department.is-selected .lamp { background: #fff; box-shadow: 0 0 12px 4px rgba(255,255,255,.72); }
.department:disabled { cursor: default; opacity: .66; filter: grayscale(.25); }

.clear-selection {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: .25rem .8rem;
  color: var(--cream);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: .76rem;
  font-weight: 800;
}

.callback-prop {
  position: absolute;
  z-index: 24;
  right: 17%;
  bottom: 17%;
  width: clamp(56px, 8vw, 120px);
  aspect-ratio: 1;
  display: none;
  border-radius: 50%;
  background: var(--yellow);
  border: clamp(5px, .7vw, 10px) solid var(--cream);
  box-shadow: 0 1dvh 0 rgba(62, 10, 67, .24);
  transform: rotate(19deg);
}

.callback-patch {
  position: absolute;
  left: 20%;
  top: 26%;
  width: 36%;
  height: 23%;
  background: var(--pink);
  border: 3px solid #30103e;
  transform: rotate(-18deg);
}

.callback-patch::before,
.callback-patch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -70%;
  width: 3px;
  height: 240%;
  background: #30103e;
}
.callback-patch::after { transform: rotate(90deg); }

.callback-banner {
  position: absolute;
  z-index: 32;
  right: 5%;
  bottom: 16%;
  width: min(26rem, 35%);
  display: none;
  margin: 0;
  padding: .55rem .75rem;
  transform: rotate(-2deg);
  background: var(--cream);
  color: #241030;
  box-shadow: .45rem .45rem 0 rgba(47, 8, 55, .28);
  font-family: system-ui, sans-serif;
  font-size: clamp(.65rem, 1vw, .84rem);
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

.theatre[data-scene="finale"] .callback-prop,
.theatre[data-scene="finale"] .callback-banner { display: block; }

.finale-labels {
  display: none;
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
}

.finale-labels span {
  position: absolute;
  display: none;
  padding: .38rem .55rem;
  transform: rotate(var(--label-tilt, -2deg));
  background: #241031;
  color: var(--cream);
  border: 2px solid var(--yellow);
  font-family: system-ui, sans-serif;
  font-size: clamp(.62rem, .85vw, .76rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.staircase-label { left: 27%; top: 39%; }
.caught-label { left: 48%; top: 53%; --label-tilt: 2deg; }
.rotated-label { right: 5%; top: 30%; --label-tilt: 1deg; }
.theatre[data-scene="finale"] .finale-labels span { display: block; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.no-script {
  position: fixed;
  z-index: 999;
  inset: 1rem;
  display: grid;
  place-content: center;
  gap: .8rem;
  padding: 2rem;
  background: #1c0a27;
  color: var(--cream);
  font-family: system-ui, sans-serif;
  text-align: center;
}

.no-script strong { font-size: 1.4rem; }
.no-script span { max-width: 42rem; line-height: 1.5; }

button:focus-visible {
  outline: 4px solid var(--white);
  outline-offset: 4px;
}

@media (max-width: 760px) {
  :root { --stage-bottom: 19.2dvh; }

  .house-ceiling { height: 4.5dvh; padding-inline: 4vw; }
  .house-ceiling span { width: 7px; }
  .proscenium { inset: 2.8dvh 1vw calc(var(--stage-bottom) - .6dvh); border-width: 10px; border-bottom-width: 14px; border-radius: 1.7rem 1.7rem .7rem .7rem; }
  .stage { inset: 3.7dvh 2.1vw var(--stage-bottom); border-radius: 1.15rem 1.15rem .45rem .45rem; }
  .valance { left: 0; right: 0; top: 1.2dvh; height: 8dvh; }
  .grand-drape { top: 2dvh; bottom: calc(var(--stage-bottom) - .5dvh); width: 27vw; }

  .intro { left: 10%; top: 9%; width: 80%; }
  .intro h1 { font-size: clamp(3.3rem, 18vw, 6.1rem); }
  .premise { max-width: 32rem; font-size: clamp(.88rem, 3.4vw, 1.03rem); line-height: 1.36; }

  .cue-panel,
  .outcome { left: 6%; top: 7%; width: 88%; }
  .cue-panel h2,
  .outcome h2 { font-size: clamp(2.55rem, 13vw, 5rem); max-width: 82%; }
  .cue-direction,
  .outcome p { width: 82%; font-size: clamp(.8rem, 3vw, .98rem); margin: .6rem 0 .75rem; }
  .cue-call { font-size: .67rem; padding: .4rem .55rem; }

  .curtain-call { left: 5%; top: 5.5%; width: 44%; }
  .curtain-call h2 { font-size: clamp(2.45rem, 11vw, 4.35rem); }
  .finale-summary { font-size: clamp(.74rem, 2.65vw, .9rem); margin: .5rem 0 .65rem; }
  .curtain-call .marquee-button { padding: .65rem .8rem; font-size: .76rem; }

  .turntable { width: 36%; height: 44%; bottom: 16%; }
  .turntable-left { left: 1%; }
  .turntable-right { right: 1%; }
  .wedding-arch { left: 28%; width: 44%; height: 48%; }
  .show-moon { right: 11%; top: 15%; }
  .cloud-one { left: 2%; top: 21%; }
  .cloud-two { right: 0; top: 33%; }

  .company { inset: 31% 2% 13%; }
  .actor { width: clamp(14px, 4.2vw, 24px); height: clamp(45px, 14vw, 78px); }
  .actor.mobile-extra { display: none; }

  .mishap-garland { right: 1.6%; top: 10%; width: 29%; gap: .3rem; }
  .mishap-garland li { padding: .3rem .4rem; font-size: .55rem; }

  .footlights {
    width: 96vw;
    min-height: 0;
    height: 108px;
    bottom: max(.8dvh, env(safe-area-inset-bottom));
    grid-template-rows: 28px 66px;
    gap: .34rem;
  }

  .control-guide { font-size: .58rem; letter-spacing: .04em; }
  .department { min-height: 66px; height: 66px; align-self: end; grid-template-columns: 1fr; grid-template-rows: auto auto; gap: .08rem; padding: .3rem .3rem; border-radius: 14px; font-size: .68rem; }
  .department kbd { width: 1.55rem; font-size: .68rem; }
  .department .lamp { right: .45rem; top: .4rem; }
  .clear-selection { position: absolute; left: 50%; top: -30px; min-height: 38px; transform: translateX(-50%); font-size: .66rem; }

  .callback-prop { right: 8%; bottom: 17%; width: 17vw; }
  .callback-banner { right: 4%; bottom: 13%; width: 48%; font-size: .64rem; }
  .staircase-label { left: 20%; top: 43%; }
  .caught-label { left: 44%; top: 58%; }
  .rotated-label { right: 2%; top: 35%; }
  .finale-labels span { font-size: .5rem; padding: .28rem .34rem; }
}

@media (max-height: 650px) and (min-width: 761px) {
  :root { --stage-bottom: 21dvh; }
  .intro { top: 9%; }
  .intro h1 { font-size: clamp(3.6rem, 8.6vw, 7.2rem); }
  .premise { margin: .65rem 0 .8rem; font-size: .9rem; }
  .cue-panel,
  .outcome { top: 8%; }
  .cue-panel h2,
  .outcome h2 { font-size: clamp(3rem, 6.5vw, 5.8rem); }
  .department { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
}
