:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --ink: #102033;
    --muted: #627084;
    --line: #dce4ee;
    --brand: #0d6efd;
    --brand-dark: #084298;
    --surface: #ffffff;
    --surface-soft: #eaf2ff;
    --success: #087f5b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.hero {
    min-height: 250px;
    padding: 36px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(7, 28, 57, .94), rgba(13, 110, 253, .72)),
        url("https://images.unsplash.com/photo-1518091043644-c1d4457512c6?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(40px, 6vw, 76px);
    line-height: .95;
}

.lede {
    max-width: 600px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, .82);
    font-size: 18px;
}

.live-widget {
    width: min(640px, 100%);
    display: grid;
    gap: 12px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
    transition: transform .24s ease, border-color .24s ease, background .24s ease, box-shadow .24s ease;
}

.live-widget:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, .44);
    background: rgba(255, 255, 255, .18);
    box-shadow: 0 22px 45px rgba(0, 0, 0, .22);
}

.hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-topline .eyebrow {
    margin: 0;
}

.connection-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.connection-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f59f00;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

.connection-chip.connected .connection-dot {
    background: #2f9e44;
    box-shadow: 0 0 0 3px rgba(47, 158, 68, .24);
}

.connection-chip.disconnected .connection-dot {
    background: #e03131;
    box-shadow: 0 0 0 3px rgba(224, 49, 49, .24);
}

.connection-chip.pending .connection-dot {
    background: #f59f00;
    box-shadow: 0 0 0 3px rgba(245, 159, 0, .24);
}

.hero-label,
.stats-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-label {
    color: rgba(255, 255, 255, .72);
}

.live-widget strong {
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1;
}

.versus {
    color: #fff;
}

.team-name-label {
    display: inline-flex;
    align-items: center;
    gap: .38em;
    max-width: 100%;
    color: inherit;
}

.hero-team-name {
    color: #fff;
}

.inline-flag {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(16, 32, 51, .16), 0 2px 5px rgba(16, 32, 51, .18);
}

.live-widget small {
    color: rgba(255, 255, 255, .72);
}

.hero-score {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 42px;
    font-weight: 900;
}

.live-widget:hover .hero-score span:not(:nth-child(2)) {
    animation: scorePulse .75s ease both;
}

.hero-score:empty {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.stats-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.stats-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 14px;
}

.tab {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
}

.tab.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.panel {
    min-height: 320px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 14px;
}

.card,
.table-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.card {
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.match-card {
    background: var(--surface);
}

.match-upcoming {
    border-color: #b9d6ff;
    background: #f2f7ff;
}

.match-ongoing {
    border-color: #ffd166;
    background: #fff8e6;
    box-shadow: inset 4px 0 0 #f59f00;
}

.match-completed {
    border-color: #b7e4c7;
    background: #f0fff4;
}

.match-neutral {
    background: var(--surface);
}

.match-upcoming .status {
    background: #dbeafe;
    color: #1d4ed8;
}

.match-ongoing .status {
    background: #fff3bf;
    color: #b35c00;
}

.match-completed .status {
    background: #d3f9d8;
    color: var(--success);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 0%, rgba(13, 110, 253, .10) 42%, transparent 72%);
    opacity: 0;
    transform: translateX(-30%);
    transition: opacity .2s ease, transform .42s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(13, 110, 253, .42);
    box-shadow: 0 16px 34px rgba(16, 32, 51, .14);
}

.card:hover::before {
    opacity: 1;
    transform: translateX(30%);
}

.card:hover .score {
    animation: scorePulse .72s ease both;
}

.match-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.teams {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.team-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
}

.winner-line {
    color: var(--success);
}

.winner-line .score,
.winner {
    color: var(--success);
}

.team-link,
.table-team-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: left;
}

.team-link:hover,
.table-team-link:hover {
    text-decoration: underline;
}

.table-team-link {
    font-weight: 700;
}

.score {
    color: var(--brand-dark);
}

@keyframes scorePulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.14);
    }

    100% {
        transform: scale(1);
    }
}

.status {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.vote-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.vote-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.vote-heading strong {
    color: var(--ink);
}

.vote-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.vote-button {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 8px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.vote-button:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    background: var(--surface-soft);
}

.vote-button.selected {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.vote-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.vote-button strong {
    font-size: 20px;
}

.vote-button small {
    color: var(--muted);
    font-weight: 800;
}

.vote-button.selected small {
    color: rgba(255, 255, 255, .78);
}

.table-card {
    overflow: hidden;
}

.table-card h2 {
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
}

.group-detail-table {
    margin-bottom: 14px;
}

.selected-team-row {
    background: var(--surface-soft);
    font-weight: 800;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.crest {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.crest.large {
    width: 68px;
    height: 68px;
}

.team-detail {
    display: grid;
    gap: 20px;
    margin-bottom: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.team-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-heading h2 {
    margin: 0;
    font-size: 34px;
}

.dark {
    color: var(--muted);
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.team-stats span {
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.team-stats strong {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-size: 24px;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.back-button {
    width: fit-content;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.compact {
    margin: 14px;
    padding: 18px;
}

.empty,
.error {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
}

.error {
    border-color: #f1aeb5;
    color: #842029;
    background: #fff5f5;
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding-top: 10px;
    }

    .hero {
        padding: 24px;
    }

    h1 {
        font-size: 42px;
    }

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

    .team-stats,
    .split-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
