/* --- 1. Reset Fundamental (CORRIGIDO PARA MOBILE) --- */
html {
    background-color: #0d0d0d !important;
    /* REMOVIDO: overflow-x: hidden; (Isso quebrava a navbar fixa no mobile) */
}

body {
    background-color: #0d0d0d;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    margin: 0;
    padding: 0;
    padding-top: 80px !important; /* ÚNICO LUGAR ONDE ISSO DEVE EXISTIR */
    position: relative;
    /* SEM OVERFLOW AQUI. NUNCA. */
}

/* 2. Container Seguro para Mobile */
.container-fluid {
    width: 100%;
    max-width: 100%;
    padding-right: 15px !important;
    padding-left: 15px !important;
    overflow-x: hidden; /* A trava de rolagem horizontal deve ficar AQUI, não no html/body */
}

@media (max-width: 576px) {
    body { 
        padding-top: 85px !important; /* Ajuste Mobile-First */
    }
    
    .container-fluid {
        padding-right: 12px !important;
        padding-left: 12px !important;
    }
    
    .row {
        margin-right: -10px !important; 
        margin-left: -10px !important;
    }
    
    .row > * {
        padding-right: 10px !important;
        padding-left: 10px !important;
    }
}

/* --- TABELAS HARMONIZADAS (NEON STYLE) --- */
.table-neon {
    background-color: #151515 !important;
    border-radius: 10px;
    overflow: hidden; /* Arredonda as bordas da tabela */
    border-collapse: separate; 
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
}

.table-neon thead th {
    background-color: #111 !important;
    color: #39ff14 !important; /* Verde Neon no Cabeçalho */
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #333;
    padding: 12px 8px;
    font-weight: 800;
}

.table-neon tbody td {
    background-color: #151515 !important;
    color: #e0e0e0;
    border-bottom: 1px solid #222;
    padding: 12px 8px;
    font-size: 0.85rem;
    vertical-align: middle;
}

.table-neon tbody tr:last-child td {
    border-bottom: none; /* Remove borda da última linha */
}

/* Hover na linha da tabela */
.table-neon tbody tr:hover td {
    background-color: #1a1a1a !important;
}

/* Badges e Elementos Internos da Tabela */
.stat-circle {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.75rem;
}
.bg-goals { background: rgba(57, 255, 20, 0.15); color: #39ff14; border: 1px solid #39ff14; }
.bg-assists { background: rgba(13, 202, 240, 0.15); color: #0dcaf0; border: 1px solid #0dcaf0; }

/* Texto "Zero" ou "Hífen" */
.stat-zero { color: #444; font-weight: 400; }

/* Scrollbar Estilizada (Fica mais pro em mobile/desktop) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #39ff14; }

/* Wrapper para Tabelas Responsivas (Evita quebrar o layout) */
.table-responsive-custom {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- CAMPINHO TÁTICO --- */
.pitch-selector {
    background-color: var(--pitch-green);
    border: 2px solid var(--pitch-line);
    border-radius: 15px;
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}
.pitch-line-center { border-top: 2px solid var(--pitch-line); position: absolute; top: 50%; width: 100%; }
.pitch-player {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 900;
    cursor: pointer; transition: transform 0.2s;
    border: 2px solid rgba(0,0,0,0.3);
}
.pitch-player:hover { transform: scale(1.2); z-index: 10; }
.pitch-player.selected { outline: 3px solid #fff; box-shadow: 0 0 15px var(--neon-green); }

/* --- TABELA FUTEBAS (TIMELINE STYLE) --- */
.futebas-table-wrapper {
    background: #111;
    border-radius: 15px;
    border: 1px solid #222;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.futebas-table {
    margin-bottom: 0;
    color: #fff;
    border-collapse: separate;
    border-spacing: 0 4px; /* Menor espaçamento entre linhas */
    width: 100%;
}

.futebas-table thead th {
    background: #0d0d0d;
    border: none;
    color: #666;
    font-size: 0.65rem; /* Fonte Header Reduzida */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 15px;
    font-weight: 700;
}

.futebas-table tbody tr {
    background: #181818;
    transition: transform 0.2s, background 0.2s;
}

.futebas-table tbody tr:hover {
    background: #202020;
    transform: scale(1.005);
}

.futebas-table td {
    border: none;
    padding: 12px 15px;
    vertical-align: middle;
}

/* Títulos e Textos da Tabela */
.table-date {
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.1;
}
.table-location {
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 2px;
}
.table-notes {
    color: #555;
    font-size: 0.65rem;
    font-style: italic;
}

/* ── CORES DE POSIÇÃO — SISTEMA GLOBAL ──────────────────────────────
   Fonte da verdade para todas as páginas.
   GK=amarelo | DEF=azul | MID=verde | ATT=vermelho | desconhecido=cinza
   ─────────────────────────────────────────────────────────────────── */
.pos-gk  { background: #f1c40f !important; color: #000 !important; }
.pos-def { background: #2980b9 !important; color: #fff !important; }
.pos-mid { background: #27ae60 !important; color: #fff !important; }
.pos-att { background: #c0392b !important; color: #fff !important; }
.pos-unknown { background: #555555 !important; color: #fff !important; }

/* aliases usados em admin_membros.php */
.bg-gk  { background: #f1c40f !important; color: #000 !important; }
.bg-def { background: #2980b9 !important; color: #fff !important; }
.bg-mid { background: #27ae60 !important; color: #fff !important; }
.bg-att { background: #c0392b !important; color: #fff !important; }

/* --- CORREÇÃO DEFINITIVA PARA BARRA LATERAL --- */
.table-neon tbody td:first-child {
    position: relative;
    padding-left: 15px !important; /* Espaço para a borda */
}

/* Em vez de um div absoluto, usamos a borda da própria célula */
.res-win-cell { border-left: 4px solid #39ff14 !important; }
.res-loss-cell { border-left: 4px solid #ff4d4d !important; }
.res-draw-cell { border-left: 4px solid #888 !important; }

.res-indicator { display: none; }

/* Badges Circulares (Gols/Assists) */
.stat-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    font-size: 0.8rem;
}
.bg-goals { background: rgba(57, 255, 20, 0.1); color: var(--neon-green); border: 1px solid var(--neon-green); }
.bg-assists { background: rgba(13, 202, 240, 0.1); color: var(--neon-blue); border: 1px solid var(--neon-blue); }
.stat-zero { color: #333; font-size: 1.2rem; line-height: 0; } /* Tracinho */

/* Placar */
.score-badge {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    opacity: 0.9;
}

/* ========================================================= */
/* --- QUADRO TÁTICO BROADCASTING (V3 - FLEXBOX) --- */
/* ========================================================= */

.tactical-board-wrapper {
    margin-top: 20px; 
    margin-bottom: 30px;
    background: #111; 
    border: 1px solid #333;
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

.tactical-board-header {
    background: #050505; 
    padding: 10px 15px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid #222;
}

.tactical-pitch {
    display: flex;
    flex-direction: column; /* MOBILE: Zonas empilhadas verticalmente (Em pé) */
    width: 100%; 
    height: 650px; /* Altura fixa para celular não encavalar */
    position: relative;
    background-color: #0b1a0e;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 20px 20px; 
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    padding: 15px 0;
}

.pitch-zone {
    flex: 1; /* O Flexbox divide a tela em 8 partes perfeitamente iguais */
    display: flex;
    flex-direction: row; /* Jogadores lado a lado dentro da linha */
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    position: relative;
    z-index: 5;
}

/* Marcações do Campo (Linhas) - MOBILE */
.pitch-line { position: absolute; border: 2px solid rgba(255,255,255,0.12); pointer-events: none; z-index: 1; }
.center-circle { top: 50%; left: 50%; width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%); }
.half-line { top: 50%; left: 0; width: 100%; height: 0; border-top: 2px solid rgba(255,255,255,0.12); transform: translateY(-50%); border-left: none; border-right: none; border-bottom: none; }
.box-area-top { top: 0; left: 25%; width: 50%; height: 12%; border-top: none; }
.box-area-bottom { bottom: 0; left: 25%; width: 50%; height: 12%; border-bottom: none; }

/* DESKTOP: Campo Horizontal */
@media (min-width: 768px) {
    .tactical-pitch { 
        flex-direction: row; /* Muda o campo para deitado (Esq pra Dir) */
        height: 480px; 
        padding: 0 10px; 
    }
    .pitch-zone { 
        flex-direction: column; /* Jogadores um em cima do outro no PC */
        width: auto;
        height: 100%;
    }
    /* Rotaciona as linhas oficiais do campo para PC */
    .half-line { top: 0; left: 50%; width: 0; height: 100%; border-left: 2px solid rgba(255,255,255,0.12); border-top: none; transform: translateX(-50%); }
    .box-area-top { top: 25%; left: 0; height: 50%; width: 12%; border-left: none; border-top: 2px solid rgba(255,255,255,0.12); border-bottom: 2px solid rgba(255,255,255,0.12); border-right: 2px solid rgba(255,255,255,0.12); }
    .box-area-bottom { top: 25%; right: 0; left: auto; height: 50%; width: 12%; border-right: none; border-top: 2px solid rgba(255,255,255,0.12); border-bottom: 2px solid rgba(255,255,255,0.12); border-left: 2px solid rgba(255,255,255,0.12); }
}

/* Peças (Avatares dos Jogadores) */
.tactical-player {
    width: 42px; height: 42px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 10; transition: transform 0.2s; cursor: pointer;
    background: #1e1e1e;
}
.tactical-player:hover { transform: scale(1.3); z-index: 20; }
.tactical-player img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tactical-player .avatar-icon { font-size: 1.2rem; color: #aaa; }

.tactical-player .player-name-label {
    position: absolute; bottom: -22px; font-size: 0.65rem; white-space: nowrap; 
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 900; 
    padding: 2px 6px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* ========================================================= */
/* --- CLASSES UTILITÁRIAS GLOBAIS (Força Bruta) ---         */
/* ========================================================= */

.text-neon {
    color: #39ff14 !important;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4); }
    
    .btn-save-master {
    background-color: var(--theme-color, #39ff14) !important;
    color: #000 !important;
    border: none !important;
    border-radius: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save-master:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--theme-color, rgba(57, 255, 20, 0.6));
    color: #000 !important;
}

.btn-save-master:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ========================================================= */
/* --- BOTÕES SECUNDÁRIOS E DE PERIGO (CANCELAR/EXCLUIR) --- */
/* ========================================================= */

/* SECUNDÁRIO (Voltar, Cancelar) - Outline discreto */
.btn-secondary-master {
    background-color: transparent !important;
    color: #888 !important;
    border: 1px solid #444 !important;
    border-radius: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-secondary-master:hover {
    background-color: #222 !important;
    color: #fff !important;
    border-color: #666 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
}

.btn-secondary-master:active {
    transform: translateY(1px) !important;
}

/* PERIGO (Excluir, Remover) - Vermelho Alerta */
.btn-danger-master {
    background-color: rgba(220, 53, 69, 0.05) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.5) !important;
    border-radius: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-danger-master:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.4) !important;
}

.btn-danger-master:active {
    transform: translateY(1px) !important;
}

/* ========================================================= */
/* --- CUSTOM STEPPERS (GOLS / ASSISTS) ---                  */
/* ========================================================= */

.stepper-wrapper {
    display: flex;
    align-items: center;
    background: #050505;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    height: 50px;
    transition: all 0.2s ease;
}

/* Os botões de + e - */
.stepper-btn {
    background: #111;
    color: #888;
    border: none;
    width: 50px;
    height: 100%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none; /* Evita selecionar texto ao clicar rápido */
}

.stepper-btn:hover {
    background: #222;
    color: #fff;
}

.stepper-btn:active {
    background: #333;
}

/* O input numérico centralizado */
.stepper-input {
    flex-grow: 1;
    background: transparent !important;
    border: none !important;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    width: 100%;
    padding: 0;
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    -moz-appearance: textfield; /* Mata as setinhas no Firefox */
}

/* Mata as setinhas no Chrome/Safari/Edge */
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Efeito ao focar no campo */
.stepper-wrapper:focus-within {
    border-color: #555;
}

/* Variantes de Cor para Gols (Neon) e Assists (Azul) */
.stepper-neon:focus-within { border-color: #39ff14; box-shadow: 0 0 10px rgba(57, 255, 20, 0.2); }
.stepper-info:focus-within { border-color: #0dcaf0; box-shadow: 0 0 10px rgba(13, 202, 240, 0.2); }

.text-neon-input { color: #39ff14 !important; text-shadow: 0 0 8px rgba(57, 255, 20, 0.4); }
.text-info-input { color: #0dcaf0 !important; text-shadow: 0 0 8px rgba(13, 202, 240, 0.4); }

/* =========================================================
   V3.0 STANDARD HEADERS (Sleek UI Harmonization)
   ========================================================= */

/* 1. TOPO DA PÁGINA (Substitui o h5 cheio de classes Bootstrap) */
.page-header-master {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); /* border-secondary */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 2. TÍTULOS DE CARDS / COLAPSÁVEIS (Substitui o h6 com style inline) */
.card-title-sleek {
    color: #ffffff;
    font-size: 0.8rem !important;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

/* 3. COMPORTAMENTO GLOBAL DO COLAPSO (Limpa as tags <style> dos arquivos PHP) */
.header-collapsible {
    cursor: pointer;
    transition: background 0.2s, filter 0.2s;
}
.header-collapsible:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}
.collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.bg-info { background-color: #0dcaf0 !important; }
.text-info { color: #0dcaf0 !important; }

/* TEXTURAS METÁLICAS V7 - OFF-WHITE + STROKE */
.text-ouro, .text-prata, .text-bronze {
    color: #F2F2F2 !important;
    font-weight: 900;
    display: inline-block;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.text-ouro {
    -webkit-text-stroke: 1.5px #D4AF37;
    text-shadow: 1px 1px 0px #917A22, -1px -1px 0px #FFF9D0, 2px 2px 5px rgba(0,0,0,0.5);
}

.text-prata {
    -webkit-text-stroke: 1.5px #A1A1A1;
    text-shadow: 1px 1px 0px #666666, -1px -1px 0px #FFFFFF, 2px 2px 5px rgba(0,0,0,0.5);
}

.text-bronze {
    -webkit-text-stroke: 1.5px #8A5A2B;
    text-shadow: 1px 1px 0px #5E3E24, -1px -1px 0px #FFD8BC, 2px 2px 5px rgba(0,0,0,0.5);
}

/* BORDAS DOS AVATARES (PÓDIOS) */
.border-ouro { border: 3px solid #D4AF37 !important; box-shadow: 0 0 15px rgba(212, 175, 55, 0.6); }
.border-prata { border: 3px solid #A1A1A1 !important; box-shadow: 0 0 15px rgba(161, 161, 161, 0.5); }
.border-bronze { border: 3px solid #8A5A2B !important; box-shadow: 0 0 15px rgba(138, 90, 43, 0.5); }

/* ==========================================
   MOTOR DE PREVIEW STICKY (MOBILE FIRST)
   ========================================== */
@media (max-width: 991px) {
    .preview-sticky-mobile {
        position: sticky;
        top: 75px; /* Gruda logo abaixo da Navbar (ajuste se a sua navbar for maior) */
        z-index: 1020; /* Fica acima dos formulários que rolam por baixo */
        background: #0d0d0d; /* Fundo sólido igual ao do body para ocultar o form atrás */
        padding: 10px 0 15px 0;
        border-bottom: 2px solid #111;
        box-shadow: 0px 15px 20px -10px rgba(0,0,0,0.9);
    }
    
    .preview-scale {
        transform: scale(0.85); /* Reduz em 15% o tamanho para caber tudo na tela */
        transform-origin: top center;
        margin-bottom: -15%; /* Elimina o espaço morto/fantasma que o scale deixa */
    }
}