/*
 * ═══════════════════════════════════════════════════════════════
 *  BLOOD MOON — Visual Override Layer
 *  bloodmoon.css  |  Fight Point World Map
 *
 *  SAFE: Only adds rules under the class "blood-moon-active".
 *        Zero existing selectors are modified or removed.
 *        Loaded after style.css so specificity wins cleanly.
 * ═══════════════════════════════════════════════════════════════
 */

/* ── 1. Force Night-Mode visuals on the map image ── */
/* Mirrors exactly what body.night-mode does in style.css, but wins
   regardless of what time-of-day class is present. */
body.blood-moon-active .main-image {
    filter: brightness(0.38) contrast(1.25) saturate(0.5) hue-rotate(220deg) sepia(0.08) !important;
    transition: filter 3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ── 2. Force city lights on (mirroring night-mode behaviour) ── */
body.blood-moon-active .map-light {
    opacity: 1 !important;
    animation: flicker 5s infinite alternate !important;
}

/* ── 3. Cloud shadows to moonlight angle (mirroring night-mode) ── */
body.blood-moon-active .cloud-container.layer-high .cloud-shadow {
    transform: translate3d(-50px, 50px, 0) !important;
    opacity: 0.15 !important;
}
body.blood-moon-active .cloud-container.layer-mid .cloud-shadow {
    transform: translate3d(-35px, 35px, 0) !important;
    opacity: 0.20 !important;
}
body.blood-moon-active .cloud-container.layer-low .cloud-shadow {
    transform: translate3d(-20px, 25px, 0) !important;
    opacity: 0.25 !important;
}

/* ── 4. The red tint — using the existing empty #weatherOverlay ──
        pointer-events: none  → never blocks map clicks/drags/pans
        z-index: 26           → above clouds (27 base), below pins (29+)
        Radial gradient fades from top so edges stay clear        */
body.blood-moon-active #weatherOverlay {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 26 !important;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(160, 20, 20, 0.13) 0%,
        rgba(120, 10, 10, 0.09) 45%,
        rgba(80, 5, 5, 0.05) 75%,
        transparent 100%
    ) !important;
    animation: bloodMoonBreath 12s ease-in-out infinite !important;
    will-change: opacity !important;
}

/* Very slow, gentle pulse — barely perceptible, purely atmospheric */
@keyframes bloodMoonBreath {
    0%   { opacity: 0.75; }
    50%  { opacity: 1.0;  }
    100% { opacity: 0.75; }
}

/* ── 5. Subtle header accent — thin red pulse on the border line ── */
body.blood-moon-active .header::after {
    background: linear-gradient(to right, #7f1d1d, #450a0a, #7f1d1d) !important;
    opacity: 1 !important;
    animation: bloodMoonHeaderPulse 8s ease-in-out infinite !important;
}

@keyframes bloodMoonHeaderPulse {
    0%   { opacity: 0.5; }
    50%  { opacity: 1.0; }
    100% { opacity: 0.5; }
}

/* ── 6. GM control panel ── */
#fp-blood-moon-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 99999;
    background: linear-gradient(160deg, rgba(20, 4, 4, 0.97), rgba(8, 2, 2, 0.98));
    border: 1px solid rgba(160, 20, 20, 0.7);
    border-left: 3px solid #7f1d1d;
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 220px;
    font-family: 'Cinzel', serif;
    box-shadow: 0 4px 30px rgba(0,0,0,0.95), -4px 0 20px rgba(160,20,20,0.12);
    display: none;
    pointer-events: all;
}

#fp-blood-moon-panel .bm-title {
    font-size: 11px;
    color: #7f1d1d;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#fp-blood-moon-panel .bm-status {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 14px;
    font-family: sans-serif;
}

#fp-blood-moon-panel .bm-status strong {
    color: #fff;
}

#fp-blood-moon-panel .bm-btn {
    width: 100%;
    padding: 9px 14px;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
    margin-bottom: 8px;
    display: block;
}

#fp-blood-moon-panel .bm-btn-activate {
    background: rgba(127, 29, 29, 0.35);
    border-color: #7f1d1d;
    color: #fca5a5;
}
#fp-blood-moon-panel .bm-btn-activate:hover {
    background: rgba(185, 28, 28, 0.6);
    border-color: #dc2626;
    color: #fff;
    box-shadow: 0 0 16px rgba(220,38,38,0.35);
}

#fp-blood-moon-panel .bm-btn-deactivate {
    background: rgba(20, 30, 60, 0.35);
    border-color: rgba(37,99,235,0.4);
    color: #7ab8ff;
}
#fp-blood-moon-panel .bm-btn-deactivate:hover {
    background: rgba(30,58,138,0.5);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 12px rgba(37,99,235,0.3);
}

#fp-blood-moon-panel .bm-close {
    font-size: 10px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    font-family: sans-serif;
    display: block;
    margin-top: 4px;
    text-align: center;
    width: 100%;
    transition: color 0.2s;
}
#fp-blood-moon-panel .bm-close:hover { color: #aaa; }
