:root {
    --bg: #f4f6f8;
    --ink: #13201c;
    --muted: #65736f;
    --line: #dbe2df;
    --surface: #ffffff;
    --green: #096b55;
    --lime: #b7e45d;
    --red: #c8473d;
    --gold: #c89b2d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(9, 107, 85, .08), transparent 340px),
        var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(19, 32, 28, .08);
    background: rgba(255, 255, 255, .76);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(24px, 3vw, 38px);
}

.status-pill {
    white-space: nowrap;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.notice {
    margin: 18px auto 0;
    width: min(1120px, calc(100% - 32px));
    padding: 12px 16px;
    color: #fff;
    background: var(--green);
    border-radius: 8px;
}

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

.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    min-height: 260px;
    padding: clamp(24px, 5vw, 52px);
    color: #fff;
    background:
        radial-gradient(circle at 75% 20%, rgba(183, 228, 93, .46), transparent 22%),
        linear-gradient(135deg, rgba(7, 56, 47, .96), rgba(9, 107, 85, .9)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160' viewBox='0 0 240 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='3'%3E%3Cpath d='M4 80h232M120 4v152M40 20h160v120H40z'/%3E%3Ccircle cx='120' cy='80' r='32'/%3E%3Cpath d='M40 50h22v60H40M200 50h-22v60h22'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, cover, 360px 240px;
    border-radius: 8px;
}

.hero::after {
    content: "";
    position: absolute;
    right: 30%;
    bottom: -64px;
    width: 260px;
    height: 260px;
    border: 16px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
}

.hero-copy,
.score-panel {
    position: relative;
    z-index: 1;
}

.hero h2 {
    max-width: 760px;
    margin-bottom: 12px;
    font-size: clamp(34px, 6vw, 74px);
    line-height: 1.02;
}

.hero h2 span {
    color: var(--lime);
    font-size: .44em;
    vertical-align: middle;
}

.fixture-meta {
    color: rgba(255, 255, 255, .78);
}

.score-panel {
    align-self: center;
    min-width: 180px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    text-align: center;
    background: rgba(255, 255, 255, .10);
}

.scoreline {
    font-size: 54px;
    line-height: 1;
    font-weight: 900;
}

.score-caption {
    margin-top: 8px;
    color: rgba(255, 255, 255, .76);
}

.actual-score {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .22);
    color: var(--lime);
    font-size: 13px;
    font-weight: 900;
}

.data-source {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.data-source a {
    color: var(--green);
    text-decoration: none;
}

.refresh-form {
    margin: 0;
}

.refresh-form button {
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.refresh-form button:disabled {
    cursor: wait;
    opacity: .72;
}

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

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

.metric {
    padding: 18px;
}

.metric span,
.metric small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin: 8px 0 12px;
    font-size: clamp(22px, 3vw, 34px);
}

.metric.accent {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.metric.accent span,
.metric.accent small {
    color: rgba(255, 255, 255, .80);
}

.bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f0;
}

.bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.filters {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.secondary-filters {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tabs button,
.predict-form button {
    border: 0;
    color: #fff;
    background: var(--green);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 800;
}

.tabs button {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
}

.tabs button.active {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filters input,
.filters select,
.predict-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.filters select {
    min-width: 160px;
}

.secondary-filters button,
.reset-link {
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.reset-link {
    color: var(--green);
    background: #fff;
}

.empty-state {
    margin-bottom: 14px;
    padding: 18px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 8px;
    font-weight: 700;
}

.match-list {
    display: grid;
    gap: 14px;
}

.match-card {
    padding: 18px;
}

.match-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.team {
    display: grid;
    gap: 4px;
}

.team.right {
    text-align: right;
}

.team strong {
    font-size: 24px;
}

.team small,
.submitted {
    color: var(--muted);
    font-size: 13px;
}

.code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    max-width: 96px;
    height: 28px;
    padding: 0 8px;
    color: #fff;
    background: var(--gold);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.team.right .code {
    justify-self: end;
}

.versus {
    text-align: center;
}

.versus strong {
    display: block;
    color: var(--green);
    font-size: 30px;
}

.versus span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.prob-row,
.score-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.prob-row span,
.score-tags span {
    border-radius: 999px;
    padding: 7px 10px;
    background: #f1f5f3;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.odds-line {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.score-tags span {
    color: var(--green);
    background: rgba(9, 107, 85, .09);
}

.predict-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 72px 72px 120px;
    gap: 8px;
    margin-top: 14px;
}

.submitted {
    margin-top: 10px;
}

.side {
    display: grid;
    gap: 14px;
}

.panel {
    padding: 18px;
}

.panel h3 {
    margin-bottom: 14px;
}

.factor,
.user-row {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.factor {
    grid-template-columns: 1fr auto;
}

.factor span,
.user-row span,
.empty {
    color: var(--muted);
}

.user-row em {
    color: var(--red);
    font-style: normal;
    font-weight: 900;
}

@media (max-width: 880px) {
    .topbar,
    .hero,
    .filters {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-grid,
    .layout {
        grid-template-columns: 1fr;
    }

    .score-panel {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .match-main {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .team.right {
        text-align: left;
    }

    .team.right .code {
        justify-self: start;
    }

    .versus {
        text-align: left;
    }

    .predict-form {
        grid-template-columns: 1fr 1fr;
    }

    .predict-form input:first-of-type,
    .predict-form button {
        grid-column: 1 / -1;
    }
}
