/* ===== VARIABLES CSS - Todo en AZUL ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --secondary-color: #64748b;
    --team-1: #1d4ed8;
    --team-2: #0891b2;
    --team-3: #0d9488;
    --team-4: #059669;
    --success-color: #22c55e;
    --success-dark: #16a34a;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --star-color: #fbbf24;
    --star-empty: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* ===== HEADER ===== */
.app-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-config {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-config:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== NAVEGACIÓN ===== */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 58px;
    z-index: 99;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--background-color);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-btn .nav-icon {
    font-size: 1.2rem;
}

.nav-btn:hover {
    background: #e2e8f0;
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== SECCIONES ===== */
.seccion {
    display: none;
    animation: fadeIn 0.3s ease;
}

.seccion.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CARDS ===== */
.card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h2 {
    margin-bottom: 0;
}

.descripcion {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.input-texto,
.input-numero,
.select-equipos,
.input-fecha {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--card-background);
}

.input-texto:focus,
.input-numero:focus,
.select-equipos:focus,
.input-fecha:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== RATING (ESTRELLAS) - 4 estrellas ===== */
.rating-container {
    display: flex;
    gap: 8px;
    font-size: 2rem;
}

.rating-container .star {
    color: var(--star-empty);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.rating-container .star:hover,
.rating-container .star.hover {
    color: var(--star-color);
    transform: scale(1.1);
}

.rating-container .star.active {
    color: var(--star-color);
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== FILTROS ===== */
.filtros,
.filtros-partidos {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filtro-btn {
    padding: 8px 16px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.filtro-btn:hover {
    background: #e2e8f0;
}

.filtro-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: transparent;
}

/* ===== LISTA DE JUGADORES ===== */
.lista-jugadores {
    max-height: 400px;
    overflow-y: auto;
}

.jugador-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.jugador-item:hover {
    background: #e2e8f0;
}

.jugador-info {
    flex: 1;
}

.jugador-nombre {
    font-weight: 600;
    margin-bottom: 4px;
}

.jugador-detalles {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.jugador-estrellas {
    color: var(--star-color);
    letter-spacing: -2px;
}

.jugador-acciones {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 1rem;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
}

/* ===== LISTA DE SELECCIÓN ===== */
.lista-seleccion .jugador-item {
    cursor: pointer;
}

.lista-seleccion .jugador-item.seleccionado {
    background: rgba(37, 99, 235, 0.15);
    border: 2px solid var(--primary-color);
}

.jugador-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.9rem;
}

.jugador-item.seleccionado .jugador-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.acciones-seleccion {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== RESULTADOS ===== */
.resultado {
    margin-top: 20px;
}

.resultado h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    text-align: center;
}

.equipos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.equipo-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.equipo-header {
    padding: 12px 16px;
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.equipo-1 .equipo-header { background: var(--team-1); }
.equipo-2 .equipo-header { background: var(--team-2); }
.equipo-3 .equipo-header { background: var(--team-3); }
.equipo-4 .equipo-header { background: var(--team-4); }

.equipo-stats {
    font-size: 0.85rem;
    opacity: 0.9;
}

.equipo-lista {
    padding: 16px;
}

.equipo-jugador {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.equipo-jugador:last-child {
    border-bottom: none;
}

.equipo-jugador-nombre {
    font-weight: 500;
}

.equipo-jugador-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== BOTÓN GUARDAR PARTIDO ===== */
.btn-guardar-partido {
    margin-top: 16px;
}

/* ===== LISTA DE PARTIDOS ===== */
.lista-partidos {
    max-height: 500px;
    overflow-y: auto;
}

.partido-item {
    background: var(--background-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.partido-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Partidos pendientes - más destacados */
.partido-item.pendiente {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary-color);
}

.partido-item.pendiente::before {
    content: '⏳';
    display: inline-block;
    margin-right: 8px;
}

.partido-estado {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.partido-item.pendiente .partido-estado {
    background: var(--primary-color);
    color: white;
}

.partido-item.finalizado .partido-estado {
    background: var(--success-color);
    color: white;
}

/* Partidos finalizados - menos destacados */
.partido-item.finalizado {
    background: var(--background-color);
    opacity: 0.75;
}

.partido-item.finalizado::before {
    content: '✅';
    display: inline-block;
    margin-right: 8px;
}

.partido-fecha {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.partido-marcador {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}

.partido-equipo {
    text-align: center;
    flex: 1;
}

.partido-equipo-nombre {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.partido-equipo-goles {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.partido-vs {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ===== MODAL DE PARTIDO ===== */
.modal-partido-content {
    max-width: 500px;
}

.partido-detalle-header {
    text-align: center;
    margin-bottom: 20px;
}

.partido-detalle-fecha {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.partido-detalle-fecha input {
    flex: 1;
}

.marcador-grande {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--radius-md);
}

.marcador-equipo {
    text-align: center;
}

.marcador-equipo-nombre {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--primary-dark);
}

.marcador-goles {
    font-size: 2.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    color: var(--primary-color);
}

.marcador-vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

.marcador-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* ===== JUGADORES EN PARTIDO ===== */
.partido-equipos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.partido-equipo-lista {
    background: var(--background-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.partido-equipo-lista h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-dark);
}

.jugador-partido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    background: var(--card-background);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.jugador-partido:hover {
    background: rgba(37, 99, 235, 0.1);
}

.jugador-partido.disabled {
    cursor: default;
    opacity: 0.7;
}

.jugador-partido.disabled:hover {
    background: var(--card-background);
}

.jugador-partido-goles {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--success-color);
}

/* ===== MODAL DE GOLES ===== */
.modal-small {
    max-width: 300px;
}

.goles-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.btn-gol {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-menos {
    background: var(--danger-color);
    color: white;
}

.btn-menos:hover {
    background: var(--danger-dark);
}

.btn-mas {
    background: var(--primary-color);
    color: white;
}

.btn-mas:hover {
    background: var(--primary-dark);
}

.goles-numero {
    font-size: 3rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    color: var(--primary-color);
}

/* ===== SECCIÓN DE AUTOGOLES ===== */
.goles-seccion {
    margin-bottom: 16px;
}

.goles-seccion:last-child {
    margin-bottom: 0;
}

.goles-label {
    display: block;
    text-align: center;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.goles-propia {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.goles-propia .goles-control {
    padding: 12px;
}

.btn-propia {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

.goles-numero-propia {
    font-size: 2rem;
    color: var(--warning-color);
}

/* Stats de jugadores en partido */
.jugador-partido-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.jugador-partido-goles {
    color: var(--primary-color);
    font-weight: 600;
}

.jugador-partido-autogoles {
    color: var(--warning-color);
    font-weight: 600;
    font-size: 0.85rem;
}

/* ===== MODAL DE CONFIGURACIÓN ===== */
.config-section {
    margin-bottom: 24px;
}

.config-section h4 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.config-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.config-btn {
    padding: 10px 20px;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.config-btn:hover {
    background: #e2e8f0;
}

.config-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.config-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 100px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--text-color);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    animation: toastIn 0.3s ease;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }
.toast.warning { background: var(--warning-color); }

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== UTILIDADES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .nav-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .nav-btn .nav-icon {
        font-size: 1rem;
    }
    
    .container {
        padding: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .rating-container {
        font-size: 1.7rem;
    }
    
    .equipos-grid {
        grid-template-columns: 1fr;
    }
    
    .acciones-seleccion {
        flex-direction: column;
    }
    
    .acciones-seleccion .btn {
        width: 100%;
    }
    
    .partido-equipos {
        grid-template-columns: 1fr;
    }
    
    .partido-detalle-fecha {
        flex-direction: column;
    }
    
    .marcador-grande {
        padding: 15px;
        gap: 15px;
    }
    
    .config-options {
        flex-direction: column;
    }
    
    .config-options .btn,
    .config-options .config-btn {
        width: 100%;
    }
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.lista-jugadores::-webkit-scrollbar,
.lista-partidos::-webkit-scrollbar {
    width: 6px;
}

.lista-jugadores::-webkit-scrollbar-track,
.lista-partidos::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 3px;
}

.lista-jugadores::-webkit-scrollbar-thumb,
.lista-partidos::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.lista-jugadores::-webkit-scrollbar-thumb:hover,
.lista-partidos::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== COLORES DE EQUIPOS Y CAMISETAS ===== */
.equipo-header-nombre {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.equipo-header-nombre:hover {
    background: rgba(255, 255, 255, 0.2);
}

.equipo-header-nombre .camiseta-icon {
    flex-shrink: 0;
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    opacity: 0.85;
}

/* ===== DRAG AND DROP ===== */
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px;
    user-select: none;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    background: var(--border-color) !important;
}

.drag-over {
    border: 2px dashed var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.ghost-drag {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    background: var(--card-background);
    padding: 8px 12px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hacer jugadores arrastrables */
.jugador-equipo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: grab;
    transition: var(--transition);
    user-select: none;
}

.jugador-equipo-item:active {
    cursor: grabbing;
}

.jugador-equipo-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== HINT DE RESULTADO ===== */
.resultado-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.8;
}

.resultado-hint-equipos {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 4px;
    font-style: italic;
}

/* ===== BOTÓN EDITAR PARTIDO ===== */
.btn-editar-partido {
    background: var(--warning-color);
    color: white;
}

.btn-editar-partido:hover {
    background: #d97706;
}

/* ===== MEJORAS VISUALES EQUIPOS ===== */
.equipo-creado {
    transition: var(--transition);
}

.equipo-creado .equipo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.equipo-jugadores {
    padding: 12px;
    min-height: 100px;
}

/* Estilos para equipos con colores dinámicos */
.equipo-creado[data-color="azul"] .equipo-header {
    background: #2563eb;
    color: white;
}

.equipo-creado[data-color="rojo"] .equipo-header {
    background: #dc2626;
    color: white;
}

.equipo-creado[data-color="negro"] .equipo-header {
    background: #1f2937;
    color: white;
}

.equipo-creado[data-color="blanco"] .equipo-header {
    background: #f8fafc;
    color: #1f2937;
    border-bottom: 1px solid var(--border-color);
}

.equipo-creado[data-color="petos"] .equipo-header {
    background: #facc15;
    color: #1f2937;
}

/* Ajuste para texto en equipos claros */
.equipo-creado[data-color="blanco"] .equipo-header-nombre:hover,
.equipo-creado[data-color="petos"] .equipo-header-nombre:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ===== SISTEMA CLICK-TO-SWAP ===== */
.jugador-clickable {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.jugador-clickable:hover {
    background: rgba(255, 255, 255, 0.15);
}

.jugador-clickable.selected {
    border: 2px solid #22c55e;
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* ===== EQUIPO MULTICOLOR ===== */
.equipo-creado[data-color="multicolor"] .equipo-header {
    background: linear-gradient(135deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6);
    color: white;
}

.equipo-header[style*="linear-gradient"] {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== MEJORAS MODAL PARTIDOS ===== */
.jugador-partido.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.jugador-partido.clickable:hover {
    background: rgba(37, 99, 235, 0.1);
}

.jugador-partido.disabled {
    opacity: 0.7;
    cursor: default;
}

/* ===== BOTÓN RESETEAR ===== */
.btn-resetear {
    background: var(--secondary-color);
}

.btn-resetear:hover {
    background: #475569;
}

/* ===== MODO OSCURO ===== */
body.dark-mode {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #475569;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

body.dark-mode .app-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

body.dark-mode .main-nav {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .nav-btn {
    color: #94a3b8;
}

body.dark-mode .nav-btn.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .input-texto,
body.dark-mode .input-numero,
body.dark-mode .select-equipos,
body.dark-mode .input-buscar {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .modal-content {
    background: #1e293b;
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

body.dark-mode .jugador-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .equipo-creado {
    background: #0f172a;
}

body.dark-mode .config-btn {
    background: #334155;
    color: #f1f5f9;
}

body.dark-mode .config-btn.active {
    background: #3b82f6;
}

body.dark-mode .toast {
    background: #334155;
    color: #f1f5f9;
}

/* ===== TOGGLE SWITCH ===== */
.config-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.config-toggle:last-child {
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ===== BÚSQUEDA DE JUGADORES ===== */
.search-container {
    margin-bottom: 16px;
}

.input-buscar {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.input-buscar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.jugadores-acciones {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== ESTADÍSTICAS ===== */
.stats-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.stats-item.stats-top {
    border-left: 4px solid var(--warning-color);
}

.stats-item.stats-top:first-child {
    border-left-color: gold;
    background: linear-gradient(90deg, rgba(255,215,0,0.1), transparent);
}

.stats-item.stats-top:nth-child(2) {
    border-left-color: silver;
}

.stats-item.stats-top:nth-child(3) {
    border-left-color: #cd7f32;
}

.stats-posicion {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.stats-info {
    flex: 1;
}

.stats-nombre {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stats-detalle {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-goles {
    text-align: center;
}

.stats-goles-numero {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stats-goles-avg {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== ACERCA DE ===== */
.acerca-body {
    text-align: center;
    padding: 24px;
}

.acerca-logo {
    font-size: 4rem;
    margin-bottom: 16px;
}

.acerca-body h2 {
    margin: 0 0 8px;
    color: var(--text-color);
}

.acerca-version {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.acerca-desc {
    color: var(--text-color);
    margin-bottom: 24px;
    line-height: 1.5;
}

.acerca-autor {
    padding: 16px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.acerca-autor p {
    margin: 4px 0;
    color: var(--text-muted);
}

.acerca-autor a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ===== MODAL VALORACIÓN ===== */
.valoracion-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
}

.btn-link:hover {
    color: var(--text-color);
}

.btn-block {
    width: 100%;
}

/* ===== RESPONSIVE MEJORAS ===== */
@media (max-width: 400px) {
    .stats-detalle {
        flex-direction: column;
        gap: 4px;
    }
    
    .config-toggle span {
        font-size: 0.9rem;
    }
}

/* ===== LANDING PAGE PARA MÓVILES ANDROID ===== */
.landing-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
    display: flex;
    flex-direction: column;
}

.landing-header {
    text-align: center;
    padding: 40px 20px 30px;
}

.landing-logo {
    margin-bottom: 20px;
}

.logo-img {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.landing-header h1 {
    font-size: 2rem;
    margin: 0 0 8px;
    font-weight: 700;
}

.landing-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.landing-main {
    flex: 1;
    padding: 0 20px 30px;
}

.landing-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.badge-item {
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    margin: 0 auto 30px;
    max-width: 280px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.download-icon {
    font-size: 1.5rem;
}

.download-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.download-text small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.download-text strong {
    font-size: 1.1rem;
}

.btn-download-large {
    max-width: 320px;
    padding: 16px 32px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.feature-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.feature-card h3 {
    font-size: 0.95rem;
    margin: 0 0 6px;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.85;
}

.landing-cta {
    text-align: center;
    padding: 20px 0;
}

.landing-cta p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.landing-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0 0 16px;
}

.btn-use-web {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-use-web:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== FOOTER WEB APP ===== */
.web-footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    text-align: center;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

body.dark-mode .web-footer {
    background: #1e293b;
    border-color: #334155;
}