:root {
    color-scheme: dark;
    --gold: #D4AF37;
    --gold-dim: #8B6914;
    --bg: #020617;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --emerald: #10b981;
    --rose: #f43f5e;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: #020617;
    background: radial-gradient(ellipse at top, rgba(212, 175, 55, 0.08) 0%, var(--bg) 60%);
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.font-display { font-family: 'Montserrat', sans-serif; }

.glass {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}
.glass-dark {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========== Header ========== */
.envivo-header {
    background: rgba(2, 6, 23, 0.9);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.envivo-header img { height: 36px; }
.envivo-header .title-block { flex: 1; padding: 0 12px; }
.envivo-header .title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1;
}
.envivo-header .subtitle {
    font-size: 8px;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-top: 4px;
}
.envivo-header .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rose);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== Match card ========== */
.match-block {
    margin: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.02));
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.15);
}
.match-block .stage-tag {
    display: inline-block;
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 14px;
}
.match-block .countdown {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 26px;
    color: var(--gold);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    line-height: 1;
}
.match-block .countdown-label {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 700;
    margin-bottom: 18px;
}
.teams-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 16px 0;
}
.teams-row .team {
    flex: 1;
    text-align: center;
    max-width: 130px;
}
.teams-row .team img {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
}
.teams-row .team .tn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}
.teams-row .vs {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 14px;
    color: #475569;
    font-style: italic;
    flex-shrink: 0;
}
.match-meta {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 10px;
    line-height: 1.6;
}
.match-meta .gold { color: var(--gold); font-weight: 700; }

/* ========== Closed banner ========== */
.closed-banner {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin: 16px;
    text-align: center;
    color: #fca5a5;
}
.closed-banner h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 4px;
}
.closed-banner p { font-size: 12px; margin: 0; color: #94a3b8; }

/* ========== Form ========== */
.vote-form {
    margin: 0 16px 24px;
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 10px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 10px;
}
.form-label small {
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: none;
    font-size: 10px;
}

.input {
    width: 100%;
    background: #0f172a !important;
    border: 1.5px solid var(--glass-border);
    color: #f1f5f9 !important;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s;
    color-scheme: dark;
    -webkit-text-fill-color: #f1f5f9;
}
.input::placeholder { color: #64748b !important; opacity: 1; }
.input:focus {
    outline: none;
    border-color: var(--gold);
    background: #111827 !important;
}
.input.error {
    border-color: var(--rose);
    background: rgba(244, 63, 94, 0.08) !important;
}
/* Evita el "amarillo de autofill" de Chrome que rompe el contraste */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset;
    transition: background-color 5000s ease-in-out 0s;
}
.input-hint {
    font-size: 10px;
    color: #64748b;
    margin-top: 6px;
}
.input-error {
    font-size: 11px;
    color: var(--rose);
    margin-top: 6px;
    font-weight: 600;
}

/* Pick winner */
.winner-options {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 8px;
}
.winner-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    color: white;
    font-family: 'Inter', sans-serif;
}
.winner-btn:hover { border-color: rgba(212, 175, 55, 0.4); }
.winner-btn.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.winner-btn img {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
}
.winner-btn .label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.winner-btn .draw-icon {
    font-size: 22px;
    color: var(--gold);
    font-weight: 900;
}

/* Goles */
.goals-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 12px;
    align-items: center;
}
.goal-input-wrap { text-align: center; }
.goal-input-wrap img {
    width: 32px;
    height: 22px;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 6px;
}
.goal-input-wrap .name {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 6px;
    line-height: 1.1;
}
.goal-input {
    width: 100%;
    text-align: center;
    background: #0f172a !important;
    border: 2px solid var(--glass-border);
    color: var(--gold) !important;
    -webkit-text-fill-color: var(--gold);
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 28px;
    padding: 8px 0;
    border-radius: 12px;
    color-scheme: dark;
    -moz-appearance: textfield;
}
.goal-input::-webkit-outer-spin-button,
.goal-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goal-input:focus { outline: none; border-color: var(--gold); }
.goals-divider {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: #475569;
    text-align: center;
    padding-top: 30px;
}

/* Submit */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #020617;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 16px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== Success / status ========== */
.status-card {
    margin: 16px;
    padding: 24px;
    border-radius: 20px;
    text-align: center;
}
.status-card.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-card.error {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
}
.status-card .icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.status-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 8px;
}
.status-card p { font-size: 12px; color: #94a3b8; margin: 0; }
.status-card .vote-summary {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    font-size: 12px;
    color: #cbd5e1;
}

/* Footer powered */
.envivo-footer {
    text-align: center;
    padding: 20px 16px 30px;
    color: #475569;
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 700;
}

.fade-in { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Botón flotante "Mis Premios" */
.fab-prizes {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #020617;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.fab-prizes:hover { transform: translateY(-2px) scale(1.03); }
.fab-prizes .badge {
    background: #020617;
    color: var(--gold);
    border-radius: 100px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 900;
}

/* ============================================================
   Fix global de <option> en dropdowns nativos.
   Los browsers no aplican el background del <select> a los <option>
   cuando se abren — se renderizan blanco-sobre-blanco-claro y no se leen.
   Forzamos fondo oscuro y texto claro en CUALQUIER option del sitio.
============================================================ */
select option {
    background-color: #0f172a;
    color: #f1f5f9;
    padding: 6px 8px;
}
select option:checked,
select option:hover {
    background-color: var(--gold) !important;
    color: #020617 !important;
}
