:root {
    --wc-navy: #07142f;
    --wc-blue: #1557ff;
    --wc-sky: #21a8ff;
    --wc-red: #e83f3f;
    --wc-green: #0fa66a;
    --wc-gold: #f6c344;
    --wc-cream: #fff8ea;
    --wc-paper: #ffffff;
    --wc-ink: #15172a;
    --wc-muted: #6d7284;
    --wc-line: #e6e9f2;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    color: var(--wc-ink);
    background:
        linear-gradient(180deg, #fff8ea 0, #f5f7ff 360px, #ffffff 100%),
        linear-gradient(90deg, rgba(232, 63, 63, .08), rgba(21, 87, 255, .08), rgba(15, 166, 106, .08));
}

.container {
    max-width: 1160px;
}

.bg-quiniela {
    background: rgba(7, 20, 47, .96);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(7, 20, 47, .22);
}

.navbar {
    --bs-navbar-padding-y: .85rem;
}

.navbar-brand {
    max-width: 68vw;
    white-space: normal;
    line-height: 1.05;
    font-weight: 900 !important;
}

.navbar .nav-link {
    border-radius: 999px;
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
    padding: .55rem .78rem !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.text-gold {
    color: var(--wc-gold) !important;
}

.btn {
    border-radius: 999px;
    font-weight: 800;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    box-shadow: none !important;
}

.btn-sm {
    min-height: 36px;
}

.btn-quiniela {
    --bs-btn-bg: var(--wc-blue);
    --bs-btn-border-color: var(--wc-blue);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #0d45d8;
    --bs-btn-hover-border-color: #0d45d8;
    --bs-btn-hover-color: #fff;
}

.btn-gold {
    --bs-btn-bg: var(--wc-gold);
    --bs-btn-border-color: var(--wc-gold);
    --bs-btn-color: #171424;
    --bs-btn-hover-bg: #e6af21;
    --bs-btn-hover-border-color: #e6af21;
    --bs-btn-hover-color: #171424;
}

.hero-shell {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    color: #fff;
    border-radius: 28px;
    padding: 1.25rem;
    display: grid;
    align-content: end;
    gap: 1rem;
    background:
        linear-gradient(90deg, rgba(7, 20, 47, .92) 0%, rgba(7, 20, 47, .78) 36%, rgba(7, 20, 47, .2) 100%),
        url('../img/worldcup-hero.png') center / cover no-repeat;
    box-shadow: 0 30px 80px rgba(7, 20, 47, .28);
}

.hero-shell::before,
.page-hero::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 7px;
    background: linear-gradient(90deg, var(--wc-red), var(--wc-gold), var(--wc-green), var(--wc-blue));
}

.hero-copy,
.hero-panel,
.page-hero > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--wc-gold);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: .65rem;
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--wc-red), var(--wc-gold), var(--wc-green), var(--wc-blue));
}

.hero-copy h1,
.page-hero h1 {
    font-size: clamp(2.4rem, 12vw, 5.8rem);
    line-height: .9;
    font-weight: 950;
    max-width: 840px;
    margin: 0 0 1rem;
}

.hero-copy p,
.page-hero p {
    color: rgba(255, 255, 255, .86);
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 700px;
    margin-bottom: 1.25rem;
}

.hero-actions,
.page-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.hero-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
}

.hero-panel div {
    color: #fff;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
}

.hero-panel span,
.match-card time,
.match-competition,
.prediction-chip.muted,
.quick-card p,
.stat span {
    color: var(--wc-muted);
}

.hero-panel div span {
    color: rgba(255, 255, 255, .74);
}

.hero-panel strong {
    display: block;
    font-size: 1.65rem;
    line-height: 1.1;
}

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

.quick-card,
.stat,
.card,
.match-card,
.empty-state,
.group-card,
.legend-strip {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--wc-line);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(21, 23, 42, .08);
}

.quick-card {
    padding: 1.15rem;
}

.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: linear-gradient(135deg, var(--wc-red), var(--wc-blue));
    border-radius: 14px;
    font-weight: 900;
}

.quick-card h2 {
    font-size: 1.08rem;
    font-weight: 900;
    margin: .85rem 0 .4rem;
}

.quick-card p {
    margin: 0;
}

.page-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 1.35rem;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    background:
        linear-gradient(135deg, rgba(7, 20, 47, .98), rgba(21, 87, 255, .78)),
        linear-gradient(90deg, var(--wc-red), var(--wc-green));
    box-shadow: 0 20px 55px rgba(7, 20, 47, .18);
}

.page-hero.compact h1 {
    font-size: clamp(2rem, 9vw, 3.7rem);
}

.page-hero.compact p {
    margin-bottom: 0;
}

.page-hero .btn-outline-secondary {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .48);
    --bs-btn-hover-bg: rgba(255, 255, 255, .12);
    --bs-btn-hover-border-color: #fff;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    min-height: 104px;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, var(--wc-red), var(--wc-gold), var(--wc-green), var(--wc-blue));
}

.stat strong {
    display: block;
    font-size: 2.35rem;
    line-height: 1.05;
    font-weight: 950;
}

.section-title {
    font-size: 1.08rem;
    font-weight: 950;
    margin-bottom: .9rem;
}

.match-stack {
    display: grid;
    gap: .9rem;
}

.match-card {
    padding: 1rem;
}

.match-card-top,
.match-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
}

.match-card-top {
    margin-bottom: 1rem;
}

.match-competition,
.match-card time {
    display: block;
    font-size: .82rem;
}

.match-competition {
    color: var(--wc-blue);
    font-weight: 900;
    text-transform: uppercase;
}

.status-pill,
.prediction-chip {
    border-radius: 999px;
    padding: .38rem .68rem;
    font-size: .76rem;
    font-weight: 900;
    white-space: nowrap;
}

.status-scheduled {
    background: #eef3ff;
    color: #1644b8;
}

.status-live {
    background: #fff0dc;
    color: #a85200;
}

.status-finished {
    background: #e8fbf1;
    color: #087447;
}

.status-postponed,
.status-cancelled {
    background: #ffe9e9;
    color: #b02424;
}

.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.team {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 950;
    font-size: 1.02rem;
}

.team span {
    display: block;
    overflow-wrap: anywhere;
}

.team-away {
    justify-content: flex-end;
    text-align: right;
}

.flag-img {
    width: 30px;
    height: 22px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(7, 20, 47, .12);
}

.flag-fallback {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 6px;
    background: #eef1f8;
    color: var(--wc-muted);
    font-size: .55rem;
    font-weight: 900;
}

.score {
    min-width: 66px;
    text-align: center;
    color: #fff;
    border-radius: 14px;
    padding: .5rem .72rem;
    background: linear-gradient(135deg, var(--wc-navy), var(--wc-blue));
    font-weight: 950;
}

.venue-line {
    color: var(--wc-muted);
    font-size: .82rem;
    margin-bottom: .9rem;
}

.prediction-chip {
    background: #fff4d2;
    color: #6d4700;
}

.prediction-chip.muted {
    background: #f3f5fa;
}

.filter-scroller {
    overflow-x: auto;
    padding-bottom: .35rem;
}

.filter-group {
    min-width: max-content;
}

.table-responsive,
.card {
    border-radius: 18px;
}

.table {
    --bs-table-bg: #fff;
}

.table thead th {
    color: #687086;
    font-size: .74rem;
    text-transform: uppercase;
}

.form-control,
.form-select {
    min-height: 46px;
    border-radius: 14px;
}

.empty-state {
    padding: 1.25rem;
    color: var(--wc-muted);
}

.auth-shell {
    min-height: calc(100vh - 190px);
    align-items: center;
}

.auth-card .card-body {
    padding: 1.35rem;
}

.auth-card .eyebrow {
    color: var(--wc-blue);
}

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

.group-card {
    overflow: hidden;
}

.group-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--wc-navy), var(--wc-blue));
}

.group-card-head span {
    font-size: 1.15rem;
    font-weight: 950;
}

.group-card-head strong {
    font-size: .82rem;
    color: rgba(255, 255, 255, .72);
}

.standings-table td,
.standings-table th {
    padding: .75rem .85rem;
}

.standing-team {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 900;
}

.standing-detail {
    color: var(--wc-muted);
    font-size: .72rem;
    margin-left: 2.55rem;
}

.qualified-row td:first-child {
    box-shadow: inset 5px 0 0 var(--wc-green);
}

.third-row td:first-child {
    box-shadow: inset 5px 0 0 var(--wc-gold);
}

.points-cell {
    color: var(--wc-blue);
    font-weight: 950;
}

.legend-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .85rem 1rem;
    color: var(--wc-muted);
    font-size: .85rem;
}

.legend-dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    margin-right: .3rem;
}

.legend-dot.direct {
    background: var(--wc-green);
}

.legend-dot.third {
    background: var(--wc-gold);
}

.group-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.group-mini-card {
    display: grid;
    gap: .45rem;
    color: var(--wc-ink);
    text-decoration: none;
    padding: .9rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--wc-line);
    box-shadow: 0 12px 28px rgba(21, 23, 42, .06);
}

.group-mini-card:hover {
    transform: translateY(-1px);
    border-color: rgba(21, 87, 255, .3);
}

.group-mini-card strong {
    color: var(--wc-blue);
}

.group-mini-card span {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--wc-muted);
    font-size: .86rem;
}

.group-mini-card b {
    margin-left: auto;
    color: var(--wc-ink);
}

@media (min-width: 768px) {
    .hero-shell {
        padding: 3rem;
        grid-template-columns: minmax(0, 1fr) 330px;
        align-items: end;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .quick-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-hero {
        padding: 1.8rem 2rem;
    }

    .auth-card .card-body {
        padding: 2rem;
    }

    .standings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .group-mini-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

    .group-mini-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    main.container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-shell,
    .page-hero {
        border-radius: 0 0 26px 26px;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .hero-shell {
        min-height: 640px;
        padding: 1.3rem 1rem;
        background-position: 62% center;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .page-hero {
        display: block;
        padding: 1.35rem 1rem;
    }

    .page-actions .btn,
    .hero-actions .btn {
        width: 100%;
    }

    .scoreboard {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .team,
    .team-away {
        justify-content: center;
        text-align: center;
    }

    .match-card-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .standing-detail {
        margin-left: 0;
    }
}
