/* Spooktober, the horror kind. Everything here hangs off
   :root[data-season="spooky"]; without it - the pumpkin at the top takes it
   away - the page is FARO's again, untouched. spooky.js builds the scenery
   it dresses. The dark theme is the night: black, bone and blood under a
   blood moon. The light theme is the fog: a grey town under falling ash.
   An old lantern lights the page, a spirit board stands in for the wheel,
   and everybody is a pumpkin of their own. */

:root:not([data-season="spooky"]) .spooky-only { display: none !important; }
:root[data-season="spooky"] .not-spooky { display: none !important; }

/* ------------------------------------------------------------ colours */

:root[data-season="spooky"] {
  color-scheme: dark;
  --serif: "Cinzel", Georgia, "Times New Roman", serif;
  --display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --fell: "IM Fell English", Georgia, "Times New Roman", serif;

  --bg: #070506;
  --surface: #120e0f;
  --raised: #1a1416;
  --field: #181213;
  --field-hover: #231b1d;
  --hover: rgba(255, 70, 70, .05);
  --border: #2d2124;
  --divider: #241b1d;
  --text: #ece4d6;
  --text-2: #b6aa9b;
  --text-3: #877970;
  --heading: #e6dccb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-soft: 0 2px 14px rgba(0, 0, 0, .6);

  --primary: #a4161a;
  --primary-hover: #c0171d;
  --on-primary: #f4ebdd;
  --primary-tint: rgba(196, 22, 28, .16);
  --primary-ink: #ff5c63;
  --success: #6f9a52;
  --success-tint: rgba(111, 154, 82, .14);
  --success-ink: #96c27c;
  --danger: #e5383b;
  --danger-tint: rgba(229, 56, 59, .14);
  --danger-ink: #ff6b6e;
  --warning: #c9a227;
  --warning-tint: rgba(201, 162, 39, .14);
  --warning-ink: #e2bd4f;

  --slice-a: #141011;
  --slice-b: #0e0b0c;
  --slice-c: #1b1517;
  --slice-ink: #e9e0d0;
  --slice-line: #2a1f22;
  --rim: #0b0809;
  --rim-line: #33242a;
  --rim-dot: #d8c8ad;
  --rim-dot-on: #f0e2c4;
  --peg: #6b5a52;
  --face-bg: #0b0809;
  --snack: #1b1416;
  --snack-ink: #ece4d6;
  --snack-action: #ff6b6e;

  --glass: rgba(15, 10, 11, .66);
  --glass-edge: rgba(255, 90, 90, .1);
  --glass-shine: rgba(255, 210, 200, .05);
  --glass-drop: rgba(0, 0, 0, .55);
  --blood: #b3131b;
  --blood-text: #d4202a;
  --blood-glow: rgba(200, 16, 28, .5);
  --stage-glow: rgba(150, 10, 20, .16);
  --sky:
    radial-gradient(ellipse 70% 45% at 62% 0%, rgba(70, 18, 22, .55), transparent 70%),
    radial-gradient(ellipse 140% 55% at 50% 112%, #221a1d 0%, transparent 62%),
    linear-gradient(180deg, #040303 0%, #0a0708 38%, #161012 66%, #2c2226 100%);
  --far: #0f0b0c;
  --near: #050304;
  --fog-tint: 150, 150, 165;
  --fog-a: .15;
  --web: rgba(210, 205, 215, .2);
  --spider: #050304;
  --watcher: #050304;
  --vignette: rgba(0, 0, 0, .8);
  --lit: #ffad55;
  --header-ink: #efe6d8;
  --header-ink-2: rgba(236, 228, 214, .66);

  /* The board: old dark wood, letters in bone, and blood where the spirits touch it. */
  --ouija-wood-1: #3b2516;
  --ouija-wood-2: #22140b;
  --ouija-wood-3: #110906;
  --ouija-burn: rgba(0, 0, 0, .7);
  --ouija-grain: .55;
  --ouija-ink: #dcc8a2;
  --ouija-lit: #ff4b3a;
  --ouija-lit-glow: rgba(255, 40, 30, .85);
  --ouija-blood: rgba(150, 10, 14, .75);
  --pl-1: #f4ead3;
  --pl-2: #d8c49c;
  --pl-3: #8f7752;
  --pl-edge: #3a2a18;
  --pl-ink: #3b2a1a;
  --pl-rim: #5a4428;

  /* The lamp's light, and the dark away from it. */
  --lamp-warm: 255, 168, 76;
  --lamp-dark: 0, 0, 0;
  --lamp-light: .44;
  --lamp-shade: .62;
  --lamp-glow: .2;
  --moth: #d9cbb0;

  /* The séance: the room gone dark, and the blood on the board. */
  --veil-a: rgba(6, 3, 4, .86);
  --veil-b: rgba(1, 0, 0, .97);
  --ouija-blood-ink: #8f0a10;
}

:root[data-season="spooky"][data-theme="light"] {
  color-scheme: light;
  --bg: #cdc7c0;
  --surface: #ece7e1;
  --raised: #ece7e1;
  --field: #e2dcd5;
  --field-hover: #d7d0c8;
  --hover: rgba(90, 20, 20, .05);
  --border: #c0b7ad;
  --divider: #d3cbc2;
  --text: #221d1d;
  --text-2: #4b4341;
  --text-3: #736a66;
  --heading: #2a2222;
  --shadow: 0 1px 2px rgba(40, 30, 30, .18), 0 6px 18px rgba(40, 30, 30, .14);
  --shadow-soft: 0 2px 14px rgba(40, 30, 30, .2);

  --primary: #7e1414;
  --primary-hover: #951919;
  --on-primary: #f5eee6;
  --primary-tint: rgba(126, 20, 20, .1);
  --primary-ink: #8e1a1a;
  --success: #4c6a35;
  --success-tint: rgba(76, 106, 53, .12);
  --success-ink: #45612f;
  --danger: #9b2226;
  --danger-tint: rgba(155, 34, 38, .1);
  --danger-ink: #8f1d21;
  --warning: #8a6a12;
  --warning-tint: rgba(138, 106, 18, .12);
  --warning-ink: #765a0d;

  --slice-a: #ebe6df;
  --slice-b: #e0d9d1;
  --slice-c: #d5cdc4;
  --slice-ink: #221d1d;
  --slice-line: #c2b9af;
  --rim: #2a2322;
  --rim-line: #181313;
  --peg: #8d827b;
  --face-bg: #e0d9d1;
  --snack: #2a2322;
  --snack-ink: #f2ece4;
  --snack-action: #ff9a9a;

  --glass: rgba(233, 228, 222, .8);
  --glass-edge: rgba(60, 40, 40, .14);
  --glass-shine: rgba(255, 255, 255, .55);
  --glass-drop: rgba(40, 30, 30, .22);
  --blood: #7e1414;
  --blood-text: #7a1212;
  --blood-glow: rgba(126, 20, 20, .28);
  --stage-glow: rgba(120, 20, 20, .07);
  --sky: linear-gradient(180deg, #9d9791 0%, #b7b1aa 30%, #cdc8c1 62%, #dad6d0 100%);
  --far: #958e88;
  --near: #47403e;
  --fog-tint: 234, 231, 226;
  --fog-a: .72;
  --web: rgba(50, 40, 40, .28);
  --spider: #141011;
  --watcher: #3a3333;
  --vignette: rgba(45, 36, 34, .5);
  --lit: #d98b3a;
  --header-ink: #241e1e;
  --header-ink-2: rgba(36, 30, 30, .66);

  --ouija-wood-1: #eadcbc;
  --ouija-wood-2: #d2bc93;
  --ouija-wood-3: #a48b64;
  --ouija-burn: rgba(70, 40, 20, .45);
  --ouija-grain: .35;
  --ouija-ink: #24170e;
  --ouija-lit: #a80f16;
  --ouija-lit-glow: rgba(190, 20, 25, .55);
  --ouija-blood: rgba(120, 10, 14, .6);
  --pl-1: #6e4a2e;
  --pl-2: #3e2717;
  --pl-3: #1c1009;
  --pl-edge: #0e0704;
  --pl-ink: #e3cfa5;
  --pl-rim: #c49f60;

  --lamp-warm: 255, 186, 110;
  --lamp-dark: 40, 32, 30;
  --lamp-light: .36;
  --lamp-shade: .4;
  --lamp-glow: .15;
  --moth: #5a4c40;

  --veil-a: rgba(36, 30, 30, .82);
  --veil-b: rgba(14, 10, 10, .95);
  --ouija-blood-ink: #7a0d10;
}

/* ------------------------------------------------------------ the page */

:root[data-season="spooky"] body { background: var(--bg); }
:root[data-season="spooky"] body::before { display: none; }
:root[data-season="spooky"] .beam { display: none; }
:root[data-season="spooky"] ::selection { background: rgba(179, 19, 27, .5); color: #fff; }
:root[data-season="spooky"] .roster,
:root[data-season="spooky"] .timeline,
:root[data-season="spooky"] .board { scrollbar-color: var(--border) transparent; }

/* ------------------------------------------------------------ the scene behind it all */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--sky);
  animation: nightfall 1.8s ease-out both;
}

@keyframes nightfall { from { opacity: 0; } }

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 78% 72% at 50% 42%, transparent 52%, var(--vignette) 100%);
}

.stars {
  position: absolute;
  inset: 0 0 52% 0;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 7% 14%, #fff 50%, transparent),
    radial-gradient(1px 1px at 19% 36%, #fff 50%, transparent),
    radial-gradient(1.4px 1.4px at 31% 9%, #fff 50%, transparent),
    radial-gradient(1px 1px at 44% 27%, #fff 50%, transparent),
    radial-gradient(1px 1px at 58% 6%, #fff 50%, transparent),
    radial-gradient(1.2px 1.2px at 73% 31%, #fff 50%, transparent),
    radial-gradient(1px 1px at 86% 12%, #fff 50%, transparent),
    radial-gradient(1px 1px at 94% 41%, #fff 50%, transparent),
    radial-gradient(1px 1px at 12% 58%, #fff 50%, transparent),
    radial-gradient(1px 1px at 66% 62%, #fff 50%, transparent);
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: .2; } to { opacity: .55; } }
:root[data-season="spooky"][data-theme="light"] .stars { display: none; }

.skyline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50vh;
}

.skyline .ridge, .skyline .house path, .skyline .stranger { fill: var(--far); }
.skyline .pine-trunk { fill: none; stroke: var(--far); stroke-width: 2.4; stroke-linecap: round; }
.skyline .pine-limb { fill: none; stroke: var(--far); stroke-width: 1.3; stroke-linecap: round; }
.skyline .house .lit { fill: var(--lit); filter: drop-shadow(0 0 5px var(--lit)) drop-shadow(0 0 14px var(--lit)); animation: dying-light 6s steps(1) infinite; }
.skyline .house .dim { fill: var(--lit); opacity: .18; }
.skyline .stranger { opacity: 0; transition: opacity 3.2s ease; }
.skyline .stranger.seen { opacity: .92; }

.skyline.near .ground, .skyline.near .stone, .skyline.near .tips { fill: var(--near); }
.skyline.near .limb, .skyline.near .iron { fill: none; stroke: var(--near); stroke-linecap: round; stroke-linejoin: round; }
.skyline.near .iron { stroke-width: 2.4; }

@keyframes dying-light {
  0%, 100% { opacity: 1; }
  41% { opacity: .35; }
  42% { opacity: 1; }
  44% { opacity: .2; }
  46% { opacity: 1; }
  78% { opacity: .6; }
  80% { opacity: 1; }
}

/* Fog rolls between the ridges and over the graves. */
.mist {
  position: absolute;
  left: -30vw;
  width: 160vw;
  height: 34vh;
  background:
    radial-gradient(ellipse 20% 48% at 12% 60%, rgba(var(--fog-tint), var(--fog-a)), transparent 70%),
    radial-gradient(ellipse 26% 44% at 38% 52%, rgba(var(--fog-tint), calc(var(--fog-a) * .85)), transparent 70%),
    radial-gradient(ellipse 22% 52% at 63% 62%, rgba(var(--fog-tint), var(--fog-a)), transparent 70%),
    radial-gradient(ellipse 24% 46% at 88% 55%, rgba(var(--fog-tint), calc(var(--fog-a) * .9)), transparent 70%);
  animation: roll 80s ease-in-out infinite alternate;
}

.mist.far { bottom: 16vh; opacity: .85; }
.mist.near { bottom: -12vh; height: 42vh; animation-duration: 64s; animation-direction: alternate-reverse; }
.mist.high { top: -4vh; bottom: auto; height: 22vh; opacity: .55; animation-duration: 110s; }

@keyframes roll { from { transform: translateX(-12vw); } to { transform: translateX(12vw); } }

.haunt { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ------------------------------------------------------------ the lamp */

/* An old lantern hangs at the top right, beside the buttons; spooky.js aims
   its light at the flame. The light falls on the scene behind the cards - warm
   near the lamp, dark further off - and on the cards themselves. It is never
   quite steady, and now and then it nearly dies (spooky.js picks the moods). */
:root[data-season="spooky"] .topbar { padding-right: 58px; }

.lamp {
  position: absolute;
  top: 0;
  right: calc(clamp(16px, 3vw, 32px) + 2px);
  z-index: 3;
  width: 46px;
  pointer-events: none;
}

.lamp-swing { position: relative; transform-origin: 50% 0; animation: lamp-sway 6.4s ease-in-out infinite alternate; }
.lamp.jolt .lamp-swing { animation: lamp-jolt 2.6s ease-out; }
.lamp svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; }
.lamp-chain { fill: none; stroke: #2a201d; stroke-width: 1.6; }
.lamp-ring { fill: none; stroke: #2a201d; stroke-width: 2; }
.lamp-iron { fill: url(#lampIron); stroke: #070505; stroke-width: .8; }
.lamp-glass { fill: url(#lampGlass); }
.lamp-flame {
  position: absolute;
  left: 39.5%;
  top: 52.5%;
  width: 21%;
  height: 18.5%;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 70% 62% at 50% 68%, #fffef5 0%, #ffe28a 40%, #ffab3d 72%, rgba(255, 106, 18, .2) 100%);
  box-shadow: 0 0 7px 3px rgba(255, 190, 90, .75), 0 0 24px 9px rgba(255, 120, 30, .38);
  transform-origin: 50% 90%;
  animation: lamp-breathe 3.7s linear infinite, lamp-lick 1.1s ease-in-out infinite alternate;
}
.lamp-wax { fill: #e8dcc2; }
.lamp-bars { fill: none; stroke: #0c0808; stroke-width: 2.6; stroke-linecap: round; }
.lamp-web { fill: none; stroke: var(--web); stroke-width: .7; }

.lamp-halo {
  position: absolute;
  left: 50%;
  top: 63.5%;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--lamp-warm), .55) 0, rgba(var(--lamp-warm), .22) 22%, rgba(var(--lamp-warm), .06) 46%, transparent 68%);
  animation: lamp-breathe 3.7s linear infinite;
}

/* A moth that cannot leave the light alone. */
.moth { position: absolute; left: 50%; top: 60%; animation: moth-x 2.4s ease-in-out infinite alternate; }
.moth b { position: absolute; display: block; animation: moth-y 2.4s ease-in-out -1.2s infinite alternate; }
.moth b::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -3.5px;
  width: 10px;
  height: 7px;
  background: var(--moth);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M10 7C7 0 1 0 1 3.5S5 10 10 7ZM10 7c3-7 9-7 9-3.5S15 10 10 7Z'/%3E%3Cpath d='M10 4v8' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M10 7C7 0 1 0 1 3.5S5 10 10 7ZM10 7c3-7 9-7 9-3.5S15 10 10 7Z'/%3E%3Cpath d='M10 4v8' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: flutter .1s steps(2) infinite;
}

.lampshade, .lamplight { position: absolute; inset: 0; pointer-events: none; }

.lampshade {
  background: radial-gradient(ellipse 150% 125% at var(--lx, 95%) var(--ly, 44px), transparent 16%, rgba(var(--lamp-dark), calc(var(--lamp-shade) * .55)) 56%, rgba(var(--lamp-dark), var(--lamp-shade)) 100%);
}

.lamplight {
  background: radial-gradient(circle at var(--lx, 95%) var(--ly, 44px), rgba(var(--lamp-warm), var(--lamp-light)) 0, rgba(var(--lamp-warm), calc(var(--lamp-light) * .45)) 14%, rgba(var(--lamp-warm), calc(var(--lamp-light) * .16)) 34%, transparent 58%);
  animation: lamp-breathe 3.7s linear infinite;
}

.lampglow {
  position: fixed;
  inset: 0;
  z-index: 54;
  pointer-events: none;
  background: radial-gradient(circle at var(--lx, 95%) var(--ly, 44px), rgba(var(--lamp-warm), var(--lamp-glow)) 0, rgba(var(--lamp-warm), calc(var(--lamp-glow) * .45)) 20%, rgba(var(--lamp-warm), calc(var(--lamp-glow) * .12)) 40%, transparent 52%);
  animation: lamp-breathe 3.7s linear infinite;
}

/* The light the lamp gives when it comes back from the dead. */
.bloodlight {
  position: fixed;
  inset: 0;
  z-index: 54;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--lx, 95%) var(--ly, 44px), rgba(210, 0, 14, .5) 0, rgba(160, 0, 10, .28) 26%, rgba(110, 0, 6, .16) 60%, rgba(70, 0, 4, .1) 100%);
}

/* What looks out of the dark. */
.dread {
  position: fixed;
  z-index: 57;
  width: 104px;
  margin: -16px 0 0 -52px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 4px #ff2a1a) drop-shadow(0 0 18px rgba(255, 0, 0, .75));
}

.dread svg { display: block; width: 100%; height: auto; }
.dread path { fill: url(#dreadIris); }
.dread .slit { fill: #160000; }

/* The moods, each a class on the page for as long as it lasts: the flame,
   its halo and its light keep the same beats, and so do the dark, the red
   light and the eyes. */
.lamp-flick .lamp-flame,
.lamp-flick .lamp-halo,
.lamp-flick .lamplight,
.lamp-flick .lampglow { animation: lamp-flick .65s linear both; }

.lamp-gutter .lamp-flame,
.lamp-gutter .lamp-halo,
.lamp-gutter .lamplight,
.lamp-gutter .lampglow { animation: lamp-gutter 1.4s steps(1) both; }
.lamp-gutter .flicker { animation: blackout 1.4s steps(1) both; }

.lamp-dread .lamp-flame,
.lamp-dread .lamp-halo,
.lamp-dread .lamplight,
.lamp-dread .lampglow { animation: lamp-dread 2.4s linear both; }
.lamp-dread .lamp-flame {
  background: radial-gradient(ellipse 70% 62% at 50% 68%, #ffe9e0 0%, #ff4a30 42%, #a0060a 76%, rgba(120, 0, 0, .25) 100%);
  box-shadow: 0 0 8px 3px rgba(255, 40, 30, .8), 0 0 26px 10px rgba(200, 0, 0, .4);
}
.lamp-dread .lamp-swing { animation: lamp-jolt 2.4s ease-out; }
.lamp-dread .flicker { animation: dread-dark 2.4s linear both; }
.lamp-dread .bloodlight { animation: blood-light 2.4s ease-out both; }
.lamp-dread .dread { animation: dread-eyes 2.4s linear both; }

@keyframes lamp-breathe {
  0% { opacity: .92; }
  9% { opacity: 1; }
  17% { opacity: .84; }
  26% { opacity: .97; }
  38% { opacity: .88; }
  52% { opacity: 1; }
  61% { opacity: .8; }
  69% { opacity: .96; }
  83% { opacity: .87; }
  100% { opacity: .92; }
}

@keyframes lamp-flick {
  0% { opacity: 1; }
  12% { opacity: .45; }
  20% { opacity: .95; }
  34% { opacity: .55; }
  46% { opacity: 1; }
  62% { opacity: .72; }
  74%, 100% { opacity: 1; }
}

@keyframes lamp-gutter {
  0% { opacity: .08; }
  9% { opacity: 1; }
  20% { opacity: .14; }
  31% { opacity: .85; }
  40%, 100% { opacity: 1; }
}

@keyframes lamp-dread {
  0% { opacity: 1; }
  4% { opacity: .35; }
  8% { opacity: .9; }
  12%, 50% { opacity: 0; }
  54% { opacity: .65; }
  57% { opacity: .15; }
  62%, 100% { opacity: 1; }
}

@keyframes dread-dark {
  0%, 10% { opacity: 0; }
  13%, 50% { opacity: .9; }
  54% { opacity: .35; }
  57% { opacity: .7; }
  62%, 100% { opacity: 0; }
}

@keyframes blood-light { 0%, 53% { opacity: 0; } 58% { opacity: 1; } 75% { opacity: .75; } 100% { opacity: 0; } }

@keyframes dread-eyes {
  0%, 16% { opacity: 0; transform: scale(.7); }
  22%, 33% { opacity: 1; transform: scale(1); }
  34.5% { opacity: 0; }
  36.5% { opacity: 1; }
  46% { opacity: 1; transform: scale(1.06); }
  50%, 100% { opacity: 0; transform: scale(1.1); }
}

@keyframes lamp-lick {
  0% { transform: scale(1, 1) skewX(0); }
  40% { transform: scale(.92, 1.1) skewX(4deg); }
  100% { transform: scale(1.04, .94) skewX(-3deg); }
}

@keyframes lamp-sway { from { transform: rotate(-2.4deg); } to { transform: rotate(2.4deg); } }

@keyframes lamp-jolt {
  0% { transform: rotate(0); }
  8% { transform: rotate(11deg); }
  24% { transform: rotate(-8deg); }
  42% { transform: rotate(5deg); }
  60% { transform: rotate(-3deg); }
  78% { transform: rotate(1.4deg); }
  100% { transform: rotate(0); }
}

@keyframes moth-x { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
@keyframes moth-y { from { transform: translateY(-20px); } to { transform: translateY(14px); } }
@keyframes flutter { 50% { transform: scaleX(.3); } }

/* ------------------------------------------------------------ over everything */

.grain {
  position: fixed;
  inset: -60%;
  z-index: 55;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.6 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(5) infinite;
}

:root[data-season="spooky"][data-theme="light"] .grain { opacity: .11; }

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-2%, 4%); }
  80% { transform: translate(4%, -2%); }
  100% { transform: translate(0, 0); }
}

/* The dark the lamp leaves when it gutters, or dies. */
.flicker { position: fixed; inset: 0; z-index: 56; pointer-events: none; background: #000; opacity: 0; }

@keyframes blackout {
  0% { opacity: .5; }
  9% { opacity: 0; }
  20% { opacity: .42; }
  31% { opacity: 0; }
  100% { opacity: 0; }
}

/* Lightning when the spirits have named somebody. */
.flash {
  position: fixed;
  inset: 0;
  z-index: 64;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 90% 75% at var(--bx, 50%) -10%, rgba(232, 238, 255, .95), rgba(170, 185, 255, .32) 55%, rgba(110, 120, 190, .06));
}

.bolt { position: fixed; inset: 0; z-index: 65; width: 100%; height: 100%; pointer-events: none; opacity: 0; overflow: visible; }
.bolt path { fill: none; stroke: #f5f7ff; stroke-width: 2.4; stroke-linejoin: bevel; stroke-linecap: round; filter: drop-shadow(0 0 4px #dfe6ff) drop-shadow(0 0 16px #8ea0ff); }

.flash.on { animation: flash 1.2s ease-out; }
.bolt.on { animation: bolt 1.2s ease-out; }

@keyframes flash { 0% { opacity: 0; } 4% { opacity: .55; } 9% { opacity: .08; } 15% { opacity: .42; } 36%, 100% { opacity: 0; } }
@keyframes bolt { 0% { opacity: 0; } 3% { opacity: 1; } 9% { opacity: 0; } 14% { opacity: 1; } 26%, 100% { opacity: 0; } }

.shell.quake { animation: quake .55s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes quake {
  10%, 90% { transform: translate(-1px, 0); }
  20%, 80% { transform: translate(2px, 1px); }
  30%, 50%, 70% { transform: translate(-3px, -1px); }
  40%, 60% { transform: translate(3px, 1px); }
}

.burst { position: fixed; inset: 0; z-index: 63; width: 100%; height: 100%; pointer-events: none; }

/* ------------------------------------------------------------ header */

:root[data-season="spooky"] .logo { background: radial-gradient(circle at 50% 40%, #2a1d1f, #070506); box-shadow: 0 0 0 1px rgba(179, 19, 27, .45), 0 0 18px rgba(179, 19, 27, .35); }
.logo-jack { width: 34px; height: 34px; }

:root[data-season="spooky"] .brand-text h1 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--header-ink);
  text-shadow: 0 0 18px var(--blood-glow), 0 2px 0 rgba(0, 0, 0, .4);
}

:root[data-season="spooky"] .brand-text p { font-family: var(--fell); font-style: italic; font-size: 14.5px; color: var(--header-ink-2); }

:root[data-season="spooky"][data-theme="light"] .topbar .icon-btn { color: rgba(36, 30, 30, .8); }
:root[data-season="spooky"][data-theme="light"] .topbar .icon-btn:hover { background: rgba(36, 30, 30, .08); color: #241e1e; }
:root[data-season="spooky"][data-theme="light"] .live { border-color: rgba(36, 30, 30, .25); background: rgba(255, 255, 255, .3); color: #241e1e; }
:root[data-season="spooky"][data-theme="light"] .toolbar-sep { background: rgba(36, 30, 30, .3); }

:root[data-season="spooky"] .live i { background: #b3131b; box-shadow: 0 0 8px 1px rgba(220, 20, 30, .8); animation: heartbeat 1.6s ease-in-out infinite; }
:root[data-season="spooky"] .live.off i { background: var(--text-3); box-shadow: none; animation: none; }

@keyframes heartbeat {
  0%, 40%, 100% { transform: scale(1); }
  10% { transform: scale(1.35); }
  20% { transform: scale(1); }
  28% { transform: scale(1.25); }
}

#season[aria-pressed="true"] { color: #ff5c63; }
#season[aria-pressed="true"] .i { filter: drop-shadow(0 0 5px rgba(220, 20, 30, .8)); }

/* ------------------------------------------------------------ type */

:root[data-season="spooky"] .eyebrow { font-family: var(--serif); font-size: 11px; font-weight: 700; letter-spacing: .32em; color: var(--text-2); }
:root[data-season="spooky"] .eyebrow::before { background: var(--blood); box-shadow: 0 0 8px var(--blood-glow); }

:root[data-season="spooky"] .headline {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
  color: var(--blood-text);
  text-shadow: 0 0 26px var(--blood-glow), 0 0 2px rgba(255, 90, 90, .35);
  animation: hum 9s steps(1) infinite;
}

:root[data-season="spooky"] .headline.won { color: var(--blood-text); animation: pop .5s var(--ease-out), hum 9s steps(1) .5s infinite; }

/* Each letter the planchette takes bleeds into the headline. */
:root[data-season="spooky"] .headline .ink { display: inline-block; animation: ink .6s ease-out both; }

@keyframes ink { from { opacity: 0; filter: blur(6px); transform: translateY(-.12em) scale(1.35); } }

/* A failing light: steady, then a stutter. */
@keyframes hum {
  0%, 100% { opacity: 1; }
  58% { opacity: .78; }
  59% { opacity: 1; }
  61% { opacity: .6; }
  62% { opacity: 1; }
}

:root[data-season="spooky"] .subline .muted { font-family: var(--fell); font-style: italic; font-size: 16px; color: var(--text-2); }
:root[data-season="spooky"] .panel-title h2 { font-family: var(--serif); font-size: 12.5px; font-weight: 700; letter-spacing: .2em; color: var(--heading); }
:root[data-season="spooky"] .panel-title p { font-family: var(--fell); font-style: italic; font-size: 13.5px; }
:root[data-season="spooky"] .badge-icon { background: rgba(179, 19, 27, .14); color: #e0565c; }
:root[data-season="spooky"][data-theme="light"] .badge-icon { background: rgba(126, 20, 20, .1); color: #7e1414; }
:root[data-season="spooky"] .foot { font-family: var(--fell); font-style: italic; font-size: 13px; }

/* ------------------------------------------------------------ cards */

/* Smoked glass: the night shows through, blurred. */
:root[data-season="spooky"] .card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-color: var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 24px 60px var(--glass-drop);
}

:root[data-season="spooky"] .stage { background: radial-gradient(ellipse 58% 46% at 50% 56%, var(--stage-glow), transparent 75%), var(--glass); }

@media (prefers-reduced-transparency: reduce) {
  :root[data-season="spooky"] .card { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Reviews left waiting gather cobwebs. */
:root[data-season="spooky"] .since.stale::after,
:root[data-season="spooky"] .since-inline.stale::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 5px;
  vertical-align: -2px;
  opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a89a90' stroke-width='1.2'%3E%3Cpath d='M0 0 24 10M0 0 17 17M0 0 10 24M7 0Q6 5 0 7M14 0Q12 11 0 14M22 0Q19 18 0 22'/%3E%3C/svg%3E") no-repeat center / contain;
}

:root[data-season="spooky"] dialog.profile::backdrop { background: rgba(0, 0, 0, .78); }
:root[data-season="spooky"][data-theme="light"] dialog.profile::backdrop { background: rgba(30, 24, 24, .55); }

/* ------------------------------------------------------------ everybody's pumpkin */

/* spooky.js puts its owner's pumpkin in every avatar, ringed in the owner's
   colour, lit from inside. Each sways its own way, on the page's clock (--t),
   so they keep going when the lists are drawn again, and now and then does
   its thing (act() in spooky.js). Whoever is away today has gone dark and still. */
:root[data-season="spooky"] .avatar {
  position: relative;
  isolation: isolate;
  color: transparent;
  background: radial-gradient(circle at 50% 60%, #2c1408 0%, #140a07 62%, #0a0606 100%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 85%, #000);
  filter: none;
}

.avatar > .pk { position: absolute; left: 3%; top: 3%; width: 94%; height: 94%; overflow: visible; transform-origin: 50% 90%; }

:root[data-season="spooky"] .avatar::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--halo, 255, 150, 40), .4) 0%, rgba(var(--halo, 255, 110, 20), .15) 38%, transparent 66%);
  pointer-events: none;
  animation: candlelight 2.4s ease-in-out var(--t, 0s) infinite;
}

[data-face="5"] { --halo: 170, 255, 80; }
[data-face="6"] { --halo: 220, 130, 255; }
[data-face="10"] { --halo: 150, 200, 255; }

[data-face="0"] > .pk { animation: pk-rock 3.8s ease-in-out infinite alternate; }
[data-face="1"] > .pk { animation: pk-lean 5.2s ease-in-out infinite; }
[data-face="2"] > .pk { animation: pk-shiver 3.2s linear infinite; }
[data-face="3"] > .pk { animation: pk-tilt 7s ease-in-out infinite; }
[data-face="4"] > .pk { animation: pk-hop 3.6s ease-out infinite; }
[data-face="5"] > .pk { animation: pk-limp 4.8s ease-in-out infinite; }
[data-face="6"] > .pk { animation: pk-bob 4s ease-in-out infinite; }
[data-face="7"] > .pk { animation: pk-nod 6.5s ease-in-out infinite; }
[data-face="8"] > .pk { animation: pk-bob 3.4s ease-in-out infinite; }
[data-face="9"] > .pk { animation: pk-huff 4.2s ease-out infinite; }
[data-face="10"] > .pk { animation: pk-haunt 5s ease-in-out infinite; }
[data-face="11"] > .pk { animation: pk-zap 5.5s linear infinite; }
.avatar > .pk { animation-delay: var(--t, 0s); }

/* Everybody sways where they appear once - the team, the leaderboard, the
   pop-ups; the many copies down the history and the reviews keep still. */
.pick .avatar > .pk,
.reviews .avatar > .pk,
.verdict-by .avatar > .pk { animation: none; }

:root[data-season="spooky"] .member.out .avatar { opacity: .7; }
:root[data-season="spooky"] .member.out .avatar::after { display: none; }
.member.out .avatar > .pk { animation: none; filter: grayscale(.85) brightness(.5); --pk-dark: #170b06; }

@keyframes candlelight {
  0% { opacity: .65; }
  20% { opacity: .95; }
  32% { opacity: .55; }
  48% { opacity: 1; }
  70% { opacity: .75; }
  100% { opacity: .65; }
}

/* Inside the pumpkins (the symbols spooky.js draws; each <use> copies them). */
.pk-root { --fire: url(#pkFire); --glow: #ffd257; }
.pk-5 { --fire: url(#pkToxic); --glow: #d4ff6a; }
.pk-6 { --fire: url(#pkVoid); --glow: #f2a9ff; }
.pk-10 { --fire: url(#pkCold); --glow: #d2ebff; }

.pk-rind { stroke: #1c0b05; stroke-width: 2; }
.pk-10 .pk-rind { stroke: #2d2824; }
.pk-shine { fill: none; stroke: #fff; stroke-opacity: .5; stroke-width: 2.2; stroke-linecap: round; }
.pk-stem { fill: #6b5a2c; stroke: #1c0b05; stroke-width: 1.6; stroke-linejoin: round; }
.pk-vine { fill: none; stroke: #3d6b1d; stroke-width: 1.8; stroke-linecap: round; }
.pk-leaf { fill: #4f8a26; stroke: #1c0b05; stroke-width: 1.3; stroke-linejoin: round; }
.pk-vein { fill: none; stroke: #2e5a14; stroke-width: 1; }
.pk-cut { fill: var(--pk-dark, var(--fire)); stroke: #1c0b05; stroke-width: 1.3; stroke-linejoin: round; }
.pk-ink { fill: none; stroke: #1c0b05; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pk-brow { stroke-width: 3.6; }
.pk-stitch, .pk-scar { stroke-width: 1.5; }
.pk-line { fill: none; stroke: #1c0b05; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pk-glow { fill: none; stroke: var(--pk-dark, var(--glow)); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pk-pupil { fill: #1c0b05; }
.pk-glint { fill: #fff; }
.pk-sweat { fill: #a9dcff; stroke: #1c0b05; stroke-width: 1.1; }
.pk-tooth { fill: url(#pkOrange); stroke: #1c0b05; stroke-width: 1.2; stroke-linejoin: round; }
.pk-fang { fill: #fff4e2; stroke: #1c0b05; stroke-width: 1.1; stroke-linejoin: round; }
.pk-drip { fill: #c1121f; }
.pk-flesh { fill: #d6577e; stroke: #1c0b05; stroke-width: 1.3; }
.pk-crease { fill: none; stroke: #8f2a4c; stroke-width: 1; }
.pk-zz { fill: none; stroke: #f3e7c9; stroke-width: 1.3; stroke-linejoin: round; }
.pk-bolt { fill: #9aa0a6; stroke: #1c0b05; stroke-width: 1.2; }

/* An act (spooky.js) names the keyframes for each part on the <use>'s svg;
   they reach inside as custom properties, and run once. */
.pk-eyes, .pk-mouth, .pk-look, .pk-open, .pk-shut, .pk-sweat, .pk-tongue, .pk-drip, .pk-zz { transform-box: fill-box; transform-origin: 50% 50%; }
.pk-eyes { animation: var(--a-eyes, none) var(--a-ms, 1s) ease-in-out; }
.pk-mouth { animation: var(--a-mouth, none) var(--a-ms, 1s) ease-in-out; }
.pk-look { animation: var(--a-look, none) var(--a-ms, 1s) ease-in-out; }
.pk-open { animation: var(--a-open, none) var(--a-ms, 1s) linear; }
.pk-shut { opacity: 0; animation: var(--a-shut, none) var(--a-ms, 1s) linear; }
.pk-sweat, .pk-drip, .pk-zz, .pk-tongue, .pk-spin { animation: var(--a-extra, none) var(--a-ms, 1s) ease-in-out; }
.pk-1 .pk-mouth, .pk-5 .pk-tongue { transform-origin: 50% 0; }
.pk-7 .pk-eyes { transform-origin: 50% 0; }
.pk-6 .pk-spin { transform-box: view-box; animation-timing-function: steps(24); }
.pk-6 .pk-spin-l { transform-origin: 22px 33px; }
.pk-6 .pk-spin-r { transform-origin: 42px 33px; animation-direction: reverse; }

@keyframes pk-blink { 0%, 30%, 70%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.08); } }
@keyframes pk-blink-late { 0%, 84%, 100% { transform: scaleY(1); } 91% { transform: scaleY(.08); } }
@keyframes pk-squint { 0%, 100% { transform: scaleY(1); } 22%, 78% { transform: scaleY(.5); } }
@keyframes pk-chomp { 0%, 100% { transform: scaleY(1); } 25% { transform: scaleY(.4); } 50% { transform: scaleY(1.08); } 75% { transform: scaleY(.55); } }
@keyframes pk-dart { 0%, 100% { transform: translate(0, 0); } 10%, 38% { transform: translate(-2.6px, .6px); } 48%, 76% { transform: translate(2.6px, .2px); } 86% { transform: translate(0, 0); } }
@keyframes pk-glance { 0%, 100% { transform: translate(0, 0); } 10%, 30% { transform: translate(-4px, 1px); } 42%, 62% { transform: translate(4px, 1.4px); } 72%, 82% { transform: translate(0, -2.4px); } 92% { transform: translate(0, 0); } }
@keyframes pk-wink-open { 0%, 100% { opacity: 1; } 12%, 88% { opacity: 0; } }
@keyframes pk-wink-shut { 0%, 100% { opacity: 0; } 12%, 88% { opacity: 1; } }
@keyframes pk-sweat { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 71% { transform: translateY(-2px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes pk-wag { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(10deg); } 45% { transform: rotate(-9deg); } 70% { transform: rotate(8deg); } 90% { transform: rotate(-3deg); } }
@keyframes pk-turn { to { transform: rotate(720deg); } }
@keyframes pk-droop { 0%, 100% { transform: scaleY(1); } 30%, 70% { transform: scaleY(.3); } }
@keyframes pk-yawn { 0%, 100% { transform: scale(1); } 35%, 65% { transform: scale(1.3, 2); } }
@keyframes pk-zz { 0% { transform: translate(0, 0); opacity: 1; } 60% { transform: translate(3px, -7px); opacity: 0; } 61% { transform: translate(0, 3px); opacity: 0; } 100% { transform: translate(0, 0); opacity: 1; } }
@keyframes pk-drip { 0% { transform: translateY(0); opacity: 1; } 65% { transform: translateY(7px); opacity: 0; } 66% { transform: translateY(-1px) scaleY(.3); opacity: 0; } 100% { transform: translateY(0) scaleY(1); opacity: 1; } }
@keyframes pk-moan { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2, 1.35); } }

@keyframes pk-rock { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes pk-lean { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(3deg) translateY(-3%); } }
@keyframes pk-shiver {
  0%, 74%, 100% { transform: translate(0, 0); }
  76% { transform: translate(-3%, 0); }
  78% { transform: translate(3%, 1%); }
  80% { transform: translate(-3%, -1%); }
  82% { transform: translate(3%, 0); }
  84% { transform: translate(-2%, 1%); }
  86% { transform: translate(2%, 0); }
  88% { transform: translate(0, 0); }
}
@keyframes pk-tilt { 0%, 22%, 92%, 100% { transform: rotate(0); } 28%, 46% { transform: rotate(-6deg); } 56%, 80% { transform: rotate(5deg); } }
@keyframes pk-hop {
  0%, 55%, 100% { transform: translateY(0) scale(1); }
  62% { transform: translateY(0) scale(1.08, .9); }
  70% { transform: translateY(-14%) scale(.95, 1.06); }
  78% { transform: translateY(0) scale(1.06, .93); }
  84% { transform: translateY(0) scale(1); }
}
@keyframes pk-limp { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } }
@keyframes pk-bob { 0%, 100% { transform: translateY(2%); } 50% { transform: translateY(-6%); } }
@keyframes pk-nod { 0%, 60%, 100% { transform: rotate(0) translateY(0); } 75%, 82% { transform: rotate(10deg) translateY(4%); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(0); } }
@keyframes pk-huff { 0%, 76%, 100% { transform: scale(1); } 80% { transform: scale(1.1, .9); } 86% { transform: scale(.96, 1.05); } 91% { transform: scale(1); } }
@keyframes pk-haunt { 0%, 100% { transform: translateY(3%); opacity: 1; } 50% { transform: translateY(-7%); opacity: .62; } }
@keyframes pk-zap {
  0%, 86%, 100% { transform: translate(0, 0); filter: none; }
  87% { transform: translate(-4%, 1%); filter: brightness(1.6); }
  88.5% { transform: translate(4%, -1%); filter: brightness(1.1); }
  90% { transform: translate(-3%, 0); filter: brightness(1.5); }
  91.5% { transform: translate(0, 0); filter: none; }
}

/* ------------------------------------------------------------ the blood moon, and its crows */

:root[data-season="spooky"] .layout { position: relative; }

.perch {
  position: absolute;
  grid-area: stage;
  top: -80px;
  left: 54%;
  width: 230px;
  height: 80px;
  pointer-events: none;
}

.perch .moon {
  position: absolute;
  z-index: -1;
  left: 50px;
  top: 14px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 36%, rgba(60, 8, 8, .35) 0 7%, transparent 8%),
    radial-gradient(circle at 62% 58%, rgba(60, 8, 8, .3) 0 11%, transparent 12%),
    radial-gradient(circle at 57% 26%, rgba(60, 8, 8, .26) 0 5%, transparent 6%),
    radial-gradient(circle at 38% 70%, rgba(60, 8, 8, .22) 0 6%, transparent 7%),
    radial-gradient(circle at 40% 36%, #f2cdb9 0%, #cf7a64 36%, #96322a 70%, #4f1110 100%);
  box-shadow: 0 0 46px 12px rgba(150, 18, 18, .42), 0 0 130px 50px rgba(110, 8, 8, .2);
  animation: moonrise 2.4s cubic-bezier(.2, .7, .2, 1) both;
}

:root[data-season="spooky"][data-theme="light"] .perch .moon {
  background: radial-gradient(circle, rgba(255, 255, 255, .96) 0%, rgba(248, 246, 242, .75) 42%, rgba(240, 236, 230, 0) 70%);
  box-shadow: none;
}

@keyframes moonrise { from { transform: translateY(46px); opacity: 0; } }

.perch .wisp {
  position: absolute;
  z-index: -1;
  top: 34px;
  left: -40px;
  width: 230px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(6, 4, 5, .92), transparent 70%);
  animation: drift-by 46s linear infinite;
}

.perch .wisp.w2 { top: 78px; height: 15px; width: 180px; animation-duration: 64s; animation-delay: -28s; }
:root[data-season="spooky"][data-theme="light"] .perch .wisp { background: radial-gradient(ellipse at center, rgba(232, 229, 224, .95), transparent 70%); }

@keyframes drift-by { from { transform: translateX(-160px); } to { transform: translateX(380px); } }

.perch .crow { position: absolute; z-index: 3; bottom: -1px; width: 56px; fill: var(--near); animation: settle 1.6s ease-out .8s both; }
.perch .crow.c1 { left: 70px; }
.perch .crow.c2 { left: 134px; width: 46px; transform: scaleX(-1); animation: none; }
.perch .crow-eye { fill: #8f1414; }
.perch .crow-legs { fill: none; stroke: var(--near); stroke-width: 1.4; stroke-linecap: round; }
.perch .crow-head { transform-box: fill-box; transform-origin: 85% 80%; animation: look 9s ease-in-out infinite; }
.perch .crow.c2 .crow-head { animation-duration: 12s; animation-delay: -5s; }
:root[data-season="spooky"][data-theme="light"] .perch .crow { fill: #2a2424; }
:root[data-season="spooky"][data-theme="light"] .perch .crow-legs { stroke: #2a2424; }

@keyframes settle { from { opacity: 0; transform: translateY(-14px); } }

@keyframes look {
  0%, 52%, 100% { transform: rotate(0); }
  56%, 70% { transform: rotate(-16deg); }
  74%, 86% { transform: rotate(9deg); }
  90% { transform: rotate(0); }
}

/* ------------------------------------------------------------ the spirit board */

/* In the season the board answers instead of the wheel; the wheel only
   comes back if the board is not there. */
:root[data-season="spooky"] .stage:has(.ouija-slot) .wheel { display: none; }

/* The board's place on the page; the board leaves it for the séance, and
   while it is away the place keeps a dark imprint. */
.ouija-slot {
  position: relative;
  width: min(100%, max(330px, (100svh - 430px) * 1.52), 760px);
  aspect-ratio: 1000 / 660;
  margin-top: 2px;
  border-radius: 4% / 6.06%;
  animation: arrive .8s var(--ease-out) both;
}

.ouija-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, rgba(120, 10, 16, .25), rgba(0, 0, 0, .45));
  box-shadow: inset 0 0 0 1px rgba(255, 60, 60, .12), inset 0 10px 40px rgba(0, 0, 0, .6);
}

.ouija {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  border-radius: 4% / 6.06%;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .62), 0 0 0 1px rgba(0, 0, 0, .55);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body.spinning .ouija { cursor: default; }

.ouija-board { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ouija .ow1 { stop-color: var(--ouija-wood-1); }
.ouija .ow2 { stop-color: var(--ouija-wood-2); }
.ouija .ow3 { stop-color: var(--ouija-wood-3); }
.ouija .ob-burn { stop-color: var(--ouija-burn); }
.ob-wood { fill: url(#ouijaWood); }
.ob-grain { fill: #000; opacity: var(--ouija-grain); }
.ob-line { fill: none; stroke: var(--ouija-ink); stroke-width: 2.6; opacity: .75; }
.ob-line.thin { stroke-width: 1.3; opacity: .5; }
.ob-ink { fill: var(--ouija-ink); }
.ob-disc { fill: none; stroke: var(--ouija-ink); stroke-width: 3; }
.ob-face { fill: none; stroke: var(--ouija-ink); stroke-width: 2.6; stroke-linecap: round; }
.ob-carve { fill: none; stroke: var(--ouija-wood-2); stroke-width: 2.4; stroke-linecap: round; }
.ob-blood { fill: var(--ouija-blood); }
.ob-runes { font-family: "Noto Sans Runic", serif; font-size: 18px; fill: var(--ouija-ink); opacity: .55; dominant-baseline: central; }

.ouija .glyph,
.ouija .word { font-family: var(--serif); font-weight: 700; fill: var(--ouija-ink); text-anchor: middle; dominant-baseline: central; }
.ouija .word { font-family: var(--display); letter-spacing: .08em; }

/* Every letter the planchette takes stays lit until it is all over; then the name fades. */
.ouija .glyph.taken { fill: var(--ouija-lit); filter: url(#ouijaGlow); }
.ouija .glyph.now { stroke: var(--ouija-lit); stroke-width: 2; }
.ouija.fading .glyph { transition: fill 1.6s ease; }

/* The jack-o'-lantern at its head blazes while the spirits speak. */
.jack .stem { fill: #2b1f0e; }
.jack .ribs { fill: none; stroke: #3a1003; stroke-opacity: .45; stroke-width: 2; }
.jack .carve { filter: drop-shadow(0 0 2px #ffcf57) drop-shadow(0 0 7px rgba(255, 120, 20, .85)); animation: smoulder 2.6s ease-in-out infinite; }
.board-jack { position: absolute; left: 45.2%; top: 9.1%; width: 9.6%; height: auto; aspect-ratio: 1; overflow: visible; pointer-events: none; }
.ouija[data-state="spinning"] .board-jack { animation: rattle .14s steps(2) infinite; }
.ouija[data-state="spinning"] .board-jack .carve,
.ouija[data-state="won"] .board-jack .carve { filter: drop-shadow(0 0 3px #fff2b0) drop-shadow(0 0 12px rgba(255, 140, 30, 1)); }
.ouija[data-state="spinning"] .board-jack .carve { animation: blaze .22s steps(2) infinite; }
.ouija[data-state="won"] .board-jack .carve { animation: none; opacity: 1; }

@keyframes smoulder {
  0%, 100% { opacity: .82; }
  25% { opacity: 1; }
  40% { opacity: .7; }
  62% { opacity: .96; }
  80% { opacity: .78; }
}

@keyframes blaze { 50% { opacity: .72; } }
@keyframes rattle { 50% { transform: translate(.6px, -.4px) rotate(.8deg); } }

/* The planchette: spooky.js moves it; its window rests on the letter it takes. */
.planchette { position: absolute; left: 0; top: 0; z-index: 2; width: 15%; aspect-ratio: 150 / 180; transform-origin: 50% 47.78%; will-change: transform; pointer-events: none; }
.planchette svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1.1cqw .9cqw rgba(0, 0, 0, .55)); animation: hover 7s ease-in-out infinite alternate; }
.planchette.on svg { filter: drop-shadow(0 1.1cqw .9cqw rgba(0, 0, 0, .55)) drop-shadow(0 0 1.6cqw var(--ouija-lit-glow)); }
.planchette .pl1 { stop-color: var(--pl-1); }
.planchette .pl2 { stop-color: var(--pl-2); }
.planchette .pl3 { stop-color: var(--pl-3); }
.pl-body { fill: url(#plWood); fill-rule: evenodd; stroke: var(--pl-edge); stroke-width: 2.4; }
.pl-inlay { fill: none; stroke: var(--pl-ink); stroke-width: 1.6; opacity: .55; }
.pl-glass { fill: url(#plGlass); }
.pl-rim { fill: none; stroke: var(--pl-rim); stroke-width: 5; }
.planchette.on .pl-rim { stroke: var(--ouija-lit); }
.pl-eye { fill: none; stroke: var(--pl-ink); stroke-width: 2.2; stroke-linejoin: round; }
.pl-pupil { fill: var(--pl-ink); }
.pl-dots { fill: none; stroke: var(--pl-ink); stroke-width: 5; stroke-linecap: round; opacity: .6; }

@keyframes hover { from { transform: translate(-.6%, .5%) rotate(-1.2deg); } to { transform: translate(.6%, -.6%) rotate(1.2deg); } }

/* Someone behind the board looks out now and then, and is gone again. */
.watcher { position: absolute; right: 0; top: 40%; width: 7%; color: var(--watcher); pointer-events: none; transform: translateX(-30%); animation: peek 21s ease-in-out 7s infinite; }
.watcher svg { display: block; width: 100%; height: auto; }
.watcher .eye { fill: #ff2b2b; filter: drop-shadow(0 0 3px #ff1010); animation: blink 21s steps(1) 7s infinite; }
:root[data-season="spooky"][data-theme="light"] .watcher .eye { fill: #efebe5; filter: none; }

@keyframes peek {
  0%, 52%, 100% { transform: translateX(-30%); }
  62%, 84% { transform: translateX(70%); }
  92% { transform: translateX(-30%); }
}

@keyframes blink { 0%, 72% { opacity: 1; } 72.4% { opacity: 0; } 73.2% { opacity: 1; } }

/* ------------------------------------------------------------ the séance */

/* Asked a question, the board rises out of the page to the middle of the
   screen at twice the size, over a room gone dark (spooky.js moves it). Only
   the lantern still shows through the dark. */
.seance-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(ellipse 58% 50% at 50% 60%, rgba(150, 10, 18, .3), transparent 72%),
    radial-gradient(ellipse 110% 90% at 50% 55%, var(--veil-a), var(--veil-b));
  -webkit-mask: radial-gradient(circle at var(--lx, 95%) var(--ly, 44px), transparent 0 34px, #000 180px);
  mask: radial-gradient(circle at var(--lx, 95%) var(--ly, 44px), transparent 0 34px, #000 180px);
  transition: opacity .8s ease, visibility 0s linear .8s;
}

:root.seance .seance-veil,
:root.seance .seance-caption { opacity: 1; visibility: visible; transition: opacity .7s ease; }

/* The question is asked above the board while it is up, not twice. */
:root.seance .stage .announce { opacity: 0; transition: opacity .3s ease; }

/* Fog that creeps along the floor of the dark - only while it is dark: an
   animation left running in the hidden veil kept the idle page busy. */
.seance-veil .fume {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -8%;
  height: 34%;
  background:
    radial-gradient(ellipse 30% 46% at 30% 70%, rgba(var(--fog-tint), .16), transparent 70%),
    radial-gradient(ellipse 34% 40% at 72% 64%, rgba(var(--fog-tint), .13), transparent 70%);
}

.seance-veil .fume.f2 { bottom: 4%; opacity: .7; }
:root.seance .seance-veil .fume { animation: roll 26s ease-in-out infinite alternate; }
:root.seance .seance-veil .fume.f2 { animation: roll 34s ease-in-out infinite alternate-reverse; }

/* The question above the risen board, and the name as it is spelled. */
.seance-caption {
  position: fixed;
  left: 0;
  right: 0;
  top: 24px;
  z-index: 61;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}

.seance-eyebrow { font-family: var(--serif); font-size: 12px; font-weight: 700; letter-spacing: .42em; color: #c9bba8; text-transform: uppercase; }

.seance-name {
  min-height: 1.25em;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(34px, 5.2vw, 66px);
  font-weight: 700;
  line-height: 1.2;
  color: #e3262f;
  text-shadow: 0 0 34px rgba(230, 20, 30, .75), 0 0 4px rgba(255, 90, 90, .55);
  white-space: nowrap;
}

.seance-name .ink { display: inline-block; animation: summon .8s ease-out both; }
.seance-for { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; max-width: 100%; font-family: var(--fell); font-style: italic; font-size: 16px; color: #c9bba8; }
.seance-for > * { flex: none; }
.seance-for .pr-title { flex: 0 1 auto; max-width: 420px; font-family: var(--font); font-style: normal; color: #ece4d6; }

@keyframes summon {
  0% { opacity: 0; filter: blur(12px); transform: translateY(-.35em) scale(1.9); }
  55% { opacity: 1; filter: blur(0); transform: translateY(.03em) scale(.96); }
  100% { opacity: 1; transform: none; }
}

.ouija.risen {
  position: fixed;
  z-index: 61;
  inset: auto;
  cursor: default;
  box-shadow: 0 50px 140px rgba(0, 0, 0, .85), 0 0 90px rgba(150, 10, 20, .4), 0 0 0 1px rgba(0, 0, 0, .6);
  transition: box-shadow .8s ease;
}

.ouija.spoken { box-shadow: 0 50px 140px rgba(0, 0, 0, .85), 0 0 130px rgba(225, 20, 30, .6), 0 0 0 1px rgba(0, 0, 0, .6); }

/* Two candles stand by the risen board, and flare at every letter it takes. */
.candle { position: absolute; bottom: 3%; width: 3%; height: 14%; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .6s ease .4s; }
.candle.c1 { left: -5%; }
.candle.c2 { right: -5%; }
.ouija.risen .candle { opacity: 1; visibility: visible; }

.candle::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80%;
  border-radius: 34% 34% 10% 10% / 9% 9% 3% 3%;
  background: linear-gradient(90deg, #a8977a, #f1e7d2 42%, #c6b490 78%, #8e7d62);
  box-shadow: inset 0 8px 8px -5px rgba(255, 170, 80, .7), 0 0 30px rgba(255, 140, 50, .25);
}

.candle b {
  position: absolute;
  left: 50%;
  bottom: 80%;
  width: 70%;
  height: 22%;
  margin-left: -35%;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 70% 62% at 50% 70%, #fffef6, #ffd96c 45%, rgba(255, 120, 30, .3));
  box-shadow: 0 0 10px 4px rgba(255, 170, 70, .6), 0 0 36px 14px rgba(255, 110, 30, .28);
  transform-origin: 50% 92%;
}

.candle.c2 { --lag: -.4s; }
.ouija.risen .candle b { animation: candle .8s ease-in-out var(--lag, 0s) infinite alternate; }
.ouija.flare .candle b { animation: candle-flare .55s ease-out; }
.ouija.spoken .candle b { animation: candle-flare .9s ease-out infinite alternate; }

@keyframes candle {
  0% { transform: scale(1, 1) skewX(0); opacity: .9; }
  50% { transform: scale(.88, 1.12) skewX(5deg); opacity: 1; }
  100% { transform: scale(1.05, .92) skewX(-4deg); opacity: .86; }
}

@keyframes candle-flare { 0% { transform: scale(1); } 30% { transform: scale(1.45, 2); } 100% { transform: scale(1); } }

/* Blood runs down from the top of the board while the spirits speak. */
.ouija-blood { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ob-drip { fill: none; stroke: var(--ouija-blood-ink); stroke-width: 6; stroke-linecap: round; stroke-dasharray: calc(var(--run) * 1px) 2000px; stroke-dashoffset: calc(var(--run) * 1px); opacity: 0; }
.ob-drop { fill: var(--ouija-blood-ink); opacity: 0; transform-box: fill-box; transform-origin: 50% 0; }
.ouija.risen .ob-drip { opacity: 1; animation: bleed 3.4s cubic-bezier(.45, 0, .6, 1) var(--d) both; }
.ouija.risen .ob-drop { animation: drop 3.4s linear var(--d) both; }

@keyframes bleed { from { stroke-dashoffset: calc(var(--run) * 1px); } to { stroke-dashoffset: 0; } }
@keyframes drop { 0%, 88% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: none; } }

/* The eye in the sun opens red, and the moon wakes. */
.ob-iris { transition: fill .8s ease; }
.ouija.risen .ob-iris { fill: var(--ouija-lit); filter: url(#ouijaGlow); }
.ob-wake { fill: var(--ouija-lit); opacity: 0; transition: opacity .8s ease .6s; }
.ouija.risen .ob-wake { opacity: 1; filter: url(#ouijaGlow); }

/* Fingers that are not there rest on the planchette. */
.pl-ghost { fill: url(#plGhostFade); opacity: 0; transition: opacity .9s ease .5s; }
.ouija.risen .pl-ghost { opacity: .62; }
:root[data-season="spooky"][data-theme="light"] .ouija.risen .pl-ghost { opacity: .78; }

/* Whoever is behind the board looks out once, while it speaks. */
.ouija.risen .board-watcher { animation: peek 7s ease-in-out 1.2s both; }

.seance-fx { position: fixed; inset: 0; z-index: 62; display: none; width: 100%; height: 100%; pointer-events: none; }
.seance-fx.on { display: block; }

/* ------------------------------------------------------------ cobwebs and the widow */

.web { position: absolute; top: 0; width: 118px; height: 118px; color: var(--web); pointer-events: none; }
.web svg { display: block; width: 100%; height: 100%; }
.web-left { left: 0; }
.web-right { right: 0; transform: scaleX(-1); }

.widow {
  position: absolute;
  top: 0;
  left: 54px;
  z-index: 1;
  width: 28px;
  height: 160px;
  pointer-events: none;
  transform-origin: 50% 0;
  animation: sway 6s ease-in-out infinite alternate;
}

.widow .silk { position: absolute; top: 0; left: 50%; width: 1px; height: 100%; margin-left: -.5px; background: var(--web); transform-origin: 50% 0; animation: silk 11s ease-in-out infinite; }
.widow svg { position: absolute; top: 0; left: 0; width: 28px; height: auto; color: var(--spider); filter: drop-shadow(0 0 2px rgba(255, 255, 255, .12)); animation: descend 11s ease-in-out infinite; }

@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes silk { 0%, 100% { transform: scaleY(.18); } 46%, 64% { transform: scaleY(.84); } }
@keyframes descend { 0%, 100% { transform: translateY(21px); } 46%, 64% { transform: translateY(126px); } }

/* ------------------------------------------------------------ the pop-up */

:root[data-season="spooky"] .verdict .sheet {
  background: radial-gradient(ellipse 80% 55% at 50% -6%, rgba(170, 14, 24, .28), transparent 70%), var(--surface);
  border: 1px solid rgba(179, 19, 27, .32);
  border-top: 3px solid var(--blood);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7), 0 0 70px rgba(150, 10, 20, .22);
  animation: emerge .7s cubic-bezier(.2, .7, .2, 1);
}

@keyframes emerge { from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(10px) brightness(.3); } }

:root[data-season="spooky"] .verdict-head h2 { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: .03em; line-height: 1.25; color: var(--blood-text); text-shadow: 0 0 22px var(--blood-glow); }
:root[data-season="spooky"] .verdict-head .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--blood), 0 0 30px 6px var(--blood-glow); animation: pop .5s var(--ease-spring), dread 2.8s ease-in-out .5s infinite; }
:root[data-season="spooky"] .verdict-lead,
:root[data-season="spooky"] .verdict-none { font-family: var(--fell); font-style: italic; font-size: 16px; }
:root[data-season="spooky"] .verdict-ask { font-family: var(--serif); font-weight: 700; letter-spacing: .02em; }

@keyframes dread {
  50% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--blood), 0 0 44px 14px var(--blood-glow); }
}

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1000px) {
  .perch { left: 50%; }
}

@media (max-width: 560px) {
  .perch, .widow { display: none; }
  .web { width: 74px; height: 74px; }
  :root[data-season="spooky"] .brand-text h1 { font-size: 16px; }
  :root[data-season="spooky"] .verdict-head h2 { font-size: 28px; }
  :root[data-season="spooky"] .topbar { padding-right: 38px; }
  .lamp { width: 32px; right: calc(clamp(16px, 3vw, 32px) - 8px); }
  .lamp-halo { width: 190px; height: 190px; margin: -95px 0 0 -95px; }
  .candle { display: none; }
  .seance-for { font-size: 14px; }
  .skyline { height: 40vh; }
}

/* Everything that moves stops for anybody who asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  .grain, .flicker, .flash, .bolt, .dread, .bloodlight, .seance-fx { display: none; }
}
