/* Barlow, self-hosted (SIL Open Font License, see assets/fonts/OFL.txt) */
@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"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/barlow-800.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 600; font-display: swap; src: url("../assets/fonts/barlow-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 700; font-display: swap; src: url("../assets/fonts/barlow-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 800; font-display: swap; src: url("../assets/fonts/barlow-800-italic.woff2") format("woff2"); }

:root {
  --page: #f3f3f3;
  --panel: #e3e3e3;
  --card: #ffffff;
  --tile: #f3f3f3;
  --ink: #121212;
  --ink-2: #5f5f5f;
  --ink-3: #a1a1a1;
  --line: #ececec;
  --band: #050505;
  --band-line: #2b2b2b;
  --lime: #b8ee3c;
  --lime-bar: #bdeb4f;
  --purple: #8b4ad3;
  --red: #e5484d;
  --win: #3fb950;
  --draw: #b4b4b4;
  --loss: #e5484d;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 500 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell */

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 24px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 40px;
  height: 76px;
}

.brand {
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  min-width: 132px;
}

.mainnav { display: flex; gap: 34px; }

.mainnav a {
  position: relative;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 0;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.mainnav a:hover, .mainnav a.active { color: var(--ink); }

.mainnav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
}

.actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.event-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
}

.iconbtn, .avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e6e6e6;
  transition: background 0.15s ease, transform 0.1s ease;
}

.iconbtn:hover { background: #dcdcdc; }
.iconbtn:active, .avatar:active, .railbtn:active, .sportbtn:active { transform: scale(0.96); }

.iconbtn.has-dot::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #e6e6e6;
}

.avatar { background: #1d1d1d; color: #fff; }
.avatar svg { width: 20px; height: 20px; }

.rail {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 12px;
  align-self: start;
  height: calc(100vh - 100px);
  min-height: 420px;
}

.rail-sports { display: flex; flex-direction: column; gap: 12px; }

.sportbtn, .railbtn {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--card);
  transition: background 0.15s ease, transform 0.1s ease;
}

.sportbtn:hover, .railbtn:hover { background: #fafafa; }
.sportbtn.active { background: var(--lime); }
.sportbtn svg, .railbtn svg { width: 20px; height: 20px; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.railbtn.logout { color: var(--red); }

.content { grid-column: 2; grid-row: 2; min-width: 0; }
main { outline: none; }

.provenance {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}

.provenance a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- shared pieces */

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 3px 7px;
}

.on-dark .chip { color: #bdbdbd; background: rgba(255, 255, 255, 0.1); }

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 12px;
  min-height: 36px;
}

.panel-body {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  flex: 1;
  min-width: 0;
}

.arrow {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.arrow:hover { background: rgba(0, 0, 0, 0.06); }

.seg { display: inline-flex; background: rgba(0, 0, 0, 0.06); border-radius: 8px; padding: 2px; }

.seg button {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.head-tools { display: flex; align-items: center; gap: 8px; }

.crest {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--tile);
  display: grid;
  place-items: center;
}

.crest img { width: 78%; height: 78%; object-fit: contain; }
.crest.lg { width: 60px; height: 60px; border-radius: 12px; }
.crest.sm { width: 24px; height: 24px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; }

.empty { color: var(--ink-3); font-size: 13px; padding: 24px 8px; text-align: center; }

/* ---------------------------------------------------------------- home grid */

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

.band { grid-column: 1 / -1; }
.dash .players { grid-column: span 4; }
.dash .momentum { grid-column: span 8; }
.dash .stats { grid-column: span 5; }
.dash .news { grid-column: span 7; }

/* live band */

.band {
  background: var(--band);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 12px 14px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 14px;
}

.band-divider { background: var(--band-line); margin: 34px 0 0; }
.band .title { padding: 2px 4px 16px; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.35; } }

.band-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.mcard {
  position: relative;
  background: #fafafa;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  min-width: 0;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.mcard { text-align: left; width: 100%; }
button.mcard:hover { transform: translateY(-1px); }
.mcard.selected { box-shadow: 0 0 0 2px var(--lime); }

.mcard-league {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 56px;
}

.mcard-clock {
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #e8e8e8;
  border: 2px solid var(--band);
  border-radius: 7px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}

.mcard-clock.next { background: var(--lime); }

.mrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.mrow-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mscore {
  font-size: 20px;
  font-weight: 800;
  font-style: italic;
  min-width: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mscore.muted { color: #cdcdcd; }
.mscore.pending { color: var(--ink-3); font-size: 14px; font-style: normal; font-weight: 600; }
.mscore.flash { animation: goal 1.2s ease-out; }

@keyframes goal {
  0% { color: var(--purple); transform: scale(1.5); }
  100% { color: inherit; transform: scale(1); }
}

/* top players */

.players-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
}

.pcard {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  min-height: 124px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.pcard-name { font-size: 16px; font-weight: 700; line-height: 1.05; max-width: 62%; }
.pcard-team { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; max-width: 50%; line-height: 1.2; }
.pcard-label { font-size: 11px; color: var(--ink-2); margin-top: auto; }
.pcard-goals { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

.kit {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 50%;
  max-width: 116px;
  z-index: -1;
}

.kit svg { width: 100%; height: auto; stroke: none; }

/* attack momentum */

.momentum-body { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; }

.mm-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: center;
  min-width: 0;
}

.mm-club, .mm-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mm-mid { gap: 2px; }

.mm-team { font-size: 12px; font-weight: 600; max-width: 104px; line-height: 1.2; }
.mm-score { font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: 0.08em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mm-clock { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chart { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; }
.ticks { position: relative; height: 14px; font-size: 11px; color: var(--ink-3); }
.ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }

.bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--minutes), minmax(0, 1fr));
  column-gap: 3px;
  min-height: 180px;
}

.bar { display: grid; grid-template-rows: 1fr 1fr; row-gap: 3px; }
.bar i { display: block; width: 100%; max-width: 7px; justify-self: center; }
.bar .up { align-self: end; height: var(--h); background: var(--lime-bar); border-radius: 4px 4px 1px 1px; }
.bar .down { align-self: start; height: var(--a); background: var(--purple); border-radius: 1px 1px 4px 4px; }
.bar.future .up, .bar.future .down { background: #f0f0f0; }
.bar.now .up, .bar.now .down { animation: grow 0.6s ease-out; transform-origin: center bottom; }
.bar.now .down { transform-origin: center top; }

@keyframes grow { from { transform: scaleY(0); } }

.ht-line { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1px dashed #d6d6d6; }

.dots { display: flex; gap: 5px; }
.dots button { width: 7px; height: 7px; border-radius: 2px; background: #c9c9c9; transition: background 0.15s ease, width 0.15s ease; }
.dots button[aria-pressed="true"] { background: var(--ink); width: 14px; }

.mm-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ink-2); }
.mm-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* standings */

.table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.table th { font-size: 11px; font-weight: 500; color: var(--ink-3); text-align: center; padding: 0 4px 10px; }
.table td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.table th.team, .table td.team { text-align: left; }
.table td.team { font-weight: 600; }
.table .team-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.table .team-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table td.pts { font-weight: 700; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: #fafafa; }

.label-sm { display: none; }
.live-tag { font-size: 11px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: 0.04em; }

.form { display: inline-flex; gap: 4px; }
.form b { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; color: #fff; }
.form .W { background: var(--win); }
.form .D { background: var(--draw); }
.form .L { background: var(--loss); }

/* news */

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-content: space-evenly; }

.nitem { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }

.thumb {
  position: relative;
  aspect-ratio: 92 / 80;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='1.2'%3E%3Crect x='4' y='4' width='84' height='72' rx='1'/%3E%3Cpath d='M46 4v72'/%3E%3Ccircle cx='46' cy='40' r='13'/%3E%3Crect x='4' y='24' width='12' height='32'/%3E%3Crect x='76' y='24' width='12' height='32'/%3E%3C/g%3E%3C/svg%3E") center / cover,
    repeating-linear-gradient(90deg, #2f8b45 0 11.5px, #2a7f3e 11.5px 23px);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.thumb img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48%;
  height: 48%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ntitle {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.ntime { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.nsummary { font-size: 13px; color: var(--ink-2); margin-top: 6px; text-wrap: pretty; }

/* ---------------------------------------------------------------- pages */

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

.day { margin-top: 18px; }
.day:first-child { margin-top: 0; }
.day h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.fixture {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px minmax(0, 1fr) minmax(0, 150px) 34px;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
}

.fixture-time { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fixture-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.fixture-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixture-team.home { justify-content: flex-end; text-align: right; }
.fixture-score { text-align: center; font-weight: 800; font-style: italic; font-size: 16px; font-variant-numeric: tabular-nums; }
.fixture-score.pending { font-style: normal; font-weight: 600; font-size: 11px; color: var(--ink-3); }
.fixture-score.live { color: var(--purple); }
.fixture-venue { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fixture-group { font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 6px; text-align: center; padding: 3px 0; }

.kit-sm { width: 26px; flex: none; }
.kit-sm svg { width: 100%; height: auto; stroke: none; }

.searchbox {
  font: inherit;
  font-size: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--card);
  padding: 7px 10px;
  min-width: 0;
  width: 180px;
}

select.searchbox { width: auto; max-width: 200px; }

.news-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.news-page .nitem { grid-template-columns: 132px minmax(0, 1fr); align-items: start; }

/* ---------------------------------------------------------------- team pages */

a.team-cell span, a.fixture-team span, .tf-opp span, .nm-club span, .mm-club .mm-team, a.pcard-team { text-underline-offset: 2px; }
a.team-cell:hover span, a.fixture-team:hover span, .tf-opp:hover span, .nm-club:hover span, .mm-club:hover .mm-team, a.pcard-team:hover {
  text-decoration: underline;
}

.table tbody tr.highlight, .table tbody tr.highlight:hover { background: rgba(184, 238, 60, 0.24); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

.tcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tcard:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
.tcard .crest { grid-row: span 2; width: 48px; height: 48px; }
.tcard-name { font-weight: 700; line-height: 1.2; align-self: end; }
.tcard-meta { font-size: 12px; color: var(--ink-3); align-self: start; }

.team-page {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "hero hero" "fixtures next" "fixtures goals" "squad group" "squad news";
  gap: 16px;
}

.tp-fixtures { grid-area: fixtures; }
.tp-next { grid-area: next; }
.tp-goals { grid-area: goals; }
.tp-squad { grid-area: squad; }
.tp-group { grid-area: group; }
.tp-news { grid-area: news; }

.team-hero {
  grid-area: hero;
  background: var(--band);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #a8a8a8; margin-bottom: 16px; transition: color 0.15s ease; }
.back:hover { color: #fff; }
.back svg { width: 16px; height: 16px; }

.team-id-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.crest.xl { width: 88px; height: 88px; border-radius: 18px; background: #fafafa; }
.team-title { margin: 0; font-size: 34px; font-weight: 800; font-style: italic; text-transform: uppercase; line-height: 1; letter-spacing: -0.01em; text-wrap: balance; }
.team-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.team-tags span { font-size: 11px; font-weight: 600; color: #cfcfcf; background: rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 4px 9px; }

.team-tiles { display: grid; grid-template-columns: repeat(4, minmax(78px, 1fr)); gap: 8px; }

.ttile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 62px;
  background: #fafafa;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.ttile.pos { background: var(--lime); }
.ttile-value { font-size: 22px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; }
.ttile > span:last-child { font-size: 11px; color: var(--ink-3); }
.ttile.pos > span:last-child { color: var(--ink-2); }

.tfix {
  display: grid;
  grid-template-columns: 52px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.tfix:first-child { border-top: 0; padding-top: 0; }
.tf-date { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tf-ha { font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 5px; text-align: center; padding: 3px 0; }
.tf-opp { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.tf-opp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-result { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.tf-score, .tf-live { font-size: 16px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.tf-live { color: var(--purple); }
.tf-clock { font-size: 11px; color: var(--purple); font-variant-numeric: tabular-nums; }
.tf-time { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tf-pending { font-size: 11px; color: var(--ink-3); }

.nm { display: grid; gap: 14px; align-content: center; }
.nm-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.nm-club { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; min-width: 0; }
.nm-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nm-big { font-size: 24px; font-weight: 800; font-style: italic; color: var(--ink); white-space: nowrap; }
.nm-venue { text-align: center; font-size: 12px; color: var(--ink-2); background: var(--tile); border-radius: 8px; padding: 7px 10px; }

.gchart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; height: 210px; padding-top: 18px; margin-bottom: 12px; }
.gcol { display: grid; grid-template-rows: 1fr 1fr auto; row-gap: 3px; justify-items: center; min-width: 0; }
.gbar { position: relative; width: 100%; max-width: 34px; min-height: 2px; height: var(--v); }
.gbar.up { align-self: end; background: var(--lime-bar); border-radius: 6px 6px 2px 2px; }
.gbar.down { align-self: start; background: var(--purple); border-radius: 2px 2px 6px 6px; }
.gbar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink-2); }
.gbar.up b { bottom: 100%; margin-bottom: 2px; }
.gbar.down b { top: 100%; margin-top: 2px; }
.glabel { font-size: 10px; font-weight: 700; color: var(--ink-3); margin-top: 18px; }

.news-list { display: grid; gap: 14px; }
.news-list .nitem { align-items: start; }

/* ---------------------------------------------------------------- player pages */

.player-page { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.player-page .team-hero { grid-area: auto; grid-column: 1 / -1; }
.pp-main, .pp-side { display: grid; gap: 16px; min-width: 0; }
.kit-xl { display: block; width: 76%; }
.kit-xl svg { display: block; width: 100%; height: auto; stroke: none; }
.team-tags a { font-size: 11px; font-weight: 600; color: #cfcfcf; background: rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 4px 9px; transition: background 0.15s ease, color 0.15s ease; }
.team-tags a:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
a.pcard-name { display: block; }
a.pcard-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-counts span { font-size: 12px; background: var(--tile); border-radius: 8px; padding: 5px 9px; }
.tag-counts b { font-weight: 800; font-style: italic; margin-right: 5px; }
.muted { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.muted a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- match coder */

.coder-intro { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); max-width: 72ch; }
.coder-row { border-radius: 8px; transition: background 0.15s ease; }
.coder-row:hover { background: #fafafa; }
.coder-row .fixture-group { background: none; }
.has-video { font-weight: 700; color: var(--purple); }
.coder-open svg { width: 16px; height: 16px; color: var(--ink-3); }

.coder {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "head head" "video tag" "players log" "stats stats";
  align-items: start;
  gap: 16px;
}

.coder-head { grid-area: head; background: var(--band); color: #fff; border-radius: var(--radius-lg); padding: 14px 16px 16px; }
.coder-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.coder-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; flex: 1 1 520px; max-width: 780px; }
.coder-club { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 18px; font-weight: 800; font-style: italic; text-transform: uppercase; line-height: 1.1; }
.coder-club.home { justify-content: flex-end; text-align: right; }
.coder-club span { min-width: 0; }
.coder-club:hover span { text-decoration: underline; text-underline-offset: 3px; }
.coder-club .crest { background: #fafafa; }
.coder-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.coder-mid b { font-size: 30px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; }
.coder-mid span { font-size: 11px; color: #a8a8a8; white-space: nowrap; }
.coder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 8px 14px; background: var(--card); color: var(--ink); white-space: nowrap; transition: background 0.15s ease, transform 0.1s ease; }
.pill:hover { background: #fafafa; }
.pill:active { transform: scale(0.97); }
.pill.primary { background: var(--lime); }
.pill.danger { color: var(--red); }
.coder-head .pill { background: #fafafa; }
.coder-head .pill:hover { background: #fff; }

.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #bdbdbd; }
.saved svg { width: 14px; height: 14px; color: var(--lime); }
.saved.bad { color: var(--red); }
.saved.flash { animation: saved 0.9s ease-out; }

@keyframes saved { from { color: var(--lime); } }

.coder-video { grid-area: video; }
.coder-players { grid-area: players; }
.coder-tag { grid-area: tag; }
.coder-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.coder-log { grid-area: log; }

.video-form { display: flex; gap: 8px; min-width: 0; }
.video-form .searchbox { width: 300px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #0b0b0b; border-radius: var(--radius-sm); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; font-size: 13px; color: #d6d6d6; }
.video-empty p { margin: 0; max-width: 44ch; text-wrap: pretty; }
.video-empty.over { background: rgba(0, 0, 0, 0.82); }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tbtn { display: inline-grid; place-items: center; height: 34px; min-width: 46px; padding: 0 10px; border-radius: 9px; background: var(--tile); font-size: 12px; font-weight: 700; transition: background 0.15s ease, transform 0.1s ease; }
.tbtn:hover { background: #ececec; }
.tbtn:active { transform: scale(0.96); }
.tbtn.play, .tbtn.play:hover { background: var(--ink); color: #fff; min-width: 54px; }
.tbtn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.vtime { min-width: 56px; margin: 0 4px; font-size: 18px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.transport .seg { margin-left: auto; }
.keys { margin: 12px 0 0; font-size: 11px; color: var(--ink-3); line-height: 1.9; }
kbd { font: inherit; font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--tile); border-radius: 4px; padding: 1px 5px; }

.event-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ebtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; background: var(--tile); font-size: 12px; font-weight: 700; transition: background 0.15s ease, color 0.15s ease; }
.ebtn:hover { background: #ececec; }
.ebtn kbd { background: var(--card); }
.ebtn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ebtn[aria-pressed="true"] kbd { background: rgba(255, 255, 255, 0.16); color: #e8e8e8; }

.squads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.squad.home { --side: var(--lime); --side-ink: var(--ink); }
.squad.away { --side: var(--purple); --side-ink: #fff; }
.squad-team { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 6px 8px; border-radius: 9px; font-size: 13px; font-weight: 700; text-align: left; transition: background 0.15s ease; }
.squad-team span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squad-team:hover { background: var(--tile); }
.squad-team.on { background: var(--tile); box-shadow: inset 0 0 0 2px var(--side); }
.squad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pbtn { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border-radius: 8px; background: var(--tile); font-size: 12px; font-weight: 600; text-align: left; transition: background 0.15s ease, color 0.15s ease; }
.pbtn:hover { background: #ececec; }
.pbtn b { min-width: 18px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; }
.pbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn.on, .pbtn.on:hover { background: var(--side); color: var(--side-ink); }

.pitch { display: block; width: 100%; height: auto; aspect-ratio: 107 / 70; border-radius: var(--radius-sm); stroke: none; }
#pitch { cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.pitch .grass { fill: #2a8040; }
.pitch .stripe { fill: #2e8a46; }
.pitch .lines { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 0.35; }
.pitch .spots { fill: rgba(255, 255, 255, 0.75); }
.mark { stroke: #fff; stroke-width: 0.3; }
.mark.home, .mark-end.home, .shot.home { fill: var(--lime-bar); }
.mark.away, .mark-end.away, .shot.away { fill: #a978ff; }
.mark-line { stroke-width: 0.45; stroke-linecap: round; }
.mark-line.home, .shot-line.home, .shot.off.home { stroke: var(--lime-bar); }
.mark-line.away, .shot-line.away, .shot.off.away { stroke: #a978ff; }
.mark.old, .mark-line.old, .mark-end.old { opacity: 0.4; }
.mark.hl { stroke-width: 0.6; }
.drag-line { stroke: #fff; stroke-width: 0.5; stroke-dasharray: 1 1; }
.shot { stroke: #fff; stroke-width: 0.3; }
.shot.goal { stroke-width: 0.6; }
.shot.off { fill: none; stroke-width: 0.5; }
.shot-line { stroke-width: 0.35; stroke-opacity: 0.7; }
.tag-status { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.shot-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11px; color: var(--ink-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.home { background: var(--lime-bar); }
.dot.away { background: #a978ff; }
.dot.ring { box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.tag-scroll { position: relative; max-height: 440px; overflow-y: auto; }
.tag-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.tag-log tbody tr { cursor: pointer; }
.tag-log tbody tr.on, .tag-log tbody tr.on:hover { background: rgba(184, 238, 60, 0.24); }
.tag-log .where { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.src { font-size: 10px; font-weight: 700; color: var(--ink-3); background: var(--tile); border-radius: 5px; padding: 1px 5px; margin-left: 4px; }
.del { width: 28px; height: 28px; border-radius: 8px; font-size: 17px; line-height: 1; color: var(--ink-3); transition: background 0.15s ease, color 0.15s ease; }
.del:hover { background: var(--tile); color: var(--red); }

.import-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--page); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); }
.import-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.import-form { display: grid; gap: 14px; padding: 20px; }
.import-form p { margin: 0; font-size: 13px; }
.slot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.slot-team { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; }
.slot { display: grid; grid-template-columns: 34px 64px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.slot span { color: var(--ink-3); }
.slot select { min-width: 0; padding: 6px; border: 1px solid #dcdcdc; border-radius: 8px; background: var(--card); font: inherit; font-size: 12px; }
.mode { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.import-form .pill { background: var(--card); }
.import-form .pill.primary { background: var(--lime); }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  z-index: 10;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--lime); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1240px) {
  .dash .players { grid-column: span 5; }
  .dash .momentum { grid-column: span 7; }
  .dash .stats, .dash .news { grid-column: span 6; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .event-chip { display: none; }
}

@media (max-width: 1080px) {
  .band { grid-template-columns: minmax(0, 1fr); }
  .band-divider { display: none; }
  .dash .players, .dash .momentum, .dash .stats, .dash .news { grid-column: 1 / -1; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-cols { grid-template-columns: minmax(0, 1fr); }
  .fixture { grid-template-columns: 56px minmax(0, 1fr) 56px minmax(0, 1fr) 34px; }
  .fixture-venue { display: none; }
  .team-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "next" "fixtures" "goals" "squad" "group" "news"; }
  .team-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .player-page { grid-template-columns: minmax(0, 1fr); }
  .pp-main, .pp-side { display: contents; }
  .pp-next { order: 1; }
  .pp-goals { order: 2; }
  .pp-extra { order: 3; }
  .pp-mates { order: 4; }
  .pp-group { order: 5; }
  .coder { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "video" "players" "tag" "log" "stats"; }
  .coder-stats { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .topbar { flex-wrap: wrap; height: auto; gap: 8px 16px; padding: 14px 0 12px; }
  .brand { font-size: 22px; min-width: 0; }
  .actions { gap: 8px; }
  .mainnav { order: 3; width: 100%; gap: 24px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .mainnav::-webkit-scrollbar { display: none; }
  .rail { display: none; }
  .content { grid-column: 1; }
  .band { padding: 12px 10px 12px; }
  .band-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-top: 10px; margin-top: -10px; scrollbar-width: none; }
  .band-cards::-webkit-scrollbar { display: none; }
  .band-cards .mcard { flex: 0 0 72%; scroll-snap-align: start; }
  .momentum-body { grid-template-columns: minmax(0, 1fr); }
  .mm-side { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; }
  .mm-side .crest.lg { width: 44px; height: 44px; }
  .mm-mid { padding-top: 8px; }
  .label-lg { display: none; }
  .label-sm { display: inline; }
  .bars { min-height: 150px; column-gap: 2px; }
  .news-grid, .news-page { grid-template-columns: minmax(0, 1fr); }
  .table { font-size: 12px; }
  .table .hide-sm { display: none; }
  .fixture { grid-template-columns: 50px minmax(0, 1fr) 44px minmax(0, 1fr); gap: 8px; }
  .fixture-time { font-size: 11px; }
  .fixture-group { display: none; }
  .fixture-team .crest { display: none; }
  .searchbox { width: 100%; }
  .team-title { font-size: 26px; }
  .crest.xl { width: 64px; height: 64px; border-radius: 14px; }
  .team-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ttile { padding: 8px 9px; min-height: 56px; }
  .ttile-value { font-size: 18px; }
  .tfix { grid-template-columns: 44px 22px minmax(0, 1fr) auto; gap: 8px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tcard { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .tcard .crest { grid-row: auto; }
  .coder-club, .coder-club.home { flex-direction: column; justify-content: center; text-align: center; font-size: 13px; gap: 8px; }
  .coder-club.home { flex-direction: column-reverse; }
  .coder-club .crest.lg { width: 44px; height: 44px; }
  .coder-mid b { font-size: 24px; }
  .coder-video .panel-head { flex-wrap: wrap; }
  .video-form { width: 100%; }
  .video-form .searchbox { width: 100%; }
  .squads, .slot-cols { grid-template-columns: minmax(0, 1fr); }
  .transport .seg { margin-left: 0; }
  .keys { display: none; }
  .head-tools { flex-wrap: wrap; justify-content: flex-end; }
}

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