/* =========================================================
   Halloween Potion Quiz — Halloween potion game
   Night palette, chunky pressable controls, haunted ambience.
   The reveal film lives in film.css.
   ========================================================= */

:root {
  --night-0: #050208;
  --night-1: #0e0418;
  --night-2: #1a0a2e;
  --ink: #fbf2ff;
  --ink-dim: #d4c2ea;
  --ink-mute: #9b86ba;
  --pumpkin: #ff7a18;
  --slime: #7cff6b;
  --ghost: #ff4fd8;
  --candle: #ffcf4a;
  --violet: #9d4dff;
  --cyan: #39e5ff;
  --blood: #ff2d4a;
  --ice: #8fdcff;
  --good: #7cff6b;
  --bad: #ff3b5c;

  /* mode accent (default = pumpkin) */
  --a1: #ffbe5c;
  --a2: #ff7a18;
  --a-edge: #a8430a;
  --a-glow: rgba(255, 122, 24, .45);
  --a-text: #1b0730;

  --card-bg: linear-gradient(180deg, rgba(42, 16, 70, .84), rgba(16, 6, 30, .88));
  --card-line: rgba(255, 196, 140, .12);
  --radius: 22px;
  --font-display: 'Creepster', 'Fredoka', cursive;
  --font-ui: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --ease-pop: cubic-bezier(.2, .9, .3, 1.25);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);

  /* a row of slime drips, used as a mask (colour comes from the element's background) */
  --drips: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 22' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H90 V4 C84 4 82 6 81 10 C80 16 75 16 74 10 C73 6 70 4 62 4 H50 C46 4 45 6 44.5 8 C44 11 41 11 40.5 8 C40 6 39 4 34 4 C27 4 25 7 24 14 C23 22 15 22 14 14 C13 7 10 4 4 4 H0 Z'/%3E%3C/svg%3E");
  --drips-hang: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 26'%3E%3Cpath d='M6 0 C8 0 10 2 10 6 C10 14 13 20 13 22 C13 26 7 26 7 22 C7 18 4 12 4 6 C4 2 4 0 6 0 Z M33 0 C35 0 36 2 36 4 C36 9 38 12 38 14 C38 17 33 17 33 14 C33 12 31 9 31 4 C31 2 31 0 33 0 Z M50 0 C52 0 53 3 53 7 C53 12 55 15 55 17 C55 21 49 21 49 17 C49 14 47 11 47 7 C47 3 48 0 50 0 Z'/%3E%3C/svg%3E");
  --web: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='rgba(230,215,255,.3)' stroke-width='.8'%3E%3Cpath d='M60 0 L0 14 M60 0 L10 40 M60 0 L34 60 M60 0 L56 60'/%3E%3Cpath d='M46 3 Q47 9 49 12 Q54 12 58 14'/%3E%3Cpath d='M32 6 Q36 18 39 24 Q48 26 59 28'/%3E%3Cpath d='M18 10 Q25 26 30 36 Q44 40 58 44'/%3E%3C/g%3E%3C/svg%3E");
}

body[data-mode="bestie"] { --a1: #c2ff9e; --a2: #4fe35a; --a-edge: #1e8a2c; --a-glow: rgba(124, 255, 107, .42); }
body[data-mode="family"] { --a1: #ffc766; --a2: #ff8a1f; --a-edge: #a8430a; --a-glow: rgba(255, 138, 31, .45); }
body[data-mode="crush"]  { --a1: #ffa8ec; --a2: #ff4fd8; --a-edge: #a31b8a; --a-glow: rgba(255, 79, 216, .45); }
body[data-mode="love"]   { --a1: #ff9aab; --a2: #ff3b5c; --a-edge: #9c1530; --a-glow: rgba(255, 59, 92, .45); }
body[data-mode="squad"]  { --a1: #d4b3ff; --a2: #a66bff; --a-edge: #5a1fb0; --a-glow: rgba(166, 107, 255, .48); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--night-0); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night-0);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--a1); }
[hidden] { display: none !important; }
::selection { background: var(--a2); color: #1b0730; }
:focus-visible { outline: 3px solid var(--candle); outline-offset: 3px; }
.em { line-height: 1; }

/* =========================================================
   Loader
   ========================================================= */
#loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(80% 60% at 50% 45%, #2a0d4a 0%, #120424 55%, #050208 100%);
  transition: opacity .6s ease, visibility .6s ease, transform .6s var(--ease-in);
}
#loader.is-done { opacity: 0; visibility: hidden; transform: scale(1.08); }
.ld-scene { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.ld-halo { position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 140, 50, .55) 0%, rgba(157, 77, 255, .25) 45%, transparent 70%); animation: haloPulse 1.6s ease-in-out infinite; }
.ld-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 14s linear infinite; }
.ld-ring text { font: 400 12px var(--font-display); fill: rgba(255, 207, 74, .8); }
.ld-pot { position: relative; width: 96px; height: 96px; animation: ldBob 1.1s ease-in-out infinite alternate; filter: drop-shadow(0 0 22px rgba(124, 255, 107, .5)); }
.ld-bubbles i { position: absolute; left: 50%; top: 40%; width: 10px; height: 10px; border-radius: 50%; background: #b8ff9e; opacity: 0; animation: ldBubble 1.6s ease-in infinite; }
.ld-bubbles i:nth-child(2) { margin-left: -18px; animation-delay: .5s; width: 7px; height: 7px; }
.ld-bubbles i:nth-child(3) { margin-left: 14px; animation-delay: 1s; width: 8px; height: 8px; }
.ld-title { font: 400 26px var(--font-display); letter-spacing: 1px; color: var(--candle); text-shadow: 0 3px 0 #3a0b4f, 0 0 18px rgba(255, 122, 24, .5); }
.ld-dots { display: flex; gap: 8px; }
.ld-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--pumpkin); box-shadow: 0 0 10px var(--pumpkin); animation: dotBounce 1s ease-in-out infinite; }
.ld-dots i:nth-child(2) { animation-delay: .15s; background: var(--slime); box-shadow: 0 0 10px var(--slime); }
.ld-dots i:nth-child(3) { animation-delay: .3s; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
@keyframes haloPulse { 50% { transform: scale(1.15); opacity: .6; } }
@keyframes ldBob { from { transform: translateY(6px) rotate(-6deg); } to { transform: translateY(-10px) rotate(6deg); } }
@keyframes ldBubble { 0% { transform: translateY(0) scale(.4); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-70px) scale(1.1); opacity: 0; } }
@keyframes dotBounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }

#topprog {
  position: fixed; top: 0; left: 0; z-index: 210; height: 3px; width: 0; opacity: 0;
  background: linear-gradient(90deg, var(--slime), var(--candle), var(--pumpkin), var(--ghost));
  box-shadow: 0 0 12px var(--pumpkin), 0 0 4px var(--slime);
  transition: width .4s var(--ease-out), opacity .3s;
}
#topprog.is-on { opacity: 1; }

/* =========================================================
   Haunted scene
   ========================================================= */
.scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(70% 38% at 50% 100%, rgba(255, 106, 24, .2), transparent 70%),
    radial-gradient(80% 55% at 84% 6%, rgba(255, 150, 60, .16), transparent 60%),
    radial-gradient(120% 80% at 70% 0%, #2c0e52 0%, #180733 38%, #0b0316 70%, #050208 100%);
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; }

.moon {
  position: absolute; top: max(7vh, 54px); right: 7vw;
  width: clamp(96px, 24vw, 176px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fff7e2 0%, #ffd98a 40%, #f2a446 76%, #d2702a 100%);
  box-shadow: 0 0 44px 10px rgba(255, 196, 100, .36), 0 0 150px 60px rgba(255, 120, 40, .16);
}
/* the glow breathes by fading a second halo (opacity runs on the compositor; animating box-shadow repaints) */
.moon-halo { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 60px 18px rgba(255, 196, 100, .3), 0 0 190px 80px rgba(255, 120, 40, .12); opacity: 0; animation: moonGlow 7s ease-in-out infinite; }
.moon i { position: absolute; border-radius: 50%; background: rgba(176, 100, 40, .3); }
.moon i:nth-of-type(1) { width: 22%; height: 22%; top: 24%; left: 52%; }
.moon i:nth-of-type(2) { width: 14%; height: 14%; top: 58%; left: 28%; }
.moon i:nth-of-type(3) { width: 10%; height: 10%; top: 66%; left: 62%; }
.moon i:nth-of-type(4) { width: 8%; height: 8%; top: 34%; left: 24%; }
@keyframes moonGlow { 50% { opacity: 1; } }

.clouds span {
  position: absolute; height: 36px; border-radius: 40px;
  background: rgba(40, 16, 70, .7); filter: blur(6px);
  animation: cloud linear infinite;
}
.clouds span:nth-child(1) { top: calc(max(7vh, 54px) + 40px); width: 200px; animation-duration: 70s; animation-delay: -10s; }
.clouds span:nth-child(2) { top: 22vh; width: 260px; height: 44px; animation-duration: 95s; animation-delay: -60s; opacity: .7; }
.clouds span:nth-child(3) { top: 12vh; width: 140px; animation-duration: 80s; animation-delay: -40s; opacity: .55; }
@keyframes cloud { from { transform: translateX(-320px); } to { transform: translateX(calc(100vw + 40px)); } }

.lightning {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(70% 55% at var(--bx, 30%) 0%, rgba(235, 225, 255, .5), rgba(170, 140, 255, .16) 45%, transparent 75%);
}
.lightning .bolt { position: absolute; top: 0; left: var(--bx, 30%); height: 40vh; translate: -50% 0; fill: #f4efff; filter: drop-shadow(0 0 14px #d9ccff); opacity: 0; }
.lightning.on { animation: lightning 1.1s ease-out; }
.lightning.on .bolt { animation: boltFlash 1.1s ease-out; }
.lightning.strong { background: radial-gradient(90% 70% at var(--bx, 30%) 0%, rgba(245, 240, 255, .8), rgba(170, 140, 255, .3) 50%, transparent 80%); }
@keyframes lightning { 0% { opacity: 0; } 4% { opacity: .9; } 9% { opacity: .15; } 15% { opacity: .7; } 100% { opacity: 0; } }
@keyframes boltFlash { 0%, 100% { opacity: 0; } 4%, 18% { opacity: 1; } 32% { opacity: 0; } }

.web { position: absolute; top: 0; left: 0; width: clamp(110px, 26vw, 200px); }
.spider {
  position: absolute; top: 0; left: clamp(52px, 13vw, 110px);
  display: flex; flex-direction: column; align-items: center;
  animation: spiderBob 5s ease-in-out infinite; transform-origin: top center;
  pointer-events: auto; cursor: pointer;
}
.spider .thread { width: 1.5px; height: clamp(60px, 13vh, 120px); background: linear-gradient(rgba(230, 215, 255, .1), rgba(230, 215, 255, .5)); }
.spider-body { width: 34px; margin-top: -4px; filter: drop-shadow(0 0 6px rgba(255, 59, 92, .25)); }
.spider.up { animation: spiderUp 1.6s var(--ease-out); }
@keyframes spiderBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(14px) rotate(3deg); } }
@keyframes spiderUp { 0% { transform: translateY(0); } 40% { transform: translateY(-140px); } 100% { transform: translateY(0); } }

.graveyard { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(150px, 24vh, 260px); }
/* Graveyard lights burn steadily; fx.js flickers one now and then (.flick), so the SVG only repaints then. */
.graveyard .win { fill: #ffcf4a; filter: drop-shadow(0 0 6px #ffb347); }
.graveyard .w3 { fill: #9dff8f; filter: drop-shadow(0 0 6px #7cff6b); }
.graveyard .win.flick { animation: windowFlicker .42s steps(1); }
@keyframes windowFlicker { 0% { opacity: .3; } 30% { opacity: 1; } 55% { opacity: .15; } 80% { opacity: .85; } 100% { opacity: 1; } }
.jack-face { fill: #ffe27a; filter: drop-shadow(0 0 6px #ffb347); }
.jack-face.flick { animation: jackFlicker .42s ease-in-out; }
@keyframes jackFlicker { 0%, 100% { opacity: 1; } 35% { opacity: .55; } 60% { opacity: .92; } 78% { opacity: .66; } }
.owl-eye { transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 3px #ffcf4a); }
.owl.flick .owl-eye { animation: owlBlink .42s; }
@keyframes owlBlink { 0%, 100% { transform: scaleY(1); } 35%, 65% { transform: scaleY(.1); } }

/* something is watching from the dark: one element per pair, so lurking + blinking stay on the compositor */
/* (the glow is drawn by the gradients: a filter here would push both animations back onto the main thread) */
.eyes i {
  position: absolute; left: var(--x); top: var(--y); width: 36px; height: 18px; margin: -5px 0 0 -6px; opacity: 0;
  background:
    radial-gradient(4.6px 3.4px at 10.6px 9px, var(--c) 80%, transparent 100%),
    radial-gradient(4.6px 3.4px at 25.4px 9px, var(--c) 80%, transparent 100%),
    radial-gradient(11px 8px at 10.6px 9px, color-mix(in srgb, var(--c) 45%, transparent), transparent 100%),
    radial-gradient(11px 8px at 25.4px 9px, color-mix(in srgb, var(--c) 45%, transparent), transparent 100%);
  animation: eyesLurk var(--t) ease-in-out var(--d) infinite, eyesBlink var(--t) var(--d) infinite;
}
@keyframes eyesLurk { 0%, 34% { opacity: 0; } 40%, 78% { opacity: .9; } 84%, 100% { opacity: 0; } }
@keyframes eyesBlink { 0%, 55%, 58%, 100% { transform: scaleY(1); } 56.5% { transform: scaleY(.1); } }

.fog {
  position: absolute; left: 0; bottom: -4vh; width: 200%; height: 34vh;
  background:
    radial-gradient(closest-side, rgba(196, 170, 255, .18), transparent) 0 40% / 34% 80% repeat-x,
    radial-gradient(closest-side, rgba(160, 120, 230, .15), transparent) 12% 90% / 26% 70% repeat-x;
  animation: fogDrift 60s linear infinite;
}
.fog-2 { bottom: -10vh; opacity: .7; animation-duration: 95s; animation-direction: reverse; height: 30vh; }
.fog-3 { bottom: -12vh; height: 22vh; opacity: .55; animation-duration: 75s;
  background: radial-gradient(closest-side, rgba(124, 255, 107, .12), transparent) 6% 70% / 30% 80% repeat-x; }
@keyframes fogDrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* flying bats, drifting ghosts, the witch (created by fx.js) */
.bat { position: fixed; top: 0; left: 0; z-index: 1; aspect-ratio: 2 / 1; pointer-events: none; will-change: transform; }
.bat svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bat .wing { transform-origin: 50% 50%; animation: flap .2s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.45); } }
.drift-ghost { position: fixed; z-index: 1; pointer-events: none; font-size: 34px; opacity: 0; will-change: transform, opacity; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .35)); }
.witch { position: fixed; top: 0; left: 0; z-index: 1; width: clamp(90px, 22vw, 140px); pointer-events: none; will-change: transform; }
.witch svg { width: 100%; display: block; overflow: visible; }
.witch .w-cape { transform-box: fill-box; transform-origin: 0 50%; animation: cape .35s ease-in-out infinite alternate; }
@keyframes cape { to { transform: scaleY(.75) skewX(-8deg); } }

/* =========================================================
   Overlays & feedback
   ========================================================= */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle at 50% 40%, #fff, #fff0dc 40%, rgba(255, 200, 150, .6)); opacity: 0; }

.wipe {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #3a1466 0%, #1a0830 45%, #07020f 100%);
  clip-path: circle(0 at 50% 50%);
  pointer-events: all; overflow: hidden;
}
.wipe-moon { position: absolute; top: 12%; right: 14%; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 36% 34%, #fff7e2, #f2a446 80%); box-shadow: 0 0 50px 12px rgba(255, 170, 80, .35); opacity: .8; }
.wipe-fog { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 45%; background: radial-gradient(closest-side, rgba(180, 150, 240, .2), transparent) 0 0 / 40% 100% repeat-x; animation: fogDrift 9s linear infinite; }
.wipe-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; animation: fadeIn .3s .2s both; }
.wipe-art { font-size: 74px; line-height: 1; animation: wipeBob .9s ease-in-out infinite alternate; filter: drop-shadow(0 0 24px rgba(255, 140, 50, .6)); }
.wipe-label { font: 400 30px var(--font-display); letter-spacing: 1px; color: var(--candle); text-shadow: 0 3px 0 #2b0a47, 0 0 18px rgba(255, 122, 24, .5); }
.wipe-dots { display: flex; gap: 7px; }
.wipe-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--slime); box-shadow: 0 0 8px var(--slime); animation: dotBounce 1s ease-in-out infinite; }
.wipe-dots i:nth-child(2) { animation-delay: .15s; }
.wipe-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wipeBob { from { transform: translateY(0) rotate(-8deg) scale(1); } to { transform: translateY(-12px) rotate(8deg) scale(1.08); } }

.edge-flash { position: fixed; inset: 0; z-index: 94; pointer-events: none; animation: edgeFlash .75s ease-out forwards; }
.edge-flash--good { box-shadow: inset 0 0 90px 24px rgba(124, 255, 107, .6); }
.edge-flash--bad { box-shadow: inset 0 0 100px 28px rgba(255, 30, 60, .7); }
.edge-flash--warn { box-shadow: inset 0 0 70px 14px rgba(255, 45, 74, .5); animation-duration: .5s; }
.edge-flash--cool { box-shadow: inset 0 0 90px 24px rgba(143, 220, 255, .75); }
.edge-flash--gold { box-shadow: inset 0 0 90px 24px rgba(255, 207, 74, .65); }
.edge-flash--magic { box-shadow: inset 0 0 90px 24px rgba(157, 77, 255, .7); }
@keyframes edgeFlash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

.is-shaking { animation: screenShake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes screenShake {
  10%, 90% { transform: translate3d(-2px, 1px, 0); }
  20%, 80% { transform: translate3d(5px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 3px, 0) rotate(-1deg); }
  40%, 60% { transform: translate3d(8px, -3px, 0) rotate(1deg); }
}

.pop-text {
  position: fixed; z-index: 90; pointer-events: none;
  font: 400 30px var(--font-display); letter-spacing: 1px;
  -webkit-text-stroke: 1.5px #1b0730; text-shadow: 0 3px 0 #1b0730, 0 0 18px currentColor;
  animation: floatUp 1.1s var(--ease-out) forwards;
}
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  20% { transform: translate(-50%, -16px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -84px) scale(1); opacity: 0; }
}

.banner {
  position: absolute; left: 50%; top: 50%; z-index: 20;
  padding: 10px 22px; border-radius: 18px;
  background: linear-gradient(180deg, #ffe08a, var(--candle)); color: #2b0a12;
  border: 3px solid #1b0730; box-shadow: 0 6px 0 #1b0730, 0 0 30px rgba(255, 207, 74, .5);
  font: 400 30px var(--font-display); letter-spacing: 1px; white-space: nowrap;
  pointer-events: none;
  animation: bannerIn 1.4s var(--ease-out) forwards;
}
.banner--fire { background: linear-gradient(180deg, #ffb347, #ff4a1a); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); box-shadow: 0 6px 0 #1b0730, 0 0 34px rgba(255, 90, 30, .7); }
.banner--time { background: linear-gradient(180deg, #ff6b7f, #c4102e); color: #fff; }
.banner--cool { background: linear-gradient(180deg, #d8f4ff, var(--ice)); }
.banner--magic { background: linear-gradient(180deg, #c9a4ff, var(--violet)); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
@keyframes bannerIn {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-10deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12) rotate(3deg); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  80% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(.9) rotate(-2deg); opacity: 0; }
}

/* press ripple (fx.js adds .rip > i) */
.rip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.rip i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .32); transform: scale(0); animation: ripple .6s var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* 3D tilt */
[data-tilt] { transition: transform .25s var(--ease-out); transform-style: preserve-3d; }
[data-tilt].is-tilting { transition: transform .08s linear; }

/* scroll reveal: hidden until the observer animates it in */
.pre-reveal { opacity: 0; }

/* toasts */
#toasts { position: fixed; z-index: 160; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 12px 18px; border-radius: 16px;
  background: rgba(24, 8, 44, .96); color: var(--ink);
  border: 1.5px solid rgba(255, 190, 120, .3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 24px var(--a-glow);
  font-weight: 500; text-align: center;
  animation: toastIn .45s var(--ease-spring) both;
}
.toast.err { border-color: rgba(255, 59, 92, .7); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 24px rgba(255, 59, 92, .45); }
.toast.is-out { animation: toastOut .3s var(--ease-in) forwards; }
@keyframes toastIn { from { transform: translateY(-30px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px) scale(.9); opacity: 0; } }

/* modal */
.modal { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(5, 2, 10, .66); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .25s; }
.modal-card {
  position: relative; width: min(100%, 400px);
  padding: 26px 20px 20px; border-radius: 26px; text-align: center;
  background: var(--web) no-repeat right top / 80px, linear-gradient(180deg, #2c0f4c, #150628);
  border: 1.5px solid rgba(255, 190, 120, .22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 40px var(--a-glow);
  animation: modalIn .45s var(--ease-spring) both;
}
.modal-emo { display: block; font-size: 52px; line-height: 1; margin-bottom: 8px; animation: wiggle 2.6s ease-in-out infinite; }
.modal-card h2 { font: 400 30px/1.05 var(--font-display); letter-spacing: .5px; color: var(--candle); text-shadow: 0 3px 0 #2b0a47; }
.modal-card p { margin-top: 8px; color: var(--ink-dim); }
.modal-actions { display: grid; gap: 10px; margin-top: 18px; }
.modal.is-out .modal-scrim { animation: fadeOut .25s forwards; }
.modal.is-out .modal-card { animation: modalOut .25s var(--ease-in) forwards; }
@keyframes modalIn { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes modalOut { to { transform: translateY(30px) scale(.94); opacity: 0; } }

/* 3·2·1 countdown before guessing */
.cd { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: rgba(5, 2, 10, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .25s; }
.cd > * { grid-area: 1 / 1; }
.cd b {
  font: 400 160px/1 var(--font-display); color: var(--candle);
  text-shadow: 0 8px 0 #2b0a47, 0 0 50px rgba(255, 140, 40, .7);
  animation: countPop .8s var(--ease-out) both;
}
.cd b.is-go { color: var(--slime); font-size: 104px; text-shadow: 0 8px 0 #0f3a14, 0 0 50px rgba(124, 255, 107, .7); }
.cd-ring { width: 240px; height: 240px; border-radius: 50%; border: 8px solid var(--a2); box-shadow: 0 0 30px var(--a-glow), inset 0 0 30px var(--a-glow); animation: ringPulse .72s var(--ease-out) both; }
.cd-art { align-self: end; margin-bottom: 14vh; font-size: 54px; animation: wipeBob .5s ease-in-out infinite alternate; }
@keyframes countPop {
  0% { transform: scale(2.4); opacity: 0; }
  30% { transform: scale(.9); opacity: 1; }
  45% { transform: scale(1.05); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.6); opacity: 0; }
}
@keyframes ringPulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* =========================================================
   App shell
   ========================================================= */
#app {
  position: relative; z-index: 10;
  width: 100%; max-width: 480px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 10px; }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 2px; text-decoration: none; }
.brand-ico { font-size: 22px; filter: drop-shadow(0 0 8px var(--a-glow)); display: inline-block; animation: wobble 4s ease-in-out infinite; }
.brand-txt { font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; color: var(--candle); text-shadow: 0 2px 0 #4a1a0a, 0 0 14px rgba(255, 122, 24, .45); }
.brand-txt em { font-style: normal; color: var(--ink-dim); font-size: 16px; }
.brand:hover .brand-ico { animation-duration: .6s; }
.tb-actions { display: flex; gap: 8px; }
.icon-btn {
  position: relative; overflow: hidden;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 18px; transition: transform .15s var(--ease-pop), background .2s, opacity .2s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.icon-btn:hover { background: rgba(255, 255, 255, .13); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.off { opacity: .45; filter: grayscale(1); }
.icon-btn.sm { width: 34px; height: 34px; font-size: 16px; }
.icon-btn.spin { animation: spin .7s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

.screen { display: none; flex-direction: column; gap: 16px; padding: 6px 0 34px; flex: 1; }
.screen.active { display: flex; }
.screen-head { text-align: center; display: flex; flex-direction: column; gap: 6px; }

/* =========================================================
   Typography
   ========================================================= */
.title {
  font-family: var(--font-display); font-weight: 400; text-align: center;
  font-size: clamp(56px, 17.5vw, 86px); line-height: .9; letter-spacing: 1px;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 6px;
}
/* The heading floats and flickers as one layer; the gradient letters and their drips stay still inside it,
   so nothing in the title repaints while it moves. */
.title { position: relative; animation: titleFloat 4s ease-in-out infinite, titleFlicker 7s linear infinite; }
.title .t-word {
  position: relative; display: inline-block;
  background: linear-gradient(180deg, #fff0b8 0%, #ffb347 30%, #ff6a1a 58%, #e01d2c 84%, #a8001c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 5px 0 #2a0612) drop-shadow(0 0 24px rgba(255, 90, 24, .4));
}
/* blood drips hanging off the letters */
.title .t-word::after {
  content: ''; position: absolute; left: 6%; right: 6%; top: 86%; height: .3em;
  background: linear-gradient(180deg, #c4102e, #7a0016);
  -webkit-mask: var(--drips-hang) 0 0 / 1.05em 100% repeat-x; mask: var(--drips-hang) 0 0 / 1.05em 100% repeat-x;
}
.title .t-word:last-of-type::after { left: 14%; right: 14%; -webkit-mask-position: .3em 0; mask-position: .3em 0; }
/* a drop now and then falls from the letters */
.t-drop {
  position: absolute; left: 31%; top: 33%; width: 7px; height: 10px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #e01d2c, #7a0016); opacity: 0;
  animation: dropFall 4.2s ease-in infinite;
}
.t-drop-2 { left: 56%; top: 86%; animation-delay: 2.1s; animation-duration: 5s; }
.title small { font-size: .4em; color: var(--ink-dim); margin: 6px 0 4px; text-shadow: 0 0 12px rgba(157, 77, 255, .7); }
@keyframes titleFloat { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes titleFlicker { 0%, 60.9%, 62%, 63.9%, 65%, 100% { opacity: 1; } 61% { opacity: .55; } 64% { opacity: .7; } }
@keyframes dropFall { 0%, 55% { transform: translateY(0) scale(.4); opacity: 0; } 60% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(70px) scale(.7); opacity: 0; } }

.h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 8.6vw, 40px); line-height: 1.02; letter-spacing: .5px; text-align: center; color: var(--ink); text-shadow: 0 3px 0 #2b0a47, 0 0 22px var(--a-glow); }
.sub { color: var(--ink-dim); text-align: center; font-size: 16px; }
.sub b { color: var(--ink); }
.lead { text-align: center; color: var(--ink-dim); font-size: 17px; padding: 0 4px; }
.lead b { font-weight: 600; }
.hl-g { color: var(--slime); } .hl-o { color: var(--pumpkin); } .hl-p { color: var(--ghost); } .hl-r { color: #ff6b84; } .hl-c { color: var(--candle); }
.label { text-align: center; color: var(--ink-dim); font-weight: 500; margin-bottom: -6px; }
.tiny { font-size: 13px; color: var(--ink-mute); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 14px 22px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 18px; letter-spacing: .2px; color: var(--a-text);
  background: linear-gradient(180deg, var(--a1), var(--a2));
  box-shadow: 0 6px 0 var(--a-edge), 0 14px 30px var(--a-glow), inset 0 2px 0 rgba(255, 255, 255, .45);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), filter .2s, opacity .2s;
  text-decoration: none; user-select: none; -webkit-user-select: none;
}
/* the shine slides on the compositor inside its own clipping span (app.js adds .shine to each button),
   so pulsing buttons can still let their ring spill outside */
.shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; z-index: -1; pointer-events: none; }
.shine::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
  transform: translateX(-130%);
  animation: shine 3.6s ease-in-out infinite;
}
.btn-ghost .shine, .btn:disabled .shine { display: none; }
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 8px 0 var(--a-edge), 0 18px 36px var(--a-glow), inset 0 2px 0 rgba(255, 255, 255, .45); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--a-edge), 0 6px 14px var(--a-glow), inset 0 2px 0 rgba(255, 255, 255, .45); }
.btn:disabled { opacity: .45; filter: saturate(.5); cursor: not-allowed; transform: none; }
.btn:disabled::after, .btn:disabled::before { animation: none; opacity: 0; }
.btn-xl { min-height: 62px; font-size: 20px; }
.btn-ghost {
  color: var(--ink); background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .16), 0 6px 0 rgba(0, 0, 0, .3);
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--a2), 0 8px 0 rgba(0, 0, 0, .3), 0 0 22px var(--a-glow); }
.btn-ghost:active { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .16), 0 2px 0 rgba(0, 0, 0, .3); }
.pulse { overflow: visible; }
.pulse::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -2; pointer-events: none;
  box-shadow: 0 0 0 3px var(--a2);
  animation: pulseRing 2s ease-out infinite;
}
.pulse .rip { border-radius: inherit; }
@keyframes pulseRing { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(1.12, 1.35); opacity: 0; } }
@keyframes shine { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

.link-btn {
  background: none; border: 0; color: var(--ink-dim); font-weight: 500;
  padding: 8px 10px; text-decoration: underline; text-decoration-color: rgba(205, 185, 234, .35);
  text-underline-offset: 4px; align-self: center; transition: color .2s;
}
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { opacity: .4; cursor: default; }
.link-btn.tiny { font-size: 13px; padding: 2px 4px; color: var(--a1); }

/* =========================================================
   Cards & form fields
   ========================================================= */
.card {
  position: relative;
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 200, 150, .1);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card--web { background: var(--web) no-repeat right top / 76px, var(--card-bg); }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }

/* slime oozing off the top edge of a card (in the mode colour) */
.drip-top::before {
  content: ''; position: absolute; left: 20px; right: 20px; top: -1px; height: 20px; pointer-events: none;
  background: linear-gradient(180deg, var(--a1), var(--a2));
  -webkit-mask: var(--drips) 0 0 / 90px 20px repeat-x; mask: var(--drips) 0 0 / 90px 20px repeat-x;
  filter: drop-shadow(0 0 6px var(--a-glow)); opacity: .92;
}
.drip-top::after {
  content: ''; position: absolute; left: calc(20px + 18.5px); top: 15px; width: 6px; height: 8px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--a2); opacity: 0; animation: dripDrop 3.6s ease-in infinite;
}
@keyframes dripDrop { 0%, 55% { transform: translateY(0) scale(.4); opacity: 0; } 60% { opacity: 1; transform: translateY(0) scale(1); } 100% { transform: translateY(60px) scale(.7); opacity: 0; } }

.field input {
  width: 100%; min-height: 60px; padding: 14px 20px; border-radius: 18px;
  background: rgba(10, 3, 22, .6); border: 2px solid rgba(255, 255, 255, .14);
  font-size: 20px; font-weight: 500; text-align: center; outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-pop);
}
.field input::placeholder { color: var(--ink-mute); }
.field input:focus { border-color: var(--a2); box-shadow: 0 0 0 4px var(--a-glow), 0 0 30px var(--a-glow); transform: scale(1.01); }
.field input.is-error { border-color: var(--bad); animation: shake .45s; }

.mode-badge {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px 7px 10px; border-radius: 999px; font-weight: 600; font-size: 15px;
  background: rgba(255, 255, 255, .07); border: 1.5px solid var(--a2); color: var(--a1);
  box-shadow: 0 0 18px var(--a-glow);
}
.mode-badge .em { font-size: 20px; }
.mode-badge .sep { font-style: normal; opacity: .55; margin: 0 -2px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}

/* =========================================================
   Cauldron
   ========================================================= */
.c-park { position: absolute; width: 0; height: 0; overflow: hidden; }
.c-slot { display: flex; justify-content: center; position: relative; }
.slot-home   { --cw: min(66vw, 270px); margin: -4px 0 -6px; }
.slot-play   { --cw: 140px; margin: -8px 0 -12px; }
.slot-seal   { --cw: min(72vw, 290px); margin-top: 6vh; }
.slot-invite { --cw: min(50vw, 210px); margin: -6px 0; }

/* 1em = 10 units of the cauldron's 240-unit artwork, so the HTML parts scale with every cauldron size */
.cauldron { position: relative; width: var(--cw, 240px); aspect-ratio: 1; flex: none; font-size: calc(var(--cw, 240px) / 24); }
.c-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c-glow {
  position: absolute; left: 2%; right: 2%; top: -4%; height: 60%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--liq-a, #9d4dff), color-mix(in srgb, var(--liq-a, #9d4dff) 35%, transparent) 45%, transparent);
  opacity: .6; animation: cGlow 3s ease-in-out infinite;
}
@keyframes cGlow { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: .75; transform: scale(1.08); } }
.c-steam i {
  position: absolute; bottom: 64%; width: 26%; height: 26%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(235, 220, 255, .22), transparent);
  animation: steam 4.2s linear infinite; opacity: 0;
}
.c-steam i:nth-child(1) { left: 22%; }
.c-steam i:nth-child(2) { left: 42%; animation-delay: -1.4s; }
.c-steam i:nth-child(3) { left: 60%; animation-delay: -2.8s; }
@keyframes steam { 0% { transform: translateY(0) scale(.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-120%) scale(1.5); opacity: 0; } }

/* flames: separate SVGs behind the cauldron (boxes match their viewBoxes in 240-unit space) */
.c-fire { position: absolute; inset: 0; pointer-events: none; }
.fl { position: absolute; overflow: visible; transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; }
.fl1 { left: 33.333%; top: 77.5%; width: 15%; height: 21.667%; }
.fl2 { left: 40%; top: 71.667%; width: 19.167%; height: 28.333%; animation-duration: .62s; animation-delay: -.2s; }
.fl3 { left: 51.667%; top: 77.5%; width: 15%; height: 21.667%; animation-duration: .44s; animation-delay: -.1s; }
.fl4 { left: 44.583%; top: 82.083%; width: 10.417%; height: 17.083%; animation-duration: .38s; }
@keyframes flicker { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.92, 1.14) skewX(4deg); } 100% { transform: scale(1.06, .9) skewX(-4deg); } }

/* bubbles: --x/--y/--r are the circle's centre and radius in 240-unit space (1 unit = .1em) */
.c-bubbles { position: absolute; inset: 0; pointer-events: none; }
.c-bubbles i {
  position: absolute; left: calc((var(--x) - var(--r)) * .1em); top: calc((var(--y) - var(--r)) * .1em);
  width: calc(var(--r) * .2em); aspect-ratio: 1; border-radius: 50%;
  background: var(--bub, #ffd6ff); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
  opacity: 0; animation: bubble 2.6s ease-in infinite;
}
.c-bubbles i:nth-child(2) { animation-delay: -.7s; animation-duration: 3s; }
.c-bubbles i:nth-child(3) { animation-delay: -1.5s; animation-duration: 2.2s; }
.c-bubbles i:nth-child(4) { animation-delay: -2.1s; animation-duration: 2.8s; }
.c-bubbles i:nth-child(5) { animation-delay: -.3s; animation-duration: 3.2s; }
.c-bubbles i:nth-child(6) { animation-delay: -1.1s; animation-duration: 2.4s; }
.c-bubbles i:nth-child(7) { animation-delay: -1.8s; animation-duration: 2.9s; }
@keyframes bubble {
  0% { transform: translateY(0) scale(.3); opacity: 0; }
  15% { opacity: .95; }
  85% { opacity: .85; }
  100% { transform: translateY(-5.8em) scale(1.15); opacity: 0; }
}
.cauldron.boil .c-bubbles i { animation-duration: .9s !important; }

/* the cauldron blinks when app.js says so (a short class), not on an endless SVG animation */
.eye { transform-box: fill-box; transform-origin: center; transition: transform .09s ease-in; }
.cauldron.blinking .eye { transform: scaleY(.08); }
.pupil, .pupil-hl { transition: transform .25s ease-out; }
.c-happy, .c-oops, .m-grin, .m-o { display: none; }
.cauldron.mood-happy .c-eyes, .cauldron.mood-oops .c-eyes { display: none; }
.cauldron.mood-happy .c-happy { display: inline; }
.cauldron.mood-happy .m-smile, .cauldron.mood-oops .m-smile, .cauldron.mood-wow .m-smile { display: none; }
.cauldron.mood-happy .m-grin { display: inline; }
.cauldron.mood-oops .c-oops { display: inline; }
.cauldron.mood-oops .m-o, .cauldron.mood-wow .m-o { display: inline; }
.cauldron.mood-wow .eye { animation: none; transform: scale(1.18); }
.c-face { transform-box: fill-box; transform-origin: center; }
.cauldron.mood-happy .c-face, .cauldron.mood-oops .c-face { animation: facePop .45s var(--ease-pop); }
@keyframes facePop { 0% { transform: scale(.8); } 100% { transform: scale(1); } }

.c-slime .sl { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); filter: drop-shadow(0 0 4px rgba(124, 255, 107, .7)); }
.cauldron.overflow .c-slime .sl { animation: drip 2.1s var(--ease-out) forwards; }
.cauldron.overflow .c-slime .sl2 { animation-delay: .08s; }
.cauldron.overflow .c-slime .sl3 { animation-delay: .16s; }
.cauldron.overflow .c-slime .sl4 { animation-delay: .05s; }
.cauldron.overflow .c-slime .sl5 { animation-delay: .12s; }
@keyframes drip { 0% { transform: scaleY(0); } 22% { transform: scaleY(1.08); } 34%, 70% { transform: scaleY(1); } 100% { transform: scaleY(0); } }

.c-ghost {
  position: absolute; left: 50%; top: 18%; width: 34%; margin-left: -17%;
  opacity: 0; pointer-events: none; transform: translateY(30%) scale(.3);
}
.c-ghost svg { width: 100%; display: block; filter: drop-shadow(0 0 12px rgba(255, 255, 255, .5)); }
.c-ghost b {
  position: absolute; left: 76%; top: -6%; white-space: nowrap;
  font-family: var(--font-display); font-weight: 400; font-size: clamp(15px, 4.6vw, 22px); color: var(--slime);
  text-shadow: 0 2px 0 #13321a, 0 0 10px rgba(124, 255, 107, .6); transform: rotate(10deg);
}
.cauldron.rumble { animation: rumble .09s linear infinite; }
@keyframes rumble { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-2px, 1px) rotate(-1deg); } 50% { transform: translate(2px, -1px) rotate(1deg); } 75% { transform: translate(-1px, -2px) rotate(0); } 100% { transform: translate(1px, 2px) rotate(-1deg); } }
.c-mouth { position: absolute; left: 14.167%; top: 25.833%; width: 71.667%; height: 13.333%; clip-path: ellipse(50% 50% at 50% 50%); pointer-events: none; }
.c-ring { position: absolute; left: 9.302%; top: 12.5%; width: 81.395%; height: 75%; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .85); opacity: 0; }
#s-home .cauldron { cursor: pointer; }

.flyer { position: fixed; left: 0; top: 0; z-index: 55; pointer-events: none; font-size: 34px; line-height: 1; will-change: transform; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.float-txt {
  position: fixed; z-index: 56; pointer-events: none; white-space: nowrap;
  font-weight: 700; font-size: 18px; padding: 6px 14px; border-radius: 999px;
  background: rgba(20, 6, 40, .9); border: 1.5px solid var(--ft-c, var(--a2)); color: var(--ft-c, var(--a1));
  box-shadow: 0 0 18px var(--ft-g, var(--a-glow));
}

/* =========================================================
   Home
   ========================================================= */
.countdown {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(30, 9, 52, .9); border: 1px solid rgba(255, 122, 24, .55); color: #ffc58a;
  font-variant-numeric: tabular-nums; position: relative; z-index: 1;
  box-shadow: 0 0 20px rgba(255, 122, 24, .2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 16px 8px 12px; border-radius: 18px; background: rgba(26, 9, 50, .9); border: 1px solid rgba(255, 196, 140, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.step-n { position: absolute; top: -10px; left: 50%; translate: -50% 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #1b0730; background: var(--candle); box-shadow: 0 0 12px rgba(255, 207, 74, .6); }
.step-ico { font-size: 28px; animation: stepIcon 5s ease-in-out infinite; }
.step:nth-child(2) .step-ico { animation-delay: 1.2s; }
.step:nth-child(3) .step-ico { animation-delay: 2.4s; }
@keyframes stepIcon { 0%, 75%, 100% { transform: translateY(0); } 85% { transform: translateY(-7px) rotate(-6deg); } 92% { transform: translateY(-3px) rotate(4deg); } }
.step b { font-size: 15px; color: var(--candle); }
.step p { font-size: 12.5px; color: var(--ink-dim); line-height: 1.3; }
.my-brews .list { display: flex; flex-direction: column; gap: 8px; }
.mb-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  transition: background .2s, transform .15s var(--ease-pop);
}
.mb-row:hover { background: rgba(255, 255, 255, .1); transform: translateX(3px); }
.mb-row:active { transform: scale(.98); }
.mb-row .em { font-size: 26px; }
.mb-row .t { flex: 1; display: flex; flex-direction: column; }
.mb-row .t b { font-weight: 600; }
.mb-row .t small { color: var(--ink-mute); font-size: 13px; }
.mb-row .go { color: var(--a1); font-weight: 600; font-size: 14px; }

.sec { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sec-title { font: 400 30px/1.05 var(--font-display); letter-spacing: .5px; text-align: center; color: var(--candle); text-shadow: 0 3px 0 #2b0a47, 0 0 18px rgba(255, 122, 24, .35); }
.sec-sub { text-align: center; color: var(--ink-dim); margin-top: -4px; }

.tiers {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 4px 16px; margin: 0 -4px;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.tiers::-webkit-scrollbar { display: none; }
.tcard {
  scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  aspect-ratio: 5 / 7.4; padding: 10px 6px; border-radius: 14px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc) 40%, #2a0b47), #14061f 85%);
  border: 2px solid color-mix(in srgb, var(--tc) 70%, transparent);
  box-shadow: 0 8px 0 #0b0414, 0 0 22px color-mix(in srgb, var(--tc) 35%, transparent);
  animation: floaty 4s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s);
  transition: transform .35s var(--ease-pop);
}
.tcard .em { font-size: 30px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.tcard b { font: 400 17px/1 var(--font-display); letter-spacing: .5px; color: #fff; }
.tcard small { font-size: 11.5px; font-weight: 600; color: var(--ink-dim); }
@media (hover: hover) { .tcard:hover { transform: translateY(-8px) rotate(-3deg); } }

.feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 16px 10px; border-radius: 18px; background: rgba(26, 9, 50, .88); border: 1px solid rgba(255, 196, 140, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}
.feat .em { font-size: 32px; transition: transform .4s var(--ease-spring); }
@media (hover: hover) { .feat:hover .em { transform: translateY(-5px) scale(1.15) rotate(-8deg); } }
.feat b { color: var(--candle); font-size: 15.5px; }
.feat p { font-size: 13px; color: var(--ink-dim); line-height: 1.3; }
.foot { text-align: center; color: var(--ink-mute); font-size: 13px; margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 14px; }
.foot-nav a { color: var(--ink-dim); text-decoration: none; padding: 4px 2px; }
.foot-nav a:hover { color: var(--candle); text-decoration: underline; }
.foot-link { background: none; border: 0; padding: 4px 2px; color: var(--ink-dim); font-size: 14px; }
.foot-link:hover { color: var(--candle); text-decoration: underline; }

/* optional-analytics choice (assets/js/privacy.js) */
.privacy-banner {
  position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; padding: 16px 16px 14px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(48, 18, 82, .97), rgba(20, 7, 38, .97)); color: var(--ink);
  border: 1px solid rgba(255, 196, 140, .25); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  font: 500 14.5px/1.5 var(--font-ui); animation: fadeIn .3s ease-out both;
}
.privacy-banner p { margin-bottom: 6px; color: var(--ink-dim); }
.privacy-banner a { color: var(--candle); font-weight: 600; }
.pb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pb-btn {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; font-weight: 600;
  background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .18); color: var(--ink);
}
.pb-btn--yes { color: #1b0730; border-color: transparent; background: linear-gradient(180deg, #ffbe5c, var(--pumpkin)); box-shadow: 0 4px 0 #a8430a; }

/* home FAQ */
.faq { gap: 8px; }
.faq-item { padding: 0; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; position: relative;
  font-weight: 600; font-size: 16px; line-height: 1.3;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; color: var(--candle); background: rgba(255, 207, 74, .12); transition: transform .3s var(--ease-pop);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 16px 16px; color: var(--ink-dim); font-size: 15px; }

/* About / Privacy / Terms / Contact (page.php) */
body.doc { background: radial-gradient(120% 70% at 50% 0%, #2a0f4a 0%, #12061f 55%, var(--night-0) 100%) fixed; }
.doc-sky { position: fixed; inset: 0; pointer-events: none; }
.doc-moon {
  position: absolute; top: 70px; right: -30px; width: 120px; height: 120px; border-radius: 50%; opacity: .5;
  background: radial-gradient(circle at 40% 38%, #fffaf0, #ffe7a6 45%, #e8ad55); box-shadow: 0 0 60px rgba(255, 214, 120, .45);
}
.doc #app { gap: 18px; }
.btn-sm { width: auto; min-height: 42px; padding: 8px 18px; font-size: 16px; box-shadow: 0 4px 0 var(--a-edge), 0 8px 18px var(--a-glow), inset 0 2px 0 rgba(255, 255, 255, .45); }
.doc-cta { margin-top: 4px; }
.prose { padding: 22px 20px; font-size: 16px; line-height: 1.6; color: var(--ink-dim); }
.prose h1 { font: 400 clamp(30px, 8vw, 40px)/1.05 var(--font-display); letter-spacing: .5px; color: var(--candle); text-shadow: 0 3px 0 #2b0a47, 0 0 18px rgba(255, 122, 24, .35); margin-bottom: 14px; }
.prose h2 { font-size: 19px; font-weight: 600; color: var(--ink); margin: 20px 0 6px; }
.prose p, .prose ul, .prose ol { margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { font-size: .92em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.prose .big-mail { font-size: 19px; font-weight: 600; }

/* =========================================================
   Mode picker
   ========================================================= */
.modes { display: flex; flex-direction: column; gap: 12px; }
.mode-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; text-align: left;
  width: 100%; padding: 16px 18px; border-radius: 22px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 20%, transparent), rgba(255, 255, 255, .03));
  background-color: rgba(26, 8, 50, .78);
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
  transition: transform .2s var(--ease-pop), box-shadow .25s, border-color .25s;
}
.mode-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 9px 0 rgba(0, 0, 0, .35), 0 12px 30px color-mix(in srgb, var(--c) 30%, transparent); border-color: var(--c); }
.mode-card:active { transform: translateY(3px) scale(.98); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.mode-card .em {
  flex: none; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 32px;
  background: color-mix(in srgb, var(--c) 18%, rgba(0, 0, 0, .25)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 50%, transparent);
}
.mode-card:hover .em { animation: emBounce .6s var(--ease-pop); }
@keyframes emBounce { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.2) rotate(-10deg); } 100% { transform: scale(1) rotate(0); } }
.mode-card .t { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.mode-card .t b { font-family: var(--font-display); font-weight: 400; font-size: 27px; letter-spacing: .5px; color: var(--c); line-height: 1.05; }
.mode-card .t small { color: var(--ink-dim); font-size: 14.5px; }
.mode-card .t small.vibe { color: var(--ink-mute); font-size: 13px; font-style: italic; }
.mode-card .arrow { font-size: 22px; color: var(--c); transition: transform .2s; }
.mode-card:hover .arrow { transform: translateX(4px); }
.mode-card::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 35%, transparent), transparent);
  pointer-events: none;
}
.mode-card.is-chosen { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 0 40px color-mix(in srgb, var(--c) 40%, transparent); animation: chosen .5s var(--ease-spring); }
@keyframes chosen { 40% { transform: scale(1.04); } }

/* =========================================================
   Play
   ========================================================= */
/* The HUD sticks to the top so the candle stays visible while reaching the lower answers. */
.hud {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  margin: -4px -10px 0; padding: 6px 10px;
  border-radius: 0 0 22px 22px;
  transition: background .3s, box-shadow .3s;
}
body.is-scrolled .hud { background: rgba(12, 4, 24, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.hud > :first-child { justify-self: start; }
.hud.is-brew { grid-template-columns: 1fr; }
.hud.is-brew > :first-child { justify-self: center; }
.hud.no-timer { grid-template-columns: 1fr 1fr; }
.hud > :last-child { justify-self: end; }
.hud-step { font-variant-numeric: tabular-nums; }
.hud-score { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.chip-pts { color: var(--candle); border-color: rgba(255, 207, 74, .45); font-variant-numeric: tabular-nums; }
.chip-pts.is-bump { animation: bump .45s var(--ease-spring); }
.streak { display: inline-flex; align-items: center; gap: 4px; padding-right: 4px; font-weight: 700; font-size: 17px; color: #ffb347; transition: transform .3s var(--ease-spring); }
.streak .em { font-size: 20px; transition: filter .3s; }
.streak.is-off { color: var(--ink-mute); }
.streak.is-off .em { filter: grayscale(1) opacity(.45); }
.streak.is-hot .em { animation: flame .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 8px #ff7a18); }
.streak.is-bump { animation: bump .45s var(--ease-spring); }
@keyframes flame { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.3) rotate(6deg); } }
@keyframes bump { 40% { transform: scale(1.35); } }

.timer { position: relative; width: 66px; height: 66px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.timer .t-bg { fill: rgba(14, 4, 26, .92); stroke: rgba(255, 196, 140, .25); stroke-width: 2.5; }
.timer .t-arc { fill: none; stroke: var(--slime); stroke-width: 8; stroke-linecap: round; transition: stroke .3s; }
.timer .t-num { position: absolute; inset: 0; display: grid; place-items: center; font: 400 26px var(--font-display); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.timer::before { content: '🕯️'; position: absolute; top: -9px; left: -8px; font-size: 18px; transform: rotate(-12deg); filter: drop-shadow(0 0 6px #ffcf4a); }
.timer.is-warn .t-arc { stroke: var(--candle); }
.timer.is-low .t-arc { stroke: var(--bad); }
.timer.is-low { animation: heartbeat .6s ease-in-out infinite; }
.timer.is-low .t-num { color: #ff8fa3; }
.timer.is-frozen .t-arc { stroke: var(--ice); }
.timer.is-frozen .t-bg { fill: #0f2a3d; stroke: rgba(143, 220, 255, .5); }
.timer.is-frozen::before { content: '❄️'; animation: popIn .4s var(--ease-spring); }
.timer.is-frozen::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 22px rgba(143, 220, 255, .7); animation: glowPulse 1.6s ease-in-out infinite; }
@keyframes heartbeat { 50% { transform: scale(1.1); } }
@keyframes glowPulse { 50% { opacity: .4; } }

.pips { display: flex; justify-content: center; gap: 6px; }
.pip {
  width: 28px; height: 9px; border-radius: 9px; background: rgba(255, 255, 255, .12);
  transition: background .4s, box-shadow .4s, transform .3s var(--ease-pop);
}
.pip.cur { background: rgba(255, 255, 255, .45); animation: pipPulse 1.2s ease-in-out infinite; }
.pip.on { background: var(--pc); box-shadow: 0 0 10px var(--pc); transform: scaleY(1.25); }
@keyframes pipPulse { 50% { opacity: .5; } }

.qstage { position: relative; z-index: 2; perspective: 1200px; }
.qcard { text-align: center; padding: 22px 18px 20px; }
.q-kicker { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.q-cat {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--a2) 22%, rgba(255, 255, 255, .06)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--a2) 55%, transparent);
}
.q-hint { font-size: 12.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--a1); }
.q-text { font-size: clamp(21px, 5.8vw, 25px); font-weight: 600; line-height: 1.25; text-wrap: balance; }
.q-text .w { display: inline-block; }

/* answers: a 2×2 grid of big, colourful emoji tiles */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 2; }
.opt {
  --t: var(--pumpkin);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 128px; padding: 14px 10px 12px; border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--t) 24%, rgba(22, 7, 42, .86)), rgba(22, 7, 42, .84) 85%);
  border: 2px solid color-mix(in srgb, var(--t) 45%, rgba(255, 255, 255, .08));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--t) 30%, rgba(0, 0, 0, .55)), 0 10px 22px rgba(0, 0, 0, .3);
  font-size: 16px; font-weight: 600; line-height: 1.2;
  transition: transform .18s var(--ease-pop), background .25s, border-color .25s, box-shadow .25s, opacity .3s, filter .3s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.opt:nth-child(2) { --t: var(--slime); }
.opt:nth-child(3) { --t: var(--ghost); }
.opt:nth-child(4) { --t: var(--cyan); }
.opt .em {
  flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 40px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--t) 34%, transparent), color-mix(in srgb, var(--t) 8%, transparent) 70%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 40%, transparent);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3));
  transition: transform .3s var(--ease-pop);
}
.opt .tx { position: relative; z-index: 1; text-wrap: balance; }
@media (hover: hover) {
  .opt:not(:disabled):hover { transform: translateY(-2px); border-color: var(--t); box-shadow: 0 7px 0 rgba(0, 0, 0, .38), 0 8px 24px color-mix(in srgb, var(--t) 40%, transparent); }
  .opt:not(:disabled):hover .em { transform: scale(1.12) rotate(-6deg); }
}
.opt:not(:disabled):active { transform: translateY(3px) scale(.99); box-shadow: 0 2px 0 rgba(0, 0, 0, .38); }
.opt:disabled { cursor: default; }
.opt.picked { border-color: var(--a2); background: linear-gradient(90deg, color-mix(in srgb, var(--a2) 32%, rgba(24, 8, 46, .9)), rgba(24, 8, 46, .85)); box-shadow: 0 0 0 3px var(--a-glow); transform: translateY(3px); animation: pickPop .4s var(--ease-spring); }
.opt.dim { opacity: .38; filter: grayscale(.4); }
.opt.right { border-color: var(--good); background: linear-gradient(90deg, rgba(124, 255, 107, .3), rgba(24, 8, 46, .85)); box-shadow: 0 0 22px rgba(124, 255, 107, .4); opacity: 1; filter: none; animation: pickPop .45s var(--ease-spring); }
.opt.wrong { border-color: var(--bad); background: linear-gradient(90deg, rgba(255, 59, 92, .3), rgba(24, 8, 46, .85)); box-shadow: 0 0 22px rgba(255, 59, 92, .35); animation: shake .45s; opacity: 1; filter: none; }
.opt.reveal { animation: revealGlow 1s ease-in-out 2; }
.opt.gone { animation: crumble .6s var(--ease-in) forwards; pointer-events: none; }
.opt .tag {
  position: absolute; right: 10px; top: -11px; z-index: 2; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; color: #0f2a12; background: var(--good);
  box-shadow: 0 4px 12px rgba(124, 255, 107, .4); animation: popIn .45s var(--ease-pop);
}
.opt.wrong .tag { background: var(--bad); color: #fff; box-shadow: 0 4px 12px rgba(255, 59, 92, .4); }
@keyframes pickPop { 0% { transform: scale(.95); } 55% { transform: translateY(2px) scale(1.03); } 100% { transform: translateY(0) scale(1); } }
@keyframes revealGlow { 50% { box-shadow: 0 0 0 6px rgba(124, 255, 107, .35), 0 0 30px rgba(124, 255, 107, .5); } }
@keyframes crumble { 0% { transform: none; opacity: 1; } 30% { transform: rotate(-3deg) scale(1.02); } 100% { transform: translateY(26px) rotate(4deg) scale(.7); opacity: 0; filter: blur(4px) grayscale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

.spells { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spell {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 9px; text-align: left; padding: 9px 12px; border-radius: 16px;
  background: rgba(26, 9, 50, .85); border: 1.5px dashed rgba(201, 164, 255, .45);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease-pop), border-color .2s, box-shadow .2s, opacity .3s, filter .3s;
}
.spell[data-spell="freeze"] { border-color: rgba(143, 220, 255, .5); }
.spell .em { font-size: 26px; flex: none; animation: floaty 3s ease-in-out infinite; }
.spell .t { display: flex; flex-direction: column; line-height: 1.15; }
.spell b { font-size: 14.5px; font-weight: 600; }
.spell small { font-size: 12px; color: var(--ink-mute); }
@media (hover: hover) { .spell:not(:disabled):hover { transform: translateY(-2px); border-style: solid; box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 0 20px rgba(157, 77, 255, .35); } }
.spell:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.spell:disabled { cursor: default; opacity: .5; }
.spell.is-used { opacity: .4; filter: grayscale(1); }
.spell.is-used b { text-decoration: line-through; }
.spell.is-used .em { animation: none; }
.spell.is-casting { animation: cast .6s var(--ease-spring); }
@keyframes cast { 40% { transform: scale(1.08) rotate(-2deg); box-shadow: 0 0 30px rgba(157, 77, 255, .7); } }

.play-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 52px; }
.btn-next .next-fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .32); transform-origin: left center; transform: scaleX(0); z-index: -1; border-radius: inherit; }
.btn-next .next-label { position: relative; }

/* =========================================================
   Secret scroll
   ========================================================= */
.parchment {
  position: relative; border-radius: 18px; padding: 4px;
  background: linear-gradient(135deg, #f3dfb0, #e2c287 55%, #d1aa66);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45), inset 0 0 30px rgba(120, 70, 20, .35);
  transition: transform .3s var(--ease-pop), box-shadow .3s;
}
.parchment:focus-within { transform: rotate(-.6deg) scale(1.01); box-shadow: 0 20px 50px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 207, 74, .3), inset 0 0 30px rgba(120, 70, 20, .35); }
.parchment textarea {
  display: block; width: 100%; min-height: 140px; resize: none; border: 0; outline: none;
  padding: 16px 18px 28px; border-radius: 14px; background: transparent;
  color: #3b1d0a; font-size: 18px; font-weight: 500; line-height: 1.45;
}
.parchment textarea::placeholder { color: rgba(80, 45, 15, .5); }
.parchment .count { position: absolute; right: 14px; bottom: 9px; font-size: 12px; font-weight: 600; color: rgba(80, 45, 15, .6); }
.need { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.need button {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 2px solid rgba(255, 255, 255, .12);
  transition: transform .2s var(--ease-pop), border-color .2s, background .2s, box-shadow .2s;
}
.need button b { font-size: 20px; font-weight: 700; }
.need button span { font-size: 13px; color: var(--ink-dim); }
.need button.on { border-color: var(--a2); background: color-mix(in srgb, var(--a2) 20%, transparent); box-shadow: 0 0 18px var(--a-glow); transform: translateY(-2px); }
.need button:active { transform: scale(.95); }

/* =========================================================
   Sealing
   ========================================================= */
.seal-line { min-height: 2.2em; font-size: clamp(24px, 7vw, 32px); }
.seal-err { display: flex; flex-direction: column; gap: 12px; text-align: center; color: #ffb3c0; }

/* =========================================================
   Share
   ========================================================= */
.bottle-wrap { width: 128px; margin: 0 auto; position: relative; isolation: isolate; }
.bottle-wrap.big { width: 170px; }
.bottle-wrap::before {
  content: ''; position: absolute; left: -20%; right: -20%; top: 20%; bottom: -5%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg-glow, var(--a-glow)), transparent); filter: blur(14px); z-index: -1;
  animation: cGlow 3s ease-in-out infinite;
}
.bottle-wrap.rays::after {
  content: ''; position: absolute; left: 50%; top: 52%; width: 300%; aspect-ratio: 1; translate: -50% -50%; z-index: -2; border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--bg-glow, var(--a-glow)) 55%, transparent) 0 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 16%, transparent 64%); mask: radial-gradient(circle, #000 16%, transparent 64%);
  animation: spin 22s linear infinite; opacity: .8; pointer-events: none;
}
.bottle-wrap.is-cursed::after { background: repeating-conic-gradient(rgba(124, 255, 107, .14) 0 4deg, transparent 4deg 26deg); animation-duration: 40s; }
.bottle { width: 100%; display: block; overflow: visible; animation: bottleFloat 3.4s ease-in-out infinite; }
@keyframes bottleFloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.bottle .wave { animation: wave 2.6s linear infinite; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
.bottle .bb { animation: bottleBubble 2.4s ease-in infinite; transform-box: fill-box; transform-origin: center; opacity: 0; }
.bottle .bb:nth-of-type(2) { animation-delay: -.8s; animation-duration: 2.9s; }
.bottle .bb:nth-of-type(3) { animation-delay: -1.6s; animation-duration: 2.1s; }
@keyframes bottleBubble { 0% { transform: translateY(0) scale(.4); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }

.linkbox {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: rgba(10, 3, 22, .66); border: 1.5px dashed color-mix(in srgb, var(--a2) 60%, transparent);
}
.linkbox input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 15px; font-weight: 500; color: var(--a1); text-overflow: ellipsis; }
.btn-copy {
  position: relative; overflow: hidden;
  flex: none; padding: 10px 18px; border-radius: 999px; border: 0; font-weight: 600; font-size: 15px;
  color: var(--a-text); background: linear-gradient(180deg, var(--a1), var(--a2)); transition: transform .15s var(--ease-pop);
}
.btn-copy:active { transform: scale(.93); }
.btn-copy.is-done { background: linear-gradient(180deg, #c2ff9e, var(--slime)); }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.soc {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 4px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600; text-decoration: none; color: #fff; border: 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease-pop), filter .2s, box-shadow .15s;
}
.soc:hover { filter: brightness(1.12); transform: translateY(-2px); }
.soc:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.soc.wa { background: #1fae52; }
.soc.tg { background: #2a9fd8; }
.soc.xx { background: #16161d; border: 1px solid rgba(255, 255, 255, .2); }
.soc.ig { background: linear-gradient(45deg, #f9a03f, #e6405f 45%, #b02fc6 75%, #5b51d8); }
.coven-card { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.coven-card h3 { margin: 0; }
.coven-card p { color: var(--ink-dim); font-size: 15px; }

/* =========================================================
   Invite
   ========================================================= */
.invite-title { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.invite-title span {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(46px, 14vw, 68px); line-height: 1; letter-spacing: 1px;
  color: var(--a1); text-shadow: 0 4px 0 #2b0a47, 0 0 26px var(--a-glow); word-break: break-word;
  animation: titleFloat 4s ease-in-out infinite;
}
.invite-title small { font-size: 20px; font-weight: 600; color: var(--ink); }
.facts, .rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 14px; font-weight: 500; }
.fact b { color: var(--a1); }
.rule { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: rgba(157, 77, 255, .1); border: 1.5px dashed rgba(201, 164, 255, .4); font-size: 13.5px; font-weight: 600; color: var(--ink-dim); }
.rule b { color: var(--candle); }

/* =========================================================
   Result
   ========================================================= */
.result { display: flex; flex-direction: column; gap: 16px; }
.again-note { align-self: center; font-size: 14px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--ink-dim); }
.res-names { text-align: center; font-weight: 600; font-size: 17px; color: var(--ink-dim); letter-spacing: .3px; }
.res-names b { color: var(--ink); }
.res-names i { font-style: normal; color: var(--a1); margin: 0 6px; }
.tier {
  align-self: center; display: inline-flex; gap: 8px; align-items: center; padding: 6px 16px; border-radius: 999px;
  font-weight: 700; letter-spacing: .6px; text-transform: uppercase; font-size: 14px;
  color: #1b0730; background: linear-gradient(90deg, var(--pa, #ff7a18), var(--pb, #ff4fd8));
  box-shadow: 0 0 22px color-mix(in srgb, var(--pa, #ff7a18) 50%, transparent);
}
.potion-name {
  font-family: var(--font-display); font-weight: 400; text-align: center; letter-spacing: .5px;
  font-size: clamp(36px, 10.5vw, 50px); line-height: 1.02;
  color: #fff; text-shadow: 0 4px 0 #2b0a47, 0 0 24px var(--pa, #ff7a18);
}
.potion-name .ch { display: inline-block; white-space: pre; }
.essence { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.essence span { padding: 4px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; border: 1.5px solid var(--ec); color: var(--ec); background: color-mix(in srgb, var(--ec) 12%, transparent); }
.res-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.res-chips .chip b { color: var(--candle); }

.bond { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 116px; flex: none; aspect-ratio: 1; }
.ring svg { width: 100%; display: block; }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; }
.ring-num b { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-num span { font-size: 18px; font-weight: 600; color: var(--ink-dim); margin-top: 8px; }
.bond-txt { display: flex; flex-direction: column; gap: 3px; }
.bond-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-mute); font-weight: 600; }
.bond-score { font-size: 18px; font-weight: 700; }
.bond-txt p { color: var(--ink-dim); font-size: 15px; line-height: 1.35; }

.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 12px 8px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 207, 74, .14), rgba(255, 255, 255, .03)); border: 1.5px solid rgba(255, 207, 74, .35);
  animation: popIn .55s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 140ms + 200ms);
}
.badge .em { font-size: 32px; animation: wiggle 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 300ms); }
.badge b { font-size: 14.5px; color: var(--candle); }
.badge small { font-size: 12px; color: var(--ink-dim); line-height: 1.25; }

.fate { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; perspective: 800px; }
.fate-card { border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 6px; backface-visibility: hidden; }
.fate-card span { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.fate-card p { font-size: 15px; line-height: 1.35; font-weight: 500; }
.fate-card.bless { background: linear-gradient(160deg, rgba(94, 62, 40, .95), rgba(34, 12, 62, .95)); border: 1.5px solid rgba(255, 207, 74, .45); }
.fate-card.bless span { color: var(--candle); }
.fate-card.curse { background: linear-gradient(160deg, rgba(36, 80, 50, .95), rgba(34, 12, 62, .95)); border: 1.5px solid rgba(124, 255, 107, .4); }
.fate-card.curse span { color: var(--slime); }

.scroll-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll { position: relative; width: 100%; max-width: 380px; padding: 0 10px; margin-bottom: 24px; }
.scroll .rod { height: 18px; border-radius: 10px; background: linear-gradient(180deg, #a86b34, #6b3d17 60%, #4a2a10); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); margin: 0 -10px; position: relative; z-index: 2; }
.scroll .rod::before, .scroll .rod::after { content: ''; position: absolute; top: -3px; width: 14px; height: 24px; border-radius: 6px; background: #3a2010; }
.scroll .rod::before { left: -6px; } .scroll .rod::after { right: -6px; }
.scroll .paper {
  overflow: hidden; margin: -4px 0;
  background: linear-gradient(90deg, #d8b67a, #f3e0b2 18%, #f6e6be 50%, #f3e0b2 82%, #d8b67a);
  box-shadow: inset 0 8px 14px rgba(90, 50, 10, .35), inset 0 -8px 14px rgba(90, 50, 10, .35);
}
.paper-in { padding: 20px 20px; color: #3b1d0a; text-align: center; }
.scroll-from { font-family: var(--font-display); font-size: 22px; color: #7a2d0a; margin-bottom: 6px; letter-spacing: .5px; }
.scroll-msg { font-size: 18px; font-weight: 500; line-height: 1.45; white-space: pre-wrap; word-break: break-word; min-height: 1.4em; }
.scroll.rolled .paper { height: 70px; }
.scroll.rolled .scroll-msg { visibility: hidden; }
.scroll-locked .scroll-msg { filter: blur(6px); user-select: none; opacity: .75; }
.wax {
  position: absolute; left: 50%; bottom: -30px; width: 64px; height: 64px; margin-left: -32px; z-index: 3;
  display: grid; place-items: center; border-radius: 50%; font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #ff6b84, #c0122f 60%, #7a0a1d);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 -4px 8px rgba(0, 0, 0, .3), 0 0 0 4px rgba(192, 18, 47, .35);
}
.scroll-note { text-align: center; color: var(--ink-dim); font-size: 15px; max-width: 360px; }
.scroll-note b { color: var(--ink); }

.res-actions { display: grid; gap: 10px; }
.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-row .btn { font-size: 16px; padding: 12px 10px; min-height: 52px; }
.cta-own { text-align: center; display: flex; flex-direction: column; gap: 10px; border-color: color-mix(in srgb, var(--a2) 50%, transparent); box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 30px var(--a-glow); }
.cta-own h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0; letter-spacing: .5px; color: var(--a1); }
.cta-own p { color: var(--ink-dim); }

/* Leaderboards */
.board .list { display: flex; flex-direction: column; gap: 8px; }
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.board-head h3 { margin: 0; }
.row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 10px;
  padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
}
.row.me { border-color: var(--a2); background: color-mix(in srgb, var(--a2) 14%, transparent); box-shadow: 0 0 16px var(--a-glow); }
.row .rk { font-size: 20px; text-align: center; font-weight: 700; color: var(--ink-mute); }
.row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; }
.row .sc { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; }
.row .sc small { display: block; font-size: 11.5px; font-weight: 600; color: var(--candle); }
.row .bar { grid-column: 2 / 4; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.row .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--a2), var(--a1)); transform-origin: left; animation: barGrow 1s var(--ease-out) both; }
@keyframes barGrow { from { transform: scaleX(0); } }
.empty { text-align: center; color: var(--ink-mute); padding: 18px 8px; font-size: 15px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; animation: spiderBob 3s ease-in-out infinite; }

.recipe summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.recipe summary::-webkit-details-marker { display: none; }
.recipe summary::after { content: '▾'; transition: transform .25s; color: var(--a1); }
.recipe[open] summary::after { transform: rotate(180deg); }
.recipe-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.recipe[open] .recipe-list .rq { animation: fadeDown .35s var(--ease-out) both; }
.rq { padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.rq .qq { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.rq .aa { display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; color: var(--ink-dim); }
.rq .aa span b { color: var(--ink); font-weight: 500; }
.rq.ok { border-color: rgba(124, 255, 107, .35); }
.rq.no { border-color: rgba(255, 59, 92, .35); }
.rq .mark { float: right; font-size: 18px; margin-left: 8px; }

/* Coven */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; padding: 12px 4px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.stat b { display: block; font-size: 24px; font-weight: 700; color: var(--a1); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.soul { border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); overflow: hidden; }
.soul > summary { list-style: none; cursor: pointer; }
.soul > summary::-webkit-details-marker { display: none; }
.soul > summary .row { background: none; border: 0; }
.soul[open] { border-color: color-mix(in srgb, var(--a2) 50%, transparent); }
.soul-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.soul-body .rq { padding: 10px; }
.soul-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.soul-badges span { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 207, 74, .12); border: 1px solid rgba(255, 207, 74, .35); color: var(--candle); }
.banish { align-self: flex-end; background: none; border: 1px solid rgba(255, 59, 92, .45); color: #ff8fa3; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.banish:hover { background: rgba(255, 59, 92, .12); }
.secret-peek { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #f3dfb0, #e2c287); color: #3b1d0a; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.secret-peek small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #7a2d0a; margin-bottom: 4px; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--bad); vertical-align: middle; animation: live 1.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255, 59, 92, 0); } }

/* Lost */
.lost { margin: auto 0; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.lost-ghost { font-size: 90px; animation: titleFloat 3s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255, 255, 255, .4)); }

/* =========================================================
   Ads (positions per screen come from config.php)
   ========================================================= */
.ad { margin: 22px auto; text-align: center; width: 100%; }
.ad-label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute); opacity: .8; }
.ad-box { margin: 0 auto; overflow: hidden; border-radius: 12px; }
.ad--small .ad-box { width: 100%; max-width: 320px; height: 100px; }
.ad--small:has(ins.adsbygoogle) .ad-box { height: auto; min-height: 100px; overflow: visible; }
.ad--big .ad-box { width: 100%; max-width: 336px; min-height: 280px; }
.ad--top { margin-top: 0; margin-bottom: 6px; }
.ad-demo {
  display: grid; place-items: center; align-content: center; gap: 2px; height: 100%; min-height: inherit;
  border: 2px dashed rgba(255, 196, 140, .3); border-radius: 12px;
  background: rgba(255, 255, 255, .04); color: var(--ink-mute); font-size: 13px; font-weight: 600;
}
.ad-demo b { font-size: 16px; font-weight: 600; color: var(--ink-dim); }

.noscript { max-width: 420px; margin: 40px auto; text-align: center; position: relative; z-index: 20; }

/* =========================================================
   Shared keyframes
   ========================================================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.1) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-height: 740px) {
  .slot-play { --cw: 112px; }
  .opt { min-height: 104px; gap: 6px; padding: 10px 8px; }
  .opt .em { width: 50px; height: 50px; font-size: 32px; }
  .q-text { font-size: 20px; }
  .timer { width: 58px; height: 58px; }
  .timer .t-num { font-size: 22px; }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .share-row { grid-template-columns: repeat(2, 1fr); }
  .fate { grid-template-columns: 1fr; }
  .step p { font-size: 11.5px; }
  .spell small { display: none; }
}
@media (min-width: 700px) {
  #app { padding-top: 22px; }
  .slot-play { --cw: 160px; }
}
/* phones: keep the moon & spider in the corners so they never sit behind text */
@media (max-width: 699px) {
  .moon { top: calc(64px + env(safe-area-inset-top)); right: -40px; width: 118px; opacity: .55; }
  .spider { left: 10px; }
  .spider .thread { height: clamp(110px, 17vh, 150px); }
  .spider-body { width: 28px; }
  .web { width: 96px; opacity: .8; }
}
/* =========================================================
   Performance: pause what can't be seen, and a lighter mode for slow devices
   ========================================================= */
/* decorations scrolled out of view (fx.js toggles .is-off) */
.is-off, .is-off *, .is-off::before, .is-off::after, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }
/* the reveal film covers everything: the scene and the page behind it stand still */
body.film-open .scene, body.film-open .scene *, body.film-open #app, body.film-open #app *,
body.film-open #app *::before, body.film-open #app *::after { animation-play-state: paused !important; }
/* …and is skipped entirely: no style, layout or paint for anything the film covers */
body.film-open #app { content-visibility: hidden; }
body.film-open .scene { visibility: hidden; }

/* .lite (fx.js turns it on when frames drop): ambient extras rest, gameplay feedback stays */
.lite .eyes, .lite .fog-3, .lite .clouds span:nth-child(n+2), .lite .c-steam, .lite .t-drop { display: none; }
.lite .fog-2, .lite .tcard, .lite .step-ico, .lite .spell .em, .lite .badge .em, .lite .moon-halo,
.lite .title, .lite .bottle-wrap::before, .lite .bottle-wrap.rays::after, .lite .drip-top::after, .lite .c-glow { animation: none !important; }
.lite .shine { display: none; }
.lite .card, .lite .opt, .lite .step, .lite .icon-btn, .lite .countdown, .lite .cd, .lite .modal-scrim {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .fog, .clouds span, .spider, .title, .t-drop, .invite-title span, .bottle, .moon-halo, .eyes i,
  .tcard, .step-ico, .spell .em, .bottle-wrap.rays::after, .drip-top::after, .lightning, .fl, .c-bubbles i, .c-glow { animation: none !important; }
  .eyes i { opacity: .6; }
  .pulse::before, .shine::before { animation: none; }
  .pre-reveal { opacity: 1 !important; }
}
