/* ============================================================
   battle.css — Battle result dialog, war loader with animations
   ============================================================ */

/* DIALOGO DE RESULTADO DE BATALHA */
#battle-dialog-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 200;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

#battle-dialog {
    min-width: 320px;
    max-width: 400px;
}


#battle-result-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

#battle-result-title {
    font-size: 16px;
    margin-bottom: 0;
}


#battle-result-content {
    text-align: left;
    font-size: 14px;
    color: #ccc;
}

/* WAR LOADER */
#worker-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.worker-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.worker-loading-box p {
    color: #f0c040;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(240, 192, 64, 0.7);
    animation: war-loader-pulse-text 1.5s ease-in-out infinite;
}

/* Container do loader de guerra */
.war-loader {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Anéis orbitais */
.war-loader-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.war-loader-ring-1 {
    width: 80px;
    height: 80px;
    border-top-color: #f0c040;
    border-right-color: rgba(240, 192, 64, 0.3);
    animation: war-loader-spin 1s linear infinite;
}

.war-loader-ring-2 {
    width: 60px;
    height: 60px;
    border-bottom-color: #c8922a;
    border-left-color: rgba(200, 146, 42, 0.3);
    animation: war-loader-spin 0.7s linear infinite reverse;
}

/* Núcleo central com ícone */
.war-loader-core {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(240,192,64,0.15) 0%, transparent 70%);
    animation: war-loader-pulse 1.5s ease-in-out infinite;
}

.war-loader-icon {
    width: 28px;
    height: 28px;
    filter: invert(80%) sepia(60%) saturate(400%) hue-rotate(5deg) brightness(110%);
    opacity: 0.95;
}

@keyframes war-loader-spin {
    to { transform: rotate(360deg); }
}

@keyframes war-loader-pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes war-loader-pulse-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Versão compacta para loadings internos de diálogos */
.war-loader-sm {
    width: 48px;
    height: 48px;
    margin: 0 auto;
}

.war-loader-sm .war-loader-ring-1 {
    width: 48px;
    height: 48px;
}

.war-loader-sm .war-loader-ring-2 {
    width: 34px;
    height: 34px;
}

.war-loader-sm .war-loader-core {
    width: 22px;
    height: 22px;
}

.war-loader-sm .war-loader-icon {
    width: 18px;
    height: 18px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    /* Dialogo de batalha mobile */
    #battle-dialog-overlay {
        top: 52px;
        bottom: 10px;
        right: 44px;
        padding: 8px;
        align-items: flex-start;
        overflow-y: auto;
    }

    #battle-dialog {
        margin: 10px auto;
        min-width: auto;
        max-width: calc(100% - 20px);
        padding: 20px;
    }

    #battle-result-icon {
        font-size: 40px;
    }

    #battle-result-title {
        font-size: 16px;
    }
}
