/* Overlay centralizado com flex (mais confiável em mobile) */
.loading-overlay {
    position: fixed;
    inset: 0;                     /* top:0; left:0; right:0; bottom:0 */
    height: 100dvh;               /* evita bug da barra do navegador no mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    animation: fadeIn 0.3s ease-in;
    padding: 20px;                /* espaço para textos em telas pequenas */
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Spinner container: centralizado por flex, relativo para partículas absolutas */
.spinner-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Anéis girantes (não usam translate para centralização) */
.spinner-ring,
.spinner-ring-inner {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Anel externo */
.spinner-ring {
    width: 160px;
    height: 160px;
    border: 4px solid transparent;
    border-top: 4px solid #ff8c00;
    border-right: 4px solid #ffa500;
    animation: spinRing 2s linear infinite;
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Anel interno */
.spinner-ring-inner {
    width: 140px;
    height: 140px;
    border: 3px solid transparent;
    border-bottom: 3px solid rgba(255,140,0,0.5);
    border-left: 3px solid rgba(255,165,0,0.5);
    animation: spinRingInner 1.5s linear infinite reverse;
}

@keyframes spinRingInner {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Logo central — usa transform-origin e anima apenas escala/efeitos */
.mountain-logo {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    /* animação aplicada aqui (apenas scale) */
    animation: mountainPulse 3s ease-in-out infinite;
}

.mountain-logo img.wolf-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(255,140,0,0.25));
}

@keyframes mountainPulse {
    0%, 100% { transform: scale(1); }
    50%     { transform: scale(1.05); }
}

/* Partículas de energia: absolutas em relação a spinner-container */
.energy-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ff8c00;
    border-radius: 50%;
    opacity: 0;
    animation: energyBurst 2s ease-out infinite;
}

/* posições e delays das partículas */
.energy-particle:nth-child(3)  { top: 18%;  left: 18%;  animation-delay: 0s;  --tx:-30px; --ty:-30px; }
.energy-particle:nth-child(4)  { top: 30%;  right: 18%; animation-delay: 0.3s; --tx:30px;  --ty:-25px; }
.energy-particle:nth-child(5)  { bottom: 30%; left: 25%; animation-delay: 0.6s; --tx:-25px; --ty:30px; }
.energy-particle:nth-child(6)  { bottom: 25%; right: 25%; animation-delay: 0.9s; --tx:25px;  --ty:25px; }

@keyframes energyBurst {
    0% {
        opacity: 0;
        transform: scale(0) translate(0,0);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.5) translate(var(--tx, 20px), var(--ty, -20px));
    }
}

/* Texto de loading e mensagem */
.loading-text {
    color: #ff8c00;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
    margin-bottom: 6px;
    animation: textPulse 2s ease-in-out infinite;
    text-align: center;
}

@keyframes textPulse {
    0%,100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.loading-message {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 6px;
    text-align: center;
    max-width: 320px;
}

.motto {
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* Responsivo: reduz tamanhos em telas pequenas */
@media (max-width: 480px) {
    .spinner-container {
        width: 130px;
        height: 130px;
        margin-bottom: 12px;
    }
    .spinner-ring { width: 120px; height: 120px; border-width: 3px; }
    .spinner-ring-inner { width: 100px; height: 100px; border-width: 2px; }
    .mountain-logo { width: 90px; height: 90px; }
    .loading-text { font-size: 16px; }
    .loading-message { font-size: 13px; max-width: 260px; }
}

/* opcional: melhora performance de animação (GPU) */
.mountain-logo,
.spinner-ring,
.spinner-ring-inner,
.energy-particle,
.loading-text {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}
