/* =========================================
   BATALHA DA POINT - RANKING PREMIUM
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,700;0,900;1,900&family=Oswald:wght@500;700&display=swap');

/* EXTERMINA qualquer resquício de fundo branco ou borda do modal da BATALHA */
#batalhaEventModal .modal-content,
#batalhaEventModal .modal-body {
    /* Fundo Slate muito elegante */
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5) !important;
}

.batalha-ecosystem {
    background: #0a0a0a;
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #050505 100%);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    padding: 30px 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Textura Estilo Cartaz */
.batalha-ecosystem::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/stardust.png');
    opacity: 0.4; pointer-events: none; z-index: 0;
}

/* Cabeçalho do Evento */
.bda-header {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px dashed rgba(255,255,255,0.1);
}
.bda-championship {
    display: inline-block;
    background: #ffffff;
    color: #000000;
    padding: 4px 16px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-radius: 2px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 0px #ff7b00;
}
.bda-title {
    font-size: 3.8rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    line-height: 0.9;
    letter-spacing: -2px;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.5);
}

.bda-filters { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.bda-select {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    color: white; font-family: 'Oswald', sans-serif; text-transform: uppercase;
    padding: 6px 20px; font-size: 1rem; cursor: pointer; transition: all 0.3s ease;
}
.bda-select:hover { border-color: #ff7b00; }
.bda-select option { background: #111; }

/* === CARDS DE LUTA & ANIMAÇÕES PREMIUM === */
.bda-card {
    position: relative;
    display: flex;
    border-radius: 6px;
    margin-bottom: 16px;
    z-index: 10;
    box-shadow: 0 8px 15px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
.bda-card:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.9);
    z-index: 50;
}
.bda-card:hover .bda-photo { transform: scale(1.08); }

/* LÓGICA ALTERNADA: ESQUERDA VS DIREITA */
.bda-card.img-left { flex-direction: row; }
.bda-card.img-right { flex-direction: row-reverse; }

.bda-card.img-left .bda-info { text-align: left; align-items: flex-start; padding: 0 20px 0 10px; }
.bda-card.img-right .bda-info { text-align: right; align-items: flex-end; padding: 0 10px 0 20px; }

/* Foto Esfumaçada Alternada */
.bda-photo-container {
    height: 100%; width: 180px; position: relative; overflow: hidden;
}
.bda-card-grid .bda-photo-container { width: 110px; }

.bda-card.img-left .bda-photo-container {
    border-radius: 6px 0 0 6px;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}
.bda-card.img-right .bda-photo-container {
    border-radius: 0 6px 6px 0;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

.bda-photo {
    width: 100%; height: 100%; object-fit: cover; object-position: top center;
    filter: contrast(1.15) saturate(1.1) grayscale(10%);
    transition: transform 0.4s ease;
}

/* Adesivos de Rank (Alternados) */
.bda-rank-badge {
    position: absolute; bottom: -8px;
    font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1.3rem;
    padding: 2px 10px; z-index: 20; box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
    border: 2px solid rgba(0,0,0,0.2);
}
.bda-card.img-left .bda-rank-badge { left: -8px; transform: rotate(-4deg); }
.bda-card.img-right .bda-rank-badge { right: -8px; transform: rotate(4deg); }

/* Cores dos Top Ranks e Altura Automática para não vazar texto */
.bda-card-1 { 
    background: linear-gradient(135deg, #cc5500, #ff7b00); 
    min-height: 150px; /* Altura mínima original */
    height: auto !important; /* MÁGICA: O card cresce se o conteúdo pedir espaço! */
    margin-bottom: 25px; 
    padding-bottom: 15px !important; /* Dá um respiro embaixo para a palavra DERROTAS */
}
.bda-card-1 .bda-rank-badge { background: #FFD700; color: #000; font-size: 1.6rem; bottom: -10px; }
.bda-card-1.img-left .bda-rank-badge { left: -10px; }
.bda-card-1 .bda-name { font-size: 2.4rem; text-shadow: 2px 2px 0px rgba(0,0,0,0.3); } /* Reduzi a fonte de 2.8 para 2.4 pra caber o Invicto melhor */

.bda-card-2 { 
    background: linear-gradient(135deg, #09203f, #0d3b66); 
    min-height: 130px; 
    height: auto !important; /* MÁGICA */
    margin-bottom: 30px; 
    padding-bottom: 15px !important; /* Respiro inferior */
}
.bda-card-2 .bda-rank-badge { background: #e0e0e0; color: #000; font-size: 1.4rem; }
.bda-card-2 .bda-name { font-size: 2rem; }

/* Grid e Cores Alternadas (Cards Menores) */
.bda-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bda-card-grid { 
    min-height: 100px; 
    height: auto !important; /* MÁGICA */
    margin-bottom: 0; 
    padding-bottom: 12px !important; 
}
.bda-card-grid .bda-name { font-size: 1.4rem; letter-spacing: -1px; }
.bda-card-grid .bda-rank-badge { background: #222; color: #fff; font-size: 1rem; padding: 2px 8px; }

.bda-bg-green { background: linear-gradient(135deg, #00b09b, #96c93d); }
.bda-bg-purple { background: linear-gradient(135deg, #471069, #874da2); }
.bda-bg-red { background: linear-gradient(135deg, #cb2d3e, #ef473a); }
.bda-bg-teal { background: linear-gradient(135deg, #1d976c, #93f9b9); color: #000 !important; }

/* Textos e Info */
.bda-info { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; z-index: 2; }

.bda-name { 
    font-weight: 900; 
    text-transform: uppercase; 
    line-height: 1; 
    margin-bottom: 6px;
    /* MÁGICA DO ALINHAMENTO DO TÍTULO */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: inherit; /* Puxa o alinhamento da esquerda/direita do pai */
    gap: 8px; /* Espaço entre o nome e o Invicto */
}

/* Proteção para a badge não crescer demais */
.bda-name .badge {
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
    white-space: nowrap;
}

.bda-stats { font-family: 'Oswald', sans-serif; font-size: 1.15rem; font-weight: 500; letter-spacing: 0.5px; color: rgba(255,255,255,0.9); }
.bda-stats span { font-weight: 700; color: #fff; }
.bda-card-grid .bda-stats { font-size: 0.95rem; line-height: 1.2; }

/* A GLORIOSA TAG MVP */
.bda-mvp-badge {
    background: linear-gradient(90deg, #ff0055, #ff7b00);
    color: #fff !important;
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(255,0,85,0.6);
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    animation: mvp-pulse 2s infinite;
}
@keyframes mvp-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,0,85,0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255,0,85,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,0,85,0); }
}

/* =========================================
   ARENA DASHBOARD (3 COLUNAS)
========================================= */
.arena-dashboard-wrapper {
    display: grid;
    grid-template-columns: 280px minmax(400px, 1fr) 280px; 
    gap: 30px;
    padding: 30px;
    align-items: start;
    min-height: 85vh;
    background: transparent; /* Remove o fundo preto antigo */
}

/* Painéis laterais de vidro esfumaçado (Glassmorphism) */
.arena-side-panel {
    background: rgba(30, 41, 59, 0.6); /* Cor Slate 800 com opacidade */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
}

.arena-side-panel::-webkit-scrollbar { width: 6px; }
.arena-side-panel::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.arena-side-title {
    color: #ff7b00;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    text-align: center;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Item: Operador Online */
.online-fighter-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #1a1a1a, #111);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #10b981; /* Verde = Online */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Item: Histórico de Duelo */
.duel-history-card {
    background: linear-gradient(135deg, #1f1c2c, #928DAB); /* Fundo roxo/dark */
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.duel-history-card .vs-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    color: #fff;
    text-transform: uppercase;
}
.duel-history-card .vs-badge {
    color: #ff0055;
    font-size: 0.8rem;
    margin: 0 5px;
}

@media (max-width: 992px) {
    .arena-dashboard-wrapper { grid-template-columns: 1fr; } /* Celular fica 1 coluna só */
}

/* =========================================
   FIX: ARENA PROPORÇÕES E BORDAS
========================================= */

/* Limita o tamanho para não esticar ao infinito, mas ainda ser Largo */
#batalhaEventModal .modal-dialog {
    max-width: 1350px !important;
    width: 95% !important;
}

/* Arranca fora os fundos brancos residuais do Bootstrap */
#batalhaEventModal .modal-content {
    background-color: #050505 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 0 !important;
}

/* Esconde o cabeçalho e o rodapé padrão que causam as barras brancas */
#batalhaEventModal .modal-header,
#batalhaEventModal .modal-footer {
    display: none !important;
}

#batalhaEventModal .modal-body {
    padding: 0 !important;
    background: transparent !important;
}

/* Grid perfeitamente dimensionada para as 3 colunas */
.arena-dashboard-wrapper {
    display: grid;
    grid-template-columns: 280px minmax(400px, 1fr) 280px; 
    gap: 30px;
    padding: 30px;
    align-items: start;
    min-height: 85vh;
}

.arena-side-panel {
    max-height: 85vh;
    overflow-y: auto;
}

/* =========================================
   EFEITO RINGUE MMA (FIGHT POSTER)
========================================= */
.duel-mma-card {
    position: relative;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    background: #000;
    overflow: hidden;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duel-mma-content {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5); /* Escurece o meio para o texto brilhar */
}

.fighter-bg {
    position: absolute;
    top: 0; bottom: 0;
    width: 55%;
    background-size: cover;
    background-position: top center;
    z-index: 1;
    filter: grayscale(20%) contrast(1.2);
    opacity: 0.7;
}

.fighter-bg.left-fighter {
    left: 0;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

.fighter-bg.right-fighter {
    right: 0;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

/* =========================================
   RESPONSIVIDADE MOBILE DA ARENA (SMARTPHONES E TABLETS)
========================================= */
@media (max-width: 1024px) {
    /* Transforma a Grid de 3 colunas em uma pilha vertical */
    .arena-dashboard-wrapper {
        display: flex !important;
        flex-direction: column !important;
        padding: 15px !important;
        gap: 20px !important;
    }

    /* Redefine a ordem para o celular: 1º Cartaz, 2º Ringue, 3º Lobby */
    .arena-dashboard-wrapper > .batalha-ecosystem {
        order: 1 !important;
        width: 100% !important;
    }
    
    .arena-dashboard-wrapper > .arena-side-panel:last-child {
        order: 2 !important; /* Ringue MMA */
        width: 100% !important;
        max-height: 500px !important; /* Permite rolagem interna sem quebrar a tela */
    }

    .arena-dashboard-wrapper > .arena-side-panel:first-child {
        order: 3 !important; /* Lobby de Operadores */
        width: 100% !important;
        max-height: 400px !important;
    }

    /* Ajusta o Modal para ocupar a tela toda no celular */
    #batalhaEventModal .modal-dialog {
        width: 98% !important;
        max-width: 98vw !important;
        margin: 10px auto !important;
    }

    /* Arruma os cards de 1º e 2º lugar que têm foto do lado */
    .bda-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 20px 10px !important;
    }

    .bda-photo-container {
        margin: 0 auto 15px auto !important;
    }

    .bda-info {
        padding: 0 !important;
    }

    /* Impede o título gigante de quebrar a tela */
    .bda-title {
        font-size: 2rem !important;
    }

    /* Ajuste fino dos cards menores (3º lugar em diante) */
    .bda-grid {
        grid-template-columns: 1fr !important; /* Fica 1 por linha no celular */
        gap: 15px !important;
    }

    /* Força os cards do Grid a empilharem verticalmente igual ao 1º e 2º */
    .bda-card-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 25px 15px 15px 15px !important;
        min-height: auto !important;
    }

    /* Mata o posicionamento absoluto do desktop e traz a foto pro meio */
    .bda-card-grid .bda-photo-container {
        position: relative !important; 
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 0 auto 10px auto !important;
        width: 70px !important; /* Tamanho bacana pro celular */
        height: 70px !important;
    }

    /* Centraliza o texto e apara as bordas */
    .bda-card-grid .bda-info {
        position: relative !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .bda-card-grid .bda-name {
        font-size: 1.3rem !important; /* Ajusta o tamanho da fonte */
        justify-content: center !important;
        margin-bottom: 8px !important;
    }

    .bda-card-grid .bda-stats {
        justify-content: space-around !important;
        width: 100% !important;
    }
}

/* =========================================
   CORREÇÃO ABSOLUTA DA ALTURA DOS CARDS (IMPEDE TEXTO DE VAZAR)
========================================= */

/* 1. Força os cards a crescerem com o texto */
.bda-card {
    height: auto !important;
    padding-top: 15px !important;
    padding-bottom: 20px !important;
    align-items: center !important;
}

.bda-card-1 {
    min-height: 160px !important;
}

.bda-card-2 {
    min-height: 140px !important;
}

.bda-card-grid {
    min-height: 110px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* 2. Arruma o agrupamento do Nome + Invicto + MVP */
.bda-name {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 15px !important;
    font-size: 2.2rem !important; /* Fonte ligeiramente menor pra caber as badges */
}

.bda-card-grid .bda-name {
    font-size: 1.4rem !important;
    margin-bottom: 8px !important;
}

/* 3. Prende a foto no canto pra ela esticar perfeitamente junto com o card */
.bda-photo-container {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
}

/* 4. Dá margem no texto para ele não ficar por cima da foto */
.bda-card.img-left .bda-info {
    padding-left: 190px !important;
}

.bda-card.img-right .bda-info {
    padding-right: 190px !important;
}

.bda-card-grid.img-left .bda-info {
    padding-left: 120px !important;
}

.bda-card-grid.img-right .bda-info {
    padding-right: 120px !important;
}

/* 5. Proteção para o Celular (Volta a foto pro centro e empilha tudo) */
@media (max-width: 1024px) {
    .bda-photo-container {
        position: relative !important;
        width: 110px !important;
        height: 110px !important;
        margin: 0 auto 10px auto !important;
    }
    .bda-card.img-left .bda-info, 
    .bda-card.img-right .bda-info,
    .bda-card-grid.img-left .bda-info, 
    .bda-card-grid.img-right .bda-info {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}