/* The start menu: a night at the theatre.
   Full-screen: a painted night sky, velvet curtains that part, a swagged valance, a floor of
   footlights. In the middle the title hangs letter by letter from a marionette's control bar,
   Sir Pip and Marlo dangle at the wings, and the ways to play are a marquee and three playbills.
   The middle is designed at 1180px wide and scaled to fit (see fitTheatre in main.js). */
#loading.ready { background: #0b0714; }
#loading.ready::before { z-index: 0; }
.mbg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(10,6,24,0.42), rgba(10,6,24,0.12) 38%, rgba(26,8,18,0.82)), var(--art) center 28% / cover no-repeat #0b0714; }
.mbg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(255,190,110,0.16), rgba(0,0,0,0) 46%, rgba(4,2,10,0.62) 100%); }

/* dust drifting up through the spotlights */
.mmotes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mmotes i { position: absolute; bottom: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(#fff8dc, rgba(255,220,140,0) 70%); opacity: 0; animation: mote var(--d) linear var(--dl) infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 0.85; } 80% { opacity: 0.5; } 100% { transform: translate(var(--dx), -104vh); opacity: 0; } }

/* the curtains */
.mcur { position: absolute; top: 0; bottom: 0; width: max(150px, 17vw); z-index: 2; pointer-events: none; transition: transform 0.7s cubic-bezier(0.5, 0, 0.8, 0.4); filter: drop-shadow(0 0 30px rgba(0,0,0,0.75)); }
.mcur.l { left: 0; transform-origin: 0 50%; } .mcur.r { right: 0; transform-origin: 100% 50%; }
.mcur svg { width: 100%; height: 100%; display: block; }
.mcur.r svg { transform: scaleX(-1); }
#loading.done .mcur.l { transform: translateX(-106%); } #loading.done .mcur.r { transform: translateX(106%); }
.intro .mcur.l, .intro .mcur.r { animation: part 1.5s cubic-bezier(0.22, 0.7, 0.18, 1) both; }
@keyframes part { from { transform: scaleX(3.1); } to { transform: scaleX(1); } }
/* the valance across the top, and the masks */
.mval { position: absolute; left: 0; right: 0; top: 0; height: clamp(64px, 11vh, 110px); z-index: 3; pointer-events: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.6)); }
.mval > svg { width: 100%; height: 100%; display: block; }
.mval .crest { position: absolute; left: 50%; top: 4%; height: 118%; width: auto; transform: translateX(-50%); filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)) drop-shadow(0 0 12px rgba(255,190,80,0.45)); }
/* the stage floor and its footlights */
.mfloor { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(54px, 11vh, 120px); z-index: 1; pointer-events: none; border-top: 4px solid #d8a446;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,0.28) 0 2px, rgba(0,0,0,0) 2px 118px), linear-gradient(#7a4422, #46220e 55%, #1c0c06); box-shadow: 0 -34px 90px rgba(255,170,70,0.24), inset 0 14px 24px rgba(0,0,0,0.4); }
.mfloor::before { content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 48px; background: radial-gradient(circle at 50% 58%, #fffbe6 0 5px, #ffd27a 6px 11px, rgba(255,190,90,0.34) 12px 26px, rgba(255,190,90,0) 36px) center / 108px 100% repeat-x; animation: foot 2.6s ease-in-out infinite alternate; }
@keyframes foot { from { opacity: 0.78; } to { opacity: 1; } }

/* ---- the middle ---- */
.theatre-wrap.mq { position: absolute; left: 50%; top: 50%; z-index: 4; width: 1180px; padding: 0; display: block; transform: translate(-50%, -50%); transform-origin: 50% 50%; text-align: center; font-style: normal; }
.mq button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; cursor: pointer; }
.mq button i { display: inline-block; flex: none; }
.mq button i svg { width: 100%; height: 100%; display: block; }
.intro .mq > *:not(.mtitle):not(.mpup) { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(1.25s + var(--o, 0) * 0.11s); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* the title, hanging from a control bar */
.mtitle { position: relative; height: 262px; }
.mbar { position: absolute; left: 50%; top: 22px; width: 660px; height: 17px; margin-left: -330px; border-radius: 9px; background: linear-gradient(#d6a468, #9a6630 55%, #5e3616); box-shadow: 0 3px 0 #3a200c, 0 10px 22px rgba(0,0,0,0.55), inset 0 2px 0 rgba(255,236,200,0.5); transform-origin: 50% -420px; animation: barSway 5.5s ease-in-out infinite alternate; }
.mbar::before { content: ""; position: absolute; left: 50%; top: -24px; width: 19px; height: 66px; margin-left: -9.5px; border-radius: 9px; background: linear-gradient(90deg, #d6a468, #8a5a2c 60%, #5e3616); box-shadow: 0 3px 0 #3a200c; }
.mbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 420px; opacity: 0.55; background: linear-gradient(90deg, rgba(0,0,0,0) 27.8%, #efe2bc 27.8% 28.1%, rgba(0,0,0,0) 28.1% 71.9%, #efe2bc 71.9% 72.2%, rgba(0,0,0,0) 72.2%); }
@keyframes barSway { from { transform: rotate(-0.7deg); } to { transform: rotate(0.7deg); } }
.mletters { position: absolute; left: 0; right: 0; top: 38px; display: flex; justify-content: center; align-items: flex-start; }
.mw { display: inline-block; }
.intro .mw { animation: drop 1.05s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(0.75s + var(--i) * 0.09s); }
@keyframes drop { from { transform: translateY(-420px); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
.ml { position: relative; display: inline-block; padding-top: var(--len); transform-origin: 50% 0; animation: sway var(--dur) ease-in-out var(--dl) infinite alternate; }
@keyframes sway { from { transform: rotate(-2.1deg); } to { transform: rotate(2.1deg); } }
.ml .mstr { position: absolute; left: 50%; top: 0; width: 1.6px; height: calc(var(--len) + 26px); background: linear-gradient(rgba(255,244,214,0.2), rgba(255,244,214,0.92)); }
.ml b { display: block; position: relative; padding: 0 3px 22px; margin-bottom: -22px; font: 400 138px/1.06 "Playball", "Brush Script MT", Georgia, serif; letter-spacing: 0;
  background: linear-gradient(#fff9d8 8%, #ffd972 36%, #f0ac2e 62%, #b9741a 88%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #6a3a0c) drop-shadow(0 6px 10px rgba(0,0,0,0.55)) drop-shadow(0 0 22px rgba(255,186,76,0.55)); }
.msub { position: relative; display: inline-block; margin-top: 4px; padding: 9px 46px 10px; font: italic 23px Georgia, serif; color: #fff1d2; background: linear-gradient(#b8262e, #861620); box-shadow: 0 6px 14px rgba(0,0,0,0.45); white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%); --o: 0; }
.msub::after { content: ""; position: absolute; left: 22px; right: 22px; top: 4px; bottom: 4px; border-top: 1px solid rgba(255,222,150,0.55); border-bottom: 1px solid rgba(255,222,150,0.55); }

/* Sir Pip and Marlo, on their strings at the wings */
.mpup { position: absolute; top: 236px; width: 178px; pointer-events: none; transform-origin: 50% -620px; animation: bob 4.2s ease-in-out infinite alternate; filter: drop-shadow(0 12px 16px rgba(0,0,0,0.5)); }
.mpup.l { left: -6px; } .mpup.r { right: -6px; animation-delay: -2.1s; animation-duration: 4.9s; }
.mpup img { display: block; width: 100%; position: relative; }
/* (the strings carry on above the picture from exactly where they leave its top edge: --s1..--s3, set
   from the puppet's hands and head; inside the picture they're drawn onto them) */
.mpup::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 720px; background: linear-gradient(90deg, rgba(0,0,0,0) calc(var(--s1) - 0.75px), rgba(255,244,214,0.7) calc(var(--s1) - 0.75px) calc(var(--s1) + 0.75px), rgba(0,0,0,0) calc(var(--s1) + 0.75px) calc(var(--s2) - 0.75px), rgba(255,244,214,0.7) calc(var(--s2) - 0.75px) calc(var(--s2) + 0.75px), rgba(0,0,0,0) calc(var(--s2) + 0.75px) calc(var(--s3) - 0.75px), rgba(255,244,214,0.7) calc(var(--s3) - 0.75px) calc(var(--s3) + 0.75px), rgba(0,0,0,0) calc(var(--s3) + 0.75px)); }
@keyframes bob { from { transform: rotate(-1.5deg) translateY(0); } to { transform: rotate(1.5deg) translateY(-12px); } }
.intro .mpup { animation: bob 4.2s ease-in-out infinite alternate, lower 1.5s cubic-bezier(0.3, 1.3, 0.5, 1) 1s both; }
@keyframes lower { from { margin-top: -760px; opacity: 0; } 20% { opacity: 1; } to { margin-top: 0; opacity: 1; } }

/* in a headset: the two ways in */
.mq .xrrow { display: flex; gap: 22px; width: 780px; margin: 22px auto 0; --o: 1; }
.mq .xrrow[hidden], .mq .xrgo[hidden] { display: none; }
.mq .xrgo { flex: 1 1 0; display: flex; align-items: center; gap: 16px; height: 92px; padding: 0 26px; box-sizing: border-box; border-radius: 24px; text-align: left; color: #eafcff; background: linear-gradient(#10505e, #0a2630); border: 3px solid #7ff3ff; box-shadow: 0 0 28px rgba(127,243,255,0.6), inset 0 0 16px rgba(127,243,255,0.22); transition: transform 0.15s, filter 0.15s; }
.mq .xrgo:hover { filter: brightness(1.14); transform: translateY(-3px); }
.mq .xrgo i { width: 46px; height: 46px; color: #9ff3ff; }
.mq .xrgo b { display: block; white-space: nowrap; font: 700 25px Georgia, serif; }
.mq .xrgo small { display: block; margin-top: 3px; white-space: nowrap; font: 14px ui-sans-serif, system-ui, sans-serif; color: #bfe9f0; }

/* the marquee: the main way in */
.mq .cta { position: relative; display: flex; align-items: center; gap: 22px; width: 680px; height: 98px; margin: 24px auto 0; padding: 0 34px; box-sizing: border-box; overflow: hidden; border-radius: 999px; text-align: left; white-space: nowrap; color: #2a1404; --o: 2;
  background: linear-gradient(#fff0a8, #f8c650 46%, #dc9422); border: 3px solid #fff4cc; box-shadow: 0 0 0 4px rgba(150,80,10,0.6), 0 0 46px rgba(255,190,80,0.75), 0 14px 30px rgba(0,0,0,0.5), inset 0 3px 0 rgba(255,255,255,0.55); transition: transform 0.15s, filter 0.15s; }
.mq .cta:hover { transform: translateY(-3px) scale(1.015); filter: brightness(1.05); }
.mq .cta::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0)); transform: skewX(-18deg); animation: shine 4.2s ease-in-out 2.4s infinite; }
@keyframes shine { 0% { left: -40%; } 38%, 100% { left: 130%; } }
.mq .cta .pl { width: 54px; height: 54px; box-sizing: border-box; padding: 14px 12px 14px 16px; border-radius: 50%; background: #2a1404; color: #ffe08a; box-shadow: 0 0 0 3px rgba(255,255,255,0.45); }
.mq .cta .tx { position: relative; z-index: 1; display: block; overflow: hidden; text-overflow: ellipsis; }
.mq .cta .tx b { display: block; font: 700 31px/1.12 Georgia, serif; overflow: hidden; text-overflow: ellipsis; }
.mq .cta .tx small { display: block; font: italic 16px Georgia, serif; color: #5a3408; overflow: hidden; text-overflow: ellipsis; }
.mq .cta .here { font: italic 400 19px Georgia, serif; opacity: 0.72; }
.mq .cta .thumb { position: absolute; right: 0; top: 0; bottom: 0; width: 250px; background-size: cover; background-position: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 42%); mask-image: linear-gradient(90deg, transparent, #000 42%); }
.mq .mlink { display: inline-block; margin: 12px 8px 0; padding: 7px 18px; border-radius: 999px; font: 600 16px Georgia, serif; color: #f8e6c0; background: rgba(24,6,10,0.6); border: 1.5px solid rgba(226,180,88,0.8); --o: 3; }
.mq .mlink:hover { background: rgba(80,24,30,0.8); }

/* three playbills */
.mcards { display: flex; gap: 22px; justify-content: center; margin-top: 26px; --o: 4; }
.mq .mcard { position: relative; width: 270px; overflow: hidden; border-radius: 16px; text-align: left; background: linear-gradient(#3a1018, #1e070c); border: 3px solid #e6b85c; box-shadow: 0 12px 26px rgba(0,0,0,0.55), 0 0 18px rgba(255,180,70,0.22); transform: rotate(var(--r, 0deg)); transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.2s; }
.mq .mcard:hover { transform: translateY(-10px) rotate(0deg) scale(1.04); box-shadow: 0 22px 34px rgba(0,0,0,0.6), 0 0 34px rgba(255,190,80,0.6); z-index: 2; }
.mq .mcard img { display: block; width: 100%; height: 128px; object-fit: cover; border-bottom: 2px solid #e6b85c; }
.mq .mcard .lb { display: flex; align-items: center; gap: 10px; padding: 11px 12px 13px; }
.mq .mcard .lb i { width: 28px; height: 28px; color: #f6cc6a; }
.mq .mcard b { display: block; font: 700 19px/1.15 Georgia, serif; color: #fbe9c4; white-space: nowrap; }
.mq .mcard small { display: block; margin-top: 2px; font: 13px ui-sans-serif, system-ui, sans-serif; color: #dcc3a8; white-space: nowrap; }
.mq .mcard::before { content: ""; position: absolute; left: 50%; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c0, #d89a2e 60%, #7a4a10); box-shadow: 0 2px 3px rgba(0,0,0,0.6); z-index: 1; }

/* options, each acting out its hand gesture */
.mopts { display: flex; gap: 14px; justify-content: center; margin-top: 22px; --o: 5; }
.mopt { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 22px 9px 14px; border-radius: 999px; text-align: left; cursor: pointer; background: rgba(18,5,10,0.66); border: 2px solid rgba(226,180,88,0.75); transition: background 0.15s, box-shadow 0.15s; }
.mopt input { position: absolute; opacity: 0; pointer-events: none; }
.mopt .ic { flex: 0 0 40px; height: 40px; color: #f6cc6a; } .mopt .ic svg { width: 100%; height: 100%; overflow: visible; }
.mopt b { display: block; font: 600 18px Georgia, serif; color: #fbe9c4; white-space: nowrap; }
.mopt small { display: block; font: 12.5px ui-sans-serif, system-ui, sans-serif; color: #dcc3a8; white-space: nowrap; }
label.mopt:hover { background: rgba(70,22,28,0.8); }
label.mopt:has(input:checked) { background: rgba(120,70,10,0.6); box-shadow: 0 0 0 2px #ffd98a, 0 0 18px rgba(255,200,100,0.5); }
label.mopt:has(input:checked) b::after { content: " · on"; color: #ffd98a; font-size: 14px; }
.mopt.info { cursor: default; border-style: dashed; border-color: rgba(226,180,88,0.5); }

/* mid-game: back to the show, and the rest of the toolbar */
.mq .mback { display: inline-block; margin-top: 20px; padding: 10px 30px; border-radius: 999px; font: 700 20px Georgia, serif; color: #2a1404; background: linear-gradient(#fff0a8, #e6a83a); box-shadow: 0 0 0 3px rgba(150,80,10,0.55), 0 8px 18px rgba(0,0,0,0.45); --o: 1; }
.mextras { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 900px; margin: 18px auto 0; --o: 6; }
.mq .mextras button { padding: 7px 15px; border-radius: 999px; font: 14px ui-sans-serif, system-ui, sans-serif; color: #f1dfc4; background: rgba(18,5,10,0.66); border: 1px solid rgba(226,180,88,0.5); }
.mq .mextras button:hover { background: rgba(70,22,28,0.85); }

@media (prefers-reduced-motion: reduce) { #loading *, #loading::before { animation: none !important; } }
