/* ============================================================
   CART-CADE — the spooky layer (with spooky.js)
   Fog, flickering lights, bats, cobwebs, eyes in the dark, hidden
   scares, and a haunted touch on buttons, cards, tabs and pop-ups.
   Purely additive: nothing here changes the size or place of anything
   already on the page. Only transform and opacity ever animate.
   Only in the Halloween theme: every rule below is scoped to
   html[data-theme="halloween"] (with :where, so it adds no weight).
   Layers: .spk-back sits just above the backdrop (behind the page),
   .spk-front over the page but under the header (100) and pop-ups (300).
   ============================================================ */
:where(html[data-theme="halloween"]) .spk-back, :where(html[data-theme="halloween"]) .spk-front { position: fixed; inset: 0; overflow: hidden; pointer-events: none; contain: strict; }
:where(html[data-theme="halloween"]) .spk-back { z-index: -1; bottom: auto; height: 100vh; height: 100lvh; }   /* no jump when a phone's address bar slides */
:where(html[data-theme="halloween"]) .spk-front { z-index: 90; --spk-top: 0px; --spk-web: clamp(100px, 11vw, 170px); }
:where(html[data-theme="halloween"]).spk-coarse .spk-front { --spk-web: 92px; }

/* ---------- fog that crawls along the bottom ---------- */
:where(html[data-theme="halloween"]) .spk-fog { position: absolute; left: 0; right: 0; bottom: 0; height: 44vh; }
:where(html[data-theme="halloween"]) .spk-fog::before, :where(html[data-theme="halloween"]) .spk-fog::after {
  content: ""; position: absolute; left: -50%; bottom: -2vh; width: 200%; height: 100%;
  animation: spkFog 52s ease-in-out infinite alternate;
  background:
    radial-gradient(26% 58% at 14% 90%, rgba(200, 190, 228, .22), transparent 70%),
    radial-gradient(22% 46% at 38% 98%, rgba(160, 205, 175, .14), transparent 70%),
    radial-gradient(30% 62% at 62% 92%, rgba(200, 190, 228, .2), transparent 70%),
    radial-gradient(24% 50% at 88% 97%, rgba(160, 205, 175, .13), transparent 70%);
}
:where(html[data-theme="halloween"]) .spk-fog::after {
  height: 58%; bottom: -4vh; animation-duration: 37s; animation-direction: alternate-reverse;
  background:
    radial-gradient(30% 70% at 24% 100%, rgba(185, 175, 220, .2), transparent 70%),
    radial-gradient(26% 64% at 70% 100%, rgba(185, 175, 220, .18), transparent 70%);
}
@keyframes spkFog { from { transform: translate3d(-11%, 0, 0); } to { transform: translate3d(11%, 0, 0); } }
:where(html[data-theme="halloween"]) body:not([data-screen="start"]) .spk-fog { opacity: .65; }
:where(html[data-theme="halloween"]).spk-coarse .spk-fog::after { display: none; }

/* a faint mist that drifts over the bottom of the page itself (not on phones) */
:where(html[data-theme="halloween"]) .spk-mist {
  position: absolute; left: -30%; bottom: -3vh; width: 160%; height: 15vh;
  background:
    radial-gradient(22% 60% at 20% 100%, rgba(200, 190, 230, .09), transparent 70%),
    radial-gradient(26% 70% at 60% 100%, rgba(170, 210, 185, .07), transparent 70%),
    radial-gradient(20% 60% at 88% 100%, rgba(200, 190, 230, .08), transparent 70%);
  animation: spkMist 44s ease-in-out infinite alternate;
}
@keyframes spkMist { from { transform: translate3d(-6%, 0, 0); } to { transform: translate3d(6%, 0, 0); } }

/* the fog keeps drifting while the page scrolls (a pause there re-styled the whole page and
   made the backdrop hitch on phones); the arcade holds it still everywhere */
:where(html[data-theme="halloween"]) body[data-screen="arcade"] .spk-fog::before, :where(html[data-theme="halloween"]) body[data-screen="arcade"] .spk-fog::after, :where(html[data-theme="halloween"]) body[data-screen="arcade"] .spk-mist { animation-play-state: paused; }
:where(html[data-theme="halloween"]).spk-paused .spk-back *, :where(html[data-theme="halloween"]).spk-paused .spk-back *::before, :where(html[data-theme="halloween"]).spk-paused .spk-back *::after, :where(html[data-theme="halloween"]).spk-paused .spk-front *, :where(html[data-theme="halloween"]).spk-paused .spk-front *::before, :where(html[data-theme="halloween"]).spk-paused .spk-front *::after { animation-play-state: paused !important; }

/* ---------- the lights flicker (the backdrop and the header's lamps, never the text) ---------- */
:where(html[data-theme="halloween"]) .spk-dim { position: absolute; inset: 0; background: rgba(2, 1, 6, .55); opacity: 0; }
:where(html[data-theme="halloween"]).spk-flicker .spk-dim { animation: spkDim 1.1s steps(1, end) 1; }
@keyframes spkDim {
  0% { opacity: .8; } 9% { opacity: .1; } 16% { opacity: .9; } 24% { opacity: .3; }
  31% { opacity: 1; } 52% { opacity: .2; } 60% { opacity: .7; } 70%, 100% { opacity: 0; }
}
:where(html[data-theme="halloween"]).spk-flicker .hud__logo, :where(html[data-theme="halloween"]).spk-flicker .hud::after, :where(html[data-theme="halloween"]).spk-flicker .neon-sign, :where(html[data-theme="halloween"]).spk-flicker .scene__lights, :where(html[data-theme="halloween"]).spk-flicker .footer > img {
  animation: spkFlick 1.1s steps(1, end) 1;
}
@keyframes spkFlick {
  0% { opacity: .45; } 9% { opacity: 1; } 16% { opacity: .35; } 24% { opacity: .85; }
  31% { opacity: .3; } 52% { opacity: .9; } 60% { opacity: .55; } 70%, 100% { opacity: 1; }
}

/* ---------- bats that cross the sky now and then ---------- */
:where(html[data-theme="halloween"]) .spk-bat {
  position: absolute; left: 0; top: var(--spk-y, 20vh);
  width: var(--spk-w, 44px); height: calc(var(--spk-w, 44px) / 2);
  opacity: 0; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'><g fill='%230b0614' stroke='%23d9b48c' stroke-opacity='.35' stroke-width='.6'><path d='M27 11L26 5.5L29.5 10.5ZM33 11L34 5.5L30.5 10.5Z'/><ellipse cx='30' cy='15' rx='3.4' ry='4.4'/></g><circle cx='28.9' cy='12.9' r='.6' fill='%23ff3b57'/><circle cx='31.1' cy='12.9' r='.6' fill='%23ff3b57'/></svg>") center / 100% 100% no-repeat;
}
:where(html[data-theme="halloween"]) .spk-bat::before, :where(html[data-theme="halloween"]) .spk-bat::after { content: ""; position: absolute; top: 0; width: 50%; height: 100%; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path fill='%230b0614' stroke='%23d9b48c' stroke-opacity='.35' stroke-width='.6' d='M28 15C20 6 8 4 0 10C6 9 10 11 13 13C6 13 2 15 0 19C7 17 11 17 15 16C10 19 8 21 6 25C12 22 17 19 21 16C23 18 25 18 28 17Z'/></svg>") center / 100% 100% no-repeat; }
:where(html[data-theme="halloween"]) .spk-bat::before { left: 0; transform-origin: 96% 50%; }
:where(html[data-theme="halloween"]) .spk-bat::after { right: 0; background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path fill='%230b0614' stroke='%23d9b48c' stroke-opacity='.35' stroke-width='.6' transform='matrix(-1 0 0 1 30 0)' d='M28 15C20 6 8 4 0 10C6 9 10 11 13 13C6 13 2 15 0 19C7 17 11 17 15 16C10 19 8 21 6 25C12 22 17 19 21 16C23 18 25 18 28 17Z'/></svg>"); transform-origin: 4% 50%; }
:where(html[data-theme="halloween"]) .spk-bat.is-flying { animation: spkBatLR var(--spk-d, 7s) linear 1 forwards; }
:where(html[data-theme="halloween"]) .spk-bat.is-flying.is-rev { animation-name: spkBatRL; }
:where(html[data-theme="halloween"]) .spk-bat.is-flying::before { animation: spkWingL .26s ease-in-out infinite; }
:where(html[data-theme="halloween"]) .spk-bat.is-flying::after { animation: spkWingR .26s ease-in-out infinite; }
@keyframes spkBatLR {
  0% { opacity: 1; transform: translate3d(-70px, 0, 0); }
  25% { transform: translate3d(26vw, -5vh, 0); }
  50% { transform: translate3d(52vw, 3vh, 0); }
  75% { transform: translate3d(78vw, -4vh, 0); }
  99% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(calc(100vw + 70px), 1vh, 0); }
}
@keyframes spkBatRL {
  0% { opacity: 1; transform: translate3d(calc(100vw + 70px), 0, 0); }
  25% { transform: translate3d(74vw, 4vh, 0); }
  50% { transform: translate3d(48vw, -3vh, 0); }
  75% { transform: translate3d(22vw, 3vh, 0); }
  99% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(-70px, -2vh, 0); }
}
@keyframes spkWingL { 0%, 100% { transform: rotate(16deg); } 50% { transform: rotate(-26deg) scaleY(.8); } }
@keyframes spkWingR { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(26deg) scaleY(.8); } }

/* ---------- eyes in the dark that follow you, and blink ---------- */
:where(html[data-theme="halloween"]) .spk-eyes {
  position: absolute; left: 0; top: 0; display: flex; gap: 9px;
  opacity: 0; transition: opacity 1.6s ease;
  --spk-ex: 0px; --spk-ey: 0px;
  --c1: #fffbe0; --c2: #ffd24a; --c3: #b86a00; --g1: rgba(255, 210, 74, .8); --g2: rgba(255, 150, 40, .25);
}
:where(html[data-theme="halloween"]) .spk-eyes.is-on { opacity: 1; }
:where(html[data-theme="halloween"]) .spk-eyes--red { --c1: #ffe0e4; --c2: #ff3b57; --c3: #6e0414; --g1: rgba(255, 59, 87, .85); --g2: rgba(255, 30, 60, .25); }
:where(html[data-theme="halloween"]) .spk-eyes--green { --c1: #f2ffe0; --c2: #9dff3d; --c3: #2f6a08; --g1: rgba(157, 255, 61, .8); --g2: rgba(120, 255, 40, .22); }
:where(html[data-theme="halloween"]) .spk-eyes i {
  position: relative; display: block; width: 15px; height: 8px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, var(--c1) 0, var(--c2) 42%, var(--c3) 100%);
  box-shadow: 0 0 6px 1px var(--g1), 0 0 18px 5px var(--g2);
  transition: transform .09s ease;
}
:where(html[data-theme="halloween"]) .spk-eyes i:first-child { rotate: 13deg; }
:where(html[data-theme="halloween"]) .spk-eyes i:last-child { rotate: -13deg; }
:where(html[data-theme="halloween"]) .spk-eyes i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 7px; margin: -3.5px 0 0 -1.5px;
  border-radius: 50%; background: #0a0410;
  transform: translate(var(--spk-ex), var(--spk-ey));
}
:where(html[data-theme="halloween"]) .spk-eyes.is-blink i { transform: scaleY(.08); }

/* ---------- the moon becomes a skull for a few seconds ---------- */
:where(html[data-theme="halloween"]) .spk-skullmoon {
  position: absolute; left: 0; top: 0; width: 100px; height: 100px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='%233b2133' fill-opacity='.86'><path d='M21 45c0-10 7-17 15.5-17S50 35 49 44c-1 9-7 14.5-14 14.5S21 54 21 45zM79 45c0-10-7-17-15.5-17S50 35 51 44c1 9 7 14.5 14 14.5S79 54 79 45z'/><path d='M50 57l-5.5 10.5c2.2 1.2 4 1 5.5-1 1.5 2 3.3 2.2 5.5 1z'/></g><g fill='none' stroke='%233b2133' stroke-opacity='.8' stroke-linecap='round'><path stroke-width='2.6' d='M31 75q19 9 38 0'/><path stroke-width='2' d='M37 73.5v8M43.5 76v8M50 77v8M56.5 76v8M63 73.5v8'/><path stroke-width='1.4' d='M50 4l3 9-4 6 3 7M84 26l-6 5 1 6'/></g><circle cx='36' cy='45' r='3' fill='%23ff3b57'/><circle cx='64' cy='45' r='3' fill='%23ff3b57'/></svg>") center / 100% 100% no-repeat;
  opacity: 0; transition: opacity 1.4s ease;
}
:where(html[data-theme="halloween"]) .spk-skullmoon.is-on { opacity: 1; }

/* ---------- cobwebs in the corners ---------- */
:where(html[data-theme="halloween"]) .spk-webs {
  position: absolute; left: 0; right: 0; top: var(--spk-top); bottom: 0; opacity: .5;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'><g fill='none' stroke='%23d8d0ea' stroke-linecap='round'><path stroke-width='1.1' stroke-opacity='.55' d='M0 0L157.8 8.3M0 0L141 51.3M0 0L116.6 91.1M0 0L86 122.9M0 0L47 144.6M0 0L8.3 157.8'/><path stroke-width='.8' stroke-opacity='.42' d='M16 0.8Q12.2 2.4 14.4 5.3Q11 6.2 13.1 10.2Q8.8 9.2 9 12.8Q5.6 11.3 5 15.5Q2.4 12.6 0.8 16M32.6 1.7Q26.3 5.5 33.2 12.1Q23.8 13 26.3 20.5Q18.5 19.6 19.9 28.4Q12.2 24.3 10.5 32.3Q4.9 26.5 1.8 34M57.1 3Q43.1 8.6 50.6 18.4Q37.9 21.2 44.2 34.5Q30.3 31.8 31.5 45.1Q19.4 38.9 17 52.3Q7.9 42 2.8 52.7M77.3 4.1Q61.2 12.6 75.7 27.6Q55.2 30.5 62.3 48.6Q43 45.3 45.3 64.7Q27.5 54.7 23.4 72.1Q11.1 61.7 4.3 82M108 5.7Q83 16.8 99.6 36.3Q73.3 40.6 83.5 65.3Q56.8 59.4 58.4 83.4Q37 75.3 34.1 104.8Q15.8 83.4 5.4 103.7M133.8 7Q103.9 21.1 125.9 45.8Q90.9 50 101.4 79.2Q72.5 77.3 79.9 114.2Q48.2 95.6 40.6 124.9Q19.1 104.6 7.2 136.5'/></g></svg>") left top / var(--spk-web) var(--spk-web) no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'><g fill='none' stroke='%23d8d0ea' stroke-linecap='round' transform='matrix(-1 0 0 1 160 0)'><path stroke-width='1.1' stroke-opacity='.55' d='M0 0L157.8 8.3M0 0L141 51.3M0 0L116.6 91.1M0 0L86 122.9M0 0L47 144.6M0 0L8.3 157.8'/><path stroke-width='.8' stroke-opacity='.42' d='M16 0.8Q12.2 2.4 14.4 5.3Q11 6.2 13.1 10.2Q8.8 9.2 9 12.8Q5.6 11.3 5 15.5Q2.4 12.6 0.8 16M32.6 1.7Q26.3 5.5 33.2 12.1Q23.8 13 26.3 20.5Q18.5 19.6 19.9 28.4Q12.2 24.3 10.5 32.3Q4.9 26.5 1.8 34M57.1 3Q43.1 8.6 50.6 18.4Q37.9 21.2 44.2 34.5Q30.3 31.8 31.5 45.1Q19.4 38.9 17 52.3Q7.9 42 2.8 52.7M77.3 4.1Q61.2 12.6 75.7 27.6Q55.2 30.5 62.3 48.6Q43 45.3 45.3 64.7Q27.5 54.7 23.4 72.1Q11.1 61.7 4.3 82M108 5.7Q83 16.8 99.6 36.3Q73.3 40.6 83.5 65.3Q56.8 59.4 58.4 83.4Q37 75.3 34.1 104.8Q15.8 83.4 5.4 103.7M133.8 7Q103.9 21.1 125.9 45.8Q90.9 50 101.4 79.2Q72.5 77.3 79.9 114.2Q48.2 95.6 40.6 124.9Q19.1 104.6 7.2 136.5'/></g></svg>") right top / var(--spk-web) var(--spk-web) no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'><g fill='none' stroke='%23d8d0ea' stroke-linecap='round' transform='matrix(1 0 0 -1 0 160)'><path stroke-width='1.1' stroke-opacity='.55' d='M0 0L157.8 8.3M0 0L141 51.3M0 0L116.6 91.1M0 0L86 122.9M0 0L47 144.6M0 0L8.3 157.8'/><path stroke-width='.8' stroke-opacity='.42' d='M16 0.8Q12.2 2.4 14.4 5.3Q11 6.2 13.1 10.2Q8.8 9.2 9 12.8Q5.6 11.3 5 15.5Q2.4 12.6 0.8 16M32.6 1.7Q26.3 5.5 33.2 12.1Q23.8 13 26.3 20.5Q18.5 19.6 19.9 28.4Q12.2 24.3 10.5 32.3Q4.9 26.5 1.8 34M57.1 3Q43.1 8.6 50.6 18.4Q37.9 21.2 44.2 34.5Q30.3 31.8 31.5 45.1Q19.4 38.9 17 52.3Q7.9 42 2.8 52.7M77.3 4.1Q61.2 12.6 75.7 27.6Q55.2 30.5 62.3 48.6Q43 45.3 45.3 64.7Q27.5 54.7 23.4 72.1Q11.1 61.7 4.3 82M108 5.7Q83 16.8 99.6 36.3Q73.3 40.6 83.5 65.3Q56.8 59.4 58.4 83.4Q37 75.3 34.1 104.8Q15.8 83.4 5.4 103.7M133.8 7Q103.9 21.1 125.9 45.8Q90.9 50 101.4 79.2Q72.5 77.3 79.9 114.2Q48.2 95.6 40.6 124.9Q19.1 104.6 7.2 136.5'/></g></svg>") left bottom / var(--spk-web) var(--spk-web) no-repeat;
}
:where(html[data-theme="halloween"]).spk-coarse .spk-webs { opacity: .38; }

/* ---------- a spider that lives in the top-right web, and sometimes drops in ---------- */
:where(html[data-theme="halloween"]) .spk-spider {
  position: absolute; right: calc(var(--spk-web) * .24); top: calc(var(--spk-top) + var(--spk-web) * .2);
  width: 18px; height: 16px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'><path fill='none' stroke='%23120a1e' stroke-width='1.4' stroke-linecap='round' d='M9 9L4 4L2 7M9 11L2 10M9 13L2 15M10 15L5 20L4 22M15 9L20 4L22 7M15 11L22 10M15 13L22 15M14 15L19 20L20 22'/><ellipse cx='12' cy='14' rx='4.6' ry='5.4' fill='%23120a1e' stroke='%23cbbde6' stroke-opacity='.45' stroke-width='.6'/><circle cx='12' cy='7.5' r='3' fill='%23120a1e' stroke='%23cbbde6' stroke-opacity='.45' stroke-width='.6'/><circle cx='11' cy='7.2' r='.8' fill='%23ff3b57'/><circle cx='13' cy='7.2' r='.8' fill='%23ff3b57'/></svg>") center / 100% 100% no-repeat;
  transform: translate3d(0, 0, 0);
  transition: transform 3s cubic-bezier(.45, 0, .35, 1);
}
:where(html[data-theme="halloween"]) .spk-spider::before {
  content: ""; position: absolute; left: 50%; bottom: 70%; width: 1px; height: 110vh; margin-left: -.5px;
  background: linear-gradient(to top, rgba(225, 215, 245, .6), rgba(225, 215, 245, .25) 30%, rgba(225, 215, 245, .1) 70%);
}
:where(html[data-theme="halloween"]) .spk-spider.is-down { transform: translate3d(0, var(--spk-drop, 30vh), 0); transition-duration: 2.2s; transition-timing-function: cubic-bezier(.55, 0, .7, .4); }
:where(html[data-theme="halloween"]) .spk-spider.is-sway { animation: spkSway 1.4s ease-in-out infinite alternate; }
@keyframes spkSway { from { translate: -3px 0; } to { translate: 3px 0; } }

/* ---------- the switch: a little haunted speaker (bottom-left, clear of the chat bubble) ---------- */
:where(html[data-theme="halloween"]) .spk-mute {
  position: absolute; left: calc(14px + env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom));
  width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(164, 104, 255, .5);
  background: radial-gradient(circle at 50% 32%, #2d1b48, #120a1e 72%);
  color: #b9abd0; cursor: pointer; pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 3px rgba(10, 6, 18, .7);
  transition: transform .15s ease, color .2s, border-color .2s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
:where(html[data-theme="halloween"]) .spk-mute svg { width: 28px; height: 28px; display: block; }
:where(html[data-theme="halloween"]) .spk-mute__face { fill: #120a1e; }
:where(html[data-theme="halloween"]) .spk-mute__waves { display: none; }
:where(html[data-theme="halloween"]) .spk-mute.is-on { color: var(--cream, #f3e6cc); border-color: rgba(157, 255, 61, .7); box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 3px rgba(10, 6, 18, .7), 0 0 20px rgba(157, 255, 61, .38); }
:where(html[data-theme="halloween"]) .spk-mute.is-on .spk-mute__face { fill: var(--slime, #9dff3d); }
:where(html[data-theme="halloween"]) .spk-mute.is-on .spk-mute__waves { display: inline; color: var(--slime, #9dff3d); }
:where(html[data-theme="halloween"]) .spk-mute.is-on .spk-mute__x { display: none; }
:where(html[data-theme="halloween"]) .spk-mute:hover { transform: translateY(-2px); color: var(--ink, #f7efe3); }
:where(html[data-theme="halloween"]) .spk-mute:active { transform: translateY(1px); }
:where(html[data-theme="halloween"]) .spk-mute:focus-visible { outline: 3px solid var(--candle, #ffd24a); outline-offset: 3px; }

/* ---------- the ghost that peeks up at the bottom of a long page ---------- */
:where(html[data-theme="halloween"]) .spk-ghost {
  position: absolute; left: 30%; bottom: 0; width: 76px; height: 96px;
  transform: translate3d(0, 105%, 0);
  transition: transform .9s cubic-bezier(.3, 1.25, .5, 1);
  filter: drop-shadow(0 0 14px rgba(200, 190, 255, .55));
}
:where(html[data-theme="halloween"]) .spk-ghost.is-up { transform: translate3d(0, 28%, 0); }
:where(html[data-theme="halloween"]) .spk-ghost svg { display: block; width: 100%; height: 100%; }
:where(html[data-theme="halloween"]) .spk-ghost__say {
  position: absolute; left: 86%; bottom: 72%; margin: 0; width: max-content; max-width: 170px;
  padding: 8px 11px; border-radius: 14px 14px 14px 4px;
  font: 700 13px/1.3 var(--ui, system-ui, sans-serif); color: var(--ink, #f7efe3);
  background: rgba(20, 12, 34, .95); border: 1px solid rgba(190, 170, 255, .45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(6px) scale(.92); transform-origin: 0 100%;
  transition: opacity .3s ease, transform .3s ease;
}
:where(html[data-theme="halloween"]) .spk-ghost.is-talk .spk-ghost__say { opacity: 1; transform: none; }
@media (max-width: 640px) { :where(html[data-theme="halloween"]) .spk-ghost { left: 26%; width: 64px; height: 81px; } :where(html[data-theme="halloween"]) .spk-ghost__say { max-width: 150px; font-size: 12px; } }
:where(html[data-theme="halloween"]).spk-rm .spk-ghost { transform: translate3d(0, 28%, 0); opacity: 0; transition: opacity .6s ease; }
:where(html[data-theme="halloween"]).spk-rm .spk-ghost.is-up { opacity: 1; }

/* ---------- the skeleton peeking over the footer's top edge ---------- */
:where(html[data-theme="halloween"]) .spk-skelanchor { position: relative; height: 0; text-align: left; }
:where(html[data-theme="halloween"]) .spk-skelclip { position: absolute; left: 2%; bottom: var(--spk-fpad, 47px); width: 64px; height: 70px; overflow: hidden; pointer-events: none; z-index: 2; }
:where(html[data-theme="halloween"]) .spk-skel {
  position: absolute; left: 0; bottom: 0; width: 64px; height: 70px; padding: 0; margin: 0;
  border: 0; border-radius: 30px 30px 0 0; background: none; cursor: pointer; pointer-events: auto;
  transform: translate3d(0, 100%, 0); transition: transform .8s cubic-bezier(.3, 1.2, .5, 1);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
:where(html[data-theme="halloween"]) .spk-skel.is-up { transform: translate3d(0, 24%, 0); }
:where(html[data-theme="halloween"]) .spk-skel:hover { transform: translate3d(0, 18%, 0); }
:where(html[data-theme="halloween"]) .spk-skel:focus-visible { outline: 2px solid var(--candle, #ffd24a); outline-offset: -3px; }
:where(html[data-theme="halloween"]) .spk-skel svg { display: block; width: 100%; height: 100%; }
:where(html[data-theme="halloween"]) .spk-skel__arm { transform-box: view-box; transform-origin: 48px 34px; }
:where(html[data-theme="halloween"]) .spk-skel.is-wave .spk-skel__arm { animation: spkWave .95s ease-in-out 2; }
@keyframes spkWave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-24deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-18deg); } }
:where(html[data-theme="halloween"]) .spk-skelsay {
  position: absolute; left: calc(2% + 62px); bottom: calc(var(--spk-fpad, 47px) + 38px); margin: 0;
  width: max-content; max-width: 190px; padding: 8px 11px; border-radius: 14px 14px 14px 4px;
  font: 700 13px/1.3 var(--ui, system-ui, sans-serif); color: var(--ink, #f7efe3);
  background: rgba(20, 12, 34, .95); border: 1px solid rgba(255, 140, 60, .45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); pointer-events: none; z-index: 2;
  opacity: 0; transform: translateY(6px) scale(.92); transform-origin: 0 100%;
  transition: opacity .25s ease, transform .25s ease;
}
:where(html[data-theme="halloween"]) .spk-skelsay.is-on { opacity: 1; transform: none; }

/* ---------- "boo" typed on the keyboard: a small jumpscare (never a white flash) ---------- */
:where(html[data-theme="halloween"]) .spk-boo {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 55%, rgba(4, 2, 8, .15), rgba(4, 2, 8, .88) 72%);
  animation: spkBooBg 1.5s ease-out forwards;
}
:where(html[data-theme="halloween"]) .spk-boo__g { width: min(44vw, 240px); height: auto; filter: drop-shadow(0 0 30px rgba(200, 190, 255, .7)); animation: spkBooG 1.5s cubic-bezier(.2, 1.3, .4, 1) forwards; }
:where(html[data-theme="halloween"]) .spk-boo b {
  position: absolute; left: 0; right: 0; top: 16%; text-align: center;
  font: 400 clamp(64px, 16vw, 150px)/1 var(--spooky, Impact, fantasy); color: var(--blood, #ff3b57);
  text-shadow: 0 0 24px rgba(255, 59, 87, .8); animation: spkBooT 1.5s ease-out forwards;
}
@keyframes spkBooBg { 0% { opacity: 0; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes spkBooG { 0% { transform: scale(.25) translateY(60%); } 30% { transform: scale(1.15) translateY(0); } 100% { transform: scale(1); } }
@keyframes spkBooT { 0%, 12% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; transform: scale(1.1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

/* ============================================================
   HAUNTED UI — glows, drips and a shiver on buttons, cards, tabs,
   menus and pop-ups. Pseudo-elements only; the buttons and cards
   themselves keep their size, place and animations.
   ============================================================ */
:where(html[data-theme="halloween"]) :where(.btn) { position: relative; --spk-drip: #8a3504; }
:where(html[data-theme="halloween"]) :where(.btn--ghost) { --spk-drip: #6a3fb8; }
:where(html[data-theme="halloween"]) :where(.btn--acct, .btn--install) { --spk-drip: #4b2290; }
:where(html[data-theme="halloween"]) :where(.btn--arcade) { --spk-drip: #4a8a12; }
:where(html[data-theme="halloween"]) :where(.btn--x) { --spk-drip: #8e1428; }
:where(html[data-theme="halloween"]) :where(.tabchip) { --spk-drip: #5b2fa6; }
:where(html[data-theme="halloween"]) :where(.tabchip.is-sel) { --spk-drip: #b8480a; }

/* wax/slime drips under the button's ledge */
:where(html[data-theme="halloween"]) .btn::before {
  content: ""; position: absolute; left: 16%; right: 16%; top: calc(100% + 1px); height: 13px;
  background: var(--spk-drip);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18'><path d='M0 0H120V3H111.8C111.8 6 111.5 9 109 9C106.5 9 106.2 6 106.2 3H97.2C97.2 8 96.9 13 94 13C91.1 13 90.8 8 90.8 3H82.6C82.6 5.5 82.3 8 80 8C77.7 8 77.4 5.5 77.4 3H66.4C66.4 10.5 66.1 18 63 18C59.9 18 59.6 10.5 59.6 3H51.8C51.8 6 51.5 9 49 9C46.5 9 46.2 6 46.2 3H36.6C36.6 9 36.2 15 33 15C29.8 15 29.4 9 29.4 3H21.6C21.6 5 21.3 7 19 7C16.7 7 16.4 5 16.4 3H9.2C9.2 6.5 8.9 10 6 10C3.1 10 2.8 6.5 2.8 3H0Z'/></svg>") 0 0 / 60px 13px repeat-x; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18'><path d='M0 0H120V3H111.8C111.8 6 111.5 9 109 9C106.5 9 106.2 6 106.2 3H97.2C97.2 8 96.9 13 94 13C91.1 13 90.8 8 90.8 3H82.6C82.6 5.5 82.3 8 80 8C77.7 8 77.4 5.5 77.4 3H66.4C66.4 10.5 66.1 18 63 18C59.9 18 59.6 10.5 59.6 3H51.8C51.8 6 51.5 9 49 9C46.5 9 46.2 6 46.2 3H36.6C36.6 9 36.2 15 33 15C29.8 15 29.4 9 29.4 3H21.6C21.6 5 21.3 7 19 7C16.7 7 16.4 5 16.4 3H9.2C9.2 6.5 8.9 10 6 10C3.1 10 2.8 6.5 2.8 3H0Z'/></svg>") 0 0 / 60px 13px repeat-x;
  transform: scaleY(0); transform-origin: 50% 0; pointer-events: none;
  transition: transform .25s ease;
}
/* the selected tab always drips a little */
:where(html[data-theme="halloween"]) .tabchip.is-sel::before { transform: scaleY(.55); }
/* an eerie outer glow (outside the button, never over its label) */
:where(html[data-theme="halloween"]) .btn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 14px 1px rgba(157, 255, 61, .42), 0 0 34px 4px rgba(164, 104, 255, .3);
  opacity: 0; transition: opacity .25s ease;
}
:where(html[data-theme="halloween"]) .btn:disabled::before, :where(html[data-theme="halloween"]) .btn:disabled::after { display: none; }

@media (hover: hover) {
  :where(html[data-theme="halloween"]) .btn:hover::before { transform: scaleY(1); transition: transform 1.1s cubic-bezier(.3, .7, .3, 1); }
  :where(html[data-theme="halloween"]) .btn:hover::after { opacity: 1; animation: spkGlow 2.6s steps(1, end) infinite; }
  :where(html[data-theme="halloween"]) .card:hover::after { transform: scaleY(1); opacity: 1; }
  :where(html[data-theme="halloween"]) .card:hover::before { opacity: 1; animation: spkGlow 3.2s steps(1, end) infinite; }
  :where(html[data-theme="halloween"]) .hud__nav a:hover, :where(html[data-theme="halloween"]) .footer__nav a:hover { text-shadow: 0 0 8px rgba(157, 255, 61, .75), 0 0 20px rgba(157, 255, 61, .3); }
  :where(html[data-theme="halloween"]) .modal__close:hover { box-shadow: 0 0 16px rgba(255, 59, 87, .6); }
}
/* a nervous shiver on hover: uses `translate`, so the press-down transform still works */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :where(html[data-theme="halloween"]) .btn:not(:disabled):not(.btn--glow):not(.bump):hover { animation: spkJit .42s steps(1, end) 1; }
}
@keyframes spkJit {
  0% { translate: 1px 0; } 18% { translate: -1px 1px; } 36% { translate: 1px -1px; }
  54% { translate: -1px 0; } 72% { translate: 0 1px; } 100% { translate: 0 0; }
}
@keyframes spkGlow { 0% { opacity: 1; } 37% { opacity: .5; } 40% { opacity: 1; } 71% { opacity: .7; } 73% { opacity: 1; } 88% { opacity: .35; } 90% { opacity: 1; } }

/* product cards: slime always oozing a little off the bottom edge, more on hover */
:where(html[data-theme="halloween"]) .card::after {
  content: ""; position: absolute; left: 24px; right: 24px; top: calc(100% - 1px); height: 16px;
  background: rgba(157, 255, 61, .55);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18'><path d='M0 0H120V3H111.8C111.8 6 111.5 9 109 9C106.5 9 106.2 6 106.2 3H97.2C97.2 8 96.9 13 94 13C91.1 13 90.8 8 90.8 3H82.6C82.6 5.5 82.3 8 80 8C77.7 8 77.4 5.5 77.4 3H66.4C66.4 10.5 66.1 18 63 18C59.9 18 59.6 10.5 59.6 3H51.8C51.8 6 51.5 9 49 9C46.5 9 46.2 6 46.2 3H36.6C36.6 9 36.2 15 33 15C29.8 15 29.4 9 29.4 3H21.6C21.6 5 21.3 7 19 7C16.7 7 16.4 5 16.4 3H9.2C9.2 6.5 8.9 10 6 10C3.1 10 2.8 6.5 2.8 3H0Z'/></svg>") 0 0 / 120px 16px repeat-x; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18'><path d='M0 0H120V3H111.8C111.8 6 111.5 9 109 9C106.5 9 106.2 6 106.2 3H97.2C97.2 8 96.9 13 94 13C91.1 13 90.8 8 90.8 3H82.6C82.6 5.5 82.3 8 80 8C77.7 8 77.4 5.5 77.4 3H66.4C66.4 10.5 66.1 18 63 18C59.9 18 59.6 10.5 59.6 3H51.8C51.8 6 51.5 9 49 9C46.5 9 46.2 6 46.2 3H36.6C36.6 9 36.2 15 33 15C29.8 15 29.4 9 29.4 3H21.6C21.6 5 21.3 7 19 7C16.7 7 16.4 5 16.4 3H9.2C9.2 6.5 8.9 10 6 10C3.1 10 2.8 6.5 2.8 3H0Z'/></svg>") 0 0 / 120px 16px repeat-x;
  transform: scaleY(.4); transform-origin: 50% 0; opacity: .7; pointer-events: none;
  transition: transform 1.3s cubic-bezier(.3, .7, .3, 1), opacity .4s ease;
}
:where(html[data-theme="halloween"]) .card:nth-child(3n+2)::after { background: rgba(255, 59, 87, .55); -webkit-mask-position: 40px 0; mask-position: 40px 0; }
:where(html[data-theme="halloween"]) .card:nth-child(3n)::after { background: rgba(164, 104, 255, .62); -webkit-mask-position: 80px 0; mask-position: 80px 0; }
/* a sickly glow around the card (outer shadow only, so it never tints the content) */
:where(html[data-theme="halloween"]) .card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(157, 255, 61, .3), 0 0 30px rgba(157, 255, 61, .2), 0 18px 44px -12px rgba(164, 104, 255, .5);
  opacity: 0; transition: opacity .35s ease;
}

/* pop-ups: a cobweb in the top-left corner */
:where(html[data-theme="halloween"]) .modal__box::after {
  content: ""; position: absolute; left: 0; top: 0; width: 76px; height: 76px; pointer-events: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'><g fill='none' stroke='%23d8d0ea' stroke-linecap='round'><path stroke-width='1.1' stroke-opacity='.55' d='M0 0L157.8 8.3M0 0L141 51.3M0 0L116.6 91.1M0 0L86 122.9M0 0L47 144.6M0 0L8.3 157.8'/><path stroke-width='.8' stroke-opacity='.42' d='M16 0.8Q12.2 2.4 14.4 5.3Q11 6.2 13.1 10.2Q8.8 9.2 9 12.8Q5.6 11.3 5 15.5Q2.4 12.6 0.8 16M32.6 1.7Q26.3 5.5 33.2 12.1Q23.8 13 26.3 20.5Q18.5 19.6 19.9 28.4Q12.2 24.3 10.5 32.3Q4.9 26.5 1.8 34M57.1 3Q43.1 8.6 50.6 18.4Q37.9 21.2 44.2 34.5Q30.3 31.8 31.5 45.1Q19.4 38.9 17 52.3Q7.9 42 2.8 52.7M77.3 4.1Q61.2 12.6 75.7 27.6Q55.2 30.5 62.3 48.6Q43 45.3 45.3 64.7Q27.5 54.7 23.4 72.1Q11.1 61.7 4.3 82M108 5.7Q83 16.8 99.6 36.3Q73.3 40.6 83.5 65.3Q56.8 59.4 58.4 83.4Q37 75.3 34.1 104.8Q15.8 83.4 5.4 103.7M133.8 7Q103.9 21.1 125.9 45.8Q90.9 50 101.4 79.2Q72.5 77.3 79.9 114.2Q48.2 95.6 40.6 124.9Q19.1 104.6 7.2 136.5'/></g></svg>") left top / 100% 100% no-repeat; opacity: .4;
}
