:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f8;
    --border: #d9e2ec;
    --text: #172033;
    --muted: #66758a;
    --accent: #0f8f7f;
    --accent-2: #2563eb;
    --warn: #d97706;
}

* { box-sizing: border-box; }
html {
    max-width: 100%;
    overflow-x: clip;
}
body {
    margin: 0;
    max-width: 100%;
    overflow-x: clip;
    padding-top: 56px;
    background:
        linear-gradient(180deg, #eef7f5 0, var(--bg) 320px),
        var(--bg);
    color: var(--text);
    font-family: Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.site-primary-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030 !important;
}
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
}
.topbar {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #10243f;
    font-weight: 800;
}
.brand b, .group-title span, .table-card h2 span { color: var(--accent); }
.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 18px rgba(15, 143, 127, .22);
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    letter-spacing: 0;
}
.ball { color: var(--accent); }
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}
.nav-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--muted);
    font-size: 14px;
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface-2);
}
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 18px 44px;
}
.hero, .page-title { margin-bottom: 24px; }
.hero {
    border: 1px solid rgba(15, 143, 127, .16);
    border-radius: 18px;
    padding: 28px;
    background:
        radial-gradient(circle at 92% 15%, rgba(37, 99, 235, .12), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(236, 250, 247, .96));
    box-shadow: 0 14px 38px rgba(23, 32, 51, .07);
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.15; margin-bottom: 10px; }
.hero p, .page-title p { max-width: 720px; }
.hero-subtitle {
    color: var(--muted);
}
.model-legend {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 4px;
    vertical-align: middle;
}
.model-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: color-mix(in srgb, var(--model-color), #172033 28%);
    font-weight: 700;
    white-space: nowrap;
}
.model-legend-item span {
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 6px;
    color: #ffffff;
    background: var(--model-color);
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
.hero-actions button {
    min-height: 38px;
    border: 1px solid rgba(15, 143, 127, .22);
    border-radius: 9px;
    background: #ffffff;
    color: var(--accent);
    padding: 7px 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(23, 32, 51, .05);
}
.hero-actions button:hover {
    background: #ecfaf7;
}
.action-note {
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, "Liberation Mono", monospace; }
.section { margin-top: 28px; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.section-head h2 {
    margin-bottom: 3px;
    font-size: 22px;
}
.text-link {
    color: var(--accent);
    font-size: 13px;
    white-space: nowrap;
}
.between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.progress {
    overflow: hidden;
    height: 9px;
    border-radius: 99px;
    background: #dce7ef;
}
.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.tab {
    border-radius: 999px;
    padding: 7px 14px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid transparent;
    font-size: 14px;
}
.tab.active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent), transparent 45%);
    background: #dff8f1;
}
.compact-tabs {
    width: min(100%, 430px);
    margin-bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(23, 32, 51, .05);
}
.compact-tabs .tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--text);
    border: 1px solid transparent;
    background: transparent;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
}
.compact-tabs .tab::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    flex: 0 0 auto;
}
.compact-tabs .tab.active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 14px rgba(15, 143, 127, .22);
}
.leader-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
}
.ad-block {
    width: 100%;
    max-width: 100%;
    margin: 26px 0;
    padding: 0;
    text-align: center;
    overflow: hidden;
}
.ad-block ins.adsbygoogle {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 90px;
}
.ad-block > div {
    max-width: 100% !important;
    overflow: hidden;
}
.ad-block iframe {
    max-width: 100% !important;
}
.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.upcoming-card {
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 50% 38%, rgba(15, 143, 127, .14), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(240, 247, 251, .98));
    border-radius: 12px;
    overflow: hidden;
    padding: 14px;
}
.upcoming-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}
.time-chip {
    background: #dff8f1;
    color: #0f766e;
    border-radius: 999px;
    padding: 3px 8px;
    font-family: Consolas, monospace;
}
.match-visual {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: center;
    min-height: 132px;
    gap: 10px;
    margin-top: 12px;
    position: relative;
}
.match-visual::before {
    content: "";
    position: absolute;
    inset: 8px 22px;
    border: 1px solid rgba(23, 32, 51, .09);
    border-radius: 14px;
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(23, 32, 51, .12) calc(50% - 1px), rgba(23, 32, 51, .12) calc(50% + 1px), transparent calc(50% + 1px)),
        radial-gradient(circle at 50% 50%, transparent 0 23px, rgba(23, 32, 51, .12) 24px 25px, transparent 26px);
    pointer-events: none;
}
.team-pane, .vs-pane {
    position: relative;
    z-index: 1;
}
.team-pane {
    min-height: 102px;
    display: grid;
    place-items: center;
    gap: 5px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(23, 32, 51, .08);
    padding: 10px 8px;
    text-align: center;
}
.team-pane strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 16px;
    line-height: 1.25;
}
.team-flag {
    font-size: 34px;
    line-height: 1;
}
.vs-pane {
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
}
.vs-pane span {
    background: var(--surface-2);
    border: 1px solid rgba(23, 32, 51, .06);
    border-radius: 6px;
    color: var(--accent);
    font-family: Consolas, monospace;
    font-weight: 800;
    padding: 7px 9px;
}
.vs-pane b {
    max-width: 72px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.vote-strip {
    display: flex;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    margin-top: 4px;
}
.vote-strip span { display: block; min-width: 0; }
.vote-strip .home { background: #60a5fa; }
.vote-strip .draw { background: #fbbf24; }
.vote-strip .away { background: #f472b6; }
.vote-labels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}
.vote-labels span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vote-labels span:last-child {
    text-align: right;
}
.upcoming-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
}
.pick-card {
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid rgba(23, 32, 51, .06);
    padding: 8px;
    min-width: 0;
}
.pick-card.home { border-color: rgba(96, 165, 250, .42); }
.pick-card.draw { border-color: rgba(251, 191, 36, .42); }
.pick-card.away { border-color: rgba(244, 114, 182, .42); }
.upcoming-picks span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}
.upcoming-picks b {
    display: block;
    margin-top: 2px;
    font-family: Consolas, monospace;
    font-size: 16px;
}
.upcoming-picks em {
    display: inline-block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}
.model-card, .info-card, .match-card, .table-card, .ko-card, .prompt-box {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(23, 32, 51, .06);
}
.model-card {
    padding: 20px;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--model-color), transparent 68%),
        0 10px 26px rgba(23, 32, 51, .06);
}
.model-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.model-head h2 {
    margin: 0;
    color: var(--model-color);
}
.badge {
    color: #0f766e;
    background: #dff8f1;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
}
.score-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--model-color), transparent 72%);
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--model-color), transparent 90%), #ffffff);
}
.score-summary span {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}
.points {
    font-family: Consolas, monospace;
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    color: var(--model-color);
}
.stats-title {
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.stats-grid div {
    background: var(--surface-2);
    border: 1px solid rgba(23, 32, 51, .05);
    border-radius: 8px;
    padding: 9px;
}
.stats-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.info-card {
    margin-top: 24px;
    padding: 18px;
}
.score-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    color: var(--muted);
}
.score-rules b {
    color: var(--accent);
    margin-right: 6px;
}
.group-title {
    font-size: 20px;
    margin-bottom: 12px;
}
.match-list { display: grid; gap: 10px; }
.match-card { padding: 16px; }
.match-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.match-info { min-width: 0; flex: 1; }
.scoreline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    font-weight: 700;
}
.scoreline b {
    background: var(--surface-2);
    border: 1px solid rgba(23, 32, 51, .05);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: Consolas, monospace;
}
.scoreline span:last-child { text-align: right; }
.prediction-stack {
    display: grid;
    gap: 4px;
    min-width: 100px;
}
.prediction-stack div {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    white-space: nowrap;
}
.prediction-stack span,
.prediction-stack b,
.prediction-stack em {
    flex: 0 0 auto;
}
.prediction-stack em {
    font-style: normal;
    color: var(--accent);
    font-size: 12px;
    min-width: 52px;
    text-align: right;
    font-weight: 800;
}
.prediction-stack em.hit-exact { color: #0f8f5f; }
.prediction-stack em.hit-close { color: #2563eb; }
.prediction-stack em.hit-result { color: #b7791f; }
.prediction-stack em.hit-miss { color: #dc2626; }
.upcoming-match-card {
    background:
        linear-gradient(90deg, rgba(15, 143, 127, .08), transparent 36%),
        var(--surface);
}
.upcoming-match-card .prediction-stack {
    min-width: 220px;
}
.upcoming-match-card .prediction-stack div {
    background: var(--surface-2);
    border: 1px solid rgba(23, 32, 51, .08);
    border-radius: 8px;
    padding: 7px 9px;
}
.upcoming-match-card .prediction-stack em {
    min-width: 58px;
    color: var(--muted);
    text-align: right;
}
details {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--border), transparent 35%);
}
summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
}
details p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.standings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.table-card { padding: 12px; overflow: hidden; }
.table-card h2 { font-size: 15px; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}
td, th { padding: 6px 4px; text-align: center; border-top: 1px solid color-mix(in srgb, var(--border), transparent 35%); }
td:nth-child(2), th:nth-child(2) { text-align: left; }
tr.qualify { background: color-mix(in srgb, var(--accent), transparent 94%); }
tr.third { background: color-mix(in srgb, var(--warn), transparent 94%); }
.bracket-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface), transparent 45%);
    border-radius: 12px;
}
.bracket-stage { min-width: 210px; }
.bracket-stage h2 {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ko-card { padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.ko-card div { padding: 2px 0; }
.ko-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.prompt-box { overflow: hidden; position: relative; }
.prompt-box button {
    position: absolute;
    right: 12px;
    top: 10px;
    border: 0;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--muted);
    padding: 7px 12px;
    cursor: pointer;
}
.prompt-box pre {
    margin: 0;
    padding: 50px 18px 18px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 13px;
}
.site-disclaimer {
    max-width: 860px;
    margin: 34px auto 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}
.disclaimer-link {
    border: 0;
    background: none;
    color: var(--accent);
    padding: 0 2px;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.prompt-modal[aria-hidden="true"] {
    display: none;
}
.prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
}
.prompt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 32, 51, .36);
}
.prompt-modal-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: min(78vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(23, 32, 51, .22);
}
.prompt-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.prompt-modal-head h2 {
    margin: 0;
    font-size: 18px;
}
.prompt-modal-head button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.prompt-modal pre {
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: var(--text);
    white-space: pre-wrap;
    font-family: Consolas, "Noto Sans TC", "Microsoft JhengHei", monospace;
    font-size: 13px;
    line-height: 1.7;
}
body.modal-open {
    overflow: hidden;
}
.footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    padding: 20px 16px;
}

@media (max-width: 820px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .nav-links { justify-content: flex-start; }
    .hero-actions {
        justify-content: flex-start;
    }
    .hero-actions button {
        flex: 1 1 138px;
    }
    .action-note {
        flex-basis: 100%;
    }
    .ad-block {
        margin: 22px 0;
        padding: 0;
    }
    .leader-grid, .standings-grid, .upcoming-grid { grid-template-columns: 1fr; }
    .section-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .section-head .compact-tabs {
        width: 100%;
    }
    .compact-tabs .tab {
        font-size: 15px;
        white-space: nowrap;
    }
    .score-rules { grid-template-columns: 1fr; }
    .match-main { flex-direction: column; align-items: stretch; }
    .prediction-stack { grid-template-columns: repeat(3, 1fr); }
    .upcoming-match-card .prediction-stack {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}
