/* =====================================================================
   🎃 DÉCOR HALLOWEEN (temporaire) — styles
   =====================================================================
   POUR TOUT ENLEVER : supprimer la ligne
       @include('partials.halloween')
   dans resources/views/layouts/site.blade.php.
   (Ménage facultatif : supprimer ensuite ce dossier public/halloween/
    et resources/views/partials/halloween.blade.php.)

   Toutes les classes sont préfixées « hw- ».
   Le décor ne capte jamais les clics, sauf les zones cliquables
   (chauves-souris et araignées).
   ===================================================================== */

#hw-root,
#hw-root * {
    pointer-events: none;
}

/* Zone cliquable des chauves-souris / araignées (visibleFill : ignorée quand l'élément est masqué) */
#hw-root .hw-hit .hw-hitbox {
    pointer-events: visibleFill;
    cursor: crosshair;
}

.hw-hitbox {
    fill: transparent;
    stroke: none;
}

.hw-dead {
    visibility: hidden;
}

/* ---------- Fond teinté + liseré sous l'en-tête (décor complet) ---------- */
.hw-tint {
    position: fixed;
    inset: 0;
    z-index: -9; /* juste au-dessus du fond du site (-10), sous le contenu */
    background: linear-gradient(
        to bottom,
        rgba(124, 58, 237, 0.16) 0%,
        rgba(124, 58, 237, 0.05) 30%,
        transparent 50%,
        rgba(234, 88, 12, 0.05) 70%,
        rgba(234, 88, 12, 0.16) 100%
    );
}

body:has(#hw-root.hw-full) > header {
    box-shadow: 0 2px 0 0 rgba(249, 115, 22, 0.85);
}

/* ---------- « 🎃 Joyeux Halloween ! » à côté du titre ---------- */
.hw-greet {
    display: inline-block;
    margin-left: 0.4em;
    font-size: clamp(0.95rem, 0.4em, 1.75rem);
    font-weight: 600;
    letter-spacing: normal;
    color: #fb923c;
    white-space: nowrap;
    vertical-align: middle;
    text-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

/* ---------- Toiles d'araignée (sous l'en-tête) ---------- */
.hw-web {
    position: fixed;
    top: var(--hw-top, 0px);
    z-index: 41;
    width: 210px;
    height: 210px;
    opacity: 0.45;
    overflow: visible;
}

.hw-web path {
    fill: none;
    stroke: #e7e5e4;
    stroke-width: 1.1;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.hw-web-l { left: 0; }
.hw-web-r { right: 0; transform: scaleX(-1); }
.hw-web-mini { width: 150px; height: 150px; }

/* ---------- Araignée pendue à son fil ---------- */
.hw-hang {
    position: fixed;
    top: var(--hw-top, 0px);
    right: 64px;
    z-index: 42;
    width: 52px;
}

.hw-mini .hw-hang { right: 44px; }

.hw-thread {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 90px;
    margin-left: -0.5px;
    background: rgba(231, 229, 228, 0.65);
}

.hw-spider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(90px);
}

.hw-spider svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    transform-origin: 50% 0;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.22));
}

/* ---------- Chauves-souris ---------- */
.hw-bat {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 43;
    transform: translateX(-200px);
    will-change: transform;
}

.hw-bat svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    fill: #241a2e;
    stroke: rgba(196, 181, 253, 0.35);
    stroke-width: 0.8;
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.45));
}

.hw-wing { transform-box: fill-box; }
.hw-wing-l { transform-origin: 100% 30%; }
.hw-wing-r { transform-origin: 0% 30%; }

/* ---------- Citrouilles ---------- */
.hw-pumpkin {
    position: fixed;
    bottom: 10px;
    z-index: 41;
    width: 96px;
    filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.6));
}

.hw-pumpkin-l { left: 12px; }
.hw-pumpkin-r { right: 12px; }

.hw-pumpkin svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Éclatement : tache, coulures, gouttes, bonbons ---------- */
.hw-splat {
    position: fixed;
    z-index: 44;
    width: 0;
    height: 0;
}

.hw-splat-svg {
    position: absolute;
    overflow: visible;
}

.hw-drip {
    position: absolute;
    height: 0;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(to bottom, #7a000e, #c4001c 70%, #6a000c);
}

.hw-drip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 160%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e0102a, #6a000c);
}

.hw-drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff2a3d, #7a000e 70%);
}

.hw-candy {
    position: fixed;
    z-index: 45;
    margin: -11px 0 0 -11px;
    font-size: 22px;
    line-height: 1;
}

/* ---------- Mobile : on allège pour ne pas cacher le contenu ---------- */
@media (max-width: 640px) {
    .hw-web-l,
    .hw-pumpkin,
    .hw-bat-0 {
        display: none;
    }

    .hw-web,
    .hw-web-mini {
        width: 110px;
        height: 110px;
    }

    .hw-hang,
    .hw-mini .hw-hang {
        right: 30px;
        width: 38px;
    }
}

/* ---------- Animations réduites : rien ne bouge, pas de chauves-souris ---------- */
@media (prefers-reduced-motion: reduce) {
    .hw-bat,
    .hw-splat,
    .hw-candy {
        display: none !important;
    }
}

/* ---------- Rien à l'impression ---------- */
@media print {
    #hw-root,
    .hw-greet {
        display: none !important;
    }

    body > header {
        box-shadow: none !important;
    }
}
