/* ============================================================
   POLLA MUNDIALISTA 2026 – Estilos globales
   Paleta: blanco, negro, rojo, verde y azul (espíritu WC 2026)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap');

:root {
    --wc-white:  #ffffff;
    --wc-black:  #0a0a0a;
    --wc-red:    #c8102e;
    --wc-green:  #047857;
    --wc-green-d:#065f46;
    --wc-blue:   #1e40af;

    /* Body blanco; franja negra centrada (.page-shell); área fluida (.container); tarjetas blancas */
    --bg:             #ffffff;
    --page-shell-bg:  #000000;
    --container-bg:   #e4e8f0;
    --surface:        #ffffff;
    --surface-inset:  #f4f4f5;
    --border:         #e2e2e2;
    --primary:        var(--wc-green);
    --primary-d:      var(--wc-green-d);
    --accent:         var(--wc-blue);
    --danger:         var(--wc-red);
    --text:           #0a0a0a;
    --muted:          #525252;
    --title-accent:   #304ffe;
    --radius:         8px;
    --font-heading:   'Archivo Black', 'Segoe UI', system-ui, sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cabecera estilo FIFA (dos franjas + franja color) ──── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #000;
    color: #fff;
}
.site-header a {
    color: #fff;
    text-decoration: none;
}
.site-header a:hover {
    text-decoration: underline;
    opacity: 0.92;
}

.header-top {
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.header-top-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.header-wordmark:hover { text-decoration: none; opacity: 1; }
.header-wordmark-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.header-util {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 22px;
}
.header-util a {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.95;
    white-space: nowrap;
}
.header-util a:hover { text-decoration: none; opacity: 1; text-decoration: underline; }
.header-util-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 0.55rem;
    font-weight: 800;
    background: var(--wc-red);
    color: #fff;
    border-radius: 999px;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

.header-main {
    background: #000;
    position: relative;
}
.header-main-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px 0 8px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    position: relative;
}

.header-left {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 4px;
}
.header-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
}
.header-logo-link:hover { opacity: 1; text-decoration: none; }
.header-main-logo {
    height: 42px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    display: block;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 48px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover { opacity: 0.85; }
.nav-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.nav-toggle-bars {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: background 0.2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, top 0.2s ease;
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.site-header.is-nav-open .nav-toggle-bars {
    background: transparent;
}
.site-header.is-nav-open .nav-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
}
.site-header.is-nav-open .nav-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
}

.header-nav {
    justify-self: center;
    max-width: 100%;
}
.header-nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 2px;
}
.header-nav-list a {
    display: block;
    padding: 10px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 2px;
    white-space: nowrap;
    color: #fff;
}
.header-nav-list a:hover,
.header-nav-list a.active {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
    opacity: 1;
}
.header-nav-list a.header-nav-cupo {
    color: #fde047;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.header-nav-list a.header-nav-cupo:hover,
.header-nav-list a.header-nav-cupo.active {
    color: #fef08a;
    background: rgba(253, 224, 71, 0.12);
}
.header-nav-list a.header-nav-locked {
    opacity: 0.7;
    cursor: not-allowed;
}
.header-util a.header-util-pago {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: rgba(4, 120, 87, 0.95);
    color: #fff !important;
    opacity: 1;
}
.header-util a.header-util-pago:hover {
    text-decoration: none;
    background: rgba(4, 120, 87, 1);
    opacity: 1;
}
.header-nav-pago-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    min-height: 40px;
    margin-right: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
}
.header-nav-pago-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #fff !important;
}
.header-nav-pago-btn--pendiente {
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.header-nav-pago-btn--pendiente:hover {
    filter: brightness(1.06);
}
@media (max-width: 991px) {
    .header-nav-pago-btn {
        font-size: 0.62rem;
        padding: 0 10px;
        min-height: 36px;
    }
}
.site-header--cupo .header-main-inner {
    flex-wrap: wrap;
    gap: 10px;
}
@media (max-width: 991px) {
    .site-header--cupo .header-nav {
        order: 3;
        width: 100%;
        padding: 8px 0 4px !important;
    }
}
.site-header--admin .header-nav-list a {
    font-size: 0.62rem;
    padding: 8px 5px;
    letter-spacing: 0.04em;
    white-space: normal;
    text-align: center;
    max-width: 7.5rem;
    line-height: 1.25;
}

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 2px;
}
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    border-radius: 4px;
    flex-shrink: 0;
}
.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    opacity: 1;
}
.header-icon-btn--danger:hover {
    background: rgba(200, 16, 46, 0.35);
}

.header-rainbow {
    height: 4px;
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--wc-red) 0%,
        var(--wc-green) 24%,
        var(--wc-blue) 48%,
        #7c3aed 72%,
        #ea580c 100%
    );
}

.badge-nav {
    background: var(--wc-red);
    color: #fff;
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 20px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Móvil / tablet: menú hamburguesa y lista desplegable */
@media (max-width: 991px) {
    body.has-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .nav-toggle {
        display: flex;
    }

    .header-main-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 0 8px 0 4px;
    }

    .header-left {
        order: 1;
        flex: 0 0 auto;
    }

    .header-actions {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .header-nav {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        position: relative;
        justify-self: stretch;
        max-width: none;
        display: none;
        margin: 0 -8px 0 -4px;
        padding: 6px 12px 16px;
        background: #0a0a0a;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
        z-index: 60;
        max-height: min(75vh, 480px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-header.is-nav-open .header-nav {
        display: block;
    }

    .header-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .header-nav-list li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-nav-list li:last-child {
        border-bottom: none;
    }

    .header-nav-list a {
        padding: 14px 12px;
        max-width: none;
        white-space: normal;
        text-align: left;
        font-size: 0.8rem;
    }

    .site-header--admin .header-nav-list a {
        font-size: 0.85rem;
        max-width: none;
        text-align: left;
        white-space: normal;
    }
}

/* Escritorio: barra horizontal, sin hamburguesa */
@media (min-width: 992px) {
    .nav-toggle {
        display: none !important;
    }

    .header-main-inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .header-nav {
        display: block !important;
        position: static;
        width: auto;
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }

    .site-header.is-nav-open .header-nav {
        display: block !important;
    }

    .header-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-nav-list li {
        border-bottom: none;
    }

    .site-header--admin .header-nav-list a {
        font-size: 0.62rem;
        padding: 8px 5px;
        letter-spacing: 0.04em;
        white-space: normal;
        text-align: center;
        max-width: 7.5rem;
        line-height: 1.25;
    }
}

/* ── Layout: negro centrado + contenido fluido blanco ─────── */
.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--page-shell-bg);
    padding: 20px 18px 32px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding: 28px 22px;
    background: var(--container-bg);
    color: var(--text);
    border-radius: 2px;
    box-sizing: border-box;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(1.85rem, 4.5vw, 2.5rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 28px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.page-title span { color: var(--title-accent); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card-title {
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 18px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1:not(.page-title) {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}
h2 {
    font-size: clamp(1.45rem, 3vw, 1.85rem);
}
h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
}
.container > h1:not(.page-title),
.container > h2,
.container > h3 {
    color: var(--text);
}

/* ── Tablas ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th {
    background: var(--wc-black);
    color: var(--wc-white);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: .05em;
}
td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(30, 64, 175, 0.06); }

/* ── Formularios ────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--wc-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--wc-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}
select option { background: var(--wc-white); }

/* ── Botones ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--primary);  color: var(--wc-white); }
.btn-accent   { background: var(--accent);   color: var(--wc-white); }
.btn-danger   { background: var(--danger);   color: var(--wc-white); }
.btn-ghost    { background: #e2e8f0;        color: var(--text); }
.btn-sm       { padding: 5px 12px; font-size: 0.82rem; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-success { background: rgba(4, 120, 87, 0.1);  border: 1px solid var(--primary); color: var(--wc-green-d); }
.alert-error   { background: rgba(200, 16, 46, 0.08); border: 1px solid var(--danger);  color: var(--danger);  }
.alert-warning { background: rgba(30, 64, 175, 0.08);border: 1px solid var(--accent);  color: var(--accent);  }

/* ── Badges de estado ────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-success  { background: rgba(4, 120, 87, 0.15);  color: var(--wc-green-d); }
.badge-warning  { background: rgba(30, 64, 175, 0.12); color: var(--accent);  }
.badge-danger   { background: rgba(200, 16, 46, 0.12); color: var(--danger);  }
.badge-muted    { background: var(--border);            color: var(--muted);   }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.login-box {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-img {
    max-width: min(240px, 100%);
    width: auto;
    height: auto;
    max-height: 88px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}
.login-logo p  { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.login-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: all .15s;
    font-size: 0.9rem;
}
.login-tab.active {
    color: var(--title-accent);
    border-bottom-color: var(--title-accent);
}

/* ── Ranking medals ──────────────────────────────────────── */
.rank-1 { color: #ffd700; font-weight: 800; }
.rank-2 { color: #c0c0c0; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }

/* ── Stats boxes ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-box {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.stat-box .stat-value {
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    font-weight: 800;
    color: var(--title-accent);
}
.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Banderas de selecciones (flagcdn + nombre) */
.equipo-con-bandera {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    max-width: 100%;
    vertical-align: middle;
}
.equipo-con-bandera .equipo-nombre {
    min-width: 0;
}
.bandera-equipo {
    flex-shrink: 0;
    width: auto;
    height: 1.1em;
    max-height: 22px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-shell { padding: 14px 10px 24px; }
    .container { padding: 18px 14px; }
    .header-top-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .header-util { justify-content: flex-start; }
}
