/* =========================================================
   Villain mode 2.0: four villains, each repaints and re-stages the whole site.
   site.css holds the shared villain rules, written in tokens. Here: the four palettes, the stage effects
   (one canvas + a few edge pieces), the picker, the whisperer. Transform/opacity only. Off under reduced motion.
   ========================================================= */

/* ---------- the four palettes ---------- */
body.villain[data-villain="scar"] {
  --villain: #a6ff3d; --v-rgb: 166 255 61; --v-warm: #d4ff6a; --v-deep: #3f8f12; --v-deep-rgb: 63 143 18; --v-light: #f1ffd6; --v-soft: #cdeea0; --v-mute: #94b86a; --v-ink: #0e1a00;
  --v2: #ff6a1f; --v2-rgb: 255 106 31; --v2-soft: #ffa15c; --v2-deep-rgb: 120 38 6;
  --v-n950: #030500; --v-n900: #070a02; --v-n800: #10160a; --v-n700: #1c2410; --v-text: #f2f7e6; --v-paper: rgba(10, 14, 4, 0.8);
  --v-sky: radial-gradient(1100px 650px at 80% -10%, rgba(120, 38, 6, 0.55), transparent 70%), radial-gradient(900px 600px at 0% 40%, rgba(63, 143, 18, 0.22), transparent 70%), radial-gradient(800px 420px at 50% 105%, rgba(166, 255, 61, 0.16), transparent 70%), linear-gradient(180deg, #151a08, #070a02 60%, #030500);
}
body.villain[data-villain="jafar"] {
  --villain: #ff3b4e; --v-rgb: 255 59 78; --v-warm: #ff7a6b; --v-deep: #a3101f; --v-deep-rgb: 163 16 31; --v-light: #ffe9d6; --v-soft: #f5c9a8; --v-mute: #c49a7e; --v-ink: #1f0205;
  --v2: #ffc53d; --v2-rgb: 255 197 61; --v2-soft: #ffe08a; --v2-deep-rgb: 122 78 6;
  --v-n950: #060102; --v-n900: #0d0305; --v-n800: #1a070b; --v-n700: #2b0c13; --v-text: #fdf1e6; --v-paper: rgba(20, 5, 8, 0.82);
  --v-sky: radial-gradient(1100px 650px at 85% -10%, rgba(163, 16, 31, 0.6), transparent 70%), radial-gradient(900px 600px at 0% 35%, rgba(122, 78, 6, 0.3), transparent 70%), radial-gradient(800px 420px at 50% 105%, rgba(255, 197, 61, 0.14), transparent 70%), linear-gradient(180deg, #1f080d, #0d0305 60%, #060102);
}
body.villain[data-villain="ursula"] {
  --villain: #d08bff; --v-rgb: 208 139 255; --v-warm: #e6b8ff; --v-deep: #7b2cbf; --v-deep-rgb: 123 44 191; --v-light: #f6e8ff; --v-soft: #d9c2f0; --v-mute: #a590c4; --v-ink: #1a052b;
  --v2: #2ee6c5; --v2-rgb: 46 230 197; --v2-soft: #8ff5e2; --v2-deep-rgb: 8 84 96;
  --v-n950: #01050b; --v-n900: #030b16; --v-n800: #071626; --v-n700: #0c2238; --v-text: #eef4ff; --v-paper: rgba(4, 14, 26, 0.82);
  --v-sky: radial-gradient(1100px 650px at 50% -20%, rgba(46, 230, 197, 0.22), transparent 70%), radial-gradient(900px 600px at 0% 50%, rgba(123, 44, 191, 0.32), transparent 70%), radial-gradient(900px 500px at 100% 90%, rgba(8, 84, 96, 0.5), transparent 70%), linear-gradient(180deg, #0a2036, #030b16 60%, #01050b);
}
body.villain[data-villain="hades"] {
  --villain: #4cc9ff; --v-rgb: 76 201 255; --v-warm: #9be3ff; --v-deep: #1769aa; --v-deep-rgb: 23 105 170; --v-light: #e6f7ff; --v-soft: #b8d8ea; --v-mute: #8aa6b8; --v-ink: #02141f;
  --v2: #ff7a1a; --v2-rgb: 255 122 26; --v2-soft: #ffb066; --v2-deep-rgb: 110 40 4;
  --v-n950: #020306; --v-n900: #05080e; --v-n800: #0b111c; --v-n700: #131c2c; --v-text: #eef5fa; --v-paper: rgba(6, 10, 18, 0.84);
  --v-sky: radial-gradient(1100px 600px at 50% 110%, rgba(76, 201, 255, 0.3), transparent 70%), radial-gradient(900px 600px at 0% 20%, rgba(23, 105, 170, 0.25), transparent 70%), radial-gradient(800px 500px at 100% 10%, rgba(30, 40, 70, 0.6), transparent 70%), linear-gradient(180deg, #0e1524, #05080e 60%, #020306);
}
/* Hades loses his temper: for a few seconds blue turns to fire */
body.villain[data-villain="hades"].v-rage {
  --villain: #ff5a1f; --v-rgb: 255 90 31; --v-warm: #ffb066; --v-deep: #b32600; --v-deep-rgb: 179 38 0; --v-light: #fff0e0; --v2: #ffd23f; --v2-rgb: 255 210 63;
}
body.villain { transition: background-color 0.6s; }
body.villain.v-rage main { animation: v-shake 0.5s linear 3; }
@keyframes v-shake { 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 2px); } }

/* ---------- stage ---------- */
body.villain #stars { display: none; }
.v-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.v-vignette { position: fixed; inset: 0; z-index: 88; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgb(0 0 0 / 0.55)); mix-blend-mode: multiply; }
/* a breath of the villain's colour along the bottom of the screen */
.v-floor { position: fixed; inset: auto 0 0; height: 26vh; z-index: 87; pointer-events: none; background: linear-gradient(0deg, rgb(var(--v-rgb) / 0.22), transparent); animation: v-breathe 5s ease-in-out infinite; }
@keyframes v-breathe { 50% { opacity: 0.45; } }
body.v-rage .v-floor { height: 44vh; animation-duration: 0.5s; }

/* Scar: lightning now and then, claw marks where you click */
.v-bolt { position: fixed; inset: 0; z-index: 9980; pointer-events: none; background: radial-gradient(80% 60% at 70% 0%, rgb(var(--v-rgb) / 0.5), transparent 70%); animation: v-bolt 0.7s steps(1, end) forwards; }
@keyframes v-bolt { 0% { opacity: 1; } 12% { opacity: 0.1; } 20% { opacity: 0.9; } 34% { opacity: 0; } 100% { opacity: 0; } }
.v-claw { position: fixed; z-index: 9981; pointer-events: none; width: 120px; height: 120px; margin: -60px 0 0 -60px; animation: v-claw 0.9s ease-out forwards; }
.v-claw path { fill: none; stroke: var(--villain); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 130; stroke-dashoffset: 130; filter: drop-shadow(0 0 6px rgb(var(--v-rgb) / 0.9)); animation: v-slash 0.28s ease-out forwards; }
.v-claw path:nth-child(2) { animation-delay: 0.05s; } .v-claw path:nth-child(3) { animation-delay: 0.1s; }
@keyframes v-slash { to { stroke-dashoffset: 0; } }
@keyframes v-claw { 70% { opacity: 1; } to { opacity: 0; } }

/* Jafar: two eyes in the dark that follow you, a hypnotic ring where you click */
.v-eyes { position: fixed; top: calc(var(--header-h, 80px) + 26px); inset-inline-start: 26px; z-index: 89; pointer-events: none; display: flex; gap: 16px; opacity: 0.9; animation: v-blink 6s steps(1, end) infinite; }
.v-eyes i { width: 34px; height: 17px; border-radius: 100% 0; background: radial-gradient(circle at calc(50% + var(--ex, 0px)) calc(50% + var(--ey, 0px)), #1a0205 0 4px, var(--v2) 5px 9px, var(--villain) 10px); box-shadow: 0 0 18px rgb(var(--v-rgb) / 0.9), 0 0 40px rgb(var(--v2-rgb) / 0.4); rotate: 12deg; }
.v-eyes i:last-child { rotate: -12deg; border-radius: 0 100%; }
@keyframes v-blink { 0%, 100% { transform: scaleY(1); } 48% { transform: scaleY(1); } 50% { transform: scaleY(0.08); } 52% { transform: scaleY(1); } }
.v-ring { position: fixed; z-index: 9981; pointer-events: none; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid var(--v2); box-shadow: 0 0 0 6px rgb(var(--v-rgb) / 0.5), 0 0 30px rgb(var(--v2-rgb) / 0.8); animation: v-ring-out 0.9s ease-out forwards; }
.v-ring::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid var(--villain); }
@keyframes v-ring-out { to { transform: scale(9); opacity: 0; } }

/* Ursula: tentacles sway up from the corners, light from the surface above */
.v-tent { position: fixed; bottom: -30px; z-index: 89; pointer-events: none; width: clamp(150px, 20vw, 300px); height: auto; color: var(--v-deep); filter: drop-shadow(0 0 18px rgb(var(--v-rgb) / 0.5)); transform-origin: 50% 100%; animation: v-sway 7s ease-in-out infinite; }
.v-tent.l { left: -30px; } .v-tent.r { right: -30px; scale: -1 1; animation-delay: -3.5s; }
.v-tent path { fill: currentColor; } .v-tent circle { fill: var(--v-warm); opacity: 0.8; }
@keyframes v-sway { 0%, 100% { transform: rotate(-5deg) translateY(12px); } 50% { transform: rotate(6deg) translateY(0); } }
.v-rays { position: fixed; inset: 0 0 auto; height: 70vh; z-index: -1; pointer-events: none; opacity: 0.5; background: repeating-linear-gradient(100deg, transparent 0 60px, rgb(var(--v2-rgb) / 0.09) 80px 120px, transparent 150px 220px); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); animation: v-rays 14s ease-in-out infinite alternate; }
@keyframes v-rays { from { transform: translateX(-4%) skewX(-4deg); } to { transform: translateX(4%) skewX(4deg); } }

/* Hades: the header wears a crown of flame */
body.villain[data-villain="hades"] .nav-shell { position: relative; }
body.villain[data-villain="hades"] .nav-shell::before { content: ''; position: absolute; inset: -16px 18px auto; height: 18px; pointer-events: none;
  background: radial-gradient(14px 18px at 50% 100%, var(--v-light), var(--villain) 45%, transparent 72%) 0 0 / 26px 18px repeat-x; filter: blur(1.4px) drop-shadow(0 0 8px rgb(var(--v-rgb) / 0.9)); animation: v-flame 0.9s steps(3) infinite; }
@keyframes v-flame { 0% { background-position-x: 0; transform: scaleY(1); } 50% { transform: scaleY(1.35); } 100% { background-position-x: 26px; transform: scaleY(1); } }
body.villain[data-villain="hades"] .nav-shell::before { transform-origin: 50% 100%; }

/* every villain: photos sink into the villain's colour, the logo glows in it, links underline themselves in it */
body.villain .brand img, body.villain .hh-logo { filter: drop-shadow(0 0 6px rgb(var(--v-rgb) / 0.65)) drop-shadow(0 6px 18px rgb(var(--v2-rgb) / 0.3)) saturate(0.9); }
body.villain .btn { transition: transform 0.2s, box-shadow 0.3s; }
body.villain .btn:hover { animation: v-tremble 0.35s linear infinite; }
@keyframes v-tremble { 25% { translate: 1px -1px; } 50% { translate: -1px 1px; } 75% { translate: 1px 1px; } }
body.villain .section-head .eyebrow::before, body.villain .eyebrow::before { content: '☠'; margin-inline-end: 6px; }
@media (hover: hover) and (pointer: fine) { body.villain, body.villain a, body.villain button { cursor: var(--v-cursor, auto); } body.villain a, body.villain button, body.villain [role="button"] { cursor: var(--v-cursor-hot, pointer); } }

/* ---------- the picker ---------- */
.v-pick { border: 0; padding: 0; background: none; color: #f4f4f4; width: min(920px, 94vw); max-height: 92svh; overflow: visible; }
.v-pick::backdrop { background: radial-gradient(circle at 50% 40%, rgba(20, 0, 30, 0.82), rgba(0, 0, 0, 0.94)); backdrop-filter: blur(6px); }
.v-pick-in { padding: 26px 22px 22px; border-radius: 30px; background: linear-gradient(170deg, #15091f, #050208); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 50px 120px -30px #000; text-align: center; max-height: 92svh; overflow-y: auto; }
.v-pick h2 { margin: 0; font-family: var(--font-hand); font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; text-shadow: 0 0 24px rgba(255, 60, 120, 0.6); }
.v-pick p { margin: 4px 0 18px; color: #c9bfd6; }
.v-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.v-card { --c: #fff; --c2: #fff; position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 22px 12px 18px; cursor: pointer; font: inherit; color: #fff; overflow: hidden; isolation: isolate;
  border-radius: 26px 26px 26px 8px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: linear-gradient(175deg, color-mix(in srgb, var(--c) 22%, #07030c), #07030c 70%);
  transition: transform 0.45s var(--ease-spring), box-shadow 0.3s, border-color 0.3s; animation: v-card-in 0.7s var(--ease-spring) both; animation-delay: calc(var(--i) * 0.09s); }
@keyframes v-card-in { from { opacity: 0; transform: translateY(40px) rotate(4deg) scale(0.9); } }
.v-card::before { content: ''; position: absolute; inset: auto -20% -30%; height: 70%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 70%, transparent), transparent); opacity: 0.35; transition: opacity 0.4s, transform 0.6s; }
.v-card:hover, .v-card:focus-visible { transform: translateY(-10px); border-color: var(--c); box-shadow: 0 30px 60px -24px #000, 0 0 50px -8px var(--c); }
.v-card:hover::before { opacity: 0.8; transform: scale(1.2); }
.v-card[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 60%, transparent), 0 0 50px -8px var(--c); }
.v-card .v-face { font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 0 18px var(--c)); transition: transform 0.5s var(--ease-spring); }
.v-card:hover .v-face { transform: scale(1.2) rotate(-8deg); }
.v-card strong { font-family: var(--font-hand); font-size: 1.5rem; color: var(--c); }
.v-card small { color: #d9d2e4; font-size: 0.9rem; line-height: 1.45; }
.v-card em { font-style: normal; font-size: 0.78rem; color: var(--c2); margin-top: 4px; }
.v-card.scar { --c: #a6ff3d; --c2: #ffa15c; } .v-card.jafar { --c: #ff3b4e; --c2: #ffc53d; } .v-card.ursula { --c: #d08bff; --c2: #2ee6c5; } .v-card.hades { --c: #4cc9ff; --c2: #ff7a1a; }
.v-pick-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.v-good { border: 1px solid rgba(255, 215, 0, 0.6); background: rgba(255, 215, 0, 0.1); color: #ffe680; font: inherit; font-weight: 700; padding: 12px 22px; min-height: 48px; border-radius: 999px; cursor: pointer; }
.v-good:hover { background: rgba(255, 215, 0, 0.22); }
.v-close { border: 0; background: none; color: #c9bfd6; font: inherit; text-decoration: underline; cursor: pointer; padding: 12px 10px; min-height: 48px; }
@media (max-width: 760px) { .v-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .v-card { padding: 16px 10px 14px; } .v-card .v-face { font-size: 2.8rem; } .v-card strong { font-size: 1.25rem; } .v-card small { font-size: 0.82rem; } }

/* ---------- the whisperer: the villain talks to you from the corner ---------- */
/* bottom right, above the WhatsApp button, so it never covers a control */
.v-whisper { position: fixed; z-index: 95; right: 18px; bottom: calc(94px + var(--safe-b, 0px)); max-width: min(340px, calc(100vw - 36px)); display: grid; grid-template-columns: auto 1fr; direction: rtl; gap: 10px; align-items: end; pointer-events: none;
  opacity: 0; transform: translateY(14px); transition: opacity 0.5s, transform 0.5s var(--ease-spring); }
.v-whisper.on { opacity: 1; transform: none; }
.v-whisper b { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 0 14px rgb(var(--v-rgb) / 0.9)); animation: v-bob 3s ease-in-out infinite; }
@keyframes v-bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.v-whisper span { font-family: var(--font-hand); font-weight: 700; font-size: 1.02rem; line-height: 1.45; color: var(--v-light); padding: 10px 16px; border-radius: 20px 20px 20px 4px; background: rgb(0 0 0 / 0.78); border: 1px solid rgb(var(--v-rgb) / 0.55); box-shadow: 0 0 26px rgb(var(--v-rgb) / 0.3); }
body.has-ev-bar .v-whisper { bottom: calc(160px + var(--safe-b, 0px)); }
body.quiz-playing .v-whisper, body.quiz-app .v-whisper { display: none; }

/* the toggle toast and flashes take the villain's colour */
.villain-toast { border-color: rgb(var(--v-rgb, 57 255 20) / 0.6); color: var(--villain); }
.villain-flash { background: radial-gradient(circle, rgb(var(--v-rgb, 57 255 20) / 0.55), transparent 70%); }

@media (max-width: 700px) { .v-eyes { scale: 0.7; inset-inline-start: 10px; } .v-tent { width: 130px; } .v-whisper span { font-size: 0.92rem; } }
@media (prefers-reduced-motion: reduce) {
  .v-fx, .v-bolt, .v-claw, .v-ring, .v-rays { display: none; }
  .v-floor, .v-tent, .v-eyes, .v-whisper b, body.villain[data-villain="hades"] .nav-shell::before, body.villain .btn:hover, body.villain.v-rage main, .v-card { animation: none !important; }
}
