:root {
  --night: #0c0605; --ink: #1d120c; --paper: #f1e6cc; --paper2: #e4d4b0; --rule: #7a1e18; --red: #8a2219;
  --gold: #d2a64a; --gold2: #f3d58a; --brass: #b8913f; --glow: rgba(255, 214, 150, .9);
  --display: 'Libre Caslon Display', 'Didot', 'Bodoni 72', Georgia, serif;
  --text: 'Libre Caslon Text', 'Iowan Old Style', Georgia, serif;
  color-scheme: dark;
}
/* one look: a dark house, whatever the viewer's theme */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--text); color: var(--paper); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
/* the house and stage are larger than the window on purpose */
#house, #stage-bg, #meter img, #micstand img { max-width: none; }

/* the house lights come up as soon as the house is there; the curtain and stage join when the drop is painted */
#house-wrap.loading > * { opacity: 0; }
#house-wrap > * { transition: opacity 1.1s ease; }
#house-wrap:not(.lit-house) #house { opacity: 0; }
#house-wrap:not(.dressed) #curtain, #house-wrap:not(.dressed) #hits { opacity: 0; visibility: hidden; }
/* the stage behind waits until the drop in front of it is fully there */
#house-wrap:not(.dressed) #stage { opacity: 0; visibility: hidden; }
#house-wrap.dressed #stage { transition: opacity 0s linear 1.3s, visibility 0s linear 1.3s; }
#house-wrap { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 35%, #2a120c 0%, #120706 55%, #070303 100%); touch-action: manipulation; user-select: none; -webkit-user-select: none; }

/* --------------------------------------------------------------- the stage behind the curtain */
#stage { position: absolute; overflow: hidden; background: #0b0807; }
#stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; filter: brightness(.62) saturate(.9); transition: filter .8s; }
#stage.lit #stage-bg { filter: brightness(.5) saturate(.85); }
#glow { position: absolute; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(closest-side, rgba(255, 236, 205, .2), rgba(255, 220, 170, .06) 60%, transparent); }
#stage.showing #glow { opacity: 1; }
#screen { position: absolute; background: #050404; box-shadow: 0 0 0 2px #0a0807, 0 0 46px 6px rgba(255, 232, 190, .16), 0 18px 40px rgba(0, 0, 0, .6); overflow: hidden; transition: left .45s cubic-bezier(.3, .7, .2, 1), top .45s cubic-bezier(.3, .7, .2, 1), width .45s cubic-bezier(.3, .7, .2, 1), height .45s cubic-bezier(.3, .7, .2, 1); }
#screen > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#screen img { object-fit: contain; background: #050404; }
#screen .poster { object-fit: cover; }
#screen .vign { pointer-events: none; background: radial-gradient(130% 120% at 50% 50%, transparent 62%, rgba(0, 0, 0, .35)); }
#screen .play { inset: auto; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; border: 2px solid rgba(255, 240, 210, .9); background: rgba(20, 10, 6, .55); cursor: pointer; }
#screen .play::after { content: ''; position: absolute; left: 30px; top: 22px; border-left: 24px solid #f6e7c8; border-top: 16px solid transparent; border-bottom: 16px solid transparent; }
#screen .play:hover, #screen .play:focus-visible { background: rgba(122, 30, 24, .8); outline: none; }
#screen .reel { inset: auto 0 0 0; height: auto; padding: 10px 14px; font: 500 13px/1.3 var(--text); color: #f4e7cb; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); letter-spacing: .02em; }
#screen .reel b { font-weight: 700; }
#screen.flash::before { content: ''; position: absolute; inset: 0; z-index: 3; background: #fff6e0; animation: flash .35s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }

#micstand { position: absolute; margin: 0; pointer-events: none; text-align: center; }
#micstand img { height: 100%; width: auto; display: block; margin: 0 auto; filter: drop-shadow(0 0 22px rgba(255, 220, 160, .35)); }
#micstand::before { content: ''; position: absolute; left: 50%; bottom: -6%; width: 260%; height: 40%; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 226, 170, .38), transparent); z-index: -1; }
#micstand::after { content: ''; position: absolute; left: 50%; top: -120%; width: 180%; height: 230%; transform: translateX(-50%); background: linear-gradient(180deg, transparent, rgba(255, 236, 200, .06) 40%, rgba(255, 236, 200, .14)); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); z-index: -1; }
#micstand figcaption { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap; font: italic 400 14px/1 var(--text); color: #f1e2c0; text-shadow: 0 1px 3px #000; }

/* --------------------------------------------------------------- the act card (an easel card on the stage) */
#card { position: absolute; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #a1886a transparent;
  background: linear-gradient(180deg, #f4ead2, #ead9b4); color: var(--ink); border-radius: 2px; padding: 22px 22px 26px;
  box-shadow: 0 0 0 1px #c2a874, 0 0 0 5px #f4ead2, 0 0 0 6px #8a6d3d, 0 22px 40px rgba(0, 0, 0, .55), 0 0 60px rgba(255, 200, 120, .12);
  transform-origin: 50% 100%; transition: opacity .5s, transform .5s cubic-bezier(.3, .8, .2, 1); }
#card.off { opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none; }
#card::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(122, 30, 24, .5); pointer-events: none; }
#card h2 { font: 400 clamp(26px, 2.4vw, 38px)/1.02 var(--display); margin: 2px 0 6px; color: #1a0f0b; letter-spacing: -.005em; }
#card .client { font: 700 11px/1.2 var(--text); letter-spacing: .22em; text-transform: uppercase; color: var(--red); margin: 0 0 14px; }
#card .desc { font: 400 15px/1.5 var(--text); margin: 0 0 12px; }
#card .credits { font: italic 400 12.5px/1.5 var(--text); color: #5d4733; margin: 0 0 6px; }
#card .orn { text-align: center; color: var(--red); margin: 12px 0 8px; font-size: 14px; letter-spacing: .5em; }
#card h3 { font: 700 11px/1.3 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--red); margin: 16px 0 6px; border-top: 1px solid rgba(122, 30, 24, .35); padding-top: 10px; }
#card .sec-p { font: 400 13.5px/1.45 var(--text); margin: 0 0 8px; color: #33241a; }
#card .pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 6px 0 2px; }
#card .pc { position: relative; display: block; padding: 0; border: 0; background: #1b120d; cursor: pointer; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 1px; box-shadow: 0 1px 0 #fff8, 0 0 0 1px #6c5434; }
#card .pc img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; transition: opacity .2s, transform .3s; }
#card .pc:hover img, #card .pc:focus-visible img { opacity: 1; transform: scale(1.04); }
#card .pc:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
#card .pc.on { box-shadow: 0 0 0 2px var(--red), 0 0 0 4px #f4ead2; }
#card .pc .t { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font: 600 10.5px/1.15 var(--text); color: #fbf1da; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
#card .pc .d { position: absolute; top: 4px; right: 5px; font: 600 9.5px/1 var(--text); color: #f3e5c6; text-shadow: 0 1px 2px #000; }
#card .pc.audio { background: #2a1913; display: flex; align-items: center; justify-content: center; }
#card .pc.audio::before { content: ''; position: absolute; left: 50%; top: 38%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #e9cf95; box-shadow: inset 0 0 0 4px #2a1913, inset 0 0 0 9px #e9cf95; }
#card .pc.audio .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: #e0a84a; width: 0; }
#card .pc.audio.on::after { content: ''; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ff6b4a; box-shadow: 0 0 8px #ff6b4a; }

/* --------------------------------------------------------------- curtain, hits, house, meter */
#curtain { position: absolute; display: block; pointer-events: none; transition: opacity 1.2s ease; }
#hits { position: absolute; }
#hits.off { visibility: hidden; }
#hits button { position: absolute; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: 2px; }
#hits button:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
#house { position: absolute; pointer-events: none; transform-origin: 0 0; transition: filter 1.4s ease, opacity 1s ease; filter: brightness(1) saturate(1); }
#house.dim { filter: brightness(.42) saturate(.88); }
#meter { position: absolute; pointer-events: none; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); transition: filter 1.4s; }
#meter.dim { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)) brightness(.68); }
#meter img, #meter svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#meter.ring #needle { filter: drop-shadow(0 0 6px rgba(255, 210, 120, .9)); }
#fx { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
#crowd { position: absolute; left: 0; bottom: 0; pointer-events: none; }

#annunciator { position: absolute; pointer-events: none; text-align: center; padding: 6px 18px 7px; min-width: 220px; max-width: 86vw;
  background: linear-gradient(180deg, #f7e6bd, #e9cf96); color: #2b170d; border-radius: 3px;
  box-shadow: 0 0 0 3px #3a2213, 0 0 0 4px #8d6a35, 0 0 26px rgba(255, 205, 120, .35), inset 0 0 12px rgba(160, 100, 30, .35);
  transition: opacity .5s; white-space: nowrap; }
#annunciator b { display: block; font: 400 21px/1.1 var(--display); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; }
#annunciator span { display: block; font: 700 9.5px/1.4 var(--text); letter-spacing: .26em; text-transform: uppercase; color: var(--red); }
#annunciator.off { opacity: 0; }
#annunciator.flip b, #annunciator.flip span { animation: flip .35s ease-out; }
@keyframes flip { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- the controls */
#ui { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: center; gap: clamp(6px, 1.6vw, 22px); padding: 0 12px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
#ui button { pointer-events: auto; background: rgba(18, 9, 6, .62); border: 1px solid rgba(214, 170, 92, .45); color: #f1dfb6; border-radius: 22px; height: 40px; padding: 0 14px 0 11px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font: 600 12px/1 var(--text); letter-spacing: .12em; text-transform: uppercase; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: background .2s, border-color .2s, transform .1s; }
#ui button:hover { background: rgba(80, 26, 18, .75); border-color: rgba(240, 200, 120, .8); }
#ui button:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
#ui button:active { transform: translateY(1px); }
#ui button[hidden] { display: none; }
#ui button[aria-pressed="true"]#b-mic { background: rgba(122, 30, 24, .85); border-color: #f0c070; }
#ui button[aria-pressed="false"]#b-sound .ico-sound::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: currentColor; transform: rotate(-40deg); }
#b-applaud { order: 0; height: auto !important; min-width: 150px; padding: 0 !important; border: 0 !important; background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; flex-direction: column; justify-content: flex-end; }
#b-applaud span { display: block; padding: 7px 16px 8px; border-radius: 20px; background: linear-gradient(180deg, #8f2a1f, #5e1712); border: 1px solid #e7b866; color: #fbe8bf; box-shadow: 0 4px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 220, 160, .35); }
#b-applaud:hover span { background: linear-gradient(180deg, #a73226, #6c1b15); }
#b-applaud.hint span { animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 0 0 rgba(240, 190, 100, .0); } 50% { box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 0 7px rgba(240, 190, 100, .22); } }
#b-program { order: -2; } #b-curtain { order: -1; } #b-encore { order: 1; } #b-mic { order: 2; } #b-sound { order: 3; }
.ico { position: relative; display: inline-block; width: 16px; height: 16px; flex: none; }
.ico-program { border: 1.6px solid currentColor; border-radius: 1px; }
.ico-program::before { content: ''; position: absolute; left: 3px; right: 3px; top: 3px; height: 1.5px; background: currentColor; box-shadow: 0 3.5px 0 currentColor, 0 7px 0 currentColor; }
.ico-mic::before { content: ''; position: absolute; left: 4px; top: 0; width: 8px; height: 11px; border-radius: 4px; border: 1.6px solid currentColor; }
.ico-mic::after { content: ''; position: absolute; left: 7.2px; top: 11px; width: 1.6px; height: 5px; background: currentColor; box-shadow: -3px 4px 0 currentColor, 3px 4px 0 currentColor; }
.ico-sound::before { content: ''; position: absolute; left: 1px; top: 5px; width: 5px; height: 6px; background: currentColor; }
.ico-sound i, .ico-sound::after { }
.ico-sound { background: radial-gradient(circle at 0 50%, transparent 7px, currentColor 7px, currentColor 8.6px, transparent 8.6px) 4px 0 / 12px 16px no-repeat; }
.ico-curtain { border-top: 2px solid currentColor; }
.ico-curtain::before, .ico-curtain::after { content: ''; position: absolute; top: 0; width: 6px; height: 14px; border: 1.6px solid currentColor; border-top: 0; }
.ico-curtain::before { left: 0; border-radius: 0 0 6px 0; } .ico-curtain::after { right: 0; border-radius: 0 0 0 6px; }
.ico-encore::before { content: '\2605'; position: absolute; inset: 0; font-size: 15px; line-height: 16px; text-align: center; }

#note { position: absolute; left: 50%; top: 18px; transform: translate(-50%, -20px); opacity: 0; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 3px; background: #f1e3c2; color: #2a170d; font: 400 14px/1.4 var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transition: opacity .3s, transform .3s; pointer-events: none; text-align: center; }
#note.on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------- the program */
#program { position: fixed; inset: 0; z-index: 20; background: rgba(6, 3, 2, .72); display: flex; justify-content: center; align-items: flex-start; overflow: auto; padding: clamp(16px, 4vh, 48px) 16px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#program[hidden] { display: none; }
.prog-paper { position: relative; width: min(640px, 100%); background: linear-gradient(180deg, #f4ead1, #ead8b2); color: var(--ink); padding: 34px clamp(18px, 5vw, 48px) 40px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: prog-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes prog-in { from { transform: translateY(18px) rotate(-.4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.prog-paper::before { content: ''; position: absolute; inset: 10px; border: 3px double rgba(122, 30, 24, .65); pointer-events: none; }
.prog-close { position: absolute; right: 16px; top: 14px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 30px; line-height: 1; color: var(--red); cursor: pointer; z-index: 1; }
.prog-paper header { text-align: center; }
.prog-orn { margin: 0; color: var(--red); font-size: 18px; }
.prog-paper h2 { font: 400 clamp(38px, 7vw, 56px)/1 var(--display); margin: 4px 0 6px; letter-spacing: .02em; }
#bill { list-style: none; margin: 24px 0 8px; padding: 0; }
#bill li { margin: 0; }
#bill button { width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 7px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); border-radius: 2px; }
#bill button:hover, #bill button:focus-visible { background: rgba(122, 30, 24, .08); outline: none; }
#bill button:focus-visible { box-shadow: 0 0 0 2px var(--red); }
#bill img, #bill .thumb { width: 64px; height: 43px; object-fit: cover; display: block; box-shadow: 0 0 0 1px #7d6440; }
#bill .thumb { background-repeat: no-repeat; }
#bill .ln { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
#bill .tt { font: 400 21px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bill .dots { flex: 1; min-width: 14px; border-bottom: 2px dotted rgba(60, 35, 20, .45); transform: translateY(-5px); }
#bill .cl { font: 700 10.5px/1 var(--text); letter-spacing: .18em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
#about { border-top: 1px solid rgba(122, 30, 24, .4); margin-top: 22px; padding-top: 20px; text-align: center; }
#about h3 { font: 700 11px/1.3 var(--text); letter-spacing: .22em; text-transform: uppercase; color: var(--red); margin: 0 0 8px; }
#about p { font: 400 15px/1.55 var(--text); margin: 0 auto 10px; max-width: 470px; }
#about .roles { list-style: none; padding: 0; margin: 14px auto 12px; max-width: 470px; text-align: left; }
#about .roles li { margin: 0 0 10px; font: 400 13.5px/1.45 var(--text); }
#about .roles b { font-weight: 700; }
#about a { color: var(--red); }

@media (max-width: 560px) {
  #ui { gap: 6px; padding-left: 8px; padding-right: 8px; }
  #ui button { height: 36px; padding: 0 9px; font-size: 10.5px; letter-spacing: .08em; gap: 5px; }
  #ui button span { display: none; }
  #b-applaud span { display: block !important; font-size: 11px; padding: 6px 12px 7px; }
  #b-applaud { min-width: 110px; }
  #annunciator b { font-size: 18px; }
  #card { padding: 16px 16px 20px; }
  #card h2 { font-size: 26px; }
  #card .desc { font-size: 13.5px; line-height: 1.45; }
  #card .credits { font-size: 11.5px; }
  #card .pieces { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  #bill .tt { font-size: 18px; }
  #bill button { grid-template-columns: 52px 1fr; gap: 10px; }
  #bill img, #bill .thumb { width: 52px; height: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  #screen, #card, #house, #meter { transition: none; }
  #b-applaud.hint span { animation: none; }
}
