/* Layout: sticky header with the two-cup logo switch → hero on a deeper
   shade with court lines and a jagged "ridge" edge (from the posters) →
   three stacked blocks in a 1120px column → white sponsor band under a
   second ridge. Each cup swaps the colour tokens via [data-cup]. */
/* Fonts come from this site (assets/fonts, made by tools/prepare_assets.py
   fonts): one file per weight with every Latvian letter, so the browser never
   builds Ā or Ē out of pieces and the accents sit where the font draws them. */
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/anton-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-condensed-700.woff2) format('woff2'); }
:root {
  color-scheme: dark;
  /* Dobele (DBČK): poster blue + trophy yellow */
  --bg: #204E99;
  --bg-deep: #183D7C;
  --bg-head: #112C5B;
  --surface: #1A417F;
  --surface-hi: #24539F;
  --ticket: #3A71C6;       /* inside of the next-round card: lighter than the page */
  --win: #1E9E58;          /* win / loss chips everywhere (U / Z) */
  --loss: #E0413F;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.34);
  --fg: #FFFFFF;
  --fg-muted: #C6D3EC;
  --fg-dim: #8EA5CF;
  --title: #E1B942;
  --accent: #E1B942;
  --accent-fill: #E1B942;
  --band-bg: #0D0D0F;          /* category band on MVP / leader cards: black + yellow */
  --inv-muted: rgba(225, 185, 66, 0.72);   /* muted text on the inverted (monthly MVP) card */
  --on-accent: #14284D;
  --on-accent-muted: #4A5A78;
  --zone-2: rgba(255, 255, 255, 0.4);
  --paper: #FFFFFF;
  --ink: #18223A;
  --ink-muted: #5B6478;
  --demo-bg: #0C1322;
  --focus: #FFFFFF;

  --font-display: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;

  --gutter: 16px;
  --maxw: 1120px;
  --radius: 10px;
  --head-h: 64px;
}

/* Jelgava (JSSC): maroon from the brand, royal blue from the logo */
:root[data-cup="jssc"] {
  --bg: #9C213D;
  --bg-deep: #7E1A31;
  --bg-head: #5E1224;
  --surface: #861C35;
  --surface-hi: #AA2C4A;
  --ticket: #C43F5E;
  --fg-muted: #F2CDD6;
  --fg-dim: #D697A6;
  --title: #FFFFFF;
  --accent: #B7CAFF;
  --accent-fill: #1E47B5;
  --band-bg: #FFFFFF;          /* category band: white + blue */
  --inv-muted: rgba(30, 71, 181, 0.72);
  --on-accent: #FFFFFF;
  --on-accent-muted: #C9D6FF;
  --ink: #2B0F17;
  --ink-muted: #6F5660;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease;
}
[hidden] { display: none !important; }
body { margin: 0; }
img { max-width: 100%; }
.test-note {
  padding: 8px 16px;
  background: #0C1322;
  color: #D7DEEC;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}
.no-demo .sponsors { padding-bottom: 40px; }

a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--bg-head);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s ease;
}
.topbar-inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: var(--head-h);
}
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hi); }
.icon-btn svg { width: 24px; height: 24px; stroke: var(--fg); fill: none; stroke-width: 2; stroke-linecap: round; }

.cup-switch {
  justify-self: center;
  display: flex;
  gap: 6px;
}
.cup-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg-dim);
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cup-btn img {
  width: 46px; height: 46px;
  border-radius: 50%;
  filter: grayscale(1) brightness(1.2);
  opacity: 0.6;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
.cup-btn:hover img, .cup-btn:focus-visible img { filter: none; opacity: 1; transform: scale(1.06); }
.cup-btn:hover { color: var(--fg); }
.cup-btn[aria-current="page"] { color: var(--fg); background: var(--surface); }
.cup-btn[aria-current="page"] img { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.cup-btn-label { display: none; padding-right: 10px; white-space: nowrap; }
@media (min-width: 720px) {
  .cup-btn-label { display: inline; }
  .cup-switch { gap: 10px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--bg-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='3'%3E%3Ccircle cx='300' cy='300' r='92'/%3E%3Ccircle cx='300' cy='300' r='26'/%3E%3Cpath d='M300 0V600'/%3E%3Cpath d='M0 120h600M0 480h600'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right -140px center;
  background-size: 620px;
  padding-block: 28px 64px;
  overflow: hidden;
  transition: background-color 0.35s ease;
}
/* Logo and text side by side, the season bar underneath both. The logo's
   size and top offset are set by app.js (layoutHero) to match the text. */
.hero-inner {
  display: grid;
  grid-template-columns: var(--hero-logo, auto) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 18px;
  align-items: start;
}
.hero-logo {
  width: clamp(84px, 20vw, 168px);
  height: auto;
  aspect-ratio: 1;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
}
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
@media (min-width: 768px) { .hero-inner { column-gap: 26px; row-gap: 24px; } }
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.65rem, 5vw, 3.3rem);
  line-height: 1.16;          /* room for Č, Ē, Ā… above capitals on the second line */
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--title);
  text-wrap: balance;
}
/* Lines never wrap on their own: app.js picks the size at which they fit. */
.hero-title .ht-line { display: block; white-space: nowrap; }
.hero-title .ht-part { display: inline; }
/* Phones: three lines for both cups (the first part split once more). */
@media (max-width: 559px) {
  .hero-title .ht-part { display: block; }
}
/* Season progress under the title: rocket at the first game, thin track,
   fill = time passed, ticks where stages start, trophy at the final. */
.season {
  grid-column: 1 / -1;          /* under the logo and the titles */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
}
.season:empty { display: none; }
.season-track { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.season-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--title); }
.season-tick {
  position: absolute; top: 50%;
  width: 2px; height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.5);
}
.season-tick.is-past { background: var(--bg-deep); opacity: 0.55; height: 6px; }
.season-dot {
  position: absolute; top: 50%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--title);
  box-shadow: 0 0 0 3px var(--bg-deep);
}
.season-end {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg-muted);
}
.season-end svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.season-end.is-on { background: var(--title); color: var(--bg-deep); }
.season-dates {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill--ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

.ridge {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 26px;
  display: block;
}
.ridge path { fill: var(--bg); transition: fill 0.35s ease; }
@media (min-width: 768px) { .ridge { height: 42px; } .hero { padding-block: 40px 84px; } }
/* ---------- Blocks ---------- */
.main {
  display: grid;
  gap: 44px;
  padding-block: 18px 72px;
}
.block { min-width: 0; }
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 16px;
}
.block-head-main { display: grid; gap: 2px; }
.block-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--title);
  text-wrap: balance;
}
.block-meta {
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.block-meta strong { color: var(--fg); font-weight: 600; }
.subhead {
  grid-column: 1 / -1;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 6px;
}
.note {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  max-width: 70ch;
}
.empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 20px;
  color: var(--fg-muted);
  display: grid;
  gap: 4px;
}
.empty strong { color: var(--fg); font-size: 1.05rem; font-weight: 600; }

/* ---------- Team logo / placeholder badge ---------- */
.badge {
  --team: #5B6C8F;
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--team);
  color: #FFFFFF;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px var(--line-strong);
}
img.badge {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.badge--empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.badge--sm { width: 24px; height: 24px; font-size: 0.64rem; }
.badge--md { width: 36px; height: 36px; font-size: 0.8rem; }
.badge--lg { width: 44px; height: 44px; font-size: 0.95rem; }

.block-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--fg-muted);
  font-size: 0.98rem;
  margin-top: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 6px 0 2px;
}
.group-head small {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  font-weight: 600;
}
.group-head::after { content: ""; flex: 1; min-width: 16px; height: 2px; background: var(--line-strong); }
@media (max-width: 559px) { .group-head { font-size: 1.02rem; gap: 2px 8px; flex-wrap: wrap; } .group-head::after { display: none; } .group-head small { white-space: nowrap; } }
.group-head + * { margin-top: 0; }
.results > .group-head:not(:first-child),
.fx-list > .group-head:not(:first-child) { margin-top: 22px; }

/* ---------- Previous round: score cards in a row ----------
   All cards side by side when they fit; otherwise a looping slider (app.js
   makeSlider): fixed card width, faded edges, drag / swipe, slow drift. */
.results { display: grid; gap: 10px; }
.res-slider {
  --gap: 12px;
  --card: 300px;        /* card width while sliding */
  --card-min: 240px;    /* narrowest card in the plain row */
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.res-track { display: flex; gap: var(--gap); }
.res-track > .res { flex: 1 1 0; min-width: 0; max-width: 400px; }
.res-slider.is-sliding {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.res-slider.is-sliding .res-track { width: max-content; will-change: transform; }
.res-slider.is-sliding .res-track > .res { flex: 0 0 var(--card); max-width: none; }
.res-slider.is-dragging { cursor: grabbing; }
.res-slider img { -webkit-user-drag: none; }
/* Phones: a card is ~83% of the width, so about a fifth of the next card shows. */
@media (max-width: 559px) {
  .res-slider { --card: min(calc((100vw - 44px) / 1.2), 320px); }
  .res-slider.is-sliding {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  }
}
.res {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta meta"
    "home hs"
    "away as"
    "note note"
    "foot foot";
  grid-template-rows: auto auto auto auto 1fr;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px 14px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
a.res:hover { background: var(--surface-hi); border-color: var(--line-strong); }
.res-meta, .res-foot {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  min-width: 0;
}
.res-meta { grid-area: meta; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-meta .tag { color: var(--accent); }
/* Time and the link at the bottom; it stays at the bottom when cards are stretched to the same height. */
.res-foot { grid-area: foot; align-self: end; display: flex; gap: 10px; padding-top: 2px; }
.res-go { margin-left: auto; white-space: nowrap; }
a.res:hover .res-go { color: var(--fg); }
/* YouTube mark top right: the game has a stream recording (link on the game page). */
.res-yt { display: flex; flex: none; }
.res-yt .yt-ico { width: 24px; height: 17px; }
.res-team {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg-muted);
}
.res-team .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Cards are narrow: always the short team name. */
.res .nm-full { display: none; }
.res .nm-short { display: inline; }
.res-home { grid-area: home; }
.res-away { grid-area: away; }
.res-sc {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.res-sc.h { grid-area: hs; }
.res-sc.a { grid-area: as; }
.res .is-win { color: var(--fg); }
.res-note {
  grid-area: note;
  font-size: 0.86rem;
  color: var(--fg-muted);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.res-note:empty { display: none; }
.res-note b { color: var(--fg); font-weight: 600; }

/* ---------- Round MVP (presented by a sponsor) ---------- */
.mvp-wrap { display: grid; }
.mvp-sponsor {
  background: var(--bg-head);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mvp-sponsor p {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.mvp-sponsor img { height: 46px; width: auto; max-width: 150px; object-fit: contain; }
/* Sponsor without a white logo yet: its name instead. */
.mvp-sponsor .mvp-sponsor-name { font-size: 1.05rem; letter-spacing: 0.04em; color: var(--fg); text-align: right; }
.mvp {
  --pad-x: 18px;
  background: var(--accent-fill);
  color: var(--on-accent);
  border-radius: 0 0 14px 14px;
  padding: 0 var(--pad-x) 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  overflow: hidden;
}
.mvp:first-child { border-radius: 14px; }   /* no sponsor strip above */
.mvp::after {
  content: "MVP";
  position: absolute;
  right: -4px; bottom: -22px;
  font-family: var(--font-display);
  font-size: 7rem;
  line-height: 1;
  color: var(--on-accent);
  opacity: 0.07;
  pointer-events: none;
}
/* Category band across the top of the MVP and leader cards: the card colour
   on black (Dobele) or on white (Jelgava), so the category stands out. */
.card-band {
  margin: 0 calc(-1 * var(--pad-x)) 8px;
  padding: 13px var(--pad-x) 12px;
  background: var(--band-bg);
  color: var(--accent-fill);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px;
  font-family: var(--font-cond); font-weight: 700; font-size: 1.08rem; line-height: 1.15;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.card-band small { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: none; opacity: 0.78; }
.mvp-k {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-accent-muted);
}
.mvp-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}
.mvp-team { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mvp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 2px 0 0;
  max-width: 420px;
}
.mvp-stats div { border-top: 2px solid var(--on-accent); padding-top: 6px; }
.mvp-stats dd { margin: 0; font-family: var(--font-display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.mvp-stats dt {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-accent-muted);
}
.mvp-link {
  justify-self: start;
  position: relative;
  z-index: 1;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-accent);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-block: 6px 2px;
}
.mvp-note {
  position: relative; z-index: 1;
  font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--on-accent-muted);
}
/* Desktop, one MVP: sponsor panel left, card right. */
@media (min-width: 760px) {
  .mvp-wrap:not(.mvp-wrap--stack) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
  .mvp-wrap:not(.mvp-wrap--stack) > .mvp-sponsor {
    border-bottom: 1px solid var(--line);
    border-radius: 14px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 18px;
  }
  .mvp-wrap:not(.mvp-wrap--stack) > .mvp-sponsor img { height: auto; width: min(240px, 80%); max-width: none; }
  .mvp-wrap:not(.mvp-wrap--stack) > .mvp { --pad-x: 28px; border-radius: 14px; padding: 0 var(--pad-x) 24px; }
  .mvp-wrap:not(.mvp-wrap--stack) > .mvp .card-band { margin-bottom: 12px; }
}
/* Round MVP and monthly MVP at the same time: each block in the phone layout
   (sponsor strip on top), side by side from 760px, equal heights. */
.mvp-duo { display: grid; gap: 16px; }
@media (min-width: 760px) { .mvp-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mvp-wrap--stack { display: flex; flex-direction: column; }
.mvp-wrap--stack > .mvp { flex: 1; }
@media (min-width: 760px) { .mvp-wrap--stack > .mvp { --pad-x: 22px; padding-bottom: 20px; } }
/* Monthly MVP card: inverted colours — band in the card colour, body in the band colour. */
.mvp--month {
  --on-accent: var(--accent-fill);
  --on-accent-muted: var(--inv-muted);
  background: var(--band-bg);
  color: var(--accent-fill);
}
.mvp--month .card-band { background: var(--accent-fill); color: var(--band-bg); }

/* ---------- Next round: outlined "ticket" with a big date stub ---------- */
.ticket {
  display: grid;
  border: 4px solid var(--accent-fill);   /* thick outline around a lighter shade of the page colour */
  background: var(--ticket);
  border-radius: 14px;
  overflow: hidden;
}
@media (min-width: 760px) { .ticket { grid-template-columns: 200px minmax(0, 1fr); } }
.stub {
  position: relative;
  background: var(--accent-fill);
  color: var(--on-accent);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stub-day {
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.stub-txt { display: grid; gap: 2px; }
.stub-month {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
}
.stub-wd {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-accent-muted);
}
.stub-cal {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
  pointer-events: none;
}
@media (min-width: 760px) {
  .stub { flex-direction: column; align-items: flex-start; justify-content: center; padding: 22px 24px; gap: 6px; }
  .stub-day { font-size: 5.2rem; }
  .stub-month { font-size: 1.8rem; }
  .stub-cal { top: 18px; right: 18px; transform: none; width: 30px; height: 30px; }
}
.ticket-main { min-width: 0; }
.venue-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px dashed var(--line-strong);
}
.venue-name {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.venue-addr { color: var(--fg-muted); font-size: 0.92rem; }
.map-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--surface-hi);
  text-decoration: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.map-link svg { width: 20px; height: 20px; fill: var(--accent); }
.map-link:hover { background: var(--accent-fill); color: var(--on-accent); }
.map-link:hover svg { fill: var(--on-accent); }
.fx-list { list-style: none; margin: 0; padding: 8px 18px 10px; }
.fx-list > .group-head { margin-top: 10px; }
.fx {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas:
    "time tag"
    "time home"
    "time away";
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  padding-block: 12px;
}
.fx + .fx { border-top: 1px dashed var(--line); }
.fx time {
  grid-area: time;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.fx-tag {
  grid-area: tag;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.fx-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 1.02rem; }
.fx-team .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-team.is-tbd { color: var(--fg-dim); font-weight: 500; font-style: italic; }
/* Home page, next round: the full team name on every screen; a long one
   wraps onto a second line instead of being cut. */
#block-next .nm-full { display: inline; }
#block-next .nm-short { display: none; }
#block-next .fx-team .nm { white-space: normal; overflow: visible; overflow-wrap: break-word; min-width: 0; line-height: 1.2; }
.fx-home { grid-area: home; }
.fx-away { grid-area: away; }
.fx-vs { display: none; }
/* Wide screens: one line per game (home – away side by side). Below 960px the
   two teams stack, so full names have room on tablets too. */
@media (min-width: 960px) {
  .fx {
    grid-template-columns: 76px minmax(0, 1fr) 28px minmax(0, 1fr) minmax(0, 150px);
    grid-template-areas: "time home vs away tag";
    column-gap: 14px;
    padding-block: 14px;
  }
  .fx time { font-size: 1.7rem; }
  .fx-home { flex-direction: row-reverse; text-align: right; }
  .fx-vs { display: block; grid-area: vs; text-align: center; color: var(--fg-dim); font-family: var(--font-display); font-size: 1.2rem; }
  .fx-tag { text-align: right; }
}
/* ---------- Standings ---------- */
.tables {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) { .tables.two { grid-template-columns: 1fr 1fr; } }
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 6px 6px;
  min-width: 0;
}
.table-card h3 {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px 8px;
}
.table-scroll { overflow-x: auto; }
.standings {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.standings th {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 6px 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line-strong);
}
.standings td {
  padding: 9px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.standings tbody tr:last-child td { border-bottom: 0; }
.standings .l { text-align: left; }
.standings .pos {
  width: 38px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--fg-muted);
}
.standings tr.z1 .pos { box-shadow: inset 3px 0 0 var(--accent); color: var(--fg); }
.standings tr.z2 .pos { box-shadow: inset 3px 0 0 var(--zone-2); }
.standings tr.zone-end td { border-bottom: 1.5px dashed var(--line-strong); }
.standings .team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 600;
}
.standings .team-cell .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.team-cell, a.gh-team, a.bx-team { color: inherit; text-decoration: none; }
a.team-cell:hover .nm, a.gh-team:hover > span:last-child, a.bx-team:hover { text-decoration: underline; text-underline-offset: 3px; }
a.bx-team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.standings .pts {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  width: 42px;
}
.standings .n { width: 34px; }
.standings .muted { color: var(--fg-muted); }
.origin {
  flex: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--fg-muted);
}
.nm-full { display: none; }
/* Phones: no A1/B2 tags in the K group table, so the short name has room. */
@media (max-width: 559px) { .standings .origin { display: none; } }
@media (min-width: 560px) {
  .nm-full { display: inline; }
  .nm-short { display: none; }
}
.col-wide { display: none; }
@media (min-width: 560px) { .col-wide { display: table-cell; } }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--fg-muted);
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.key { width: 4px; height: 16px; border-radius: 2px; background: var(--accent); }
.key--2 { background: var(--zone-2); }

/* ---------- Tie cards (shared by all brackets) ---------- */
/* Brackets are the one light element on the page: light grey boxes, dark text. */
:root {
  --bk-bg: #EEF0F3;
  --bk-bye: #DFE3E8;
  --bk-ink: #121722;
  --bk-muted: #4E5665;
  --bk-dim: #8A909C;
  --bk-line: rgba(18, 23, 34, 0.14);
  --bk-conn: rgba(255, 255, 255, 0.6);
}
.tie {
  background: var(--bk-bg);
  color: var(--bk-ink);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
a.tie { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.tie:hover { box-shadow: 0 0 0 2px var(--accent-fill), 0 6px 16px rgba(0, 0, 0, 0.28); transform: translateY(-1px); }
.tie.is-projected { border: 1.5px dashed var(--bk-dim); }
.tie.is-final { box-shadow: inset 0 4px 0 var(--accent-fill), 0 1px 2px rgba(0, 0, 0, 0.2); }
a.tie.is-final:hover { box-shadow: inset 0 4px 0 var(--accent-fill), 0 0 0 2px var(--accent-fill), 0 6px 16px rgba(0, 0, 0, 0.28); }
.tie--bye { background: var(--bk-bye); border: 1.5px dashed var(--bk-dim); box-shadow: none; }
.tie-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-head);
}
.tie-head small { font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em; color: var(--bk-muted); text-transform: none; }
.t-row {
  display: grid;
  grid-template-columns: 28px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-block: 3px;
  color: var(--bk-muted);
}
.t-row .tname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row.is-tbd .tname { color: var(--bk-dim); font-weight: 500; font-style: italic; }
.t-row.is-win { color: var(--bk-ink); }
.t-row.is-win .tname { font-weight: 700; }
.tie .badge:not(img) { box-shadow: none; }
.tie .badge--empty { box-shadow: inset 0 0 0 1.5px var(--bk-dim); }
.seed {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--bk-muted);
  text-align: center;
  padding: 1px 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--bk-dim);
}
.t-sc { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.t-sc .leg { font-size: 0.85rem; color: var(--bk-dim); min-width: 2ch; text-align: right; }
.t-row.is-win .leg { color: var(--bk-muted); }
.t-sc .agg {
  font-family: var(--font-display);
  font-size: 1.2rem;
  min-width: 2.4ch;
  text-align: right;
  color: var(--bk-dim);
}
.t-row.is-win .agg { color: var(--bk-ink); }
.t-row.t-note { grid-template-columns: minmax(0, 1fr); min-height: 30px; font-style: italic; font-weight: 500; font-size: 0.86rem; line-height: 1.3; color: var(--bk-muted); }
.tie-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--bk-line);
  margin-top: 4px;
  padding-top: 5px;
  font-size: 0.8rem;
  color: var(--bk-muted);
}
.tie-foot span:last-child { text-align: right; }
.tie-foot span:only-child { text-align: left; }
.champ {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 700;
}
.champ small {
  display: block;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-accent-muted);
}

/* ---------- Bracket tabs (phones) ---------- */
.tree-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--bg-deep);
}
.tree-tab {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 4px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}
.tree-tab[aria-selected="true"] { background: var(--accent-fill); color: var(--on-accent); }
@media (min-width: 900px) { .tree-tabs.tabs-po { display: none; } }
@media (min-width: 940px) { .tree-tabs { display: none; } }

/* ---------- Left-to-right bracket (Jelgava cup, Hope Cup) ---------- */
.tree {
  --gap: 34px;
  --g1: 26px;
  --g2: 56px;
  --ln: var(--bk-conn);
}
.tree-head {
  display: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.tree-head small { display: block; font-weight: 600; letter-spacing: 0.04em; text-transform: none; font-size: 0.8rem; color: var(--fg-dim); }
.tc { display: none; padding-block: 5px; min-width: 0; }
.tree[data-active="r16"] .c-r16,
.tree[data-active="qf"] .c-qf,
.tree[data-active="sf"] .c-sf,
.tree[data-active="f"] .c-f { display: block; }
.tc.path-gap { margin-top: 14px; }
.tc.half-gap { margin-top: 32px; }

@media (min-width: 940px) {
  .tree {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    grid-template-rows: var(--rows);
    column-gap: var(--gap);
    row-gap: 0;
  }
  .tree-head { display: block; margin: 0 0 10px; }
  .tree .tc, .tree[data-active] .tc {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0;
  }
  .tc > .tie { width: 100%; }
  /* outgoing connector: ┐ for the upper tie of a pair, ┘ for the lower */
  .tc.top::after, .tc.bot::after {
    content: "";
    position: absolute;
    left: 100%;
    width: calc(var(--gap) / 2);
    border-right: 2px solid var(--ln);
  }
  .tc.top::after { top: 50%; bottom: calc(-1 * var(--join, 0px)); border-top: 2px solid var(--ln); }
  .tc.bot::after { bottom: 50%; top: calc(-1 * var(--join, 0px)); border-bottom: 2px solid var(--ln); }
  /* incoming connector */
  .tc.recv::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    width: calc(var(--gap) / 2);
    border-top: 2px solid var(--ln);
  }
}
.tree--hope { max-width: 760px; }
/* 1/8 column: every box fills its row, so "automatic" boxes match the game boxes. */
@media (min-width: 940px) { .tree .c-r16 { align-items: stretch; } .tree .c-r16 > .tie { align-content: space-between; } }

/* ---------- Mirrored bracket (Dobele playoffs) ---------- */
.po { --gap: 48px; --ln: var(--bk-conn); display: grid; gap: 14px; }
.po > div { min-width: 0; }
@media (max-width: 899px) {
  .po[data-active="sf"] .po-gold,
  .po[data-active="sf"] .po-bronze,
  .po[data-active="f"] .po-sf1,
  .po[data-active="f"] .po-sf2 { display: none; }
}
@media (min-width: 900px) {
  .po {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr 1fr;
    column-gap: var(--gap);
    row-gap: 0;
  }
  .po > div { display: flex; align-items: center; position: relative; padding-block: 8px; }
  .po > div > .tie { width: 100%; }
  .po-sf1 { grid-column: 1; grid-row: 1 / 3; }
  .po-gold { grid-column: 2; grid-row: 1; }
  .po-bronze { grid-column: 2; grid-row: 2; }
  .po-sf2 { grid-column: 3; grid-row: 1 / 3; }
  .po-sf1::before, .po-sf2::before {
    content: ""; position: absolute; top: 50%;
    width: calc(var(--gap) / 2);
    border-top: 2px solid var(--ln);
  }
  .po-sf1::before { left: 100%; }
  .po-sf2::before { right: 100%; }
  .po-sf1::after, .po-sf2::after {
    content: ""; position: absolute; top: 25%; bottom: 25%;
    border-left: 2px solid var(--ln);
  }
  .po-sf1::after { left: calc(100% + var(--gap) / 2 - 1px); }
  .po-sf2::after { right: calc(100% + var(--gap) / 2 - 1px); }
  .po-gold::before, .po-gold::after, .po-bronze::before, .po-bronze::after {
    content: ""; position: absolute; top: 50%;
    width: calc(var(--gap) / 2);
    border-top: 2px solid var(--ln);
  }
  .po-gold::before, .po-bronze::before { right: 100%; }
  .po-gold::after, .po-bronze::after { left: 100%; }
}
.section-gap { margin-top: 8px; }
/* ---------- Sponsors ---------- */
.sponsors {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding-block: 20px calc(40px + 64px); /* bottom room for the prototype bar */
  margin-top: 30px;
}
.sponsors .ridge {
  bottom: auto;
  top: 1px;
  transform: translateY(-100%);
  height: 30px;
}
.sponsors .ridge path { fill: var(--paper); }
@media (min-width: 768px) { .sponsors .ridge { height: 48px; } }
.sponsors h2 {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 18px;
}
/* Each logo carries its own --w/--h (same visual area for every sponsor,
   worked out at build time from the logo's proportions); --k scales them. */
.sponsor-row {
  --k: 0.74;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px 26px;
  max-width: 1000px;
  margin-inline: auto;
}
.sponsor-row img {
  width: calc(var(--w) * var(--k) * 1px);
  height: calc(var(--h) * var(--k) * 1px);
  object-fit: contain;
}
@media (min-width: 768px) { .sponsor-row { --k: 1; gap: 26px 40px; } }
.foot:empty { display: none; }
.foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  font-size: 0.86rem;
  color: var(--ink-muted);
}
.socials { display: flex; gap: 10px; }

/* Cookie banner (Google Analytics only with consent): fixed at the bottom
   until the visitor chooses; both answers equally easy to press. */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 52;
  background: var(--bg-head); color: var(--fg);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
.consent-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.consent-text { flex: 1 1 420px; min-width: 0; font-size: 0.95rem; line-height: 1.45; color: var(--fg-muted); }
.consent-btns { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-btns .btn { min-width: 128px; }
@media (max-width: 559px) {
  .consent-btns { flex: 1 1 100%; }
  .consent-btns .btn { flex: 1; min-width: 0; }
}
/* Small round cookie button in the bottom-right corner (after a choice):
   opens the banner again to change the choice. */
.cookie-btn {
  position: fixed; z-index: 45;
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--bg-head); color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
/* Small on screen, but still easy to tap: the tappable area reaches 44 px. */
.cookie-btn::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.cookie-btn svg { width: 17px; height: 17px; }
@media (max-width: 767px) {
  .cookie-btn {
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}
.cookie-btn:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .cookie-btn { transition: none; } .cookie-btn:hover { transform: none; } }
.social {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg);
  transition: transform 0.2s ease, background-color 0.35s ease;
}
.social:hover { transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; fill: var(--fg); }

/* ---------- Game page ---------- */
.game-view { display: grid; gap: 30px; padding-block: 14px 72px; }
.back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.back:hover { color: var(--fg); }
.back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.gh {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 14px 16px;
  display: grid;
  gap: 14px;
  text-align: center;
}
.gh-meta {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-family: var(--font-cond);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gh-cup { color: var(--accent); font-size: 0.9rem; }
.gh-stage { color: var(--fg-muted); font-size: 0.85rem; }
.gh-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.gh-team {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--fg-muted);
  text-wrap: balance;
}
.gh-team.is-win { color: var(--fg); }
.gh-team .badge { width: 60px; height: 60px; font-size: 1.1rem; }
.gh-score {
  display: flex;
  align-items: baseline;
  gap: 0.18em;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
}
.gh-score .w { color: var(--fg); }
.gh-score .sep { font-size: 0.6em; }
.gh-when { color: var(--fg-muted); font-size: 0.95rem; }
/* Video of the game: a white pill that reads on both cups' colours. */
.gh-yt {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #0F0F0F;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gh-yt:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.26); }
.gh-yt:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.gh-yt .yt-ico { width: 28px; height: 20px; flex: none; }
.gh-yt-out { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.gh-note { font-size: 0.92rem; color: var(--fg-muted); }
.gh-note b { color: var(--fg); font-weight: 600; }
.gh-tie { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gh-tie a, .gh-tie span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 0.86rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.gh-tie a:hover { color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg-muted); }
.gh-tie [aria-current="page"] { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; font-weight: 600; }
.gh-tie b { font-weight: 700; }
@media (min-width: 760px) {
  .gh { padding: 24px 28px 22px; }
  .gh-team { font-size: 1.15rem; }
  .gh-team .badge { width: 88px; height: 88px; }
}

.g-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--title);
  margin-bottom: 12px;
}

/* quarter scores */
.qt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.qt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.qt th {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-strong);
  text-align: center;
}
.qt td { padding: 10px 6px; text-align: center; color: var(--fg-muted); }
.qt tr + tr td { border-top: 1px solid var(--line); }
.qt .l { text-align: left; }
.qt .tm { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--fg); min-width: 0; }
.qt .tm .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt .tot { font-family: var(--font-display); font-size: 1.3rem; color: var(--fg); }
.qt .qw { color: var(--fg); font-weight: 700; }

/* top performers */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.ldr {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}
.ldr-k {
  grid-column: 1 / -1;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ldr-who { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.ldr-who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ldr-v { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
/* Phones: centred tiles — category, number, then logo + first name / surname on two lines. */
@media (max-width: 559px) {
  .leaders { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ldr { padding: 12px 8px 14px; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 6px; }
  .ldr-k { grid-row: 1; }
  .ldr-v { grid-row: 2; font-size: 2rem; }
  .ldr-who { grid-row: 3; justify-content: center; gap: 8px; line-height: 1.2; }
  .ldr-who .badge { width: 2.4rem; height: 2.4rem; flex: none; }   /* as tall as the two name lines */
  .ldr-who .nm { display: grid; text-align: left; white-space: normal; }
}

/* team comparison */
.cmp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px 12px; }
.cmp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-block: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 600;
}
.cmp-head > :first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-head > :last-child { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.cmp-head .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "h l a" "bar bar bar";
  align-items: center;
  gap: 6px 10px;
  padding-block: 9px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 559px) {
  .cmp-row { grid-template-areas: "l l l" "h . a" "bar bar bar"; gap: 4px 10px; }
}
.cmp-v.h { grid-area: h; }
.cmp-v.a { grid-area: a; text-align: right; }
.cmp-l { grid-area: l; }
.cmp-bar { grid-area: bar; }
.cmp-row + .cmp-row { border-top: 1px solid var(--line); }
.cmp-v { font-weight: 600; color: var(--fg-muted); }
.cmp-v.lead { color: var(--fg); font-weight: 700; }
.cmp-v small { font-weight: 500; color: var(--fg-dim); margin-inline: 4px; }
.cmp-l {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: center;
}
.cmp-bar { display: flex; gap: 3px; height: 6px; }
.cmp-bar i { display: block; border-radius: 3px; }
/* The better team's bar gets the cup colour; the other stays white. */
.cmp-bar i { background: var(--fg); opacity: 0.85; }
.cmp-bar i.lead { background: var(--accent); opacity: 1; }

/* box scores */
.bx-grid { display: grid; gap: 18px; }
.bx-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 0 6px; min-width: 0; }
.bx-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 10px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bx-card h3 .sc { margin-left: auto; font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0; }
.bx-scroll { overflow-x: auto; }
.bx { width: 100%; min-width: 820px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.bx th {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 6px 7px 8px;
  border-bottom: 1px solid var(--line-strong);
  text-align: center;
  white-space: nowrap;
}
.bx td { padding: 8px 7px; text-align: center; border-bottom: 1px solid var(--line); color: var(--fg-muted); white-space: nowrap; }
.bx .pl {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  min-width: 168px;
  max-width: 190px;
  box-shadow: 1px 0 0 var(--line);
}
.bx td.pl { color: var(--fg); }
.bx .pl .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bx .pl .no { flex: none; width: 2.2ch; text-align: right; color: var(--fg-dim); font-size: 0.85rem; }
.bx .pl .nm { overflow: hidden; text-overflow: ellipsis; }
.bx tr.st .pl .nm { font-weight: 700; }
.bx tr.bench-start td { border-top: 1.5px dashed var(--line-strong); }
.bx td.pts { font-family: var(--font-display); font-size: 1.12rem; color: var(--fg); }
.bx tr.dnp td { color: var(--fg-dim); font-style: italic; }
.bx tr.tot td { border-bottom: 0; border-top: 1.5px solid var(--line-strong); color: var(--fg); font-weight: 700; }
.bx tr.pct td { border-bottom: 0; padding-top: 0; color: var(--fg-dim); font-size: 0.8rem; }
.bx tr.tot .pl, .bx tr.pct .pl { font-family: var(--font-cond); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; color: var(--fg-muted); }
.mvp-chip {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-style: normal;
}
.forfeit-box {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--fg-muted);
}

/* ---------- Footer on phones ---------- */
@media (max-width: 767px) {
  .foot { flex-direction: column; justify-content: center; text-align: center; }
  .socials { justify-content: center; }
}
/* ---------- Calendar page ---------- */
.cal-view { display: grid; gap: 22px; padding-block: 20px 72px; }
.page-head { display: grid; gap: 6px; }
/* Room above the big title so Ā, Ē, Ī, Ū clear the line above it. */
.page-head .eyebrow + .page-title { margin-top: 0.12em; }
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--title);
}
.page-sub { color: var(--fg-muted); max-width: 62ch; }
.head-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.head-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.cal-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.team-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  max-width: 380px;
  min-height: 48px;
  padding: 4px 14px 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.team-pick:focus-within { border-color: var(--accent); }
.team-ico { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--fg-muted); stroke-width: 1.8; stroke-linecap: round; }
.team-pick select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 18px;
  color: var(--fg);
  font: 600 1rem var(--font-body);
  padding: 8px 26px 8px 0;
  cursor: pointer;
  text-overflow: ellipsis;
}
.team-pick select:focus { outline: none; }
.team-pick select option { background: var(--bg-head); color: var(--fg); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-deep); }
.seg button {
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 999px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.seg .sm { display: none; }
@media (max-width: 559px) {
  .team-pick { max-width: none; }
  .seg { flex: 1 1 100%; }
  .seg button { flex: 1; }
  .seg .lg { display: none; }
  .seg .sm { display: inline; }
}

.cal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-mh { text-align: center; min-width: 0; }
.cal-month { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.05; text-transform: uppercase; color: var(--fg); }
.cal-sum { color: var(--fg-muted); font-size: 0.9rem; }
.cal-btn {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-hi);
  display: grid; place-items: center;
  cursor: pointer;
}
.cal-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--fg); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cal-btn:disabled { opacity: 0.3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow {
  text-align: center;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 4px 0 6px;
}
.cal-day {
  position: relative;
  min-width: 0;
  min-height: 54px;
  border-radius: 8px;
  padding: 5px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  color: var(--fg-dim);
  font: inherit;
  text-align: center;
}
.cal-day.out { background: transparent; opacity: 0.35; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--fg-muted); }
.cal-n { font-weight: 600; font-size: 0.85rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
button.cal-day { cursor: pointer; background: var(--surface-hi); border-color: var(--line-strong); color: var(--fg); transition: border-color 0.15s ease, transform 0.15s ease; }
button.cal-day:hover { border-color: var(--accent); }
.cal-day.past { background: transparent; border-style: dashed; color: var(--fg-muted); }
.cal-day.next { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.cal-marks { display: flex; gap: 2px; justify-content: center; }
.cal-cup { flex: none; width: 22px; height: 22px; border-radius: 50%; }
.cal-count, .cal-what, .cal-flag, .cal-oppn, .cal-res { display: none; }
.cal-opp { display: flex; justify-content: center; }
/* Team selected: phones show the opponent's logo and a small cup logo in the corner. */
.cal-day.tv .cal-marks { position: absolute; top: 3px; right: 3px; }
.cal-day.tv .cal-marks .cal-cup { width: 13px; height: 13px; }
.cal-day.tv .cal-n { align-self: flex-start; padding-left: 2px; }   /* date left, cup logo right */
.cal-vs { display: none; }
.cal-day .cal-opp .badge { width: 24px; height: 24px; }
@media (min-width: 760px) {
  .cal-card { padding: 18px; }
  .cal-grid { gap: 6px; }
  .cal-day { min-height: 112px; padding: 8px; align-items: stretch; text-align: left; gap: 4px; }
  .cal-n { font-size: 1rem; }
  .cal-marks { position: absolute; top: 7px; right: 7px; }
  .cal-day.tv .cal-marks { top: 7px; right: 7px; }
  .cal-day.tv .cal-marks .cal-cup { width: 22px; height: 22px; }
  .cal-vs { display: inline; font-family: var(--font-cond); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.08em; }
  .cal-count { display: block; font-weight: 700; font-size: 0.95rem; }
  .cal-what {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.25;
    opacity: 0.85;
  }
  .cal-flag {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--on-accent);
    color: var(--accent-fill);
    font-family: var(--font-cond);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .cal-opp { justify-content: flex-start; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: 0.86rem; }
  .cal-day .cal-opp .badge { width: 26px; height: 26px; }
  .cal-day.tv .cal-n { padding-left: 0; }
  .cal-oppn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-res { display: block; font-family: var(--font-display); font-size: 1.15rem; line-height: 1; font-variant-numeric: tabular-nums; }
}
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 0.84rem; color: var(--fg-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend .cal-cup { width: 18px; height: 18px; }
.cal-key { width: 16px; height: 16px; border-radius: 4px; }
.cal-key.next { background: var(--accent-fill); }
.cal-key.past { border: 1.5px dashed var(--line-strong); }

.cal-list { display: grid; gap: 8px; }
.cal-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.cal-row:hover { background: var(--surface-hi); border-color: var(--line-strong); }
/* Next game day: filled like its square in the month grid. */
.cal-row.next { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.cal-row.next:hover { background: var(--accent-fill); filter: brightness(1.05); }
.cal-row.next .cal-date span, .cal-row.next .cal-rright, .cal-row.next .cal-rright b { color: var(--on-accent); }
.cal-row.past { color: var(--fg-muted); }
.cal-date { display: grid; line-height: 1; }
.cal-date b { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; }
.cal-date span { white-space: nowrap; margin-top: 3px; font-family: var(--font-cond); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
.cal-rmid { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.cal-rmid > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-rright { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 0.9rem; white-space: nowrap; }
.cal-rright b { color: var(--fg); font-variant-numeric: tabular-nums; }
.cal-wl, .cal-res { display: inline-flex; align-items: center; gap: 6px; }
/* Month list with a team selected: date · my team · time or score · opponent · cup logo. */
.cal-row--tv { grid-template-columns: 64px minmax(0, 1fr) auto; }
.cal-match { display: grid; grid-template-columns: 96px 92px 96px; align-items: center; justify-items: center; min-width: 0; }
.cal-side { display: grid; justify-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.cal-side .badge { width: 40px; height: 40px; }
.cal-tn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; font-weight: 600; color: var(--fg-muted); }
.cal-mid { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--fg); }
.cal-mid.is-res { display: inline-flex; align-items: baseline; gap: 4px; font-size: 1.75rem; }
.cal-mid.is-res b { font-weight: 400; color: var(--fg-dim); }
.cal-mid.is-res b.is-win { color: var(--fg); }
.cal-mid.is-res i { font-style: normal; font-size: 0.8em; color: var(--fg-dim); }
.cal-rcup { width: 30px; height: 30px; }
.cal-row.next .cal-tn, .cal-row.next .cal-mid, .cal-row.next .cal-mid i { color: var(--on-accent); }
@media (max-width: 559px) {
  .cal-row.cal-row--tv { grid-template-columns: 50px minmax(0, 1fr) auto; column-gap: 8px; padding: 10px 12px; }
  .cal-row--tv .cal-date { grid-row: auto; }
  .cal-match { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); }
  .cal-side .badge { width: 32px; height: 32px; }
  .cal-tn { font-size: 0.72rem; }
  .cal-mid { font-size: 1.25rem; }
  .cal-mid.is-res { font-size: 1.4rem; gap: 3px; }
  .cal-rcup { width: 20px; height: 20px; }
}
/* Month grid on phones: logos only; the result is one tap away. */
@media (max-width: 759px) { .cal-day .cal-res { display: none; } }
@media (max-width: 559px) {
  .cal-row { grid-template-columns: 58px minmax(0, 1fr); row-gap: 4px; }
  .cal-date { grid-row: span 2; }
  .cal-rright { grid-column: 2; }
}

/* ---------- Day pop-up (bottom sheet on phones) ---------- */
body.no-scroll { overflow: hidden; }
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5, 8, 16, 0.6); }
.sheet {
  position: fixed;
  z-index: 71;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
}
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px 10px;
}
.sheet-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--title);
}
.sheet-body { display: grid; gap: 12px; }
/* The pop-up is narrow on every screen: logo + short team name, never cut.
   Places not decided yet ("A grupas 3. vieta") wrap instead of being cut. */
.sheet .nm-full { display: none; }
.sheet .nm-short { display: inline; }
.sheet .fx-team.is-tbd .nm { white-space: normal; overflow: visible; line-height: 1.2; }
.sheet-cup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.sheet-venue { color: var(--fg-muted); font-size: 0.88rem; }
.sheet-more {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
@media (min-width: 760px) {
  .sheet {
    left: 50%; top: 50%; right: auto; bottom: auto;
    transform: translate(-50%, -50%);
    width: min(880px, calc(100% - 48px));
    max-height: 86vh;
    border-radius: 18px;
    padding: 0 24px 24px;
  }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 16px; }
}

/* ---------- Share posters ---------- */
.head-actions { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
/* Phones: a row under the section — calendar link on the left, "Dalīties" on the right. */
.foot-m { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.foot-m--end { justify-content: flex-end; }
@media (max-width: 767px) { #block-next .block-head .head-actions, #block-last .block-head .head-actions { display: none; } }
@media (min-width: 768px) { .foot-m { display: none; } }
/* The round MVP belongs to the previous-round section: no heading, smaller gap. */
#block-mvp { margin-top: -20px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.share-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.share-btn svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.sheet--share .sheet-body { gap: 16px; }
.poster-grid {
  display: grid;
  grid-template-columns: 0.8fr 0.5625fr;   /* equal heights for 4:5 and 9:16 */
  gap: 14px;
  align-items: stretch;
  max-width: calc(min(52vh, 520px) * 1.3625 + 14px);
  width: 100%;
  margin-inline: auto;
}
.poster-card { margin: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; min-width: 0; }  /* buttons line up at the bottom */
.poster-frame {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}
.poster-card--story .poster-frame { aspect-ratio: 9 / 16; }
.poster-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-wait { color: var(--fg-dim); font-size: 0.85rem; padding: 8px; text-align: center; }
.poster-hint { color: var(--fg-muted); font-size: 0.86rem; line-height: 1.3; align-self: start; }
.poster-actions { display: grid; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn--fill { background: var(--accent-fill); color: var(--on-accent); box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: progress; }
.poster-note { color: var(--fg-muted); font-size: 0.86rem; text-align: center; }
@media (max-width: 420px) {
  .poster-grid { gap: 10px; }
  .btn { font-size: 0.85rem; padding: 0 8px; gap: 6px; }
  .btn svg { width: 16px; height: 16px; }
}

/* ---------- Kopvērtējums page ---------- */
.std-view { display: grid; gap: 44px; padding-block: 20px 72px; }
.st-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.st-top > div { display: grid; gap: 6px; }
.season-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.season-pick:focus-within { border-color: var(--accent); }
.season-pick span { font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.season-pick select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 16px;
  color: var(--fg);
  font: 700 1rem var(--font-body);
  padding: 6px 24px 6px 0;
  cursor: pointer;
}
.season-pick select:focus { outline: none; }
.season-pick select option { background: var(--bg-head); color: var(--fg); }
.st-sec { min-width: 0; }
.st-sec .block-head { align-items: center; }
.st-sec.is-done .block-title { color: var(--fg); font-size: clamp(1.45rem, 3.4vw, 2rem); }
.st-lead {
  margin: -4px 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 80ch;
}
.pill--done { background: transparent; color: var(--fg-muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.st-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.st-divider::before, .st-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.podium {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  max-width: 760px;
  margin-inline: auto;
  border-bottom: 2px solid var(--line-strong);
}
.pod { display: grid; justify-items: center; gap: 12px; text-align: center; min-width: 0; }
.pod-team { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.badge--xl { width: 60px; height: 60px; font-size: 1.2rem; }
.pod--1 .badge--xl { width: 84px; height: 84px; }
.pod-name { font-weight: 700; font-size: 0.88rem; line-height: 1.25; text-wrap: balance; }
.pod-step {
  width: 100%;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 12px 12px 0 0;
  background: var(--surface-hi);
}
.pod--1 .pod-step { height: 128px; background: var(--accent-fill); color: var(--on-accent); }
.pod--2 .pod-step { height: 96px; }
.pod--3 .pod-step { height: 72px; }
.pod-n { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.pod--1 .pod-n { font-size: 3rem; }
.pod-l { font-family: var(--font-cond); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.pod-finals { text-align: center; color: var(--fg-muted); font-size: 0.92rem; margin-top: 14px; }
.pod-extra {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.pod-extra-k { font-family: var(--font-cond); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.pod-extra-n { font-weight: 700; }
@media (min-width: 760px) {
  .podium { gap: 16px; }
  .badge--xl { width: 84px; height: 84px; }
  .pod--1 .badge--xl { width: 116px; height: 116px; }
  .pod-name { font-size: 1.05rem; }
  .pod--1 .pod-step { height: 170px; }
  .pod--2 .pod-step { height: 126px; }
  .pod--3 .pod-step { height: 94px; }
  .pod-n { font-size: 2.8rem; }
  .pod--1 .pod-n { font-size: 3.8rem; }
}

/* ---------- Drawer menu ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(5, 8, 16, 0.55);
}
.drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 60;
  width: min(86vw, 340px);
  background: #FFFFFF;
  color: #111111;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 12px 18px;
  height: var(--head-h);
  border-bottom: 1px solid var(--line);
}
/* The menu is white with black text on both cups. */
.drawer-head { border-bottom-color: rgba(0, 0, 0, 0.1); }
.drawer-head .eyebrow { color: #111111; }
.drawer .eyebrow { color: #5A5F6B; }
.drawer .icon-btn svg { stroke: #111111; }
.drawer .icon-btn:hover { background: #EEF0F4; }
.drawer .nav-item { color: #111111; }
.drawer-sec { padding: 14px 10px; display: grid; gap: 2px; }
.drawer-sec + .drawer-sec { border-top: 1px solid rgba(0, 0, 0, 0.1); }
.drawer-sec .eyebrow { padding: 0 10px 6px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: #EEF0F4; }
.nav-item[aria-current="page"] { background: #EEF0F4; box-shadow: inset 4px 0 0 var(--accent-fill); font-weight: 700; }
.nav-item[aria-disabled="true"] { color: var(--fg-dim); cursor: default; }
.nav-item[aria-disabled="true"]:hover { background: transparent; }
.soon {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--fg-muted);
}
.nav-cup { justify-content: flex-start; gap: 12px; }
.nav-cup img { width: 34px; height: 34px; border-radius: 50%; }

/* ---------- Prototype bar ---------- */
.demo {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 16px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--demo-bg);
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow-x: auto;
  scrollbar-width: none;
}
.demo::-webkit-scrollbar { display: none; }
.demo-tag {
  flex: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9AA6BF;
  padding: 0 6px 0 10px;
}
.demo button {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 36px;
  background: transparent;
  color: #D7DEEC;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.demo button:hover { background: #1D2740; }
.demo button[aria-pressed="true"] { background: #FFFFFF; color: #0C1322; }
.demo .sm { display: none; }
@media (max-width: 559px) {
  .demo .lg, .demo-tag { display: none; }
  .demo .sm { display: inline; }
}

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

/* ---------- Sponsori page ---------- */
.sp-view { display: grid; gap: 36px; padding-block: 20px 72px; }
.sp-grid {
  --k: 0.82;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sp-grid--main { grid-template-columns: minmax(0, 1fr); --k: 0.9; }
@media (min-width: 560px) { .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-grid--main { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .sp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; --k: 1; }
  .sp-grid--main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-grid--main .sp-tile { min-height: 220px; }
}
.sp-tile {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: 150px;
  padding: 18px 14px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-muted);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sp-grid--main .sp-tile { min-height: 190px; padding-top: 26px; }
.sp-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.sp-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sp-logo { display: grid; place-items: center; min-height: 0; }
.sp-logo img {
  width: calc(var(--w) * var(--k) * 1px);
  height: calc(var(--h) * var(--k) * 1px);
  max-width: 100%;
  object-fit: contain;
}
.sp-name {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Pop-up: a narrower card on wider screens. */
@media (min-width: 760px) { .sheet--sponsor { width: min(560px, calc(100% - 48px)); } }
.sheet--sponsor .sheet-body { gap: 14px; }
.sp-pop-logo {
  display: grid;
  place-items: center;
  padding: 26px 20px;
  border-radius: 12px;
  background: var(--paper);
}
.sp-pop-logo img { max-width: min(320px, 80%); max-height: 130px; object-fit: contain; }
.sp-desc { color: var(--fg); line-height: 1.55; white-space: pre-line; }
.sp-links { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
a.sp-link:hover { border-color: var(--accent); }
.sp-link svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
/* Prototype placeholders (where the sheet's text and links will go). */
.sp-ph { border: 1px dashed var(--line-strong); color: var(--fg-muted); background: transparent; }
p.sp-ph { padding: 12px 14px; border-radius: 10px; font-style: italic; }

/* ---------- Win / loss chips (U / Z), the same everywhere ---------- */
.wl {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 5px;
  font: 700 0.72rem/1 var(--font-cond); font-style: normal; letter-spacing: 0;
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.wl.w { background: var(--win); }
.wl.l { background: var(--loss); }
.form { display: inline-flex; gap: 3px; }

/* ---------- Komandas: team list + team page ---------- */
.tm-view { display: grid; gap: 30px; padding-block: 20px 72px; }
.tm-sec { min-width: 0; }
.g-title small {
  font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em;
  color: var(--fg-muted); margin-left: 8px; vertical-align: middle;
}
/* Team list: logo tiles like the sponsors page, on the dark card colour
   (several team logos have white lettering). */
.tm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 420px) { .tm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .tm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1040px) { .tm-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tm-tile {
  display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 10px;
  min-height: 150px; padding: 18px 10px 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--fg-muted); text-decoration: none; text-align: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.tm-tile:hover { transform: translateY(-2px); background: var(--surface-hi); border-color: var(--line-strong); }
.tm-tile-logo { display: grid; place-items: center; }
.tm-tile .badge--xl { width: 84px; height: 84px; font-size: 1.5rem; }
.tm-tile-name { font-family: var(--font-cond); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; }
@media (min-width: 760px) { .tm-tile { min-height: 170px; } .tm-tile .badge--xl { width: 96px; height: 96px; } }

/* Team page: back link left, cup switch right. */
.tm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tm-seg { flex: none; }
.tm-seg button { white-space: nowrap; }
@media (max-width: 559px) { .tm-bar .tm-seg { flex: none; } .tm-bar .tm-seg button { flex: none; } }

/* Highlighted team block, styled like the round MVP card. */
.tm-hl {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px 18px;
  padding: 20px 18px 18px;
  border-radius: 14px;
  background: var(--accent-fill);
  color: var(--on-accent);
}
.tm-hl::after {
  content: attr(data-mark);
  position: absolute; right: -6px; bottom: -26px;
  font-family: var(--font-display); font-size: 7rem; line-height: 1; text-transform: uppercase;
  color: var(--on-accent); opacity: 0.07; pointer-events: none; white-space: nowrap;
}
.tm-hl-logo .badge--xl { width: 76px; height: 76px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18)); }
.tm-hl-id { display: grid; gap: 4px; min-width: 0; }
.tm-hl-name {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.7rem, 5vw, 2.7rem); line-height: 1.04;
  text-transform: uppercase; text-wrap: balance;
}
.tm-hl-pos { font-family: var(--font-cond); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tm-hl-rec { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; position: relative; z-index: 1; }
.tm-hl-rec .mvp-stats { flex: 1 1 260px; margin: 0; }
.tm-hl-form { display: grid; gap: 6px; }
.tm-hl-form > span { font-family: var(--font-cond); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-accent-muted); }
.tm-hl-form .wl { width: 28px; height: 28px; font-size: 0.9rem; border-radius: 6px; }
.tm-hl-form .form { gap: 5px; }
@media (min-width: 760px) {
  .tm-hl { grid-template-columns: auto minmax(0, 1fr) auto; padding: 24px 26px; gap: 18px 24px; }
  .tm-hl-logo .badge--xl { width: 108px; height: 108px; }
  .tm-hl-rec { grid-column: auto; flex-direction: column; align-items: flex-end; }
  .tm-hl-rec .mvp-stats { flex: none; width: 300px; }
}
.tm-about { display: grid; gap: 12px; max-width: 720px; }

/* Team averages: a table in one or two columns, value + cup average + rank, bar vs the best team. */
.tm-avg { display: grid; gap: 14px; }
@media (min-width: 900px) { .tm-avg { grid-template-columns: 1fr 1fr; align-items: start; } }
.tm-avg-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 10px; }
.tm-avg-head, .tm-avg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 84px 84px;
  align-items: center;
  column-gap: 10px;
}
.tm-avg-head {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-cond); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim);
}
.tm-avg-head span:not(:first-child) { text-align: right; }
.tm-avg-g {
  padding: 14px 0 2px;
  font-family: var(--font-cond); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.tm-avg-head span { line-height: 1.25; }
.tm-avg-row { grid-template-areas: "k v c r"; padding: 12px 0; }
.tm-avg-row + .tm-avg-row { border-top: 1px solid var(--line); }
.tm-avg-k { grid-area: k; display: grid; gap: 2px; font-weight: 600; line-height: 1.2; }
.tm-avg-k small { font-weight: 500; font-size: 0.78rem; color: var(--fg-dim); }
.tm-avg-v { grid-area: v; text-align: right; font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.tm-avg-c { grid-area: c; text-align: right; color: var(--fg-muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.tm-avg-r { grid-area: r; text-align: right; }
.tm-rank {
  display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px;
  border-radius: 999px; background: var(--bg-deep); color: var(--fg-muted);
  font: 700 0.85rem var(--font-cond);
}
.tm-avg-row.is-top .tm-rank { background: var(--accent-fill); color: var(--on-accent); }
.tm-rank { white-space: nowrap; }
@media (max-width: 480px) {
  .tm-avg-col { padding-inline: 12px; }
  .tm-avg-head, .tm-avg-row { grid-template-columns: minmax(0, 1fr) 62px 58px 62px; column-gap: 6px; }
  .tm-avg-v { font-size: 1.45rem; }
  .tm-avg-c { font-size: 0.88rem; }
  .tm-rank { min-width: 0; font-size: 0.78rem; padding: 0 7px; }
}

/* Leaders: MVP-style cards with the top three. */
.tm-ldrs { display: grid; gap: 12px; }
@media (min-width: 640px) { .tm-ldrs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tm-ldrs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-ldr {
  --pad-x: 18px;
  display: grid; gap: 10px; align-content: start;
  padding: 0 var(--pad-x) 14px; border-radius: 14px; overflow: hidden;
  background: var(--accent-fill); color: var(--on-accent);
}
.tm-ldr-1 { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tm-ldr-name {
  font-family: var(--font-display); font-size: clamp(1.45rem, 3.6vw, 1.8rem); line-height: 1.05;
  text-transform: uppercase; text-wrap: balance; min-width: 0;
}
.tm-ldr-v { font-family: var(--font-display); font-size: 2.6rem; line-height: 0.95; font-variant-numeric: tabular-nums; }
.tm-ldr-rest { list-style: none; margin: 0; padding: 8px 0 0; border-top: 2px solid var(--on-accent); display: grid; gap: 6px; }
.tm-ldr-rest li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; align-items: baseline; gap: 6px; font-weight: 600; }
.tm-ldr-rest .n { color: var(--on-accent-muted); font-family: var(--font-cond); font-weight: 700; }
.tm-ldr-rest .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-ldr-rest b { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* ---------- Līderi page: cards like the team leaders, top five, with team ---------- */
.ld-view { display: grid; gap: 34px; padding-block: 20px 72px; }
.ld-sec { display: grid; gap: 4px; min-width: 0; }
.ld-sec .note { margin-top: 8px; }
.ld-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .ld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Three cards in a row; the four shooting cards stay two by two so names fit,
   and the two Dzelzs vīri cards share the row. */
@media (min-width: 1000px) { .ld-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ld-grid--4, .ld-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-sec .g-title small { white-space: nowrap; }
@media (max-width: 559px) { .ld-sec .g-title small { display: block; margin: 4px 0 0; } }
.ld-card {
  --pad-x: 18px;
  display: grid; gap: 12px; align-content: start;
  padding: 0 var(--pad-x) 14px; border-radius: 14px; overflow: hidden;
  background: var(--accent-fill); color: var(--on-accent);
}
.ld-none { color: var(--on-accent-muted); font-weight: 600; }
.ld-1 { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.ld-1-id { display: grid; gap: 6px; min-width: 0; }
.ld-1-name {
  font-family: var(--font-display); font-size: clamp(1.45rem, 3.6vw, 1.8rem); line-height: 1.05;
  text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere;
}
.ld-tm {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--on-accent-muted);
}
.ld-tm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-1-v { display: grid; justify-items: end; text-align: right; }
.ld-1-v b { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; line-height: 0.95; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-1-v small, .ld-v small, .ld-who small {
  font-family: var(--font-cond); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--on-accent-muted); font-variant-numeric: tabular-nums;
}
.ld-1-v small { margin-top: 4px; }
.ld-pc { font-size: 0.62em; margin-left: 1px; }
.ld-rest { list-style: none; margin: 0; padding: 10px 0 0; border-top: 2px solid var(--on-accent); display: grid; gap: 9px; }
.ld-rest li { display: grid; grid-template-columns: 1.4em auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.ld-rest .n { font-family: var(--font-cond); font-weight: 700; color: var(--on-accent-muted); }
.ld-who { display: grid; min-width: 0; line-height: 1.2; }
.ld-who .nm, .ld-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-who .nm { font-weight: 600; }
.ld-v { display: grid; justify-items: end; text-align: right; line-height: 1.1; }
.ld-v b { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Rows for next games and results. */
.tm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
/* Registered players before the first game: names only */
.tm-names-k { margin: -4px 0 10px; color: var(--fg-muted); font-size: 0.92rem; }
.tm-names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.tm-names a.tm-name { display: block; padding: 11px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--fg); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-names a.tm-name:hover { background: var(--surface-hi); border-color: var(--line-strong); }
.tm-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
}
a.tm-row:hover { background: var(--surface-hi); border-color: var(--line-strong); }
.tm-row-d { display: grid; justify-items: center; line-height: 1; padding-right: 10px; border-right: 1px solid var(--line); }
.tm-row-d b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.tm-row-d span { font-family: var(--font-cond); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-top: 3px; }
.tm-row-m { display: grid; gap: 4px; min-width: 0; }
.tm-row-k { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--font-cond); font-weight: 700; font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tm-row-o { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--fg-muted); font-size: 0.92rem; }
.tm-row-o .nm { color: var(--fg); font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-row-o .nm.is-tbd { color: var(--fg-dim); font-style: italic; font-weight: 500; }
.tm-row-r { display: grid; justify-items: end; gap: 2px; text-align: right; }
.tm-row-r b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tm-row-r b.tm-res { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); }
.tm-row-r small { color: var(--fg-muted); font-size: 0.78rem; max-width: 16ch; }
@media (max-width: 420px) { .tm-row-r small { display: none; } .tm-row { gap: 10px; } }
.bx--roster { min-width: 680px; }

/* Sortable player tables: header buttons with a small arrow on the sorted column. */
.bx th .sort-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  width: 100%; min-height: 28px;
  cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.bx th.pl .sort-btn { justify-content: flex-start; }
.bx th .sort-btn:hover { color: var(--fg); }
.bx th .sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bx th[aria-sort="descending"], .bx th[aria-sort="ascending"] { color: var(--accent); }
.bx th[aria-sort="descending"] .sort-btn::after { content: "▼"; font-size: 0.6em; }
.bx th[aria-sort="ascending"] .sort-btn::after { content: "▲"; font-size: 0.6em; }
.bx.is-sorted tr.bench-start td { border-top: 1px solid var(--line); }

/* ---------- Statistika: all players of the cup (sortable) ---------- */
.sts-view { display: grid; gap: 22px; padding-block: 20px 72px; }
/* Grid items may shrink below the wide table, so the table scrolls inside its card on phones. */
.sts-view > * { min-width: 0; }
.sts-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sts-search {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 220px; max-width: 320px; min-height: 48px; padding: 4px 16px 4px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong);
}
.sts-search:focus-within { border-color: var(--accent); }
.sts-search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--fg-muted); stroke-width: 2; stroke-linecap: round; }
.sts-search { min-width: 0; }
/* width 0 + flex: the field fills the box but never forces it wider than a small phone. */
.sts-search input { flex: 1; width: 0; min-width: 0; border: 0; background: transparent; color: var(--fg); font: 600 1rem var(--font-body); padding: 8px 0; }
.sts-search input::placeholder { color: var(--fg-dim); font-weight: 500; }
.sts-search input:focus { outline: none; }
.sts-count { margin-left: auto; font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
@media (max-width: 559px) { .sts-search { max-width: none; } .sts-count { margin-left: 0; } }
.bx--stats { min-width: 900px; }
.bx--stats .pl { min-width: 200px; max-width: 232px; }
.bx .pl .who { display: grid; min-width: 0; line-height: 1.2; }
.bx .pl .who .nm { color: var(--fg); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx .pl .who small { font-family: var(--font-cond); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-dim); }
/* Whole rows open the player (stats) or the game (player's games). */
.bx tr[data-href] { cursor: pointer; }
.bx tr[data-href]:hover td { background: var(--surface-hi); }
.bx tr[data-href]:hover .nm { text-decoration: underline; }
.bx tr[data-href] a.nm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- Player page: period filters, stat tiles with trend, chart, games ---------- */
.pl-hl .tm-hl-pos a { color: inherit; text-decoration: none; border-bottom: 2px solid currentColor; }
.pl-hl .mvp-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: none; }
@media (max-width: 759px) {
  .pl-hl .tm-hl-rec .mvp-stats { flex: 1 1 100%; }
  .pl-hl .mvp-stats dd { font-size: 1.55rem; }
  .pl-hl .mvp-stats dt { font-size: 0.68rem; letter-spacing: 0.03em; }
}
@media (min-width: 760px) { .pl-hl .tm-hl-rec .mvp-stats { width: 470px; } }
.pl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.pl-dates { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-dates label {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong);
}
.pl-dates label:focus-within { border-color: var(--accent); }
.pl-dates span { font-family: var(--font-cond); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.pl-dates input { border: 0; background: transparent; color: var(--fg); font: 600 0.95rem var(--font-body); color-scheme: dark; padding: 6px 0; min-width: 0; }
.pl-dates input:focus { outline: none; }
@media (max-width: 559px) {
  .pl-filters .seg { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .pl-filters .seg button { min-width: 0; padding: 6px 8px; font-size: 0.8rem; white-space: normal; line-height: 1.1; }
  /* Side by side when both fit; stacked on narrow phones (a date field can't shrink below its text). */
  .pl-dates { flex: 1 1 100%; flex-wrap: wrap; }
  .pl-dates label { flex: 1 1 170px; min-width: 0; padding-inline: 12px; }
  .pl-dates input { width: 100%; }
}
.pl-panel { display: grid; gap: 18px; min-width: 0; }
.pl-range { font-family: var(--font-cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
.pl-range b { color: var(--fg); }
.pl-panel > .note { margin-top: -6px; }
.pl-group { display: grid; gap: 8px; }
.pl-grp { font-family: var(--font-cond); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pl-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .pl-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pl-tile {
  display: grid; gap: 4px; align-content: start; text-align: left; min-width: 0;
  padding: 12px 14px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg);
  font: inherit; cursor: pointer;
}
.pl-tile:hover { background: var(--surface-hi); border-color: var(--line-strong); }
.pl-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.pl-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-tile-k { font-family: var(--font-cond); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.pl-tile-v { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; margin-top: 2px; }
.pl-tile-v .pc { font-size: 0.6em; margin-left: 1px; }
.pl-tile-s { font-size: 0.78rem; color: var(--fg-dim); }
/* Trend: a zigzag icon going up or down (like the chart emoji) on a small
   white tile — green stroke when the change is good, red when bad — plus the
   signed change. Shape carries the direction, so it never relies on colour. */
.trend { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; vertical-align: 0.35em; font: 700 0.8rem var(--font-body); color: var(--fg); white-space: nowrap; }
.trend i { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.trend i svg { width: 17px; height: 17px; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.trend.is-good i svg { stroke: #138A4B; }
.trend.is-bad i svg { stroke: #D2302E; }
.spark { display: block; width: 100%; height: 30px; margin-top: 6px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--fg-dim); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .dot { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* Per-game chart: columns in the cup accent, dashed trend line with a halo. */
.pl-chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 8px; display: grid; gap: 6px; min-width: 0; }
.pl-chart-card .g-title { margin-bottom: 0; }
.pl-chart { position: relative; min-width: 0; }
.pl-chart svg { display: block; max-width: 100%; height: auto; }
.pl-chart .grid { stroke: var(--line); stroke-width: 1; }
.pl-chart .base { stroke: var(--line-strong); stroke-width: 1; }
.pl-chart .ax { fill: var(--fg-dim); font: 600 11px var(--font-body); font-variant-numeric: tabular-nums; }
.pl-chart .val { fill: var(--fg); font: 700 12px var(--font-body); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.pl-chart .bar { fill: var(--accent); }
.pl-chart .avg-halo { stroke: var(--surface); stroke-width: 7; stroke-linecap: round; }
.pl-chart .avg-line { stroke: var(--fg); stroke-width: 2; stroke-dasharray: 7 5; stroke-linecap: round; }
.pl-chart .avg-lab { fill: var(--fg-muted); font: 700 11px var(--font-cond); letter-spacing: 0.06em; text-transform: uppercase; }
.pl-chart .avg-val { fill: var(--fg); font: 700 13px var(--font-body); font-variant-numeric: tabular-nums; }
.pl-chart .hit { fill: transparent; outline: none; }
.pl-chart .hit.is-on { fill: rgba(255, 255, 255, 0.07); }
.pl-chart .hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
.pl-tip {
  position: absolute; top: 0; z-index: 2; display: grid; gap: 1px;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-head); border: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); pointer-events: none; white-space: nowrap;
}
.pl-tip .tv { font-weight: 700; font-size: 1rem; color: var(--fg); }
.pl-tip .tk, .pl-tip .tg { font-size: 0.76rem; color: var(--fg-muted); }
/* The player's games */
.bx--log { min-width: 780px; }
.bx--log .pl { min-width: 150px; }
.bx--log .dt { flex: none; width: 3.3em; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.bx--log a.nm { color: var(--fg); text-decoration: none; font-weight: 600; }
.bx--log td.lg-res { color: var(--fg); }
.bx--log td.lg-res .wl { margin-right: 6px; vertical-align: -1px; }

/* Statistika: Spēlētāji / Komandas switch (links, so each view has its own address) */
.sts-mode { justify-self: start; }
.seg a {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-muted); text-decoration: none;
  font-family: var(--font-cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 10px 18px; border-radius: 999px; min-height: 40px; white-space: nowrap;
}
.seg a:hover { color: var(--fg); }
.seg a[aria-current="page"] { background: var(--accent-fill); color: var(--on-accent); }
@media (max-width: 559px) { .sts-mode { justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; } }
.bx--teams .pl { min-width: 210px; }

/* Player names link to the player page (everywhere except the MVP blocks). */
a.plink, a.nm { color: inherit; text-decoration: none; }
a.plink:hover, a.nm:hover { text-decoration: underline; text-underline-offset: 3px; }
a.plink:focus-visible, a.nm:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.bx .pl a.nm { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-rest a.nm, .tm-ldr-rest a.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ld-who a.nm { font-weight: 600; }
.ld-1-v a.ld-game, .ld-v a.ld-game { color: inherit; text-decoration: none; }
.ld-1-v a.ld-game:hover, .ld-v a.ld-game:hover { text-decoration: underline; }

/* Līderi: every round / monthly MVP so far, newest first. */
.mvph-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "d m s"; }
.mvph-row .tm-row-d { grid-area: d; }
.mvph-row .tm-row-m { grid-area: m; }
.mvph-row--month .tm-row-d b { font-size: 1.25rem; text-transform: uppercase; }
.mvph-name { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.05; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvph-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.86rem; color: var(--fg-muted); }
.mvph-team > span { font-weight: 600; color: var(--fg); white-space: nowrap; }
.mvph-game, .mvph-gp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvph-game { color: var(--fg-muted); text-decoration: none; }
.mvph-game:hover { color: var(--fg); text-decoration: underline; }
.mvph-team .badge--sm { width: 22px; height: 22px; }
.mvph-stats { grid-area: s; display: flex; gap: 14px; margin: 0; }
.mvph-stats div { display: grid; justify-items: center; min-width: 38px; }
.mvph-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.mvph-stats dt { font-family: var(--font-cond); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); margin-top: 3px; }
@media (max-width: 480px) {
  .mvph-row { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "d m" "d s"; row-gap: 8px; }
  .mvph-stats { justify-content: flex-start; gap: 18px; }
  .mvph-stats div { justify-items: start; min-width: 0; }
}
.mvph-wrap { display: grid; gap: 10px; min-width: 0; }
.mvph-wrap > .tm-list { min-width: 0; }
.mvph-sp { border-radius: 14px; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) {
  .mvph-wrap.has-sp { grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
  /* stays in view while the list scrolls past */
  .mvph-sp { position: sticky; top: calc(var(--head-h) + 16px); flex-direction: column; justify-content: center; text-align: center; padding: 24px 18px; gap: 16px; }
  .mvph-sp img { height: auto; width: min(170px, 80%); max-width: none; }
}
