/* Estilos Generales */
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0; 
    padding: 20px; 
    line-height: 1.6;
}
.container { max-width: 1200px; margin: auto; }
.header-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;}
.header-buttons-group {
    display: flex;
    gap: 10px;
}
#fullscreen-button { background-color: #17a2b8; }
#fullscreen-button:hover { background-color: #138496; }
#reset-button { background-color: #dc3545; }
#reset-button:hover { background-color: #c82333; }
h1, h2, h3 { text-align: center; color: #0056b3; }
h1 { flex-grow: 1; text-align: left; }
h2 { margin-bottom: 20px; }
h3 { margin-top: 0; color: #333; }
button { background-color: #007bff; color: white; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 1em; font-weight: 600; transition: background-color 0.2s ease-in-out, transform 0.1s ease; }
button:hover { background-color: #0056b3; transform: translateY(-1px); }
input[type="text"] { width: 95%; padding: 10px; margin-bottom: 12px; background-color: #fff; border: 1px solid #ced4da; color: #333; border-radius: 5px; }

/* Estilos del Bracket */
.bracket { display: flex; flex-direction: column; align-items: center; gap: 20px; }
@media (min-width: 1100px) { 
    .bracket { 
        display: grid;
        grid-template-columns: repeat(4, 1fr); 
        align-items: center; 
    } 
}
.round { display: flex; flex-direction: column; width: 100%; max-width: 300px; height: 100%;}
.matchups-container { display: flex; flex-direction: column; justify-content: space-around; flex-grow: 1; }
.matchup { background-color: #ffffff; margin: 10px 0; padding: 0; border-radius: 8px; cursor: pointer; transition: box-shadow 0.2s ease-in-out; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; }
.matchup:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.team { padding: 12px 12px 12px 18px; border-left: 8px solid gray; }
.team-name { font-weight: 600; cursor: pointer; color: #0056b3; }
.team-name:hover { text-decoration: underline; }
.players { font-size: 0.85em; color: #6c757d; margin-left: 10px; }
.winner { font-weight: 700; color: #28a745; }

/* Estilos de los Modales */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); align-items: center; justify-content: center; overflow-y: auto; padding: 20px 0; }
.modal-content { background-color: #ffffff; padding: 25px; border-radius: 10px; width: 90%; max-width: 1100px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: #333; }

/* Ocultar sidebar cuando el modal está abierto */
body.modal-open .sidebar {
    display: none;
}
body.modal-open .main-content {
    margin-left: 0;
}

/* Estilos para Pestañas de Estadísticas */
#general-stats { margin-top: 50px; background-color: #ffffff; padding: 25px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.tabs { margin-bottom: 20px; border-bottom: 2px solid #dee2e6; }
.tab-button { background-color: transparent; color: #6c757d; border: none; padding: 12px 18px; cursor: pointer; border-radius: 0; font-weight: 600; border-bottom: 3px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
.tab-button.active { color: #007bff; border-bottom: 3px solid #007bff; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.stats-table { width: 100%; border-collapse: collapse; }
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.tab-header h3 { margin: 0; text-align: left; }
.export-btn { background-color: #28a745; font-size: 0.9em; padding: 8px 14px; }
.export-btn:hover { background-color: #218838; }
.stats-table th, .stats-table td { padding: 12px 15px; border-bottom: 1px solid #dee2e6; text-align: left; }
.stats-table thead { background-color: #f4f7f9; }
.stats-table tbody tr:hover { background-color: #f8f9fa; }
.sortable-header { cursor: pointer; transition: color 0.2s ease; }
.sortable-header:hover { color: #0056b3; }
.active-sort { color: #0056b3; background-color: #e7f1ff; }
.active-sort::after { content: ' ▼'; font-size: 0.8em; }
.mvp-badge {
    background-color: #ffc107;
    color: #212529;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}
.mvp-row { background-color: #fffbe6 !important; }

/* --- Estilos para el Panel de Juego en Vivo --- */
.game-panel { display: flex; flex-direction: column; gap: 15px; }
@media (min-width: 1000px) { .game-panel { flex-direction: row; justify-content: space-between; gap: 20px; } }
.team-column { width: 100%; background-color: #f8f9fa; border-radius: 8px; padding: 10px; border-top: 5px solid; overflow-x: auto; }

/* Estilos antiguos del encabezado del equipo (reemplazados por el nuevo marcador) */
.team-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #dee2e6; margin-bottom: 10px; padding-bottom: 10px; }
.team-score { font-size: 2.2em; font-weight: bold; color: #333; }
.box-score-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.box-score-table th, .box-score-table td { padding: 8px 5px; text-align: center; border-bottom: 1px solid #e9ecef; }
.box-score-table th { font-weight: 600; color: #495057; background-color: #f4f7f9; }
.box-score-table td:first-child { text-align: left; font-weight: 600; color: #0056b3; }
.stat-controls { display: flex; justify-content: center; align-items: center; gap: 2px; }

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 250px;
    font-size: 0.95em;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { border-left: 5px solid #28a745; }
.toast.error { border-left: 5px solid #dc3545; }
.toast.info { border-left: 5px solid #17a2b8; }
.toast.warning { border-left: 5px solid #ffc107; color: #fff; }

/* --- Pantalla de Carga --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4f7f9;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Nuevos controles de puntos */
.points-controls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.points-add-controls { display: flex; gap: 4px; }
.points-add-controls button { background-color: #007bff; flex-grow: 1; }
.points-add-controls button:hover { background-color: #0056b3; }
.points-remove-controls { display: flex; gap: 4px; }

/* Estilo para TODOS los botones de resta (color rojo) */
.points-remove-controls button,
.stat-controls button[onclick*="', -1"] {
    background-color: #dc3545; /* Rojo */
}
.points-remove-controls button:hover,
.stat-controls button[onclick*="', -1"]:hover {
    background-color: #c82333; /* Rojo oscuro */
}

/* Nuevo marcador central */
.live-scoreboard { display: flex; text-align: center; margin-bottom: 25px; border-radius: 8px; overflow: hidden; /* Clave para que los bordes redondeados afecten a los hijos */ }
.scoreboard-team { flex: 1; padding: 15px; }
.scoreboard-team-name { font-size: 1.4em; font-weight: 600; }
.scoreboard-score { font-size: 3.5em; font-weight: bold; line-height: 1.1; }
/* .scoreboard-separator ya no es necesario */

/* Ajustes generales al modal de juego */
#game-stats-modal-content h2 { color: #333; }

/* --- Fin de estilos del Panel de Juego en Vivo --- */

.finalize-section { margin-top: 20px; padding: 20px; border-top: 2px solid #007bff; text-align: center; background-color: #e9ecef; border-radius: 8px; }
.finalize-section select { padding: 8px; border-radius: 5px; margin-right: 10px; border: 1px solid #ced4da; }
.finalize-section .secondary-button { background-color: #6c757d; }
.finalize-section .secondary-button:hover { background-color: #5a6268; }


/* Estilos para el Podio del Campeón */
.champion-podium {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.champion-box {
    background-color: #fff;
    border: 2px solid #ffc107; /* Borde dorado */
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
}
.champion-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #0056b3;
}

/* Estilos para el pie de página */
.page-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6; /* Línea sutil de separación */
    color: #6c757d; /* Color de texto grisáceo */
    font-size: 0.9em;
}
.page-footer strong {
    color: #495057; /* Un poco más oscuro para el nombre */
}

/* Marca de agua */
.watermark {
    text-align: center;
    margin-top: 40px;
    padding: 15px 0;
    color: #6c757d;
    font-size: 0.85em;
    border-top: 1px solid #e9ecef;
}
.watermark .developer-name {
    color: #0056b3;
    font-weight: 600;
}

/* --- Estilos Competencia Triples --- */
.triples-container {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.triples-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 15px;
}

.triples-header h2 {
    margin-bottom: 10px;
}

.triples-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.triples-controls select {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    min-width: 200px;
}

.triples-table input[type="number"] {
    width: 80px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
}

.triples-table button.delete-btn {
    background-color: #dc3545;
    padding: 5px 10px;
    font-size: 0.8em;
}

.triples-table button.delete-btn:hover {
    background-color: #c82333;
}

.gold-medal { color: #ffd700; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.silver-medal { color: #c0c0c0; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.bronze-medal { color: #cd7f32; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* --- NUEVO LAYOUT CON SIDEBAR --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background-color: #1a252f;
}

.sidebar-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5em;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #ecf0f1;
    padding: 15px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0;
}

.sidebar-menu button:hover {
    background-color: #34495e;
    transform: none;
}

.sidebar-menu button.active {
    background-color: #3498db;
    border-left: 4px solid #2980b9;
}

.sidebar-menu .divider {
    height: 20px;
    background-color: transparent;
    border: none;
}

.sidebar-menu .danger-btn:hover {
    background-color: #c0392b;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    padding: 30px;
    background-color: #f4f7f9;
}

.view-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.view-header h1 {
    color: #2c3e50;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2, .sidebar-menu button span, .sidebar-menu button {
        font-size: 0; /* Hide text */
    }
    .sidebar-menu button {
        justify-content: center;
        padding: 15px 0;
    }
    .sidebar-menu button i {
        font-size: 1.2rem; /* Show icon */
        margin: 0;
    }
    .main-content {
        margin-left: 60px;
    }
}

/* --- MEJORAS MODAL JUEGO EN VIVO --- */
.modal-content {
    width: 98%;
    max-width: 1600px;
    padding: 15px;
    max-height: 95vh;
    overflow-y: auto;
}

#game-stats-modal .modal-content {
    max-width: 1650px;
}

.box-score-table {
    width: 100%;
    table-layout: auto;
    font-size: 0.8em;
}

.box-score-table th, .box-score-table td {
    padding: 5px 2px;
    vertical-align: middle;
    white-space: nowrap;
}

.box-score-table th {
    font-size: 0.75em;
}

.player-name-cell {
    text-align: left;
    font-weight: 600;
    color: #0056b3;
    white-space: nowrap;
    overflow: visible;
    font-size: 0.85em;
}

/* Botones Mini */
.btn-mini {
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-width: 28px;
    margin: 1px;
    border-radius: 4px;
}
.btn-success { background-color: #28a745 !important; }
.btn-danger { background-color: #dc3545 !important; }

/* Layout de Puntos */
.points-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.points-display {
    font-size: 1.2em;
    font-weight: bold;
    width: 25px;
    text-align: center;
}
.points-actions {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.action-row {
    display: flex;
    gap: 1px;
}

/* Layout de otros controles */
.stat-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.stat-controls .stat-value {
    min-width: 16px;
    text-align: center;
    font-weight: bold;
}
/* --- CRONÓMETRO ESTILO NBA --- */
.nba-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px auto 40px auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
}

.nba-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
    border-radius: 12px;
    border: 3px solid #e94560;
    box-shadow: 
        0 0 20px rgba(233, 69, 96, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.timer-display {
    display: flex;
    align-items: center;
    font-family: 'Segoe UI', 'Arial Black', sans-serif;
}

.timer-minutes, .timer-seconds {
    font-size: 5rem;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 
        0 0 10px #ff6b6b,
        0 0 20px #ff6b6b,
        0 0 30px #e94560;
    letter-spacing: 2px;
    min-width: 100px;
    text-align: center;
}

/* Input editable del cronómetro */
.timer-input {
    font-size: 5rem;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 
        0 0 10px #ff6b6b,
        0 0 20px #ff6b6b,
        0 0 30px #e94560;
    letter-spacing: 2px;
    width: 120px;
    text-align: center;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: 'Segoe UI', 'Arial Black', sans-serif;
    -moz-appearance: textfield;
    transition: border-color 0.3s ease;
}

.timer-input::-webkit-outer-spin-button,
.timer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.timer-input:focus {
    outline: none;
    border-bottom: 3px solid #e94560;
}

.timer-input:hover {
    border-bottom: 3px solid rgba(233, 69, 96, 0.5);
}

.timer-separator {
    font-size: 5rem;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
    animation: blink 1s infinite;
    margin: 0 5px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.timer-label {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 10px;
    font-weight: 600;
}

.timer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.timer-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-btn.start-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.timer-btn.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.timer-btn.pause-btn {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.timer-btn.pause-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.timer-btn.reset-btn {
    background: linear-gradient(135deg, #dc3545 0%, #e94560 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.timer-btn.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.timer-preset {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
}

.timer-preset label {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.timer-preset select {
    padding: 8px 12px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background: #2c3e50;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.timer-preset select:focus {
    outline: 2px solid #e94560;
}

/* Estado activo del cronómetro (últimos 10 segundos) */
.nba-timer.warning .timer-minutes,
.nba-timer.warning .timer-seconds,
.nba-timer.warning .timer-input {
    color: #ff0000;
    animation: pulse-red 0.5s infinite;
}

@keyframes pulse-red {
    0%, 100% { 
        text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000;
    }
    50% { 
        text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000, 0 0 60px #ff0000;
    }
}

/* Estado pausado */
.nba-timer.paused .timer-minutes,
.nba-timer.paused .timer-seconds,
.nba-timer.paused .timer-input {
    color: #ffc107;
    text-shadow: 0 0 10px #ffc107, 0 0 20px #ffc107;
}

/* Responsive para cronómetro */
@media (max-width: 600px) {
    .timer-minutes, .timer-seconds, .timer-input {
        font-size: 3rem;
        min-width: 60px;
        width: 80px;
    }
    .timer-separator {
        font-size: 3rem;
    }
    .nba-timer {
        padding: 15px 25px;
    }
    .timer-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* --- CRONÓMETRO DEL JUEGO EN VIVO --- */
.game-timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.game-timer-display {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.quarter-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.quarter-selector label {
    color: #aaa;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quarter-selector select {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.quarter-selector select:focus {
    outline: 2px solid #e94560;
}

.game-clock {
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #e94560;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.game-timer-input {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b, 0 0 20px #e94560;
    width: 60px;
    text-align: center;
    background: transparent;
    border: none;
    font-family: 'Segoe UI', 'Arial Black', sans-serif;
    -moz-appearance: textfield;
}

.game-timer-input::-webkit-outer-spin-button,
.game-timer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.game-timer-input:focus {
    outline: none;
}

.game-timer-separator {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
    animation: blink 1s infinite;
}

.game-timer-controls {
    display: flex;
    gap: 8px;
}

.game-timer-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.game-timer-btn.start {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.game-timer-btn.pause {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.game-timer-btn.reset {
    background: linear-gradient(135deg, #dc3545 0%, #e94560 100%);
    color: white;
}

.game-timer-btn:hover {
    transform: scale(1.1);
}

/* Advertencia últimos 30 segundos */
.game-clock.warning .game-timer-input,
.game-clock.warning .game-timer-separator {
    color: #ff0000;
    animation: pulse-red 0.5s infinite;
}

/* Responsive para cronómetro del juego */
@media (max-width: 600px) {
    .game-timer-display {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .game-timer-input {
        font-size: 2rem;
        width: 50px;
    }
    
    .game-timer-separator {
        font-size: 2rem;
    }
    
    .game-timer-btn {
        width: 35px;
        height: 35px;
    }
}

/* --- ESTILOS PARA FALTAS --- */
.fouls-control {
    min-width: 70px;
}

.foul-count {
    font-weight: bold;
    min-width: 20px;
    display: inline-block;
    text-align: center;
}

.btn-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
}

/* Jugador en problemas de faltas (4 faltas) */
.foul-trouble {
    background-color: #fff3cd !important;
}

.foul-trouble td {
    color: #856404;
}

.foul-trouble .foul-count {
    color: #ff9800;
    font-size: 1.1em;
}

/* Jugador eliminado por faltas (5+ faltas) */
.fouled-out {
    background-color: #f8d7da !important;
    opacity: 0.7;
}

.fouled-out td {
    color: #721c24;
    text-decoration: line-through;
}

.fouled-out .foul-count {
    color: #dc3545;
    font-weight: 900;
    font-size: 1.2em;
}

.fouled-out .btn-mini {
    opacity: 0.5;
}

/* --- ESTILOS PARTIDO ÚNICO --- */
.singlematch-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.singlematch-header {
    text-align: center;
    margin-bottom: 30px;
}

.singlematch-header h2 {
    color: #0056b3;
    font-size: 2em;
    margin-bottom: 5px;
}

.singlematch-description {
    color: #6c757d;
    font-size: 1em;
}

.singlematch-board {
    max-width: 720px;
    margin: 0 auto 25px;
}

.singlematch-matchup {
    background: #fff;
    border: 2px solid #e8f0fe;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.singlematch-matchup:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.singlematch-team-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    border-left: 10px solid #ccc;
}

.singlematch-team-summary + .singlematch-vs,
.singlematch-vs + .singlematch-team-summary {
    border-top: 1px solid #eef2f8;
}

.singlematch-team-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0056b3;
    margin-bottom: 6px;
}

.singlematch-team-players {
    color: #5f6f83;
    font-size: 0.95rem;
    line-height: 1.5;
}

.singlematch-score {
    flex: 0 0 auto;
    min-width: 72px;
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    color: #0056b3;
    line-height: 1;
}

.singlematch-vs {
    padding: 8px 20px;
    text-align: center;
    font-weight: 900;
    color: #6c757d;
    background: #f8f9fa;
    letter-spacing: 2px;
}

.singlematch-primary-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.singlematch-play-btn {
    background: #28a745;
}

.singlematch-setup-panel {
    margin-top: 30px;
}

.singlematch-setup-panel.is-hidden {
    display: none;
}

.singlematch-setup {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.team-setup {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    min-width: 300px;
    max-width: 400px;
    flex: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-top: 5px solid #ccc;
}

.team-setup-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.team-name-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 1.2em;
    font-weight: bold;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.team-color-picker {
    width: 50px;
    height: 44px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.add-player-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.add-player-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
}

.add-player-form button {
    padding: 10px 15px;
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.add-player-form button:hover {
    background: #218838;
}

.players-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

.players-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 6px;
    transition: background 0.2s;
}

.players-list li:hover {
    background: #e9ecef;
}

.players-list .player-name {
    font-weight: 500;
}

.players-list .remove-player-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.players-list .remove-player-btn:hover {
    background: #c82333;
}

.team-score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    margin-top: 10px;
}

.team-score-display .score-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
}

.team-score-display .score-value {
    font-size: 2.5em;
    font-weight: 800;
    color: #0056b3;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vs-divider span {
    font-size: 2.5em;
    font-weight: 900;
    color: #6c757d;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.singlematch-timer-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.singlematch-stats {
    background: #1a202c;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.singlematch-stats h3 {
    text-align: center;
    color: #fff;
    margin-bottom: 25px;
    font-size: 1.4em;
}

.singlematch-tables {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.team-stats-panel {
    flex: 1;
    min-width: 340px;
    border-radius: 12px;
    overflow: hidden;
    background: #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.team-stats-panel h4 {
    text-align: center;
    padding: 16px;
    margin: 0;
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Contenedor de tarjetas de jugadores */
.players-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    min-height: 150px;
    max-height: 550px;
    overflow-y: auto;
    background: #1e2533;
}



.no-players-msg {
    text-align: center;
    color: #718096;
    padding: 40px;
    font-style: italic;
}

/* Tarjeta de jugador */
.player-stat-card {
    background: #2d3748;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.player-stat-card:hover {
    transform: translateY(-2px);
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.player-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #fff;
}

.player-pts {
    font-size: 1.4em;
    font-weight: 800;
    color: #ffc107;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.player-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sección de anotación */
.score-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-label {
    font-size: 0.85em;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.score-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.score-btn {
    flex: 1;
    min-width: 50px;
    border: none;
    color: white;
    padding: 14px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1em;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.25);
}

.score-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

.score-btn:active {
    transform: translateY(0);
}

.score-minus {
    background: linear-gradient(135deg, #dc3545, #c82333);
    flex: 0.7;
}

.score-1 {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.score-2 {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.score-3 {
    background: linear-gradient(135deg, #fd7e14, #e55300);
}

/* Sección de estadísticas */
.stats-section {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.stat-box {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75em;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #fff;
    min-width: 28px;
    text-align: center;
}

.stat-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.15s ease;
    background: #4a5568;
    color: #fff;
}

.stat-btn:hover {
    background: #718096;
    transform: scale(1.1);
}

.stat-minus:hover {
    background: #5a6268;
}

/* Animación de puntuación */
.score-flash {
    animation: scoreFlash 0.3s ease;
}

@keyframes scoreFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #28a745; }
    100% { transform: scale(1); }
}

/* Mejorar el marcador principal */
.team-score-display .score-value {
    font-size: 3em;
    font-weight: 900;
    transition: all 0.3s ease;
}

.singlematch-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.singlematch-live-panel {
    min-height: 0;
}

.singlematch-modal-actions {
    flex-wrap: wrap;
}

.reset-btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: background 0.2s;
}

.reset-btn-danger:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .singlematch-setup {
        flex-direction: column;
        align-items: center;
    }

    .singlematch-team-summary {
        padding: 18px;
        align-items: flex-start;
    }

    .singlematch-score {
        min-width: 54px;
        font-size: 2.2rem;
    }
    
    .team-setup {
        max-width: 100%;
        width: 100%;
    }
    
    .vs-divider {
        padding: 10px;
    }
    
    .vs-divider span {
        font-size: 1.8em;
    }
    
    .singlematch-tables {
        flex-direction: column;
    }
    
    .score-buttons {
        flex-wrap: wrap;
    }
    
    .score-btn {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    .pts-value {
        font-size: 1.2em;
    }
}

/* --- ESTILOS SERIE AL MEJOR DE 3 --- */
.series-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.series-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
}

/* Toggle switch personalizado */
.series-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.series-toggle input {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.series-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.series-toggle input:checked + .toggle-slider::before {
    left: 26px;
}

.toggle-label {
    font-weight: 600;
    color: #495057;
}

/* Marcador de la serie */
.series-scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
}

.series-team {
    display: flex;
    align-items: center;
    gap: 15px;
}

.series-team-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.series-wins {
    font-size: 3em;
    font-weight: 900;
    color: #0056b3;
    min-width: 60px;
    text-align: center;
}

.series-vs {
    text-align: center;
}

.series-vs span {
    font-size: 1em;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Indicadores de juegos */
.series-games {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.game-indicator {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 15px 25px;
    text-align: center;
    min-width: 100px;
    transition: all 0.3s ease;
}

.game-indicator.current {
    border-color: #ffc107;
    background: #fff8e1;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.game-indicator.completed {
    border-color: #28a745;
    background: #e8f5e9;
}

.game-number {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.game-result {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
}

.game-result.team-a-win {
    color: #d32f2f;
}

.game-result.team-b-win {
    color: #007bff;
}

/* Botones de registro de victoria */
.series-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.series-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.series-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.series-btn.win-a {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
}

.series-btn.win-b {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.series-btn.simulate {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
}

.series-btn.simulate:hover {
    background: linear-gradient(135deg, #ab47bc, #8e24aa);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

/* Sección de simulación completa */
.full-simulation-section {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    border-radius: 15px;
    border: 2px dashed rgba(255, 193, 7, 0.4);
}

.full-simulate-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.full-simulate-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5);
    background: linear-gradient(135deg, #ffa726, #fb8c00);
}

.full-simulate-btn:active {
    transform: translateY(0);
}

.full-simulate-btn i {
    font-size: 1.3em;
    animation: magicWand 2s ease-in-out infinite;
}

@keyframes magicWand {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.simulation-hint {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    font-style: italic;
}

.series-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Banner del ganador */
.series-winner-banner {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #333;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    animation: winnerPulse 1.5s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.winner-icon {
    font-size: 2em;
}

.winner-text {
    font-size: 1.5em;
    font-weight: 800;
    margin: 0 15px;
}

/* Botón reiniciar serie */
.reset-series-btn {
    display: block;
    margin: 0 auto;
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-series-btn:hover {
    background: #5a6268;
}

/* --- MVP DE LA SERIE --- */
.series-mvp-section {
    margin-bottom: 25px;
}

.mvp-card {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 50%, #ff8c00 100%);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
    position: relative;
    overflow: hidden;
}

.mvp-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: mvpShine 3s infinite;
}

@keyframes mvpShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.mvp-icon {
    font-size: 4em;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: mvpBounce 2s ease-in-out infinite;
}

@keyframes mvpBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mvp-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mvp-title {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(0,0,0,0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mvp-name {
    font-size: 2em;
    font-weight: 900;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.mvp-team {
    font-size: 1.1em;
    font-weight: 600;
    color: rgba(0,0,0,0.7);
}

.mvp-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mvp-stat {
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    padding: 10px 15px;
    text-align: center;
    min-width: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mvp-stat-item {
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    padding: 10px 15px;
    text-align: center;
    min-width: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mvp-stat-item .stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 800;
    color: #0056b3;
    background: transparent;
    padding: 0;
}

.mvp-stat-item .stat-label {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.mvp-stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 800;
    color: #0056b3;
}

.mvp-stat-label {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

/* --- RANKING DE JUGADORES DE LA SERIE --- */
.series-ranking {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.series-ranking h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.ranking-table {
    font-size: 0.9em;
}

.ranking-table th,
.ranking-table td {
    padding: 10px 8px;
    text-align: center;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
    text-align: left;
}

.ranking-table .mvp-row {
    background: linear-gradient(90deg, #fffbe6, #fff8e1) !important;
}

.ranking-table .mvp-badge {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #333;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ranking-medal {
    font-size: 1.2em;
}

/* --- HISTORIAL DE LA SERIE --- */
.series-history {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.export-history-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.export-history-btn:hover {
    background: #218838;
}

.no-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.history-game {
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Tarjetas del historial de mini serie */
.history-game-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.history-game-card .history-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0;
    cursor: default;
}

.history-game-card .game-number {
    font-weight: bold;
    font-size: 1.1em;
    color: #ffc107;
}

.history-game-card .game-date {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.history-game-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
}

.history-team {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-team .team-name {
    font-weight: 600;
    color: #fff;
}

.history-team .team-score {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 8px;
}

.history-team.winner .team-score {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
}

.history-team.winner .team-name {
    color: #28a745;
}

.vs-separator {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
}

.history-winner {
    text-align: center;
    font-size: 0.95em;
    color: #ffc107;
    font-weight: 600;
}

/* Botón de editar juego */
.history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-game-btn {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #ffc107;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
}

.edit-game-btn:hover {
    background: rgba(255, 193, 7, 0.4);
    transform: scale(1.05);
}

/* Modal de edición de juego */
.edit-game-modal {
    z-index: 10000;
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.edit-game-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    border-radius: 15px;
    color: #fff;
    position: relative;
}

.edit-game-modal-content .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.edit-game-modal-content .close-btn:hover {
    color: #ff4444;
}

.edit-game-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.edit-game-header h3 {
    font-size: 1.5em;
    margin: 0 0 5px 0;
    color: #ffc107;
}

.edit-game-date {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.edit-winner-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.edit-winner-section label {
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.winner-toggle {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.winner-option {
    padding: 12px 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.winner-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.winner-option.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.edit-teams-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.edit-team-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.edit-team-section h4 {
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.1em;
}

.edit-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.edit-stats-table th,
.edit-stats-table td {
    padding: 8px 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-stats-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: bold;
    color: #ccc;
}

.edit-stats-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.edit-stat-input {
    width: 50px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    font-size: 1em;
}

.edit-stat-input:focus {
    outline: none;
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.2);
}

.edit-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel {
    padding: 12px 30px;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: rgba(108, 117, 125, 1);
}

.btn-save {
    padding: 12px 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

@media (max-width: 768px) {
    .edit-teams-container {
        flex-direction: column;
    }
    
    .edit-game-modal-content {
        padding: 15px;
    }
    
    .winner-toggle {
        flex-direction: column;
    }
}

.no-history {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px;
}

.history-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
    flex-wrap: wrap;
    gap: 10px;
}

.history-game-header:hover {
    background: #f1f3f5;
}

.game-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.game-badge {
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 700;
}

.game-score {
    font-size: 1.1em;
    font-weight: 600;
}

.game-score b {
    font-size: 1.2em;
    color: #0056b3;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.winner-tag {
    border: 2px solid;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.game-date {
    color: #6c757d;
    font-size: 0.85em;
}

.expand-icon {
    color: #6c757d;
    transition: transform 0.3s;
}

/* Detalles del juego */
.history-game-details {
    border-top: 1px solid #dee2e6;
    padding: 20px;
    background: #fafbfc;
}

.history-team-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.history-team {
    flex: 1;
    min-width: 280px;
    border-left: 4px solid;
    padding-left: 15px;
}

.history-team h5 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.history-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.history-stats-table th,
.history-stats-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.history-stats-table th {
    background: #f1f3f5;
    font-weight: 600;
    color: #495057;
}

.history-stats-table td:first-child {
    text-align: left;
}

.history-stats-table .total-row {
    background: #e9ecef;
    font-weight: 600;
}

.history-stats-table .total-row td {
    border-top: 2px solid #dee2e6;
}

@media (max-width: 768px) {
    .series-scoreboard {
        flex-direction: column;
        gap: 15px;
    }
    
    .series-team {
        flex-direction: column;
        gap: 5px;
    }
    
    .series-wins {
        font-size: 2.5em;
    }
    
    .series-games {
        flex-direction: column;
        align-items: center;
    }
    
    .game-indicator {
        width: 100%;
        max-width: 200px;
    }
    
    .series-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .series-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .history-game-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .history-team-stats {
        flex-direction: column;
    }
    
    .history-team {
        min-width: 100%;
    }
}

/* =============================== */
/* ESTILOS MINI SERIE              */
/* =============================== */

.miniseries-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.miniseries-header {
    text-align: center;
    margin-bottom: 30px;
}

.miniseries-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 8px;
}

.miniseries-description {
    color: #6c757d;
    font-size: 1.1em;
}

.miniseries-setup {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.miniseries-setup-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    max-width: 960px;
    margin: 0 auto 30px;
}

.miniseries-setup-panel.is-hidden {
    display: none;
}

.miniseries-setup .team-setup {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.miniseries-setup-panel .team-setup {
    min-width: 0;
    max-width: none;
    width: 100%;
}

.miniseries-setup-panel .team-name-input,
.miniseries-setup-panel .add-player-form input {
    min-width: 0;
}

.miniseries-setup-panel .add-player-form {
    flex-direction: column;
}

.miniseries-setup-panel .add-player-form button {
    justify-content: center;
}

.series-scoreboard-section {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.current-game-section {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.current-game-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.current-game-scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

.current-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    border-radius: 12px;
    color: white;
    min-width: 150px;
}

.current-team-name {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
}

.current-score {
    font-size: 3.5em;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.current-vs {
    font-size: 1.5em;
    font-weight: 700;
    color: #6c757d;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.miniseries-primary-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: -5px 0 30px;
}

.miniseries-modal-series-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 10px auto 18px;
    color: #5f6f83;
    font-weight: 800;
}

.miniseries-modal-series-score b {
    color: #1d4ed8;
    letter-spacing: 0.08em;
}

.miniseries-live-panel {
    min-height: 0;
}

.miniseries-modal-actions {
    flex-wrap: wrap;
}

.miniseries-stats {
    background: #1a202c;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.miniseries-stats h3 {
    text-align: center;
    color: #fff;
    margin-bottom: 25px;
    font-size: 1.4em;
}

.miniseries-tables {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.miniseries-tables .team-stats-panel {
    flex: 1;
    min-width: 340px;
}

.miniseries-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.score-flash {
    animation: scoreFlash 0.3s ease;
}

@keyframes scoreFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #ffc107; }
    100% { transform: scale(1); }
}

/* Responsive Mini Serie */
@media (max-width: 1100px) {
    .miniseries-setup-panel {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
}

@media (max-width: 768px) {
    .miniseries-live-panel {
        flex: 0 0 auto;
        flex-direction: column;
        overflow: visible;
        width: 100%;
    }

    .miniseries-live-panel .team-column {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
    }

    .miniseries-live-panel .team-players-grid {
        grid-template-columns: 1fr;
    }

    .current-game-scoreboard {
        flex-direction: column;
        gap: 15px;
    }
    
    .current-team {
        width: 100%;
        max-width: 250px;
    }
    
    .current-score {
        font-size: 2.5em;
    }
    
    .game-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-actions .series-btn {
        width: 100%;
        max-width: 280px;
    }
}
