:root {
    --bp-primary: #0d6efd;
    --bp-accent: #ffc107;
    --bp-dark: #14161f;
}

body {
    background-color: #f5f6fa;
}

[data-bs-theme="dark"] body {
    background-color: #0f1117;
}

[data-bs-theme="dark"] .card-room {
    background-color: #1a1d29;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

[data-bs-theme="dark"] .market-title,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
    color: #f1f2f6;
}

[data-bs-theme="dark"] .prediction-period-header {
    color: #9aa0ac;
}

[data-bs-theme="dark"] .badge-basico {
    background: #2a2e3d;
    color: #c5c9d3;
}

[data-bs-theme="dark"] .stat-card {
    background-color: #1a1d29;
}

/* btn-outline-dark queda invisible en tema oscuro (texto oscuro sobre fondo oscuro) */
[data-bs-theme="dark"] .btn-outline-dark {
    color: #e9ecef;
    border-color: #6c757d;
}
[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: #e9ecef;
    color: #14161f;
    border-color: #e9ecef;
}

/* Badge "Pendiente" (bg-light + text-muted) queda casi ilegible en modo oscuro */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #2a2e3d !important;
    color: #c5c9d3 !important;
    border-color: #454b5c !important;
}

.card-room {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card-room:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.10);
}

.badge-plus {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: #1a1a1a;
    font-weight: 600;
}

.badge-basico {
    background: #e9ecef;
    color: #495057;
}

.multiplier-tag {
    font-weight: 700;
    color: var(--bp-primary);
}

.ranking-table th, .ranking-table td {
    vertical-align: middle;
}

.rank-1 { color: #d4af37; font-weight: 700; }
.rank-2 { color: #a7a7ad; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }

/* Ajustes específicos para pantallas pequeñas (celulares) */
@media (max-width: 576px) {
    .container { padding-left: 12px; padding-right: 12px; }
    h1 { font-size: 1.5rem; }
    .table-responsive { font-size: .875rem; }
}

/* ---------- Formulario de pronósticos (mercados) ---------- */
.prediction-period-header {
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6c757d;
    padding: .5rem 0;
    margin-top: .5rem;
    margin-bottom: .5rem;
    border-bottom: 2px solid var(--bp-primary);
    display: inline-block;
}

.market-card {
    border-left: 4px solid var(--bp-primary);
}

.market-title {
    font-weight: 700;
    color: #212529;
}

.market-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
}

@media (min-width: 576px) {
    .market-options-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 992px) {
    .market-options-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
    .market-options-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mercados con exactamente 3 opciones (ej. Ganador Partido) siempre
   van en una sola fila de 3 columnas, incluso en celular */
.market-options-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.market-options-grid-3 .market-option-label {
    font-size: .75rem;
}

.market-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .6rem .4rem;
    border-radius: .6rem;
    text-align: center;
    line-height: 1.2;
}

.market-option-label {
    font-size: .85rem;
    font-weight: 600;
}

.market-option-points {
    font-size: .75rem;
    font-weight: 700;
    opacity: .85;
}

.sticky-submit {
    position: sticky;
    bottom: .75rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* ---------- Pestañas de periodo (Tiempo Reglamentario / 1ra / 2da Mitad) ---------- */
.bp-period-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: .4rem;
    padding-bottom: .25rem;
}
.bp-period-tabs .nav-link {
    white-space: nowrap;
    border-radius: 2rem;
    font-size: .85rem;
    font-weight: 600;
    color: #495057;
    background: #eef0f4;
    padding: .45rem 1rem;
}
.bp-period-tabs .nav-link.active {
    background: var(--bp-primary);
    color: #fff;
}
[data-bs-theme="dark"] .bp-period-tabs .nav-link {
    background: #232735;
    color: #c5c9d3;
}
[data-bs-theme="dark"] .bp-period-tabs .nav-link.active {
    background: var(--bp-primary);
    color: #fff;
}

/* ---------- Tabla de 2 columnas: Más de / Menos de ---------- */
.mas-menos-table {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.mas-menos-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    padding-bottom: .25rem;
    border-bottom: 1px solid #e9ecef;
}

.mas-menos-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.mas-menos-row .market-option {
    width: 100%;
}

/* ---------- Dashboard ---------- */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-card .stat-label {
    font-size: .75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.available-matches-btn {
    background: linear-gradient(135deg, #ff8a5c, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
}
.available-matches-btn:hover { color: #fff; opacity: .92; }

.recent-match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-bs-theme="dark"] .recent-match-row {
    border-bottom-color: rgba(255,255,255,.08);
}
.recent-match-row:last-child { border-bottom: none; }

.origin-tag {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: .15rem .5rem;
    border-radius: .4rem;
}
.origin-tag.liga { background: #e7f1ff; color: #0d6efd; }
.origin-tag.barrio { background: #fff3e0; color: #e67e22; }
[data-bs-theme="dark"] .origin-tag.liga { background: #17263d; color: #6ea8fe; }
[data-bs-theme="dark"] .origin-tag.barrio { background: #3a2a12; color: #ffb066; }

/* ---------- Barra inferior de navegación (solo celular) ---------- */
.bottom-nav {
    display: none;
}
@media (max-width: 767px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #fff;
        border-top: 1px solid rgba(0,0,0,.08);
        z-index: 1030;
        padding: .4rem 0 calc(.4rem + env(safe-area-inset-bottom));
    }
    [data-bs-theme="dark"] .bottom-nav {
        background: #14161f;
        border-top-color: rgba(255,255,255,.08);
    }
    body { padding-bottom: 4.2rem; }
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    color: #6c757d;
    text-decoration: none;
    font-size: .68rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
}
.bottom-nav a.active { color: var(--bp-primary); font-weight: 700; }
.bottom-nav a i { font-size: 1.25rem; }
