@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --pts-exact: #10b981;
    --pts-outcome: #F7A700;
    --pts-wrong: #EF0000;
}

html.dark {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e3a8a;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #0f172a;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);

    --pts-exact: #34d399;
    --pts-outcome: #F7A700;
    --pts-wrong: #EF0000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
html.dark header {
    background-color: rgba(30, 41, 59, 0.85);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: var(--bg-main);
}

.nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.btn-logout {
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: white;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: rgba(0,0,0,0.02);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
html.dark th { background-color: rgba(255,255,255,0.02); }

td {
    font-size: 14px;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(0,0,0,0.01);
}
html.dark tr:hover td { background-color: rgba(255,255,255,0.02); }

.rank-badge {
    background-color: var(--bg-main);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

tr:nth-child(1) .rank-badge { background-color: #fef08a; color: #854d0e; border-color: #fde047; }
tr:nth-child(2) .rank-badge { background-color: #e2e8f0; color: #475569; border-color: #cbd5e1; }
tr:nth-child(3) .rank-badge { background-color: #ffedd5; color: #9a3412; border-color: #fed7aa; }

.row-current-user td {
    background-color: var(--primary-light);
}
.row-current-user:hover td {
    background-color: var(--primary-light);
}

.bar-chart-container {
    padding: 24px;
    background-color: var(--bg-card);
}

.chart-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.chart-bar-row:last-child {
    margin-bottom: 0;
}

.chart-label {
    width: 150px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.chart-bar-wrapper {
    flex: 1;
    height: 12px;
    background-color: var(--bg-main);
    border-radius: 6px;
    margin: 0 15px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 6px;
    transition: width 1s ease-out;
}

.chart-value {
    width: 60px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    background-color: var(--bg-card);
}

.team-crest {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
}

/* Cartões de Jogos */
.grid-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.match-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-card:hover {
    box-shadow: var(--shadow-md);
}

.match-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.match-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-scheduled { background-color: #f1f5f9; color: #475569; }
.status-finished { background-color: #d1fae5; color: #065f46; }
.status-live { background-color: #fee2e2; color: #991b1b; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 35%;
    text-align: center;
}

.team-name {
    font-size: 16px;
    font-weight: 700;
    margin-top: 5px;
}

.vs-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 30%;
}

.score-input {
    width: 45px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
}

.score-input:disabled {
    background-color: #f8fafc;
    color: var(--text-main);
    border-color: var(--border);
}

html.dark .score-input:disabled {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.score-divider {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.result-badge-container {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.points-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.pts-exact { background-color: var(--pts-exact); }
.pts-outcome { background-color: var(--pts-outcome); }
.pts-wrong { background-color: var(--pts-wrong); }

/* Abas de Navegação */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 2px;
}

.tab-btn {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    margin-bottom: -4px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* =========================================
   BOTÕES (btn-outline)
   ========================================= */
.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-outline:hover {
    background-color: rgba(0,0,0,0.05);
}
html.dark .btn-outline:hover {
    background-color: rgba(255,255,255,0.05);
}

/* =========================================
   PAGINAÇÃO (Moderno e Elegante)
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px auto;
    flex-wrap: wrap;
    width: 100%;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
    font-size: 14px;
}

html.dark .page-link {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border);
}

.page-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

html.dark .page-link:hover {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary-hover);
    border-color: rgba(37, 99, 235, 0.3);
}

.page-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: scale(1.05);
}

html.dark .page-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.page-dots {
    color: var(--text-muted);
    font-weight: 700;
    padding: 0 4px;
    letter-spacing: 1px;
}

/* =========================================
   Responsividade (Mobile)
   ========================================= */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    main {
        padding: 15px 10px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .card {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 15px;
    }

    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 10px;
        gap: 15px;
    }
    
    .header-top-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
        width: 100%;
    }
    
    .header-top-row .logo {
        flex: 1 1 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    #server-clock {
        margin-right: 0 !important;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .user-badge {
        border-left: none;
        padding-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }
    
    .grid-matches {
        grid-template-columns: 1fr;
    }
    
    /* Adaptação de tabelas para formato de cards no mobile */
    .table-responsive {
        overflow-x: visible;
        background: transparent;
        border: none;
    }
    
    .table-responsive table {
        display: block;
        background: transparent;
    }
    
    .table-responsive table thead {
        display: none; /* Esconde o cabeçalho da tabela */
    }
    
    .table-responsive table tbody {
        display: block;
        background: transparent;
    }
    
    .table-responsive table tbody tr {
        display: block;
        width: 100%;
        box-sizing: border-box;
        background-color: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 15px;
        margin-bottom: 15px;
        position: relative;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .table-responsive table tbody tr:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
    
    .table-responsive table tbody tr td {
        display: block;
        width: 100% !important;
        padding: 8px 0 !important;
        border-bottom: none !important;
        text-align: left !important;
        background: transparent;
    }
    
    /* 1. Tabela de Classificação Geral (painel.php) */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr {
        padding-top: 55px; /* Espaço para o badge de rank absoluto */
    }
    
    /* Badge de Posição (Pos) */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(1) {
        position: absolute;
        top: 12px;
        left: 18px;
        width: auto !important;
        padding: 0 !important;
    }
    
    /* Nome do Participante */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(2) {
        border-bottom: 1px solid var(--border) !important;
        padding-bottom: 14px !important;
        margin-bottom: 8px;
        word-break: break-word;
        padding-right: 80px !important; /* Espaço para não encavalar com os pontos */
    }
    
    /* Acertos Exatos (2,03 pts) */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(3) {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(3)::before {
        content: "Acertos Exatos (2,03 pts)";
        color: var(--text-muted);
        font-weight: 500;
    }
    
    /* Acertos Ganhador (1,01 pts) */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(4) {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(4)::before {
        content: "Acertos Ganhador (1,01 pts)";
        color: var(--text-muted);
        font-weight: 500;
    }
    
    /* Pontuação Final */
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(5) {
        position: absolute;
        top: 15px;
        right: 15px;
        width: auto !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }
    .table-responsive table:not(:has(select)):not(:has(form)) tbody tr td:nth-of-type(5)::before {
        content: "Pontos";
        font-size: 11px;
        color: var(--text-muted);
        font-weight: 600;
        text-transform: uppercase;
    }
    
    /* 2. Tabela de Gerenciamento de Apostadores (admin_usuarios.php) */
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(1) {
        font-size: 16px;
        border-bottom: 1px solid var(--border) !important;
        padding-bottom: 12px !important;
        margin-bottom: 10px;
    }
    
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(2) {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(2)::before {
        content: "Usuário";
        color: var(--text-muted);
        font-weight: 500;
    }
    
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(3) {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(3)::before {
        content: "Status da Senha";
        color: var(--text-muted);
        font-weight: 500;
    }
    
    .table-responsive table:has(form):not(:has(select)) tbody tr td:nth-of-type(4) {
        border-top: 1px solid var(--border) !important;
        padding-top: 14px !important;
        margin-top: 10px;
        display: flex !important;
        justify-content: flex-end;
    }
    
    /* 3. Tabela de Gerenciamento de Jogos (admin_jogos.php) */
    .table-responsive table:has(select) tbody tr {
        display: grid !important;
        grid-template-columns: 1fr 1.5fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        align-items: center;
    }
    
    /* Suporte a formulários em grid */
    .table-responsive table:has(select) tbody tr form {
        display: contents;
    }
    
    /* Data/Hora do Jogo */
    .table-responsive table:has(select) tbody tr td:nth-of-type(1) {
        grid-column: 1 / span 3;
        grid-row: 1;
        border-bottom: 1px solid var(--border) !important;
        padding-bottom: 10px !important;
        margin-bottom: 4px;
        font-size: 13px;
        color: var(--text-muted);
    }
    
    /* Time Mandante */
    .table-responsive table:has(select) tbody tr td:nth-of-type(2) {
        grid-column: 1;
        grid-row: 2;
        text-align: right !important;
        font-weight: 700;
        font-size: 15px;
        padding: 0 !important;
    }
    
    /* Placar Oficial (Inputs) */
    .table-responsive table:has(select) tbody tr td:nth-of-type(3) {
        grid-column: 2;
        grid-row: 2;
        display: flex !important;
        justify-content: center !important;
        align-items: center;
        padding: 0 !important;
    }
    
    /* Time Visitante */
    .table-responsive table:has(select) tbody tr td:nth-of-type(4) {
        grid-column: 3;
        grid-row: 2;
        text-align: left !important;
        font-weight: 700;
        font-size: 15px;
        padding: 0 !important;
    }
    
    /* Status Select */
    .table-responsive table:has(select) tbody tr td:nth-of-type(5) {
        grid-column: 1 / span 2;
        grid-row: 3;
        display: flex !important;
        align-items: center;
        border-top: 1px solid var(--border) !important;
        padding-top: 14px !important;
        margin-top: 4px;
        gap: 8px;
    }
    .table-responsive table:has(select) tbody tr td:nth-of-type(5)::before {
        content: "Status:";
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 500;
    }
    
    /* Botão de Ação (Salvar) */
    .table-responsive table:has(select) tbody tr td:nth-of-type(6) {
        grid-column: 3;
        grid-row: 3;
        display: flex !important;
        justify-content: flex-end !important;
        border-top: 1px solid var(--border) !important;
        padding-top: 14px !important;
        margin-top: 4px;
    }
    
    /* Ajustes das abas no mobile */
    .tabs-container {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .tabs-container::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.alert-info { background-color: #eff6ff; color: #1e40af; border-left: 4px solid #2563eb; padding: 15px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
html.dark .alert-info { background-color: rgba(37, 99, 235, 0.1); color: #93c5fd; border-left-color: #3b82f6; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s ease; text-decoration: none; text-align: center; }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); transform: translateY(-1px); }
html.dark .btn-primary:hover { box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2); }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

.match-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 16px;
    color: white;
    padding: 40px 20px;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.match-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 100 L100 0" stroke="rgba(255,255,255,0.05)" stroke-width="2"/></svg>') repeat;
    opacity: 0.5;
    pointer-events: none;
        }

        .competition-tag {
            text-align: center;
            font-size: 13px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: rgba(255,255,255,0.8);
            margin-bottom: 30px;
            position: relative;
            z-index: 1;
        }

        .scoreboard {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 40px;
            position: relative;
            z-index: 1;
        }

        .team-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 150px;
        }

        .team-logo-large {
            width: 90px;
            height: 90px;
            object-fit: contain;
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
            margin-bottom: 15px;
            transition: transform 0.3s ease;
        }
        
        .team-logo-large:hover {
            transform: scale(1.1);
        }

        .team-name-large {
            font-size: 18px;
            font-weight: 700;
            text-align: center;
            text-shadow: 0 2px 4px rgba(0,0,0,0.5);
            line-height: 1.2;
        }

        .score-center {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .score-numbers {
            font-size: 56px;
            font-weight: 800;
            letter-spacing: 2px;
            text-shadow: 0 4px 8px rgba(0,0,0,0.4);
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .score-divider {
            color: rgba(255,255,255,0.5);
            font-size: 32px;
        }

        .match-status-pill {
            margin-top: 15px;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }

        .match-status-pill.status-scheduled { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }
        .match-status-pill.status-live { background: #ef4444; color: white; animation: pulseLive 2s infinite; }
        .match-status-pill.status-finished { background: #10b981; color: white; }

        @keyframes pulseLive {
            0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
            100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
        }

        .info-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .detail-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 20px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            box-sizing: border-box;
            min-width: 0;
            overflow: hidden;
        }

        .detail-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }

        .detail-card-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-main);
        }

        .detail-icon {
            color: var(--primary);
            width: 20px;
            height: 20px;
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px dashed var(--border);
        }

        .detail-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .detail-label {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 600;
        }

        .detail-value {
            font-size: 14px;
            color: var(--text-main);
            font-weight: 700;
            text-align: right;
        }

        .empty-state-message {
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
            padding: 30px 0;
            background: rgba(0,0,0,0.02);
            border-radius: 8px;
            margin-top: 10px;
        }

        .referee-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        .referee-table th {
            background: #f1f5f9;
            color: var(--text-muted);
            font-size: 11px;
            text-transform: uppercase;
            font-weight: 700;
            padding: 10px 12px;
            text-align: left;
        }
        
        .referee-table th:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
        .referee-table th:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

        .referee-table td {
            padding: 12px;
            border-bottom: 1px dashed var(--border);
            font-size: 13px;
        }

        .referee-table tr:last-child td {
            border-bottom: none;
        }

        .ref-name { font-weight: 600; color: var(--text-main); }
        .ref-role { color: var(--primary); font-size: 11px; font-weight: 700; background: var(--primary-light); padding: 3px 6px; border-radius: 4px; display: inline-block; }
        .ref-nation { color: var(--text-muted); font-size: 12px; }

        .btn-voltar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            background: rgba(37, 99, 235, 0.1);
            border-radius: 8px;
            text-decoration: none;
            color: var(--primary);
            font-weight: 600;
            font-size: 14px;
            transition: background 0.2s;
        }

        .stat-bar-container {
            margin-top: 15px;
            margin-bottom: 15px;
        }
        .stat-bar-header {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 5px;
            color: var(--text-main);
        }
        .stat-bar-label {
            text-align: center;
            color: var(--text-muted);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 11px;
            letter-spacing: 0.5px;
        }
        .stat-bar-track {
            height: 8px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
            display: flex;
        }
        .stat-bar-fill-home {
            background: var(--primary);
            height: 100%;
            transition: width 0.5s ease-in-out;
        }
        .stat-bar-fill-away {
            background: #10b981;
            height: 100%;
            transition: width 0.5s ease-in-out;
        }

        .lineup-container {
            display: flex;
            gap: 20px;
        }
        .lineup-team-column {
            flex: 1;
        }
        .lineup-team-name {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 5px;
            border-bottom: 2px solid var(--primary-light);
            padding-bottom: 4px;
        }
        .lineup-formation {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 600;
            margin-bottom: 12px;
            text-transform: uppercase;
        }
        .lineup-player-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px dashed var(--border);
            font-size: 13px;
        }
        .lineup-player-row:last-child {
            border-bottom: none;
        }
        .lineup-jersey-badge {
            background: var(--primary-light);
            color: var(--primary);
            font-size: 11px;
            font-weight: 800;
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .lineup-player-info {
            display: flex;
            flex-direction: column;
        }
        .lineup-player-name {
            font-weight: 600;
            color: var(--text-main);
        }
        .lineup-player-pos {
            font-size: 11px;
            color: var(--text-muted);
        }
        .substitutes-section {
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid var(--border);
        }
        .substitutes-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .substitutes-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }
        .substitutes-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .substitutes-list li {
            font-size: 12px;
            padding: 4px 0;
            color: var(--text-muted);
            border-bottom: 1px dashed rgba(0,0,0,0.05);
        }

        .timeline-vertical {
            position: relative;
            padding-left: 20px;
            margin-top: 15px;
        }
        .timeline-vertical::before {
            content: '';
            position: absolute;
            top: 5px;
            bottom: 5px;
            left: 45px;
            width: 2px;
            background: var(--border);
        }
        .timeline-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 20px;
            position: relative;
        }
        .timeline-item:last-child {
            margin-bottom: 0;
        }
        .timeline-minute {
            width: 35px;
            font-weight: 700;
            font-size: 13px;
            color: var(--primary);
            text-align: right;
            padding-right: 10px;
            flex-shrink: 0;
            margin-top: 2px;
        }
        .timeline-marker {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--surface);
            border: 2px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1;
            margin: 0 10px;
            flex-shrink: 0;
        }
        .timeline-marker.marker-goal {
            border-color: #10b981;
            background: #e6f4ea;
            color: #10b981;
        }
        .timeline-marker.marker-yellow {
            border-color: #eab308;
            background: #fef9c3;
            color: #eab308;
        }
        .timeline-marker.marker-red {
            border-color: #ef4444;
            background: #fee2e2;
            color: #ef4444;
        }
        .timeline-marker.marker-sub {
            border-color: #3b82f6;
            background: #dbeafe;
            color: #3b82f6;
        }
        .timeline-content {
            flex: 1;
            font-size: 13px;
            color: var(--text-main);
            line-height: 1.4;
            margin-top: 2px;
        }
        .timeline-team-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 8px;
            text-transform: uppercase;
        }
        .timeline-team-badge.team-home {
            background: var(--primary-light);
            color: var(--primary);
        }
        .timeline-team-badge.team-away {
            background: #e6f4ea;
            color: #10b981;
        }

        @media (max-width: 600px) {
            .info-cards-grid { grid-template-columns: 1fr; gap: 15px; }
            .detail-card { grid-column: span 1 !important; padding: 15px; width: 100%; box-sizing: border-box; }
            .lineup-container { flex-direction: column; gap: 30px; }
            .substitutes-grid { grid-template-columns: 1fr; gap: 20px; }
            
            /* Aproxima as bandeiras para o centro do card */
            .scoreboard { gap: 10px; }
            .team-display { width: 90px; } 
            
            .team-logo-large { width: 60px; height: 60px; }
            .team-name-large { font-size: 14px; }
            .score-numbers { font-size: 40px; }
            transition: width 0.5s ease-in-out;
        }

        .lineup-container {
            display: flex;
            gap: 20px;
        }
        .lineup-team-column {
            flex: 1;
        }
        .lineup-team-name {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 5px;
            border-bottom: 2px solid var(--primary-light);
            padding-bottom: 4px;
        }
        .lineup-formation {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 600;
            margin-bottom: 12px;
            text-transform: uppercase;
        }
        .lineup-player-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            border-bottom: 1px dashed var(--border);
            font-size: 13px;
        }
        .lineup-player-row:last-child {
            border-bottom: none;
        }
        .lineup-jersey-badge {
            background: var(--primary-light);
            color: var(--primary);
            font-size: 11px;
            font-weight: 800;
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .lineup-player-info {
            display: flex;
            flex-direction: column;
        }
        .lineup-player-name {
            font-weight: 600;
            color: var(--text-main);
        }
        .lineup-player-pos {
            font-size: 11px;
            color: var(--text-muted);
        }
        .substitutes-section {
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid var(--border);
        }
        .substitutes-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .substitutes-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }
        .substitutes-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .substitutes-list li {
            font-size: 12px;
            padding: 4px 0;
            color: var(--text-muted);
            border-bottom: 1px dashed rgba(0,0,0,0.05);
        }

        .timeline-vertical {
            position: relative;
            padding-left: 20px;
            margin-top: 15px;
        }
        .timeline-vertical::before {
            content: '';
            position: absolute;
            top: 5px;
            bottom: 5px;
            left: 45px;
            width: 2px;
            background: var(--border);
        }
        .timeline-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 20px;
            position: relative;
        }
        .timeline-item:last-child {
            margin-bottom: 0;
        }
        .timeline-minute {
            width: 35px;
            font-weight: 700;
            font-size: 13px;
            color: var(--primary);
            text-align: right;
            padding-right: 10px;
            flex-shrink: 0;
            margin-top: 2px;
        }
        .timeline-marker {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--surface);
            border: 2px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1;
            margin: 0 10px;
            flex-shrink: 0;
        }
        .timeline-marker.marker-goal {
            border-color: #10b981;
            background: #e6f4ea;
            color: #10b981;
        }
        .timeline-marker.marker-yellow {
            border-color: #eab308;
            background: #fef9c3;
            color: #eab308;
        }
        .timeline-marker.marker-red {
            border-color: #ef4444;
            background: #fee2e2;
            color: #ef4444;
        }
        .timeline-marker.marker-sub {
            border-color: #3b82f6;
            background: #dbeafe;
            color: #3b82f6;
        }
        .timeline-content {
            flex: 1;
            font-size: 13px;
            color: var(--text-main);
            line-height: 1.4;
            margin-top: 2px;
        }
        .timeline-team-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 8px;
            text-transform: uppercase;
        }
        .timeline-team-badge.team-home {
            background: var(--primary-light);
            color: var(--primary);
        }
        .timeline-team-badge.team-away {
            background: #e6f4ea;
            color: #10b981;
        }

        @media (max-width: 600px) {
            .info-cards-grid { grid-template-columns: 1fr; gap: 15px; }
            .detail-card { grid-column: span 1 !important; padding: 15px; width: 100%; box-sizing: border-box; }
            .lineup-container { flex-direction: column; gap: 30px; }
            .substitutes-grid { grid-template-columns: 1fr; gap: 20px; }
            
            /* Aproxima as bandeiras para o centro do card */
            .scoreboard { gap: 10px; }
            .team-display { width: 90px; } 
            
            .team-logo-large { width: 60px; height: 60px; }
            .team-name-large { font-size: 14px; }
            .score-numbers { font-size: 40px; }
            
            .page-header { flex-direction: column; align-items: flex-start; gap: 15px; }
            .btn-voltar { align-self: flex-start; }
            .timeline-vertical::before { left: 35px; }
            .timeline-minute { width: 28px; font-size: 11px; padding-right: 5px; }
            .timeline-marker { margin: 0 5px; }
        }

/* =========================================
   Estilos de Autenticação (Login / Cadastro)
   ========================================= */
body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
}

.login-container {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
    position: relative;
    margin: auto;
    margin-top: 50px;
    margin-bottom: 50px;
}

.login-container h1 { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.login-container p { color: var(--text-muted); font-size: 14px; margin-bottom: 25px; }

.form-group { text-align: left; margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
    display: inline-block;
    box-sizing: border-box;
}
.btn-submit:hover { background-color: var(--primary-hover); }
.btn-submit:disabled { background-color: var(--text-muted); cursor: not-allowed; }

.error-msg {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    border: 1px solid #f87171;
}
html.dark .error-msg { background-color: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }

.success-msg {
    background-color: #dcfce7;
    color: #166534;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    border: 1px solid #bbf7d0;
}
html.dark .success-msg { background-color: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); color: #4ade80; }

.login-container .theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}
.login-container .theme-toggle:hover { color: var(--text-main); }

.logo-img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    margin-top: 20px;
    margin-bottom: 40px;
    object-fit: contain;
}
