:root {
    --disco-pink: #FF00FF;
    --disco-purple: #8A2BE2;
    --disco-blue: #00BFFF;
    --disco-green: #00FF7F;
    --disco-orange: #FF4500;
    --disco-yellow: #FFFF00;
    --dark-bg: #1A1A2E;
    --neon-text: #FFFFFF;
    --card-bg: #2D2D44;
}

/* Personalização da barra de scroll para a página inteira - Tema Roxo */
html {
    scrollbar-width: thin;
    scrollbar-color: #8A2BE2 #1A1A2E;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0F0C29, #302B63, #24243E);
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-text);
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
    
    /* Personalização do scrollbar para Webkit (Chrome, Safari, Edge) */
    scrollbar-width: thin;
    scrollbar-color: #8A2BE2 #1A1A2E;
}

/* Para Webkit (Chrome, Safari, Edge) */
body::-webkit-scrollbar {
    width: 14px;
}

body::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #1A1A2E, #2D2D44, #1A1A2E);
    border-left: 1px solid rgba(138, 43, 226, 0.3);
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8A2BE2, #FF00FF, #8A2BE2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 15px rgba(138, 43, 226, 0.6),
        inset 0 0 8px rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF00FF, #8A2BE2, #FF00FF);
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

body::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #8A2BE2, #6A1B9A, #8A2BE2);
}

body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Efeito de brilho na borda da página quando há scroll */
body::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 14px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(138, 43, 226, 0.1) 20%, 
        rgba(255, 0, 255, 0.2) 50%, 
        rgba(138, 43, 226, 0.1) 80%, 
        transparent 100%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.scrollable::after {
    opacity: 1;
}

/* Para Firefox */
body {
    scrollbar-width: thin;
    scrollbar-color: #8A2BE2 #1A1A2E;
}

/* Animações suaves para o scroll */
html {
    scroll-behavior: smooth;
}

/* Efeito de pulso no scrollbar quando a página carrega */
@keyframes scrollbarPulse {
    0%, 100% {
        box-shadow: 
            0 0 15px rgba(138, 43, 226, 0.6),
            inset 0 0 8px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(255, 0, 255, 0.8),
            inset 0 0 12px rgba(255, 255, 255, 0.6);
    }
}

body::-webkit-scrollbar-thumb {
    animation: scrollbarPulse 3s ease-in-out 1;
}

a{
    text-decoration: none;
}


#messages-container {
    position: fixed;
    top: 160px;
    right: 20px;
    /* O overlay tem 9999, então a mensagem precisa ser maior que isso */
    z-index: 10000; 
    max-width: 400px;
    width: 100%;
    pointer-events: auto;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-out;
}

.alert-success {
    background: #28a745 !important;   /* Cor verde vibrante */
    color: white;
    border: 2px solid #218838; /* Cor mais escura para a borda */
    font-weight: bold;
    animation: bounceIn 0.6s ease-out, glowEffect 1s ease-in-out infinite; /* Efeito de brilho */
}

.alert-error {
    background: #f44336;
    color: white;
    border: 1px solid #da190b;
}

.close-message {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 15px;
}

/* Efeito de animação de entrada */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animação de entrada com efeito de "pulo" */
@keyframes bounceIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Efeito de brilho pulsante */
@keyframes glowEffect {
    0% {
        text-shadow: 0 0 5px #ffffff, 0 0 10px #28a745, 0 0 15px #28a745;
    }
    50% {
        text-shadow: 0 0 10px #ffffff, 0 0 20px #28a745, 0 0 30px #28a745;
    }
    100% {
        text-shadow: 0 0 5px #ffffff, 0 0 10px #28a745, 0 0 15px #28a745;
    }
}

/* Overlay de carregamento */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Ajuste no ícone de loading (somente o ícone gira) */
.loading-spinner {
    color: white;
    font-size: 2rem;
    display: flex;       /* Adicionado para alinhar ícone e texto */
    align-items: center; /* Centraliza verticalmente */
    gap: 15px;          /* Espaço entre o ícone e o texto */
    /* animation: spin 1s infinite linear; <--- REMOVIDO DAQUI */
}

.loading-spinner i {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timezone-abbr{
    color: #00FF7F;
    font-size: .78rem;
}


@media (max-width: 768px) {
    #messages-container {
    position: fixed;
    top: 140px;
    right: 3px;
    z-index: 10000; 
    max-width: 350px;
    width: 100%;
    pointer-events: auto;
}
}

/* 1. CORREÇÃO GLOBAL PARA O IOS (Safari) */
@supports (-webkit-touch-callout: none) {
    /* Forçamos o HTML e o BODY a terem uma cor sólida escura. 
       Isso elimina o branco no "overscroll" (efeito elástico). */
    html, body {
        background-color: #0F0C29 !important;
        /* Garante que o corpo ocupe toda a altura sem vazar */
        min-height: 100% !important;
        height: auto !important;
        overscroll-behavior: none !important;
    }

    /* Usamos o ::before como o fundo real, fixo na tela.
       Isso evita que o gradiente "quebre" em páginas longas. */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #0F0C29 0%, #302B63 50%, #24243E 100%) !important;
        z-index: -10; /* Fica atrás de absolutamente tudo */
        pointer-events: none;
        /* Força a renderização por GPU no iPhone */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* 2. AJUSTE DE SAFE AREAS (NOTCH) */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        /* Reforço da cor caso o ::before falhe por um milésimo de segundo */
        background-color: #0F0C29;
    }
}

/* 3. RESET DE PARTICULAS PARA IOS 
   Se o fundo branco persistir, o culpado é o 'blur' das partículas. 
   O código abaixo suaviza o peso delas no iPhone. */
@supports (-webkit-touch-callout: none) {
    .particle-1, .particle-2, .particle-3 {
        /* O iOS sofre para renderizar blurs muito altos (20px-30px) 
           Reduzir um pouco ajuda na performance do fundo. */
        filter: blur(10px) !important;
        -webkit-filter: blur(10px) !important;
        /* Impede que as partículas causem 'repaints' constantes */
        will-change: transform;
    }
}


/* WIDGET GAMING EXPERIENCE */
.tournament-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(40, 40, 40, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-left: 4px solid #03dac6;
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(98, 0, 234, 0.2);
    animation: slideIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    min-width: 250px;
}

.widget-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.live-indicator {
    color: #ff4d4d;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
    animation: pulse-glow 1.5s infinite;
}

.tournament-label {
    color: #03dac6;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0;
    opacity: 0.9;
}

.tournament-name {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 2px 0 0 0;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-btn {
    background: linear-gradient(45deg, var(--disco-pink), var(--disco-purple));
    color: #fff !important;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(98, 0, 234, 0.4);
}

.widget-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(3, 218, 198, 0.6);
    background: #03dac6;
}

/* ANIMAÇÕES */
@keyframes pulse-glow {
    0% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.6; filter: brightness(1.5); }
    100% { opacity: 1; filter: brightness(1); }
}

@keyframes slideIn {
    from { transform: translateX(120%) skewX(-10deg); opacity: 0; }
    to { transform: translateX(0) skewX(0deg); opacity: 1; }
}

/* MENSAGEM NAO LIDA */
/* CONTAINER DO ÍCONE DE CHAT */
.nav-item-tournament {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chat-trigger {
    position: fixed;
    bottom: 80px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(40, 40, 40, 0.95) 100%);
    animation: slideIn 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Efeito ao passar o mouse no ícone */
.chat-trigger:hover {
    color: #03dac6;
    transform: translateY(-2px);
}

/* BADGE DE NOTIFICAÇÃO (A BOLINHA) */
.chat-badge-notify {
    position: absolute;
    top: -5px;
    right: -5px;
    color: #000; 
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #121212;
    box-shadow: 0 0 6px rgba(218, 17, 3, 0.349);
    z-index: 10;
    pointer-events: none; 
    

    
    color: #ff4d4d;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
    animation: pulse-glow 1.5s infinite;
}


/* Ajuste para telas menores (Mobile) */
@media (max-width: 768px) {
    .nav-item-tournament {
        bottom: 25px;
        right: 10px;
    }

    .chat-trigger {
        font-size: 18px;
        width: 40px;
        height: 40px;
        bottom: 80px;
    }
    
    .chat-badge-notify {
        min-width: 16px;
        height: 18px;
        font-size: 11px;
    }

    .tournament-widget {
        position: fixed;
        bottom: 30px;
        right: 7px;
    }
}