:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #16181d;
    --muted: #727782;
    --line: #e5e7eb;
    --line-strong: #d8dbe1;
    --accent: #19704a;
    --accent-soft: #eef8f2;
    --danger: #c83e3e;
    --warning: #a76b00;
    --header-height: 68px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1380px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-size: 1.22rem;
    font-weight: 750;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.brand-mark {
    color: var(--accent);
}

.main-nav {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 26px;
}

.main-nav a {
    display: flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 650;
    border-bottom: 2px solid transparent;
    transition: color .18s ease, border-color .18s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
}

.page-shell {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: calc(var(--header-height) + 38px) 0 48px;
}

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input {
    width: min(340px, 40vw);
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(25, 112, 74, 0.08);
}

.text-button {
    height: 42px;
    padding: 0 4px;
    color: var(--accent);
    border: 0;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.table-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.match-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.match-table th {
    padding: 12px 14px;
    color: var(--muted);
    background: #fafafa;
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
}

.match-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.match-table tbody tr:last-child td {
    border-bottom: 0;
}

.match-table tbody tr:hover {
    background: #fcfcfc;
}

.col-status { width: 78px; }
.col-match { width: 31%; }
.col-score { width: 90px; text-align: center !important; }
.col-stat { width: 112px; text-align: center !important; }
.col-missing { width: 132px; text-align: center !important; }
.col-fav { width: 54px; text-align: center !important; }

.status-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.status-live {
    color: var(--danger);
    font-size: 0.76rem;
    font-weight: 800;
}

.status-time {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.match-meta {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.73rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teams {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.teams span {
    min-width: 0;
}

.team-home,
.team-away {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-separator {
    color: var(--muted);
    font-weight: 500;
}

.score {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.stat-pair {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-pair strong {
    font-weight: 750;
}

.missing-value {
    display: inline-flex;
    min-width: 56px;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.missing-value.low {
    background: #f6f1e7;
    color: var(--warning);
}

.favourite-button {
    border: 0;
    background: transparent;
    color: #b6bac2;
    font-size: 1.28rem;
    cursor: pointer;
}

.favourite-button.active {
    color: #d09a17;
}

.loading-state,
.empty-state {
    padding: 54px 20px;
    color: var(--muted);
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 920px) {
    .main-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        display: none;
        height: auto;
        padding: 8px 16px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        min-height: 46px;
        border-bottom: 0;
        border-left: 2px solid transparent;
        padding-left: 14px;
    }

    .main-nav a.active {
        border-left-color: var(--accent);
    }

    .menu-toggle {
        display: block;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-actions {
        width: 100%;
    }

    .search-box {
        flex: 1;
    }

    .search-box input {
        width: 100%;
    }

    .col-shots,
    .col-sot {
        display: none;
    }

    .col-match { width: auto; }
}

@media (max-width: 640px) {
    :root {
        --header-height: 60px;
    }

    .header-inner,
    .page-shell {
        width: min(100% - 22px, 1380px);
    }

    .page-shell {
        padding-top: calc(var(--header-height) + 26px);
    }

    .table-panel {
        border-radius: 8px;
    }

    .match-table thead {
        display: none;
    }

    .match-table,
    .match-table tbody,
    .match-table tr,
    .match-table td {
        display: block;
        width: 100%;
    }

    .match-table tr {
        position: relative;
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr) 62px;
        gap: 7px 10px;
        padding: 13px 12px;
        border-bottom: 1px solid var(--line);
    }

    .match-table td {
        padding: 0;
        border: 0;
    }

    .match-table tbody tr:last-child {
        border-bottom: 0;
    }

    .cell-status {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .cell-match {
        grid-column: 2;
        grid-row: 1;
    }

    .cell-score {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .cell-xg {
        grid-column: 2;
        grid-row: 2;
        text-align: left !important;
        color: var(--muted);
        font-size: 0.82rem;
    }

    .cell-missing {
        grid-column: 3;
        grid-row: 2;
        text-align: right !important;
    }

    .cell-fav {
        position: absolute;
        right: 6px;
        top: 38px;
        transform: translateY(-50%);
        display: none;
    }

    .match-meta {
        font-size: 0.69rem;
    }

    .teams {
        display: block;
        line-height: 1.35;
    }

    .team-separator {
        display: none;
    }

    .team-home,
    .team-away {
        display: block;
    }

    .score {
        font-size: 1rem;
    }

    .missing-value {
        min-width: 46px;
        padding: 4px 7px;
        font-size: 0.82rem;
    }
}
