:root {
  --ink: #0b0f19; --panel: #131a29; --panel-2: #1c2538; --line: #2a3550;
  --text: #f1f5f9; --muted: #94a3b8; --blue: #1d5fd6; --blue-dark: #0b2a6b; --accent: #fbbf24; --live: #ef4444;
}
/* Windows has no flag emoji: without this, 🇸🇪 shows as the letters "SE".
   The font holds only the flags and is used only for them (unicode-range),
   so all other text keeps its normal font. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("/flags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: "Twemoji Country Flags", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; line-height: 1.35; }
main, .top, .foot { max-width: 760px; margin: 0 auto; padding-left: 14px; padding-right: 14px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.top-logo { flex: 0 0 auto; width: 46px; height: 54px; object-fit: contain; }
.top-text { min-width: 0; }
h1 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.top-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.live { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); border-radius: 14px; padding: 12px 14px 14px; margin-bottom: 14px; }
.live-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.live-clock { font-size: 20px; font-weight: 800; line-height: 1; }
.live-label { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.live[data-status="live"] .live-label::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--live); margin-right: 7px; }
.live-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 8px; }
.live-team { font-size: 16px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; min-width: 0; }
.live-blue { text-align: right; }
.live-score { font-size: 30px; font-weight: 800; line-height: 1; white-space: nowrap; background: var(--ink); border-radius: 10px; padding: 6px 12px; }
.live-sub { margin-top: 8px; font-size: 13px; color: #dbeafe; text-align: center; }

.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; position: sticky; top: 0; z-index: 2; background: var(--ink); padding: 8px 0; }
.tab { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; padding: 10px 6px; border-radius: 10px; cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice { background: #422006; border: 1px solid #92400e; color: #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 6px 0 10px; }
.empty, .hint { color: var(--muted); font-size: 14px; }
.day { margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* One panel per day; every match is one line that opens on a click */
.day-block { min-width: 0; }
.matches { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.match { position: relative; }
.match + .match { border-top: 1px solid var(--line); }
/* The match on the screens right now: gold */
.match-current { background: linear-gradient(90deg, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0.07)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.match-current::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.match-current .match-time, .match-current .match-no { color: var(--accent); }
.match-current .match-row .match-team { font-weight: 800; }
.match:first-child.match-current { border-radius: 11px 11px 0 0; }
.match:last-child.match-current { border-radius: 0 0 11px 11px; }
.match:only-child.match-current { border-radius: 11px; }
.match-row { appearance: none; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 50px 1fr 50px 1fr; grid-template-areas: "time blue res white"; align-items: center; column-gap: 8px; padding: 7px 10px; min-height: 38px; }
.match-row:hover { background: rgba(255, 255, 255, 0.04); }
.match-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.match-time { grid-area: time; font-weight: 800; font-size: 13px; white-space: nowrap; }
/* Phones: the class is a coloured dot in front of the time; the chip comes on wider screens */
.match-time::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--hue, var(--muted)); vertical-align: 1px; }
.match-row[data-hue="0"] { --hue: #e879f9; --hue-bg: #3b1d4a; --hue-text: #f0abfc; }
.match-row[data-hue="1"] { --hue: #2dd4bf; --hue-bg: #0f3a3d; --hue-text: #5eead4; }
.match-row[data-hue="2"] { --hue: #fbbf24; --hue-bg: #3d2f0f; --hue-text: #fcd34d; }
.match-row[data-hue="3"] { --hue: #60a5fa; --hue-bg: #1e2f5c; --hue-text: #93c5fd; }
.match-tag, .match-no { display: none; }
.match-class { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; white-space: nowrap; background: var(--hue-bg); color: var(--hue-text); }
.match-type { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-team { font-size: 15px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; line-height: 1.15; }
.match-blue { grid-area: blue; text-align: right; }
.match-white { grid-area: white; }
.match-winner { font-weight: 800; }
.match-loser { color: var(--muted); }
.match-result { grid-area: res; text-align: center; white-space: nowrap; font-weight: 800; font-size: 14px; color: var(--line); padding: 2px 0; border-radius: 7px; border: 1px solid transparent; }
.match-played { color: var(--text); background: var(--ink); border-color: var(--line); }
.match-inplay { border-color: var(--accent); background: var(--accent); color: #1a1205; }
/* The running match: its clock under the score */
.match-clock { grid-column: 3; grid-row: 2; text-align: center; font-size: 11px; font-weight: 800; color: var(--accent); margin-top: 1px; }

.match-detail { padding: 4px 12px 14px; font-size: 13px; }
.detail-head { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: space-between; color: var(--muted); padding-bottom: 8px; }
.detail-status { color: var(--text); font-weight: 700; }
.detail-status-live { color: var(--accent); }
.detail-stats { display: grid; grid-template-columns: 1fr auto 1fr; gap: 3px 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.detail-stat-blue { text-align: right; font-weight: 800; }
.detail-stat-white { font-weight: 800; }
.detail-stat-label { color: var(--muted); text-align: center; }
.detail-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.detail-team { min-width: 0; }
.detail-team-name { font-weight: 800; overflow-wrap: anywhere; }
.detail-team-rank { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-games { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.detail-game { display: grid; grid-template-columns: 68px 1fr; gap: 6px; color: var(--muted); }
.detail-game-res { font-weight: 800; text-align: center; white-space: nowrap; border-radius: 5px; background: var(--ink); color: var(--muted); }
.detail-game.won .detail-game-res { color: #4ade80; }
.detail-game.lost .detail-game-res { color: #f87171; }
.detail-game.drew .detail-game-res { color: var(--text); }
.detail-game-opp { overflow-wrap: anywhere; color: var(--text); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 6px; text-align: center; white-space: nowrap; }
.table th { background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table tbody tr + tr td { border-top: 1px solid var(--line); }
.table .c-rank { color: var(--muted); width: 30px; padding-left: 10px; }
.table .c-name, .table .c-team { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.table td.c-name { font-weight: 700; }
.table td.c-team { color: var(--muted); }
.table td.c-pts { font-weight: 800; color: var(--accent); }
.table .c-pts { padding-right: 12px; }
.table tbody tr:first-child td.c-rank { color: var(--accent); font-weight: 800; }
.table td.c-goals { color: var(--muted); }

.foot { color: var(--muted); font-size: 12px; padding-top: 22px; padding-bottom: 28px; }
@media (min-width: 600px) {
  h1 { font-size: 24px; } .live-team { font-size: 24px; } .live-clock { font-size: 24px; }
  .match-row { grid-template-columns: 44px 118px 1fr 56px 1fr 30px; grid-template-areas: "time tag blue res white no"; column-gap: 10px; padding: 6px 14px; min-height: 36px; }
  .match-time { font-size: 14px; }
  .match-time::before { display: none; }
  .match-tag { grid-area: tag; display: flex; align-items: center; gap: 6px; min-width: 0; }
  .match-no { grid-area: no; display: block; justify-self: end; font-size: 12px; color: var(--muted); }
  .match-clock { grid-column: 4; }
  .match-detail { padding: 6px 16px 16px; font-size: 14px; }
  .table { font-size: 15px; table-layout: fixed; }
  .table .c-rank { width: 40px; } .table .c-n { width: 56px; } .table .c-goals { width: 90px; } .table .c-pts { width: 70px; }
  .table th, .table td { padding: 11px 10px; }
}
/* Wide screens: the days side by side, so the whole schedule is on one screen */
@media (min-width: 1100px) {
  main, .top, .foot { max-width: 1280px; }
  #view-matches { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 0 20px; align-items: start; }
  #view-matches > .empty { grid-column: 1 / -1; }
  #view-standings { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 0 20px; align-items: start; }
  #view-standings > .hint, #view-standings > .empty { grid-column: 1 / -1; }
  .live, .tabs { max-width: 760px; margin-left: auto; margin-right: auto; }
  .day { margin-top: 14px; }
}
