:root, [data-theme="dark"] {
    --bg: #000000;
    --bg2: #0a0a0a;
    --card: rgba(255,255,255,0.04);
    --card-h: rgba(255,255,255,0.08);
    --gold: #c9a84c;
    --gold-l: #e8d48b;
    --text: #ffffff;
    --text-mut: #a0a0a0;
    --text-dim: #666666;
    --grn: #22c55e;
    --red: #ef4444;
    --blu: #3b82f6;
    --bdr: rgba(255,255,255,0.08);
    --r: 16px;
    --header-bg: rgba(201,168,76,.08);
    --nav-bg: rgba(0,0,0,.96);
    --pill-bg: rgba(201,168,76,.25);
    --pill-txt: var(--gold);
    --card-live-bdr: rgba(239,68,68,.5);
    --card-live-sh: rgba(239,68,68,.18);
    --card-fin-bdr: rgba(34,197,94,.2);
    --err-bg: rgba(239,68,68,.12);
    --grp-bg: rgba(201,168,76,.12);
    --title-from: var(--gold);
    --title-to: var(--gold-l);
    color-scheme: dark
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --bg2: #ffffff;
    --card: rgba(0,0,0,0.03);
    --card-h: rgba(0,0,0,0.06);
    --gold: #8B7332;
    --gold-l: #6B5722;
    --text: #1a1a1a;
    --text-mut: #555555;
    --text-dim: #888888;
    --grn: #16a34a;
    --red: #dc2626;
    --blu: #2563eb;
    --bdr: rgba(0,0,0,0.1);
    --header-bg: rgba(139,115,50,.06);
    --nav-bg: rgba(245,245,245,.96);
    --pill-bg: rgba(139,115,50,.15);
    --pill-txt: var(--gold);
    --card-live-bdr: rgba(220,38,38,.4);
    --card-live-sh: rgba(220,38,38,.1);
    --card-fin-bdr: rgba(22,163,74,.2);
    --err-bg: rgba(220,38,38,.08);
    --grp-bg: rgba(139,115,50,.1);
    --title-from: var(--gold);
    --title-to: var(--gold-l);
    color-scheme: light
}

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

body {
    font-family: 'Segoe UI',system-ui,sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background .3s,color .3s
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: var(--bg)
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--bdr);
    flex-wrap: wrap;
    gap: 1rem
}

.header__left {
    display: flex;
    align-items: center;
    gap: .8rem
}

.header__icon {
    font-size: 2.6rem;
    animation: bounce 2s ease-in-out infinite
}

@keyframes bounce {
    0%,100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-5px)
    }
}

.header__title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg,var(--title-from),var(--title-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.header__sub {
    color: var(--text-mut);
    font-size: .82rem;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap
}

.sub-flag {
    font-size: .9rem !important;
    vertical-align: middle
}

.header__right {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .82rem;
    color: var(--text-mut)
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239,68,68,.15);
    color: var(--red);
    border: 1px solid rgba(239,68,68,.3);
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 700;
    font-size: .75rem;
    animation: pulse 1.5s infinite
}

.live-dot-red {
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: .4rem
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--grn);
    border-radius: 50%;
    animation: pulse 2s infinite
}

@keyframes pulse {
    0%,100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .4;
        transform: scale(.7)
    }
}

.btn-refresh, .btn-theme {
    background: none;
    border: 1px solid var(--bdr);
    color: var(--text-mut);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: .2s;
    display: flex;
    align-items: center;
    justify-content: center
}

    .btn-refresh:hover, .btn-theme:hover {
        border-color: var(--gold);
        color: var(--gold)
    }

    .btn-refresh:hover {
        transform: rotate(180deg)
    }

.date-nav {
    display: flex;
    gap: .35rem;
    padding: .8rem 2rem;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bdr)
}

    .date-nav::-webkit-scrollbar {
        display: none
    }

.date-pill {
    padding: .4rem .9rem;
    border: 1px solid var(--bdr);
    border-radius: 999px;
    background: transparent;
    color: var(--text-mut);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
    flex-shrink: 0
}

    .date-pill:hover {
        border-color: var(--gold);
        color: var(--gold)
    }

    .date-pill.active {
        background: var(--gold);
        color: #fff;
        border-color: var(--gold)
    }

[data-theme="light"] .date-pill.active {
    color: #fff
}

.date-pill .pill-count {
    font-size: .6rem;
    background: var(--pill-bg);
    color: var(--pill-txt);
    border-radius: 99px;
    padding: 1px 5px;
    margin-left: 4px
}

.date-pill.active .pill-count {
    background: rgba(255,255,255,.3);
    color: #fff
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-mut)
}

    .loader.hidden {
        display: none
    }

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--bdr);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .7s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.error-bar {
    margin: 1rem 2rem;
    padding: .8rem 1.2rem;
    background: var(--err-bg);
    border: 1px solid var(--red);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem
}

    .error-bar p {
        color: var(--red);
        font-size: .85rem
    }

    .error-bar button {
        padding: .35rem .8rem;
        background: var(--red);
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600
    }

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 3rem
}

.day-section {
    margin-bottom: 2rem
}

.day-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
    padding: .4rem 0
}

.day-header__label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold)
}

.day-header__count {
    font-size: .7rem;
    background: var(--grp-bg);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600
}

.day-header__line {
    flex: 1;
    height: 1px;
    background: var(--bdr)
}

.match-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem
}

@media(min-width:700px) {
    .match-grid {
        grid-template-columns: repeat(2,1fr)
    }
}

@media(min-width:1100px) {
    .match-grid {
        grid-template-columns: repeat(3,1fr)
    }
}

.match-card {
    background: var(--card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    overflow: hidden;
    transition: .3s
}

    .match-card:hover {
        transform: translateY(-3px);
        border-color: rgba(201,168,76,.25);
        background: var(--card-h)
    }

    .match-card.live {
        border-color: var(--card-live-bdr);
        box-shadow: 0 0 24px var(--card-live-sh)
    }

    .match-card.finished {
        border-color: var(--card-fin-bdr)
    }

.mc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .9rem;
    background: var(--grp-bg);
    border-bottom: 1px solid var(--bdr)
}

.mc-group {
    font-size: .65rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--grp-bg);
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.mc-time {
    font-size: .7rem;
    color: var(--text-dim)
}

.mc-board {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem .5rem;
    gap: .3rem
}

.mc-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    flex: 1;
    min-width: 0
}

.mc-flag .fi {
    font-size: 2.5rem;
    line-height: 1;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3)
}

.mc-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem
}

.mc-name {
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px
}

.mc-score {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
    min-width: 100px;
    justify-content: center
}

.mc-score__num {
    font-size: 2.4rem;
    font-weight: 900;
    font-family: 'Courier New',monospace;
    line-height: 1;
    min-width: 36px;
    text-align: center
}

.mc-score__sep {
    font-size: 1.4rem;
    color: var(--text-dim);
    font-weight: 300
}

.mc-score.scheduled .mc-score__num {
    color: var(--text-dim);
    font-size: 1.6rem
}

.mc-score.scheduled .mc-score__sep {
    font-size: 1.2rem
}

.mc-score.live .mc-score__num {
    color: var(--red)
}

.mc-score.finished .mc-score__num {
    color: var(--grn)
}

.mc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem .9rem;
    border-top: 1px solid var(--bdr)
}

.mc-venue {
    font-size: .62rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px
}

    .status-pill.scheduled {
        background: rgba(59,130,246,.12);
        color: var(--blu);
        border: 1px solid rgba(59,130,246,.25)
    }

    .status-pill.live {
        background: rgba(239,68,68,.12);
        color: var(--red);
        border: 1px solid rgba(239,68,68,.3);
        animation: pulse 1.5s infinite
    }

    .status-pill.finished {
        background: rgba(34,197,94,.1);
        color: var(--grn);
        border: 1px solid rgba(34,197,94,.25)
    }

/* -- Cuenta regresiva para el mundial -- */
.countdown {
    font-size: 0.75rem;
    color: inherit;
    opacity: 0.8;
    margin-top: 0.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* -- Banner de bloqueo de predicciones -- */
.lock-banner {
    background: #ff6f00;
    color: #ffffff;
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

@keyframes scoreFlash {
    0% {
        background: rgba(201,168,76,.35)
    }

    100% {
        background: transparent
    }
}

.score-flash {
    animation: scoreFlash 1s ease-out
}

.footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--bdr);
    color: var(--text-dim);
    font-size: .8rem
}

    .footer a {
        color: var(--gold);
        text-decoration: none
    }

        .footer a:hover {
            text-decoration: underline
        }

.footer__ts {
    font-size: .7rem;
    margin-top: .3rem
}

@media(max-width:600px) {
    .header {
        padding: 1rem
    }

    .header__title {
        font-size: 1.15rem
    }

    .date-nav {
        padding: .6rem 1rem
    }

    main {
        padding: .8rem 1rem 2rem
    }

    .mc-flag .fi {
        font-size: 1.8rem
    }

    .mc-score__num {
        font-size: 1.8rem;
        min-width: 28px
    }

    .mc-name {
        font-size: .68rem;
        max-width: 75px
    }

    .mc-board {
        padding: .8rem .3rem
    }
}
