/* Match page (game_page.html), on top of signal.css. */

.gp-top { padding-top: 4px; }
.gp-title { max-width: 24ch; margin-top: 14px; font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.gp-answer { margin: 10px 0 24px; color: var(--text-2); font-size: 17px; }
.gp-answer b { color: var(--text); font-weight: 700; }

.gp-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---------- Ink header: teams on the left, the verdict on the right ---------- */

.gp-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--ink);
    color: #fff;
}

.gp-head-match { display: flex; flex-direction: column; gap: 22px; padding: 24px; }

.gp-head-score {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-left: 1px solid var(--ink-line);
}

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

.gp-badge {
    padding: 6px 9px;
    border: 1px solid var(--ink-line);
    border-radius: 6px;
    color: var(--ink-text-2);
    font: 600 12.5px/1 var(--font);
}

.gp-badge.is-tier { background: var(--tier); border-color: var(--tier); color: var(--ink); }

.gp-teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 16px;
}

.gp-label {
    color: var(--ink-text-3);
    font: 500 13px/1.3 var(--font);
}

.gp-team h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: clamp(1.35rem, 2.3vw, 1.85rem);
    line-height: 1.05;
}

.gp-team.is-away { text-align: right; }
.gp-team.is-away h2 { flex-direction: row-reverse; }
.gp-vs { padding-bottom: 6px; color: var(--ink-text-3); font: 500 13px var(--font); }

.gp-form { display: flex; gap: 3px; margin-top: 10px; }
.gp-team.is-away .gp-form { justify-content: flex-end; }

.form-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font: 600 10px var(--mono);
}

.form-w { background: var(--ink); color: #fff; }
.form-d { background: var(--heat-1); color: var(--ink); }
.form-l { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-3); }
.on-ink .form-w { background: #fff; color: var(--ink); }
.on-ink .form-d { background: #3D4A6B; color: #fff; }
.on-ink .form-l { box-shadow: inset 0 0 0 1px #3D4A6B; color: var(--ink-text-2); }

.gp-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid var(--ink-line);
}

.gp-facts dd { margin: 5px 0 0; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.gp-facts .gp-venue { grid-column: 1 / -1; }

.gp-head .score-xl { font-size: clamp(5rem, 9vw, 8.5rem); }
.gp-scale .band-bar { height: 6px; }

@media (max-width: 760px) {
    .gp-head { grid-template-columns: minmax(0, 1fr); }
    .gp-head-score { order: -1; border-left: 0; border-bottom: 1px solid var(--ink-line); }
    .gp-head-match, .gp-head-score { padding: 20px; }
    .gp-teams { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .gp-team.is-away { text-align: left; }
    .gp-team.is-away h2 { flex-direction: row; }
    .gp-team.is-away .gp-form { justify-content: flex-start; }
    .gp-vs { padding: 0; }
    .gp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Fingerprint ---------- */

/* Radar beside the rows once the panel is wide enough, above them otherwise.
   This match is the accent; the week's average match is a dashed Ink Text 3 line. */
.gp-fp-body { container-type: inline-size; }
.gp-fp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.gp-radar { width: 100%; max-width: 320px; margin: 0 auto; }
.gp-radar svg { display: block; width: 100%; height: auto; }

.gp-radar-grid polygon, .gp-radar-grid line { fill: none; stroke: var(--line); stroke-width: 1; }
.gp-radar-grid .is-outer { stroke: var(--line-strong); }
/* A factor with no data: the shape drops to the centre, so its spoke is dashed to show it isn't a zero. */
.gp-radar-grid .is-na { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.gp-radar-fill { fill: var(--accent); fill-opacity: 0.14; }
.gp-radar-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.gp-radar-average { fill: none; stroke: var(--ink-text-3); stroke-width: 1.5; stroke-dasharray: 4 3; stroke-linejoin: round; }
.gp-radar-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.gp-radar-code { fill: var(--text-3); font: 500 12px var(--mono); }
.gp-radar-code.is-top { fill: var(--text); font-weight: 700; }
.gp-radar-hit { fill: transparent; }
.gp-radar-axis.is-hover .gp-radar-dot { stroke: var(--ink); }
.gp-radar-axis.is-hover .gp-radar-code { fill: var(--text); }

.gp-radar-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 4px; color: var(--text-2); font-size: 13px; }
.gp-radar-key span { display: inline-flex; align-items: center; gap: 6px; }
.gp-radar-swatch { width: 16px; border-top: 2px solid var(--accent); }
.gp-radar-swatch.is-average { border-top: 2px dashed var(--ink-text-3); }

.gp-fp-rows { margin: 0; padding: 0; list-style: none; }

.gp-fp-rows li {
    display: grid;
    grid-template-columns: 34px minmax(0, 13rem) minmax(0, 1fr) 3.2rem;
    align-items: center;
    gap: 14px;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
    font-size: 14px;
}

.gp-fp-code { color: var(--text-3); font: 500 11px var(--mono); }
.gp-fp-label { font-weight: 500; }

.top-badge {
    margin-left: 6px;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    font: 600 11px/1.3 var(--font);
    vertical-align: 1px;
}

.gp-fp-bar { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.gp-fp-bar span { display: block; height: 100%; border-radius: 3px; }
.gp-fp-bar.heat-na { border-radius: 3px; }
.gp-fp-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.gp-fp-value.is-na { color: var(--text-3); font: 400 13px var(--font); }

@media (max-width: 560px) {
    .gp-fp-rows li { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "code label value" "bar bar bar"; gap: 6px 10px; }
    .gp-fp-code { grid-area: code; }
    .gp-fp-label { grid-area: label; }
    .gp-fp-bar { grid-area: bar; }
    .gp-fp-value { grid-area: value; }
}

@container (min-width: 700px) {
    .gp-fp-grid { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: center; gap: 32px; }
    .gp-radar { margin: 0; }
    .gp-fp-rows li { grid-template-columns: 34px minmax(0, 11rem) minmax(0, 1fr) 3.2rem; }
}

/* ---------- Why watch ---------- */

.gp-lead { max-width: 68ch; margin-bottom: 14px; color: var(--text); font-size: 17px; font-weight: 500; line-height: 1.5; }

.gp-prose { max-width: 70ch; color: var(--text-2); font-size: 16px; line-height: 1.65; }
.gp-prose > * + * { margin-top: 14px; }
.gp-prose h1, .gp-prose h2, .gp-prose h3, .gp-prose h4 { margin-top: 22px; color: var(--text); font-size: 1.05rem; font-stretch: 100%; letter-spacing: 0; }
.gp-prose strong { color: var(--text); }
.gp-prose ul, .gp-prose ol { padding-left: 1.2em; }
.gp-prose li + li { margin-top: 6px; }
.gp-prose a { color: var(--text); font-weight: 600; }

.gp-watch-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; }

.ad-article { max-width: 356px; min-height: 300px; margin: 22px auto; }

/* ---------- Against this week's top 10 ---------- */

.gp-vs-top-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    color: var(--text-3);
    font: 500 13px var(--font);
}

.gp-vs-top-legend b { color: var(--text); font-weight: 600; }
.gp-key-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ink); vertical-align: 0; }
.gp-key-dot.is-this { background: var(--accent); }

.gp-vs-top { position: relative; height: 44px; margin-top: 14px; }

.gp-vs-top-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 16px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(to right,
        var(--heat-0) 0 40%, #FFF3E8 40% 60%, #FFE6D2 60% 85%, #FFDCCB 85% 100%);
}

.gp-dot {
    position: absolute;
    top: 22px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--ink);
    transform: translate(-50%, -50%);
}

.gp-dot.is-up { top: 15px; }
.gp-dot.is-down { top: 29px; }
.gp-dot.is-this { width: 16px; height: 16px; background: var(--accent); top: 22px; z-index: 1; }

/* ---------- Head to head, form, players ---------- */

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

.gp-sub {
    margin-bottom: 10px;
    color: var(--text-2);
    font: 600 13.5px var(--font);
}

.gp-list { margin: 0; padding: 0; list-style: none; }
.gp-list > li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.gp-list > li:first-child { border-top: 0; padding-top: 0; }

.gp-meeting { font-size: 14px; font-weight: 500; }
.gp-meeting-score { margin: 0 6px; font-weight: 700; font-variant-numeric: tabular-nums; }

.gp-split { display: flex; gap: 2px; height: 10px; margin: 16px 0 14px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.gp-split span { display: block; height: 100%; }
.gp-split .is-home, .gp-split-legend .is-home .tier-swatch { background: var(--ink); }
.gp-split .is-draw, .gp-split-legend .is-draw .tier-swatch { background: var(--heat-1); }
.gp-split .is-away, .gp-split-legend .is-away .tier-swatch { background: #8B94A1; }

.gp-split-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gp-split-legend div { display: grid; gap: 2px; }
.gp-split-num { font-weight: 800; font-size: 1.8rem; line-height: 1; font-variant-numeric: tabular-nums; }
.gp-split-label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.25; }
.gp-split-pct { color: var(--text-3); font: 400 12px var(--mono); }

.gp-team-title { margin-bottom: 10px; font-size: 1.05rem; }
.gp-form-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gp-form-line .gp-form { margin: 0; }

.gp-stat { margin-top: 14px; }
.gp-stat-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.gp-stat-row b { font-variant-numeric: tabular-nums; }
.gp-bar { display: block; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.gp-bar span { display: block; height: 100%; max-width: 100%; border-radius: 3px; background: var(--ink); }
.gp-bar.is-muted span { background: #8B94A1; }
.gp-trend { margin-top: 14px; color: var(--text-2); font: 600 13px var(--font); }

.gp-player { display: flex; align-items: center; gap: 10px; }
.gp-player img, .gp-player-blank { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--line-soft); object-fit: cover; }
.gp-player-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.gp-player-stats { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gp-rating { display: inline-flex; align-items: center; gap: 6px; }
.gp-rating .gp-bar { width: 44px; margin: 0; }

.gp-players-block + .gp-players-block { margin-top: 22px; }

@media (max-width: 640px) {
    .gp-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

/* ---------- Standings ---------- */

.gp-table-wrap { overflow-x: auto; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }

.gp-table th {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    color: var(--text-3);
    font: 600 12px var(--font);
    text-align: center;
}

.gp-table td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); text-align: center; color: var(--text-2); }
.gp-table td.is-team { text-align: left; color: var(--text); }
.gp-table td.is-pts { color: var(--text); font-weight: 700; }
.gp-table .gp-table-team { display: flex; align-items: center; gap: 8px; min-width: 9rem; }
.gp-table .gp-table-team img { width: 16px; height: 16px; object-fit: contain; }
.gp-table tr.is-playing td { background: #FFF4EC; }
.gp-table tr.is-playing .gp-table-team { font-weight: 700; }
.gp-table tr.is-group td { padding-top: 14px; background: var(--surface); color: var(--text-2); font: 600 13px var(--font); text-align: left; }
.gp-table .form-chip { width: 15px; height: 15px; font-size: 9px; }
.gp-table .is-form { text-align: left; }
.gp-table .gp-form { justify-content: flex-start; margin: 0; }

/* ---------- More this week ---------- */

.gp-rows { margin: 0; padding: 0; list-style: none; }

.gp-rows li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
}

.gp-rows a { font-size: 15px; text-decoration: none; }
.gp-rows a:hover .team-name { text-decoration: underline; }

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

.gp-other {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    transition: border-color 0.15s;
}

.gp-other:hover { border-color: var(--line-strong); }
.gp-other a { font-weight: 700; font-size: 15px; line-height: 1.25; text-decoration: none; }
.gp-other a::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-lg); }
.gp-other-score { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

.gp-section-title { margin: 8px 0 0; font-size: 1.25rem; }

.gp-faq { display: grid; gap: 16px; }
.gp-faq h3 { font-size: 15px; font-stretch: 100%; letter-spacing: 0; line-height: 1.35; }
.gp-faq p { margin-top: 4px; color: var(--text-2); }

.gp-team-links li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); font-weight: 600; font-size: 14px; }
.gp-team-links li:first-child { border-top: 0; }
.gp-team-links a { color: var(--text-3); font: 500 13px var(--font); }

@media (max-width: 900px) {
    .gp-others { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .gp-others { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 78%; overflow-x: auto; scrollbar-width: none; }
    .gp-rows li { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
    .gp-rows .tier-tag { display: none; }
}

/* ---------- Compact bar once the header scrolls away ---------- */

.gp-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: var(--ink);
    color: #fff;
    border-bottom: 1px solid var(--ink-line);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gp-sticky.is-visible { transform: none; }
.gp-sticky-inner { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.gp-sticky-teams { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 15px; }
.gp-sticky-team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.gp-sticky-team > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-sticky-vs { flex-shrink: 0; color: var(--ink-text-3); font-size: 13px; font-weight: 500; }
.gp-sticky-score { display: inline-flex; flex-shrink: 0; align-items: center; gap: 12px; }
.gp-sticky .score { color: var(--accent); }
.gp-sticky .score-dec { color: var(--ink-text-3); }

/* On a phone the two teams stack, so both names fit; the tier tag gives way. */
@media (max-width: 640px) {
    .gp-sticky-inner { gap: 12px; padding-block: 8px; }
    .gp-sticky-teams { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13.5px; }
    .gp-sticky-vs, .gp-sticky .tier-tag { display: none; }
    .gp-sticky .score-sm { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-sticky { transition: none; }
}
