/* ==========================================================================
   Wargame Combat DVR Replay Animations & Visual FX Engine
   ========================================================================== */

/* 1. Camera / Arena Screen Shake (Hardware-accelerated 3D damped spring) */
@keyframes dvr-screen-shake {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    12% { transform: translate3d(-6px, 3px, 0) rotate(-0.6deg); }
    24% { transform: translate3d(5px, -4px, 0) rotate(0.5deg); }
    36% { transform: translate3d(-4px, -2px, 0) rotate(-0.3deg); }
    50% { transform: translate3d(3px, 2px, 0) rotate(0.2deg); }
    68% { transform: translate3d(-1.5px, 1px, 0) rotate(-0.1deg); }
    84% { transform: translate3d(1px, -0.5px, 0) rotate(0deg); }
}
.dvr-shake-active {
    animation: dvr-screen-shake 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* 2. EMP Lockout Glitch & Electric Arc */
@keyframes emp-lockout-border {
    0%, 100% {
        box-shadow: 0 0 15px rgba(244, 63, 94, 0.7), inset 0 0 15px rgba(244, 63, 94, 0.4);
        border-color: rgba(244, 63, 94, 0.9);
        filter: hue-rotate(0deg) saturate(1.8);
    }
    50% {
        box-shadow: 0 0 35px rgba(244, 63, 94, 1), inset 0 0 25px rgba(244, 63, 94, 0.8);
        border-color: rgba(255, 255, 255, 1);
        filter: hue-rotate(-25deg) saturate(0.5);
    }
}
.dvr-emp-locked {
    animation: emp-lockout-border 0.8s infinite ease-in-out;
}

/* 3. Overclock Thruster / Afterburner Flame */
@keyframes overclock-flame-surge {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 40px rgba(239, 68, 68, 0.5);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 1), 0 0 70px rgba(239, 68, 68, 0.8);
        transform: scale(1.06);
    }
}
.dvr-overclock-active {
    animation: overclock-flame-surge 0.6s infinite alternate ease-in-out;
}

/* 4. Shield Dome & Deflection Shockwave */
@keyframes shield-deflection-ripple {
    0% {
        transform: scale(0.9);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.9);
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
        box-shadow: 0 0 40px 20px rgba(6, 182, 212, 0);
    }
}
.dvr-shield-ripple {
    position: absolute;
    inset: -10px;
    border-radius: 9999px;
    border: 3px solid rgba(6, 182, 212, 0.9);
    animation: shield-deflection-ripple 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
    pointer-events: none;
}

/* 5. Floating Combat Text (FCT with Spring Bounce & Perspective Tilt) */
@keyframes fct-float-up {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.65) rotate(-3deg);
        filter: blur(1px);
    }
    18% {
        opacity: 1;
        transform: translateY(-8px) scale(1.2) rotate(1deg);
        filter: blur(0);
    }
    32% {
        transform: translateY(-18px) scale(1.0) rotate(0deg);
    }
    80% {
        opacity: 0.95;
        transform: translateY(-40px) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.85);
        filter: blur(1.5px);
    }
}
.dvr-fct-item {
    position: absolute;
    font-weight: 900;
    text-transform: uppercase;
    pointer-events: none;
    animation: fct-float-up 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 15px currentColor;
    z-index: 50;
    white-space: nowrap;
    user-select: none;
    will-change: transform, opacity;
}

/* 6. Block Strike Supernova Flare */
@keyframes supernova-burst {
    0% {
        transform: scale(0);
        opacity: 1;
        background: radial-gradient(circle, rgba(255, 215, 0, 1) 0%, rgba(245, 158, 11, 0.8) 40%, transparent 80%);
    }
    100% {
        transform: scale(3.5);
        opacity: 0;
        background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(245, 158, 11, 0) 70%, transparent 100%);
    }
}
.dvr-supernova-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: supernova-burst 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 45;
}

/* 7. Scrubber Notches with Spring Hover */
.dvr-notch {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 14px;
    border-radius: 3px;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    z-index: 25;
    pointer-events: auto;
}
.dvr-notch:hover {
    transform: translate(-50%, -50%) scale(1.85);
    filter: brightness(1.5);
    z-index: 30;
}
.dvr-notch-red { background: #f43f5e; box-shadow: 0 0 10px #f43f5e; }
.dvr-notch-amber { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.dvr-notch-cyan { background: #06b6d4; box-shadow: 0 0 10px #06b6d4; }
.dvr-notch-purple { background: #a855f7; box-shadow: 0 0 10px #a855f7; }
.dvr-notch-gold { background: #ffd700; box-shadow: 0 0 14px #ffd700; width: 10px; height: 18px; border-radius: 4px; }

/* 7.5. Key Events Highlight Chips */
.dvr-highlight-chip {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dvr-highlight-chip:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.dvr-highlight-chip.active-highlight {
    transform: scale(1.05);
}
.dvr-highlight-chip-red.active-highlight {
    background: rgba(244, 63, 94, 0.2) !important;
    border-color: rgba(244, 63, 94, 0.8) !important;
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}
.dvr-highlight-chip-amber.active-highlight {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: rgba(245, 158, 11, 0.8) !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}
.dvr-highlight-chip-cyan.active-highlight {
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: rgba(6, 182, 212, 0.8) !important;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}
.dvr-highlight-chip-gold.active-highlight {
    background: rgba(255, 215, 0, 0.25) !important;
    border-color: rgba(255, 215, 0, 0.9) !important;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.5);
}

/* 8. YouTube-Style Scrubber & Tooltip Extras */
.dvr-hover-card {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 12px;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 40;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
}
.dvr-hover-card::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

/* Scrubber thumb glow */
#dvr-scrubber-thumb {
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
#dvr-scrubber-track:hover #dvr-scrubber-thumb {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.9);
}

/* Clan emblem pulse */
.dvr-clan-pillar {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.dvr-clan-pillar.leading {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
}

/* Post-Mortem Backdrop & Forensic Card */
#dvr-postmortem-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(2, 6, 23, 0.85);
    z-index: 55;
    transition: opacity 0.25s ease;
}

#dvr-postmortem-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, calc(100% - 2.5rem));
    max-height: calc(100% - 2.5rem);
    background-color: #0b0f19 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.98), 0 0 40px rgba(99, 102, 241, 0.2) !important;
    z-index: 60;
    overflow-y: auto;
}

@keyframes dvr-postmortem-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
#dvr-postmortem-card.active {
    animation: dvr-postmortem-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Clan Selector Pills & Tactical Intel Drawer */
.dvr-clan-pill {
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}
.dvr-clan-pill:hover {
    transform: translateY(-1px);
}
.dvr-clan-pill.active {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.8) !important;
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.45) !important;
}
.dvr-clan-pill.is-my-clan {
    border-color: rgba(245, 158, 11, 0.5) !important;
}
#dvr-clan-intel-drawer.open {
    transform: translateX(0) !important;
}

