*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --verde: #1a7a3c;
    --verde-claro: #25a355;
    --fondo: #f0f4f0;
    --card: #ffffff;
    --texto: #1a1a1a;
    --gris: #6b7280;
    --borde: #e0e7e0;
    --correcto: #16a34a;
    --incorrecto: #dc2626;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    min-height: 100vh;
}

/* Nav */
nav {
    background: var(--verde);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.nav-brand { color: white; font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: white; }
.btn-logout {
    background: rgba(255,255,255,0.15);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
}

main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
h1 { font-size: 1.6rem; margin-bottom: 1.25rem; color: var(--verde); }
h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--texto); }

/* Auth */
.auth-box {
    max-width: 360px;
    margin: 4rem auto;
    background: var(--card);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.auth-box h1 { text-align: center; margin-bottom: 1.5rem; }
.auth-box form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-box input {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 1rem;
}
.auth-box button {
    padding: 0.7rem;
    background: var(--verde);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.25rem;
}
.auth-box button:hover { background: var(--verde-claro); }
.auth-link { text-align: center; margin-top: 1rem; color: var(--gris); font-size: 0.9rem; }
.auth-link a { color: var(--verde); }
.error { color: var(--incorrecto); font-size: 0.9rem; margin-bottom: 0.5rem; text-align: center; }

/* Puntos info */
.puntos-info {
    display: flex;
    gap: 1.5rem;
    background: var(--card);
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--gris);
}

/* Partidos */
.partidos-grid { display: flex; flex-direction: column; gap: 1rem; }

.partido-card {
    background: var(--card);
    border: 1px solid var(--borde);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.partido-card.jugado { opacity: 0.85; }

.partido-fecha { font-size: 0.82rem; color: var(--gris); margin-bottom: 0.5rem; }

.partido-equipos {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.vs { color: var(--gris); font-weight: 400; font-size: 0.95rem; }

.resultado-final {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--verde);
    margin-bottom: 0.6rem;
}

.pred-resultado {
    text-align: center;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
}
.pred-resultado.correcto { background: #dcfce7; color: var(--correcto); }
.pred-resultado.incorrecto { background: #fee2e2; color: var(--incorrecto); }
.pred-resultado.sin-pred { background: #f3f4f6; color: var(--gris); }

/* Opciones de predicción */
.score-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.score-equipo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.score-label {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 80px;
    text-align: center;
    line-height: 1.2;
}
.score-input {
    width: 52px;
    padding: 0.5rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--borde);
    border-radius: 8px;
    background: var(--fondo);
    -moz-appearance: textfield;
}
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-input:focus { border-color: var(--verde); outline: none; }
.score-sep {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--texto-suave);
}
.badge-exacto {
    background: #ffd700;
    color: #7a5000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.btn-predecir {
    width: 100%;
    padding: 0.65rem;
    background: var(--verde);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-predecir:hover { background: var(--verde-claro); }

/* Ranking */
.ranking-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
.ranking-table th {
    background: var(--verde);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}
.ranking-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--borde); }
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table .pos { font-size: 1.1rem; width: 50px; }
.ranking-table .puntos { font-weight: 700; font-size: 1.1rem; color: var(--verde); }
.fila-propia { background: #f0faf4; }

/* Admin */
.admin-section { background: var(--card); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--borde); }
.admin-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; }
.admin-form input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 140px;
}
.admin-form button, .admin-section button[type="submit"] {
    padding: 0.6rem 1.2rem;
    background: var(--verde);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}
.admin-form button:hover { background: var(--verde-claro); }

.admin-partido {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--borde);
    flex-wrap: wrap;
}
.admin-partido:last-child { border-bottom: none; }
.admin-partido-info { display: flex; flex-direction: column; gap: 0.2rem; }
.fecha-small { font-size: 0.82rem; color: var(--gris); }
.resultado-badge {
    display: inline-block;
    background: #dcfce7;
    color: var(--correcto);
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.9rem;
}
.admin-partido-acciones { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.form-resultado { display: flex; align-items: center; gap: 0.4rem; }
.form-resultado input {
    padding: 0.5rem;
    border: 1px solid var(--borde);
    border-radius: 6px;
    text-align: center;
}
.btn-eliminar {
    padding: 0.5rem 0.9rem;
    background: #fee2e2;
    color: var(--incorrecto);
    border: 1px solid #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-eliminar:hover { background: #fca5a5; }

.empty { color: var(--gris); font-style: italic; }

/* Secciones por día */
.dia-seccion { margin-bottom: 2.5rem; }
.dia-titulo {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gris);
    border-bottom: 2px solid var(--borde);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Header del partido */
.partido-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.partido-hora { font-size: 0.9rem; font-weight: 600; color: var(--verde); }

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}
.badge-abierto { background: #dcfce7; color: var(--correcto); }
.badge-cerrado { background: #fef9c3; color: #854d0e; }
.badge-jugado  { background: #e0e7ff; color: #3730a3; }

/* Partido bloqueado */
.partido-card.bloqueado { background: #fafafa; }
.pred-bloqueada {
    text-align: center;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    background: #fef9c3;
    color: #854d0e;
}

@media (max-width: 600px) {
    .partido-equipos { font-size: 1rem; }
    .admin-form { flex-direction: column; }
    .admin-form input { min-width: unset; width: 100%; }
}
