:root {
  color-scheme: dark;
  --bg: #0b1010;
  --panel: #121919;
  --raised: #182221;
  --line: #2b3937;
  --text: #edf5f3;
  --muted: #a6bab6;
  --quiet: #90a5a0;
  --home: #71efbd;
  --away: #ff9e92;
  --zone: #e8d181;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
h1, h2, h3, p, dl, dd { margin: 0; }
h2, h3 { line-height: 1.25; }
button, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--home); outline-offset: 4px; }
[id] { scroll-margin-top: 1.5rem; }
.shell { width: min(100% - 3.5rem, 80rem); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; inset: .75rem auto auto .75rem; z-index: 2; padding: .75rem 1rem; color: var(--bg); background: var(--home); }

.site-header { border-bottom: 1px solid var(--line); background: #0e1514; }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; gap: .8rem; align-items: center; text-decoration: none; font-size: 1.125rem; font-weight: 750; white-space: nowrap; }
.brand small { display: block; color: var(--quiet); font: 650 .625rem var(--mono); letter-spacing: .17em; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .6rem; background: #15382d; color: var(--home); border: 1px solid #2c614f; }
.brand-mark span { width: 1.4rem; height: .9rem; border: 1px solid currentColor; border-radius: .12rem; position: relative; }
.brand-mark span::before, .brand-mark span::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.brand-mark span::before { height: 100%; border-left: 1px solid currentColor; }
.brand-mark span::after { width: .34rem; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; }
nav { display: flex; gap: 1.75rem; }
nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
nav a:hover { color: var(--home); }
nav a:first-child { color: var(--text); }
.privacy-label { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.privacy-label > span, .eyebrow > span { width: .42rem; height: .42rem; background: var(--home); border-radius: 50%; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; padding-block: 2.5rem 1.65rem; }
.eyebrow { color: var(--home); font: 650 .73rem var(--mono); text-transform: uppercase; letter-spacing: .14em; display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
h1 { font-size: clamp(2.85rem, 5.3vw, 4.4rem); line-height: 1; letter-spacing: -.067em; font-weight: 760; }
h1 span { color: var(--home); }
.subtitle { color: var(--muted); margin-top: .8rem; }
.fixture-control { display: grid; gap: .35rem; min-width: 17rem; }
.fixture-control label { color: var(--muted); font-size: .84rem; }
select { appearance: none; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: .45rem; min-height: 2.65rem; padding: .35rem 2.2rem .35rem .75rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.notice { padding: 1rem; color: var(--zone); }

.scoreboard, .panel, .metrics article { border: 1px solid var(--line); border-radius: .85rem; background: var(--panel); min-width: 0; }
.scoreboard { overflow: hidden; background: radial-gradient(ellipse at 13% 0%, #1a3a2e 0%, transparent 46%), radial-gradient(ellipse at 96% 20%, #322723 0%, transparent 45%), #131e1b; }
.scoreline { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(.55rem, 3vw, 3rem); padding: 1.45rem clamp(.8rem, 4vw, 3.5rem); }
.team { display: flex; align-items: center; gap: clamp(.45rem, 1.5vw, 1.15rem); }
.team span:has(strong) { min-width: 0; }
.team strong { font-size: clamp(1rem, 2.2vw, 1.75rem); line-height: 1.1; letter-spacing: -.035em; display: block; overflow-wrap: anywhere; }
.team small { display: block; color: var(--muted); margin-top: .45rem; font: 650 .68rem var(--mono); letter-spacing: .13em; }
.team-away { justify-content: end; text-align: right; }
.crest { display: grid; place-items: center; flex: none; width: clamp(2.4rem, 5.1vw, 4.25rem); aspect-ratio: 1.02; border: 1px solid #417c67; border-radius: 24% 24% 46% 46%; box-shadow: inset 0 0 0 4px #17322a; background: #265241; color: var(--home); font-size: clamp(1.1rem, 2.6vw, 2.1rem); font-weight: 800; line-height: 1; }
.team-away .crest { border-color: #895e57; box-shadow: inset 0 0 0 4px #3d2b28; background: #593a36; color: var(--away); }
.score-center { min-width: 10rem; display: grid; justify-items: center; line-height: 1; }
.match-status, .small-count { font: 650 .73rem var(--mono); color: var(--home); letter-spacing: .045em; white-space: nowrap; }
.score { font: 740 clamp(2.4rem, 5.25vw, 4.2rem)/1.05 var(--mono); letter-spacing: -.1em; padding-right: .1em; margin: .28rem 0; white-space: nowrap; }
.score span { color: var(--quiet); margin: 0 .2em; }
.clock { color: var(--muted); font: 650 .85rem var(--mono); }
.replay { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; border-top: 1px solid var(--line); background: #111b19; padding: .85rem 1.2rem; }
.replay-progress { flex: 1; max-width: 37rem; }
.replay-progress > div { display: flex; justify-content: space-between; font: .8rem var(--mono); color: var(--muted); padding-bottom: .45rem; }
progress { display: block; width: 100%; height: .32rem; appearance: none; border: 0; border-radius: 1rem; background: #344641; overflow: hidden; }
progress::-webkit-progress-bar { background: #344641; }
progress::-webkit-progress-value { background: var(--home); }
progress::-moz-progress-bar { background: var(--home); }
.replay-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.button { color: var(--text); background: #21302d; border: 1px solid #3c514b; min-height: 2.5rem; border-radius: .45rem; padding: .4rem .8rem; font-size: .87rem; font-weight: 670; }
.button:hover:enabled { background: #2e433d; }
.button:disabled { opacity: .55; cursor: default; }
.button.primary { background: var(--home); border-color: var(--home); color: #09231a; }
.button.primary:hover:enabled { background: #a3f7d6; }
.button.quiet { background: transparent; color: var(--muted); border-color: transparent; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-block: .9rem; }
.metrics article { padding: .95rem 1.15rem; }
.metrics h2 { display: flex; justify-content: space-between; align-items: center; gap: .25rem; font-weight: 630; font-size: .91rem; color: var(--muted); }
abbr { text-decoration: none; color: var(--home); font-family: var(--mono); font-size: .75rem; }
.metric-pair { font: 710 clamp(1.35rem, 2.5vw, 1.95rem)/1.25 var(--mono); letter-spacing: -.055em; white-space: nowrap; margin: .31rem 0 .1rem; }
.metric-pair.compact { font-size: clamp(.875rem, 2.1vw, 1.65rem); }
.metric-pair .secondary { color: var(--away); }
.metric-pair .divider { color: var(--quiet); font-size: .73em; padding-inline: .32em; }
.metric-note { color: var(--quiet); font-size: .78rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: .9rem; align-items: stretch; }
.lower-grid, .log-panel, .method-panel { margin-top: .9rem; }
.panel-heading { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin: 1.1rem 1.2rem .95rem; }
.panel-heading h2 { letter-spacing: -.035em; font-size: 1.19rem; }
.panel-heading p { color: var(--muted); font-size: .86rem; margin-top: .21rem; }
.segmented { display: flex; align-items: center; gap: .12rem; padding: .19rem; background: #0c1513; border: 1px solid var(--line); border-radius: .53rem; }
.segmented button { min-height: 2rem; color: var(--muted); padding: .22rem .64rem; border: 1px solid transparent; border-radius: .34rem; background: none; font-size: .82rem; }
.segmented button[aria-pressed="true"] { border-color: #3a5d50; background: #213a30; color: #a3f4d2; }
.segmented button:hover { color: var(--text); }
.pitch-stage, .momentum-stage { margin-inline: 1.2rem; overflow: hidden; border-radius: .5rem; }
.pitch-stage { background: #112720; border: 1px solid #355247; }
.momentum-stage { background: #101918; border: 1px solid #263834; }
canvas { display: block; width: 100%; max-width: 100%; height: auto; }
.pitch-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .8rem 1.2rem .45rem; flex-wrap: wrap; }
.legend { display: flex; gap: .75rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { display: inline-block; width: .52rem; height: .52rem; border-radius: 50%; flex: none; background: var(--home); }
.dot.away { background: var(--away); }
.zone { width: .63rem; height: .63rem; border: 1px dashed var(--zone); background: #52452a; }
.filter-label { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .45rem; }
.filter-label select { min-height: 2.1rem; }
.pitch-selection, .chart-summary { margin: 0 1.2rem .85rem; color: var(--quiet); font-size: .83rem; }
.chart-summary { margin-top: .75rem; }

.events-panel { display: flex; flex-direction: column; }
.events-panel .panel-heading { margin-bottom: .4rem; }
.event-list { list-style: none; margin: 0 1.2rem; padding: 0; }
.event-list li { border-bottom: 1px solid var(--line); }
.event-button { width: 100%; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; text-align: left; min-height: 3.3rem; padding: .48rem .15rem; color: var(--text); border: 0; background: transparent; }
.event-button:hover, .event-button[aria-pressed="true"] { background: #1b2925; }
.event-minute { color: var(--quiet); font: .83rem var(--mono); }
.event-detail { display: grid; }
.event-name { font-size: .91rem; font-weight: 660; line-height: 1.15; }
.event-team { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); margin-top: .17rem; overflow-wrap: anywhere; }
.event-value { color: var(--muted); font: .77rem var(--mono); white-space: nowrap; }
.goal-name, .positive { color: var(--home); }
.feed-empty { color: var(--muted); margin: .8rem 1.2rem; }
.text-link { color: var(--home); font-size: .86rem; text-underline-offset: .23em; font-weight: 620; }
.text-link:hover { color: #adf9db; }
.feed-link { margin: auto 1.2rem 0; padding: .9rem 0 .9rem; align-self: start; }

.report-list { display: grid; gap: .72rem; padding: 0 1.2rem 1.1rem; }
.report-list div { border-left: 2px solid #3d6f5d; padding-left: .74rem; }
.report-list dt { color: var(--home); font: 640 .76rem var(--mono); margin-bottom: .18rem; }
.report-list dd { color: var(--muted); line-height: 1.46; font-size: .91rem; }
.table-scroll { overflow-x: auto; margin-inline: 1.2rem; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .87rem; }
th, td { padding: .55rem .65rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--raised); font-weight: 690; color: var(--muted); }
td { color: var(--muted); }
td:nth-child(2) { color: var(--text); }
.log-footer { padding: .7rem 1.2rem; }
.log-footer:has([hidden]) { padding-bottom: .45rem; }
.method-content { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.1rem; padding: 0 1.2rem 1.25rem; }
details { border-bottom: 1px solid var(--line); }
details summary { padding: .6rem 0; font-size: .96rem; font-weight: 650; }
details p, .import-box p { color: var(--muted); font-size: .9rem; max-width: 65ch; }
details p { padding: 0 0 .7rem; }
.import-box { background: var(--raised); border: 1px solid var(--line); border-radius: .5rem; padding: .8rem .95rem; }
.import-box h3 { font-size: 1rem; margin-bottom: .25rem; }
.import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .7rem; }
input[type="file"] { font-size: .81rem; max-width: 100%; color: var(--muted); width: 15rem; }
input[type="file"]::file-selector-button { font: inherit; cursor: pointer; color: var(--text); background: #21312c; border: 1px solid #465e55; border-radius: .35rem; padding: .35rem .5rem; margin-right: .45rem; }
.import-status:not(:empty) { margin-top: .6rem; color: var(--home); overflow-wrap: anywhere; }
.import-status.error { color: var(--away); }
.site-footer { display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; color: var(--quiet); font-size: .84rem; padding-block: 1.25rem 2rem; }
.site-footer a { text-underline-offset: .17em; }

@media (max-width: 920px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .event-button { gap: .28rem; grid-template-columns: 2.1rem minmax(0, 1fr) auto; }
  .metric-note { line-height: 1.3; }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 3.7rem; gap: .5rem; }
  nav { gap: .75rem; }
  nav a { font-size: .8rem; }
  .privacy-label { display: none; }
  .intro { align-items: start; flex-direction: column; gap: .85rem; padding-block: 1.65rem 1.1rem; }
  .fixture-control { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .fixture-control select { min-width: 0; }
  .fixture-control label, .eyebrow { font-size: .74rem; }
  .replay { flex-direction: column; align-items: stretch; padding: .75rem .75rem; gap: .65rem; }
  .replay-progress { max-width: none; }
  .replay-actions { justify-content: end; }
  .metrics { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .metrics article { padding: .75rem .8rem; }
  .dashboard-grid, .method-content { grid-template-columns: minmax(0, 1fr); }
  .panel-heading { margin: .9rem .85rem .8rem; }
  .pitch-stage, .momentum-stage, .table-scroll, .event-list { margin-inline: .85rem; }
  .pitch-footer, .pitch-selection, .chart-summary, .feed-link, .feed-empty { margin-inline: .85rem; }
  .report-list, .method-content { padding-inline: .85rem; }
  .event-button { gap: .65rem; grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
}

@media (max-width: 465px) {
  .scoreline { padding: .8rem .65rem; }
  .score-center { min-width: 0; }
  .score.compact { font-size: clamp(1.55rem, 5.6vw, 2.4rem); }
  .match-status { font-size: .54rem; }
  .team { flex-direction: column; align-self: start; text-align: center; gap: .35rem; }
  .team-away .crest { order: -1; }
  .team small { font-size: .62rem; margin-top: .28rem; }
  .brand { gap: .4rem; font-size: .99rem; }
  .brand-mark { width: 1.95rem; height: 1.95rem; }
  .brand small { font-size: .48rem; }
  nav { gap: .52rem; }
  nav a { font-size: .73rem; }
}
