:root {
  --ink: #1d1410;
  --cream: #f4ecd8;
  --red: #9e1b1b;
  --gold: #e0b21a;
  --strip: 44px;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #140608; color: var(--ink); font-family: var(--serif); }
body { overflow: hidden; }
#show { position: relative; height: 100vh; height: 100svh; overflow: hidden; }

/* ---------- final stage ---------- */
.lab {
  position: absolute; inset: 0; z-index: 1; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: clamp(10px, 2vh, 20px);
  padding: 76px 22px calc(var(--strip) + clamp(84px, 14vh, 130px));
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 250, 235, .9), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(150, 100, 40, .25), transparent 60%),
    repeating-linear-gradient(0deg, rgba(120, 90, 40, .035) 0 2px, transparent 2px 5px),
    var(--cream);
  opacity: 0; transition: opacity .9s ease .35s;
}
.open .lab { opacity: 1; }
.lab > * { margin: 0; }
.lab__kicker { font-style: italic; font-size: clamp(15px, 2vw, 20px); color: #5a3e2b; }
.lab h1 {
  font-weight: 900; font-size: clamp(52px, 13vw, 150px); line-height: .9; letter-spacing: -.02em;
  color: var(--ink); text-shadow: .04em .04em 0 var(--red);
}
.lab__mono { font-family: var(--mono); font-size: clamp(13px, 1.6vw, 16px); line-height: 1.6; max-width: 40em; color: #3a2a1f; }
.lab__motto { font-style: italic; font-size: clamp(18px, 2.4vw, 26px); }
.tickets { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 6px; }
.ticket {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  padding: 12px 30px; font-family: var(--mono); font-weight: 500; font-size: 15px;
  text-decoration: none; color: var(--ink); background: #e6d6ae;
  outline: 2px dashed rgba(29, 20, 16, .45); outline-offset: -7px;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 9px, #000 10px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 9px, #000 10px) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at 0 50%, transparent 9px, #000 10px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 9px, #000 10px) right / 51% 100% no-repeat;
  transition: transform .2s;
}
.ticket--main { background: var(--red); color: #fff8e7; outline-color: rgba(255, 248, 231, .6); font-size: 16px; }
.ticket:hover { transform: translateY(-2px) rotate(-1deg); }
.ticket:focus-visible { box-shadow: inset 0 0 0 4px var(--gold); transform: translateY(-2px); }

/* ---------- curtains, valance, spotlight ---------- */
.curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; z-index: 5;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 22%, transparent 75%, rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, #4e0610 0, #8f0e1c 3%, #d22a36 5.5%, #a3101f 7.5%, #5c0812 10%);
  transition: transform 1.5s cubic-bezier(.75, 0, .2, 1);
}
.curtain--l { left: 0; transform-origin: left; box-shadow: inset -18px 0 30px rgba(0, 0, 0, .5); }
.curtain--r { right: 0; transform-origin: right; box-shadow: inset 18px 0 30px rgba(0, 0, 0, .5); }
.open .curtain--l { transform: translateX(-28%) scaleX(.35); }
.open .curtain--r { transform: translateX(28%) scaleX(.35); }
.valance {
  position: absolute; top: 0; left: 0; right: 0; height: 60px; z-index: 7;
  background: repeating-linear-gradient(90deg, #6a0914 0 20px, #9c1220 20px 40px);
  border-bottom: 6px solid #c99a22; box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.bulbs {
  position: absolute; left: 0; right: 0; bottom: 6px; height: 16px;
  background:
    radial-gradient(circle, #fffbe0 0 3px, #ffc23a 4px, rgba(255, 190, 40, .35) 6px, transparent 8px) 0 50% / 54px 16px repeat-x,
    radial-gradient(circle, #8a6418 0 3px, transparent 4px) 0 50% / 18px 16px repeat-x;
  animation: chase .5s steps(3) infinite;
}
@keyframes chase { to { background-position: 54px 50%, 0 50%; } }
.spot {
  position: absolute; z-index: 6; left: 50%; top: 46%; width: 70vmin; height: 70vmin; margin: -35vmin 0 0 -35vmin;
  border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 236, 190, .42), rgba(255, 220, 160, .14) 45%, transparent 70%);
  animation: wobble 5s ease-in-out infinite alternate; transition: opacity .6s;
}
@keyframes wobble {
  0% { transform: translate(-6vmin, -2vmin) scale(1); }
  35% { transform: translate(5vmin, 3vmin) scale(1.06); }
  70% { transform: translate(-2vmin, 4vmin) scale(.96); }
  100% { transform: translate(6vmin, -3vmin) scale(1.03); }
}
.open .spot { opacity: 0; }

/* ---------- cards, cannon, fx ---------- */
.cards { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; pointer-events: none; padding: 0 24px; }
.card {
  grid-area: 1 / 1; margin: 0; max-width: 17em; text-align: center; color: #fff3d6;
  font-style: italic; font-size: clamp(24px, 4.6vw, 48px); line-height: 1.2;
  text-shadow: 0 2px 0 #3a0508, 0 0 24px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .6s, transform .8s;
}
.card span { font-style: normal; font-weight: 700; color: #ffd76a; }
.card.on { opacity: 1; transform: none; }
.cannon {
  position: absolute; z-index: 9; left: 4vw; bottom: calc(var(--strip) + 6px); width: clamp(110px, 18vw, 180px);
  transform: translateX(-160%); transition: transform .9s cubic-bezier(.3, 1.5, .5, 1);
}
.cannon.in { transform: none; }
.cannon.recoil { animation: recoil .5s ease-out; }
@keyframes recoil { 30% { transform: translateX(-18px) rotate(4deg); } }
.open .cannon { transform: translateX(-180%); transition-duration: 1.2s; }
#fx { position: fixed; inset: 0; z-index: 12; pointer-events: none; width: 100%; height: 100%; }
.flash { position: fixed; inset: 0; z-index: 13; background: #fffbe8; opacity: 0; pointer-events: none; }
.boom .flash { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.shake { animation: shake .45s linear infinite; }
.bigshake { animation: shake .12s linear 5; }
@keyframes shake {
  25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 2px); }
}
.bigshake { --amp: 8px; }

/* ---------- googly letters ---------- */
.bryan {
  position: absolute; z-index: 14; left: 0; right: 0; bottom: calc(var(--strip) + 8px);
  display: flex; justify-content: center; gap: clamp(4px, 1.5vw, 14px); pointer-events: none;
}
.gl {
  position: relative; display: inline-block; font-weight: 900; line-height: 1;
  font-size: clamp(44px, 9vw, 86px); color: var(--c);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  opacity: 0; will-change: transform;
}
.gl.live { opacity: 1; }
.eyes { position: absolute; left: 50%; top: -.16em; transform: translateX(-50%); display: flex; gap: .02em; }
.eyes b {
  position: relative; width: .3em; height: .3em; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink);
}
.eyes b::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: .14em; height: .14em; margin: -.07em;
  border-radius: 50%; background: #111;
  transform: translate(var(--px, 0), var(--py, .04em));
}

/* ---------- controls + strip ---------- */
.controls { position: fixed; z-index: 20; top: 7px; right: 10px; display: flex; gap: 8px; }
.ctl {
  min-height: 44px; min-width: 44px; padding: 0 16px; border: 2px solid #c99a22; border-radius: 999px;
  background: rgba(29, 10, 8, .88); color: #fff3d6; font: 500 14px var(--mono); cursor: pointer;
}
.ctl:hover { background: #3a0a10; }
.ctl:focus-visible { outline: 3px solid #ffd76a; outline-offset: 2px; }
.ctl[aria-pressed="true"] { background: #c99a22; color: var(--ink); }
.ctl[hidden] { display: none; }
.strip {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; min-height: var(--strip);
  display: flex; align-items: center; justify-content: center; padding: 6px 14px; text-align: center;
  background: var(--ink); color: #f2c94c; font: 12px/1.4 var(--mono);
}
@media (max-width: 600px) {
  :root { --strip: 52px; }
  .valance { height: 58px; }
  .ctl { padding: 0 12px; font-size: 13px; }
  .lab { padding-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .curtain, .cannon { transition: none; }
  .bulbs, .spot { animation: none; }
}
