/* Previgol public site.
   A working tool for someone following matches, often on a phone next to a TV. The world lends four things only:
   type, palette, density and one signature move. The move: a match is a line from 0 to 90, a goal is a ball on it and an
   alert is a yellow diamond on it (never a card: a yellow card is a booking). Layout, navigation and controls are the ordinary ones.
   Palette: pitch green for the shell, marking chalk for the ground, card yellow for alerts, and the green and red of a
   result. Type: Barlow and Barlow Condensed (SIL Open Font License), served from this site: nothing is fetched from
   anyone else. */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --pitch: #0f3d2a;
    --pitch-ink: #f1f6f2;
    --pitch-soft: #b9cdc1;
    --chalk: #eef2ee;
    --sheet: #ffffff;
    --tint: #f5f8f5;
    --ink: #10261e;
    --soft: #55675d;
    --line: #c9d4cb;
    --turf: #1f6b47;
    --card: #f5c400;
    --card-ink: #1c1700;
    --hit: #17753f;
    --on-hit: #ffffff;
    --miss: #b3312a;
    --live: #dc2626;
    --late: #ea580c;
    --break: #b45309;
    --goal: #059669;
    /* Corner and shot-on-target alerts: yellow (--card) belongs to goal alerts only. */
    --stat: #2e5f8a;
    --on-stat: #ffffff;
    --focus: #10261e;
    --condensed: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --pitch: #0b2a1d;
        --pitch-soft: #9fb8aa;
        --chalk: #0e1713;
        --sheet: #16231d;
        --tint: #1b2a23;
        --ink: #e6eee8;
        --soft: #98aa9f;
        --line: #2b3b32;
        --turf: #58b98a;
        --hit: #5fd08f;
        --on-hit: #0e1713;
        --miss: #ff8d84;
        --live: #ef4444;
        --late: #f97316;
        --break: #fbbf24;
        --goal: #39f5a6;
        --stat: #8ab6de;
        --on-stat: #0e1713;
        --focus: #f5c400;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }

body {
    margin: 0;
    background: var(--chalk);
    color: var(--ink);
    font: 1rem/1.5 var(--text);
    font-variant-numeric: tabular-nums;
}

::selection { background: var(--card); color: var(--card-ink); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color 0.15s var(--ease); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); color: var(--ink); padding: 0.5rem 0.75rem; z-index: 5; }

ul { list-style: none; margin: 0; padding: 0; }

/* Page frame. One width for every page; text pages keep a reading measure inside it. */
.wrap { max-width: 70rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }

/* The shell: a pitch-green bar with the name and the four pages. */
.top { background: var(--pitch); color: var(--pitch-ink); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.5rem; }
.top a:focus-visible { outline-color: var(--card); }
.mark { font: 700 1.5rem/1 var(--condensed); letter-spacing: 0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 0.45rem; min-height: 3.25rem; }
.mark svg { fill: var(--card); stroke: var(--card-ink); stroke-width: 2; transform: rotate(-8deg); transition: transform 0.2s var(--ease); }
.mark:hover svg { transform: rotate(-16deg) translateY(-1px); }
.top nav { display: flex; gap: 1.4rem; margin-left: -0.1rem; }
.top nav a {
    display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; color: var(--pitch-soft); white-space: nowrap;
    background: linear-gradient(var(--card), var(--card)) left calc(100% - 0.45rem) / 0 2px no-repeat;
    transition: color 0.15s var(--ease), background-size 0.2s var(--ease);
}
.top nav a:hover { color: var(--pitch-ink); background-size: 100% 2px; }
.top nav a[aria-current="page"] { color: var(--pitch-ink); font-weight: 600; background-size: 100% 2px; }

main { padding-top: 1.5rem; padding-bottom: 3rem; }

/* Page heads. A working page gets a short one with its state on the right; a text page gets a larger title. */
.pagehead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1.5rem; margin-bottom: 1rem; }
.pagehead h1, .intro h1 { font: 700 1.5rem/1.1 var(--condensed); margin: 0; text-wrap: balance; }
.intro { margin-bottom: 1.25rem; }
.intro h1 { margin-bottom: 0.4rem; }
.intro p { margin: 0; max-width: 40rem; color: var(--soft); }
.intro .status { margin-top: 0.4rem; font-size: 0.875rem; }

/* The state of the live page: a dot that beats while updates arrive, red and still when they stop. */
.status { margin: 0; font-size: 0.875rem; color: var(--soft); min-height: 1.3em; }
.pagehead .status::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.45rem; border-radius: 50%; background: var(--turf); animation: beat 2s ease-in-out infinite; }
.pagehead .status:empty::before { display: none; }
.status.is-stopped { color: var(--miss); font-weight: 600; }
.pagehead .status.is-stopped::before { background: var(--miss); animation: none; }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

h2 { font: 700 1.1rem/1.15 var(--condensed); margin: 0 0 0.5rem; display: flex; align-items: baseline; gap: 0.6rem; }
section + section > h2, .prose section + section h2 { margin-top: 2rem; }
h3 { font: 600 1rem/1.3 var(--text); margin: 1.4rem 0 0.5rem; display: flex; align-items: baseline; gap: 0.5rem; }
h3::first-letter { text-transform: uppercase; }
.count { font: 400 0.875rem/1 var(--text); color: var(--soft); }
.empty, .quiet { color: var(--soft); margin: 0; }
.empty { padding: 1rem; background: var(--sheet); border: 1px dashed var(--line); border-radius: 6px; }
.empty p { margin: 0; }
.empty .comp { margin: 1rem 0 0.25rem; }
.empty .fixtures { color: var(--ink); }
.more { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; color: var(--turf); }

/* The live page: the cards of the matches, and beside them (below them on a phone) today's alerts. */
.live { display: grid; gap: 1.75rem; }
.live > section { min-width: 0; }
@media (min-width: 62rem) {
    .live { grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.5rem; align-items: start; }
    .live > .today { position: sticky; top: 1rem; }
    .live > .today .feed { max-height: calc(100vh - 5rem); overflow-y: auto; overscroll-behavior: contain; }
    .live > section + section > h2 { margin-top: 0; }
}

/* One match, one small card: competition and minute, a line per team (goals, that team's chance to score), the chance
   of another goal, the match line, and the alerts given in that match. */
.cards { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.match { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.75rem 0.6rem; font-size: 0.875rem; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin: 0; font-size: 0.75rem; line-height: 1.3; color: var(--soft); }
.league { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) 2.9rem 3.9rem; column-gap: 0.55rem; align-items: center; margin-top: 0.25rem; }
/* The minute, written as on the main alertesportive scanner ("60'", "HT"), as plain text. The tick after the number blinks
   once a second: the clock is running. */
.clock { flex: none; font-weight: 600; color: var(--turf); white-space: nowrap; }
.colon { font-style: normal; }
.tick { font-style: normal; animation: tick 1s steps(1, end) infinite; }
@keyframes tick { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.15; } }
.line .is-home { grid-row: 1; }
.line .is-away { grid-row: 2; }
.name { grid-column: 2; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goals { grid-column: 1; margin: 1px 0; border-radius: 3px; background: var(--tint); font: 700 1.05rem/1.3 var(--condensed); text-align: center; transition: background-color 0.4s var(--ease), color 0.4s var(--ease); }
/* A goal, as on the main scanner: the card flashes green once, and the score of the side that scored stays lit in green
   for a while (green, because yellow belongs to the alerts). */
.goals.is-goal { background: color-mix(in srgb, var(--goal) 22%, transparent); box-shadow: 0 0 0 1px var(--goal), 0 0 8px color-mix(in srgb, var(--goal) 45%, transparent); }
.match.is-goal-new { animation: cardgoal 2.8s ease-out; }
@keyframes cardgoal { 0% { background: color-mix(in srgb, var(--goal) 30%, var(--sheet)); } 50% { background: color-mix(in srgb, var(--goal) 14%, var(--sheet)); } 100% { background: var(--sheet); } }
.goals.is-goal-new { animation: goal 1.2s var(--ease); }
@keyframes goal { 0% { transform: scale(1); } 25% { transform: scale(1.5); } 55% { transform: scale(0.95); } 100% { transform: scale(1); } }
.chance { grid-column: 3; text-align: right; color: var(--soft); }
.any { grid-column: 4; grid-row: 1 / span 2; font: 700 1.3rem/1 var(--condensed); text-align: right; }

/* The match line from 0 to 90: the played part is filled, a ball is a goal, a yellow diamond is an alert. */
.strip { position: relative; height: 0.9rem; margin-top: 0.15rem; border-bottom: 2px solid var(--line); }
.strip .played { position: absolute; left: 0; bottom: -2px; height: 2px; background: var(--turf); }
.strip .played::after { content: ""; position: absolute; right: -1px; bottom: 0; width: 2px; height: 0.45rem; background: var(--turf); }
.strip .half { position: absolute; left: 50%; bottom: -2px; width: 2px; height: 0.35rem; background: var(--line); }
.strip .goal { position: absolute; bottom: 0.15rem; width: 0.45rem; height: 0.45rem; margin-left: -0.225rem; border-radius: 50%; background: var(--ink); }
.strip .goal-away { background: var(--sheet); border: 2px solid var(--ink); }
.strip .pin { position: absolute; bottom: 0.18rem; width: 0.42rem; height: 0.42rem; margin-left: -0.21rem; background: var(--card); border: 1px solid var(--card-ink); transform: rotate(45deg); }
.strip .pin.is-silent { background: var(--stat); border-color: var(--stat); }

/* An alert, the same wherever it is shown: the chance said at that moment, what is expected, when and why it was said,
   and its state in words. The chance sits on yellow only while the alert is pending. */
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 0.15rem 0.65rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.alert p { margin: 0; }
.pct { display: grid; place-items: center; min-width: 2.7rem; padding: 0.3rem 0.3rem; border-radius: 4px; background: var(--card); color: var(--card-ink); border: 1px solid var(--card-ink); line-height: 1; }
.pct b { font: 700 1.05rem/1.05 var(--condensed); }
.call { font-weight: 600; line-height: 1.3; }
.where, .when { font-size: 0.8125rem; color: var(--soft); line-height: 1.35; }
.state { align-self: center; display: grid; justify-items: end; gap: 0.2rem; font-size: 0.75rem; line-height: 1.3; }
.state b { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.state small { font-size: 0.75rem; font-weight: 600; color: var(--hit); white-space: nowrap; }
.state .ico { width: 0.75rem; height: 0.75rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* A hit is the one filled badge: solid green with a check, and the minute of the goal beside or under it. */
.is-hit .state b { background: var(--hit); border-color: var(--hit); color: var(--on-hit); }
.is-miss .state b { color: var(--miss); border-color: var(--miss); }
.is-hit .pct { background: transparent; color: var(--hit); border-color: var(--hit); }
.is-miss .pct, .is-nodata .pct, .is-void .pct { background: transparent; color: var(--soft); border-color: var(--line); }
.is-silent.is-open .pct { background: var(--stat); color: var(--on-stat); border-color: var(--stat); }
.is-miss .state small { color: var(--soft); }

/* Alerts inside a match card. */
.match .alerts { margin-top: 0.35rem; }
.match .alert { padding: 0.4rem 0 0; border-bottom: 0; font-size: 0.8125rem; gap: 0.1rem 0.55rem; }
.match .when { font-size: 0.75rem; }

/* Lists of alerts on their own: today's, and the record's days. */
.feed { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 0 0.75rem; }
.feed .alert:last-child { border-bottom: 0; }
.today .feed .alert { grid-template-columns: auto minmax(0, 1fr); }
.today .feed .state { grid-column: 2; justify-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }

/* The one moment of motion: a new alert is marked once. */
@keyframes raise { from { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } to { transform: none; } }
@keyframes mark { from { background: color-mix(in srgb, var(--card) 28%, transparent); } to { background: transparent; } }
.alert.is-new { animation: mark 6s ease-out; }
.alert.is-new .pct { animation: raise 0.5s var(--ease); }

/* The record. */
.narrow { max-width: 52rem; }
.scroll { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; }
table.types { border-collapse: collapse; width: 100%; min-width: 36rem; }
.types th, .types td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.types thead th { font-size: 0.8125rem; font-weight: 600; color: var(--soft); vertical-align: bottom; line-height: 1.25; background: var(--tint); }
.types tbody tr:last-child th, .types tbody tr:last-child td { border-bottom: 0; }
.types tbody th { font-weight: 600; line-height: 1.3; min-width: 12.5rem; }
.types tbody th small { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--soft); }
.types .n { text-align: right; white-space: nowrap; }
.rate { white-space: nowrap; }
.rate b { font: 700 1.25rem/1 var(--condensed); margin-left: 0.5rem; vertical-align: middle; }
.bar { position: relative; display: inline-block; vertical-align: middle; width: 6.5rem; height: 0.6rem; background: var(--chalk); border-radius: 2px; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--turf); border-radius: 2px; }
.bar i { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 2px; background: var(--ink); }
.few { color: var(--soft); font-size: 0.875rem; }
.note { font-size: 0.875rem; color: var(--soft); max-width: 40rem; margin: 0.75rem 0 0; }

/* Upcoming matches: one box per day (today and tomorrow open), the competition once, its matches side by side. */
.day { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 0 1rem; }
.day + .day { margin-top: 0.5rem; }
.day[open] { padding-bottom: 0.7rem; }
.day summary { display: list-item; margin-left: 1rem; padding: 0.65rem 0; font-weight: 600; cursor: pointer; }
.day summary::marker { color: var(--soft); }
.day summary:hover .dayname { text-decoration: underline; text-underline-offset: 0.2em; }
.day .dayname { display: inline-block; }
.day .dayname::first-letter { text-transform: uppercase; }
.day .comp { margin-top: 0.5rem; }
.day .comp:first-of-type { margin-top: 0; }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); column-gap: 1.5rem; }
.fixtures li { display: flex; gap: 0.6rem; padding: 0.12rem 0; line-height: 1.4; min-width: 0; }
.fixtures time { color: var(--turf); font-weight: 600; flex: none; }
.fixtures span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Text pages. */
.prose { max-width: 40rem; }
.prose h2 { margin-bottom: 0.4rem; }
.prose p { margin: 0 0 0.75rem; }
.contact { margin-top: 2rem !important; }

.foot { border-top: 1px solid var(--line); color: var(--soft); font-size: 0.875rem; }
.foot .wrap { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.foot p { margin: 0 0 0.4rem; max-width: 40rem; }
.langs { margin-top: 0.9rem !important; }
.langs a, .langs span { margin-left: 0.4rem; display: inline-block; padding: 0.5rem 0.35rem; }
.langs span { font-weight: 700; color: var(--ink); }

@media (max-width: 30rem) {
    .top nav { gap: 1.1rem; width: 100%; overflow-x: auto; scrollbar-width: none; }
    .mark { min-height: 2.75rem; }
    .alert { grid-template-columns: auto minmax(0, 1fr); }
    .state { grid-column: 2; justify-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
