/* Variables maestras del ecosistema visual de la plataforma */
:root {
    --bg-main: #070c14;       /* Fondo oscuro absoluto de estadio */
    --bg-card: #111a2e;       /* Base sólida para las cajas */
    --primary: #1d72b8;       /* Azul eléctrico deportivo */
    --accent-gold: #f1c40f;   /* Dorado reflectivo para premios y fichas */
    --text-main: #ffffff;     /* Texto de alto contraste */
    --text-muted: #94a3b8;    /* Gris atenuado para etiquetas secundarias */
    --success: #2ecc71;       /* Verde neón para botones de confirmación */
    --danger: #e74c3c;        /* Rojo vibrante para cierres/alertas */
    --vs-glow: rgba(30, 144, 255, 0.4);
    color-scheme: dark;       /* OBLIGA al navegador a renderizar menús y selects en Modo Oscuro nativo */
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 10px;
    padding-bottom: 50px;
    background-image: radial-gradient(circle at top center, #152542 0%, #070c14 100%);
    background-attachment: fixed;
}

/* Encabezado Principal */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(17, 26, 46, 0.85);
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
}

header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.badge {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(241, 196, 15, 0.05));
    color: var(--accent-gold);
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    border: 1px solid rgba(241, 196, 15, 0.4);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.1);
}

.logout {
    color: var(--danger);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: transform 0.2s;
}
.logout:hover {
    transform: scale(1.05);
}

/* Estructura del Feed Central */
main {
    max-width: 620px;
    margin: 0 auto;
}

.seccion-titulo {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.seccion-titulo span {
    color: var(--accent-gold);
}

/* Caja de Navegación de Fechas */
.calendar-navigator-box {
    background: rgba(17, 26, 46, 0.8);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(46, 204, 113, 0.25);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.calendar-navigator-box label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}
.calendar-navigator-box select {
    margin: 0;
    border-color: var(--success);
    font-weight: 700;
    cursor: pointer;
}

/* NUEVA CLASE: CAJA CONTENEDORA DE LA FICHA EDITABLE DE JUGADORES */
.box-profile-premium {
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.9), rgba(17, 26, 46, 0.95));
    border: 1px solid rgba(31, 114, 184, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.profile-header-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 8px;
}
.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.profile-input-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    display: block;
    margin-bottom: 3px;
}
.btn-profile-save {
    background: linear-gradient(135deg, #1d72b8, #115b9b) !important;
    padding: 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(29, 114, 184, 0.2) !important;
}

/* ARQUITECTURA DE LA TARJETA DE TRANSMISIÓN PREMIUM */
.card-premium {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
}

.card-premium:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 45px rgba(0,0,0,0.7), 0 0 20px rgba(31, 114, 184, 0.2);
}

.card-header-premium {
    text-align: center;
    margin-bottom: 20px;
}
.marcador-digital {
    font-size: 34px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255,255,255,0.4), 0 3px 6px rgba(0,0,0,0.8);
    font-family: 'Courier New', Courier, monospace;
}
.estadio-texto {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Bloque del Versus Central */
.versus-container-premium {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 25px 0;
}

.team-shield-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 42%;
    text-align: center;
}

.shield-wrapper {
    width: 85px;
    height: 85px;
    background: radial-gradient(circle, #1a2942 0%, #0d1624 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.15);
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
}
.card-premium:hover .shield-wrapper {
    transform: scale(1.08);
}

.flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.emoji-fallback {
    font-size: 38px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.nombre-equipo-premium {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-vs-glow {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 0 15px var(--danger), 0 4px 8px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    font-style: italic;
    animation: pulsacion-suave 2s infinite ease-in-out;
    flex-shrink: 0;
}

/* Zona Inferior y Formularios */
.card-premium-footer {
    margin-top: 20px;
}
.bet-form-premium {
    background: rgba(7, 12, 20, 0.85);
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(4px);
}
.inputs-row-premium {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.inputs-row-premium select, 
.inputs-row-premium input {
    margin: 0;
    padding: 12px;
    font-weight: 600;
    background: rgba(11, 17, 30, 0.9);
}

/* Botones Principales */
button, .btn-premium-glow {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    transition: all 0.3s;
}

.btn-premium-glow {
    background: linear-gradient(135deg, var(--success), #219a52);
}
.btn-premium-glow:hover {
    filter: brightness(1.15);
    box-shadow: 0 7px 20px rgba(46, 204, 113, 0.5);
}

.btn-admin-box {
    background: linear-gradient(135deg, var(--primary), #115b9b) !important;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(29, 114, 184, 0.2) !important;
}
.btn-admin-box:hover {
    filter: brightness(1.2);
}

.apuesta-registrada-premium {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.03));
    border: 1px solid rgba(46, 204, 113, 0.4);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: inset 0 0 10px rgba(46, 204, 113, 0.05);
}
.check-icon {
    background: var(--success);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    flex-shrink: 0;
}
.apuesta-registrada-premium p {
    margin: 0;
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* LETREROS GRANDES DE RESULTADOS FINALES */
.letrero-resultado-premium {
    padding: 20px 15px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
}
.letrero-resultado-premium h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.letrero-resultado-premium p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: rgba(255,255,255,0.9) !important;
}
.monto-letrero {
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.letrero-resultado-premium.ganaste { background: linear-gradient(135deg, #2ecc71, #1e8449); border-color: #58d68d; }
.letrero-resultado-premium.perdiste { background: linear-gradient(135deg, #e74c3c, #922b21); border-color: #f1948a; }
.letrero-resultado-premium.neutro { background: rgba(7, 12, 20, 0.85); border: 1px dashed var(--text-muted); padding: 15px; }
.letrero-resultado-premium.neutro p { margin: 0; color: var(--text-muted) !important; }

/* Contenedores Auxiliares e Inputs */
.login-container {
    max-width: 380px;
    margin: 80px auto;
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}
input, select {
    width: 100%;
    padding: 12px 16px;
    margin: 10px 0;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #111a2e;
    color: #fff !important;
    font-size: 15px;
    transition: all 0.3s ease;
}
select option {
    background-color: #111a2e !important;
    color: #ffffff !important;
    padding: 10px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
}
.error {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.empty-state {
    padding: 40px 30px !important;
    text-align: center;
}
.icon-alert { font-size: 40px; margin: 0 0 15px 0; }
.empty-state h4 { margin: 0 0 8px 0; font-size: 18px; }

/* PANEL ADMINISTRATIVO */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}
.box {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.05);
}
.box-full {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    margin: 30px auto 0 auto;
}
.width-container { max-width: 1000px; }
hr { border: 0; height: 1px; background: rgba(255,255,255,0.1); margin: 25px 0; }
.mini-card {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mini-card p { margin: 0; font-size: 14px; }
.fecha-aviso-box {
    background: linear-gradient(135deg, rgba(31, 126, 208, 0.2), rgba(243, 156, 18, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}
.fecha-aviso-box span { font-size: 11px; font-weight: bold; color: var(--text-muted); }
.fecha-aviso-box h2 { margin: 5px 0 0 0; font-size: 22px; color: var(--accent-gold); }

.danger-zone-box {
    background: rgba(231, 76, 60, 0.05);
    border: 1px dashed rgba(231, 76, 60, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}
.danger-zone-box h4 { margin: 0 0 5px 0; color: var(--danger); }
.btn-danger-reset {
    background: linear-gradient(135deg, var(--danger), #922b21) !important;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2) !important;
    font-size: 13px !important;
    padding: 10px !important;
    margin-top: 5px;
}
.btn-danger-reset:hover { filter: brightness(1.2); }

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.15);
}
.table-premium th {
    background-color: rgba(17, 26, 46, 0.9);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(255,255,255,0.05);
}
.table-premium td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #cbd5e1; }
.table-premium tr:hover td { background: rgba(255,255,255,0.02); }

.lbl-status { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.lbl-status.pending { background: rgba(241, 196, 15, 0.15); color: var(--accent-gold); }
.lbl-status.closed { background: rgba(31, 114, 184, 0.15); color: #5dade2; }

/* ANIMACIONES NATIVAS */
.animate-fade-in { animation: entrar-suave 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
.animate-pulse { animation: pulso-victoria 2s infinite ease-in-out; }

@keyframes entrar-suave {
    0% { transform: translateY(15px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes pulsacion-suave {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7), 0 4px 8px rgba(0,0,0,0.5); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0), 0 4px 8px rgba(0,0,0,0.5); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0), 0 4px 8px rgba(0,0,0,0.5); }
}
@keyframes pulso-victoria {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 10px 30px rgba(46, 204, 113, 0.5); }
    100% { transform: scale(1); }
}