/* ==========================================================================
   LEGION ARENA | CINEMATIC GLADIATOR INTRO ANIMATION (MAXIMUS STRIKE & FIRE)
   Ultra-High Performance 60 FPS, Zero-Lag, Hardware-Accelerated
   ========================================================================== */

#legionGladiatorOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    user-select: none;
    -webkit-user-select: none;
}

#legionGladiatorOverlay.active {
    opacity: 1;
    visibility: visible;
}

#legionGladiatorOverlay.closing {
    opacity: 0;
    transform: scale(1.04);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Background Scene with Cinematic Motion */
.gladiator-scene-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.gladiator-bg-art {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transform: scale(1.18);
    filter: brightness(0.7) contrast(1.15) saturate(1.1);
    transition: transform 3.5s cubic-bezier(0.1, 0.9, 0.2, 1), filter 1.5s ease;
    will-change: transform, filter;
}

#legionGladiatorOverlay.active .gladiator-bg-art {
    transform: scale(1.02);
    filter: brightness(0.95) contrast(1.25) saturate(1.25);
}

/* Vignette & Torchlight Ambience */
.gladiator-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, rgba(255, 100, 20, 0.12) 0%, rgba(10, 8, 12, 0.75) 60%, rgba(0, 0, 0, 0.96) 100%);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.gladiator-torch-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 52% 40%, rgba(255, 120, 30, 0.25) 0%, transparent 65%);
    pointer-events: none;
    animation: torchFlicker 2.4s infinite ease-in-out;
}

@keyframes torchFlicker {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

/* Impact Shockwave Flash */
.gladiator-impact-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 52% 42%, rgba(255, 230, 180, 0.95) 0%, rgba(255, 100, 20, 0.7) 40%, transparent 80%);
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 10;
}

.gladiator-impact-flash.strike {
    animation: flashBurst 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes flashBurst {
    0% { opacity: 0; transform: scale(0.6); }
    15% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.3); }
}

/* Camera Shake on Strike */
.gladiator-scene-container.shake {
    animation: gladiatorImpactShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gladiatorImpactShake {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    15% { transform: translate3d(-10px, 8px, 0) rotate(-0.7deg); }
    30% { transform: translate3d(8px, -7px, 0) rotate(0.6deg); }
    45% { transform: translate3d(-6px, 5px, 0) rotate(-0.4deg); }
    60% { transform: translate3d(4px, -3px, 0) rotate(0.2deg); }
    75% { transform: translate3d(-2px, 2px, 0) rotate(-0.1deg); }
}

/* Fullscreen Canvas Particle System (Fire Embers, Sparks, Shockwave) */
#gladiatorCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
}

/* Content Container (Title & CTAs) */
.gladiator-content {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 0 20px 45px;
    box-sizing: border-box;
    text-align: center;
    pointer-events: auto;
}

/* STRIKE BADGE (Appears right on sword impact) */
.gladiator-strike-badge {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    padding: 6px 18px;
    background: rgba(220, 38, 38, 0.45);
    border: 1.5px solid #ef4444;
    border-radius: 999px;
    color: #fef08a;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.8), inset 0 0 15px rgba(254, 240, 138, 0.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 25;
}

.gladiator-strike-badge.ignite {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* BURNING FLAMING TEXT: "LEGION ARENA COMMUNITY" */
.gladiator-title-box {
    margin-bottom: 22px;
    max-width: 1100px;
    width: 100%;
    opacity: 0;
    transform: translateY(35px) scale(0.95);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gladiator-title-box.ignited {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Tagline Above Title */
.gladiator-subtitle-top {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(12px, 2vw, 16px);
    font-weight: 800;
    letter-spacing: 5px;
    color: #f59e0b;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.8);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gladiator-subtitle-top::before,
.gladiator-subtitle-top::after {
    content: '';
    width: clamp(25px, 6vw, 60px);
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #f59e0b);
}
.gladiator-subtitle-top::after {
    background: linear-gradient(90deg, #f59e0b, transparent);
}

/* FIRE TEXT MAIN HEADING */
.gladiator-fire-text {
    font-family: 'Orbitron', 'Cinzel', 'Outfit', sans-serif;
    font-weight: 900;
    font-size: clamp(2.2rem, 6.2vw, 5.2rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.8vw, 6px);
    margin: 0;
    background: linear-gradient(180deg, #ffffff 0%, #ffea79 25%, #ff8800 60%, #e11d48 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(255, 100, 0, 0.9)) drop-shadow(0 0 50px rgba(239, 68, 68, 0.7));
    position: relative;
    animation: firePulse 1.8s infinite alternate ease-in-out;
}

@keyframes firePulse {
    0% {
        filter: drop-shadow(0 0 20px rgba(255, 120, 20, 0.8)) drop-shadow(0 0 45px rgba(239, 68, 68, 0.6));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 32px rgba(255, 200, 50, 0.95)) drop-shadow(0 0 65px rgba(255, 70, 20, 0.9));
        transform: scale(1.012);
    }
}

.gladiator-subtitle-bottom {
    font-family: 'Inter', sans-serif;
    font-size: clamp(11px, 1.6vw, 14px);
    font-weight: 700;
    letter-spacing: 2.5px;
    color: #e4e4e7;
    text-transform: uppercase;
    margin-top: 10px;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
    opacity: 0.95;
}

/* Action Controls (Enter Arena / Skip / Sound) */
.gladiator-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.2s;
}

.gladiator-title-box.ignited + .gladiator-actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-enter-arena {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: 1.5px solid #fca5a5;
    color: #fff;
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-enter-arena:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.9), inset 0 0 16px rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

/* Top Corner Navigation Buttons (Sound & Skip) */
.gladiator-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 30;
    pointer-events: auto;
}

.gladiator-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(15, 18, 26, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e4e4e7;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.gladiator-pill-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fff;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .gladiator-content {
        padding-bottom: 30px;
    }
    .gladiator-top-bar {
        top: 14px;
        left: 14px;
        right: 14px;
    }
    .gladiator-pill-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    .btn-enter-arena {
        padding: 10px 24px;
        font-size: 13px;
    }
}
