/* StatBeasts design system.
   Tokens first, then base, components, pages. Class names are stable —
   js/*.js renders into these, so rename a class only with its markup. */

:root {
  /* Color — brand near-black ramp (StatBeasts identity, Nov 2026), shared by every page. */
  --bg: #080812;
  --surface: #100e20;
  --surface-2: #181430;
  --border: #292447;
  --border-strong: #3d3566;
  --text: #f5f5f7;
  --muted: #a49fc4;
  --accent: #8b3dff;
  --accent-2: #ff8a00;
  --green: #22c55e;
  --red: #dc2626;
  --brick: #cf6f66;

  /* Type scale — every size on the site is one of these seven steps. */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;

  /* Radii — controls, cards, pills. Nothing else. */
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-pill: 999px;

  /* Elevation — one popover shadow for the whole site. */
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

/* ---- Base ---- */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }

h1, h2, h3, h4 { line-height: 1.25; }
h1, h2 { font-weight: 800; font-style: italic; }
h1 { margin: 0; font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-xl); margin: 0 0 0.6rem; }
h3 { font-size: var(--fs-lg); }

a { color: inherit; }

.muted { color: var(--muted); }

/* Eyebrow label shared by every page. */
.kicker {
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

/* Skip link: visible on keyboard focus only (WCAG 2.4.1). */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--radius-control);
  padding: 0.6rem 1rem; font-weight: 700; text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.6rem; }

/* Visible keyboard focus (WCAG 2.4.7). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced-motion settings (WCAG 2.2.2). */
@media (prefers-reduced-motion: reduce) {
  .pill-in::before { animation: none; }
  .game-card:hover { transform: none; }
  .skel::after { animation: none; }
  * { transition: none !important; }
}

/* ---- Header + nav ---- */
.site-header {
  background: rgba(8, 8, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 48px; width: auto; display: block; }
.brand:hover { opacity: 0.85; }

/* One nav language on desktop and mobile: pill links, accent marks the page. */
.site-nav { display: flex; gap: 0.25rem; align-items: center; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  padding: 0.5rem 0.9rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { background: var(--accent); color: #fff; border-color: transparent; font-weight: 800; }
.site-nav a.active:hover { background: var(--accent); color: #fff; }

/* ---- Page head + footer ---- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.6rem 0 1rem; flex-wrap: wrap; gap: 0.75rem;
}

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; flex-wrap: wrap;
  padding-top: 1.25rem; padding-bottom: 1.75rem;
  color: var(--muted); font-size: var(--fs-sm);
}
.footer-brand { color: var(--text); font-weight: 800; display: inline-flex; align-items: center; gap: 0.45rem; }
.footer-brand img { height: 22px; width: auto; display: block; }

/* ---- Buttons: one base, two variants ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-size: var(--fs-sm); font-weight: 700;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-control);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); }

/* ---- Game status pills ----
   Scheduled and final look deliberately different; live pulses red. */
.pill {
  display: inline-flex; align-items: center;
  font-size: var(--fs-xs); font-weight: 700;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-pill);
  letter-spacing: 0.03em; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.pill-pre { background: transparent; border-color: var(--border); color: var(--muted); }
.pill-post { background: var(--surface-2); color: var(--text); }
.pill-in { background: #2a0d12; color: #ff5a5a; border-color: #7a2230; gap: 0.4rem; }
.pill-in::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #ff3b30; animation: pulse 1.6s infinite; flex-shrink: 0;
}
@keyframes pulse { 50% { opacity: 0.6; } }

/* ---- Loading skeletons + error/empty states ---- */
.skel {
  position: relative; overflow: hidden;
  background: var(--surface-2); border-radius: var(--radius-card);
  min-height: 3rem;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.07) 50%, transparent 75%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.state-error {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 2rem 1.5rem;
  text-align: center; margin: 1rem 0 2rem;
}
.state-error p { color: var(--muted); margin: 0 0 1rem; }
.state-empty { color: var(--muted); padding: 2.5rem 1rem; text-align: center; }
.state-empty img { width: 72px; height: auto; opacity: 0.9; margin-bottom: 0.5rem; }
.state-empty p { margin: 0; }

/* ---- Game cards (Scores) ---- */
.games-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding-bottom: 3rem;
}
.game-card {
  display: block;
  background: linear-gradient(180deg, #151231 0%, #100e20 100%);
  border: 1px solid #2e2952; border-radius: var(--radius-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
  padding: 1rem; color: inherit; text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.game-card:active { transform: scale(0.985); }
.game-card.live {
  border-color: #7a2230;
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.25), 0 10px 24px rgba(0, 0, 0, 0.35);
}
.game-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.game-card-foot { margin-top: 0.6rem; color: var(--muted); font-size: var(--fs-sm); }

/* Broadcast chips on score cards: national TV pops in the accent color,
   League Pass sits quiet. */
.bcasts { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }
.bcast {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
  padding: 0.14rem 0.45rem; border-radius: var(--radius-pill);
}
.bcast-nat { background: var(--accent); color: #fff; }
.bcast-lp { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.team { display: flex; align-items: center; gap: 0.7rem; padding: 0.35rem 0; }
.team img { width: 38px; height: 38px; object-fit: contain; }
.team-meta { display: flex; flex-direction: column; flex: 1; }
.team-abbr { font-weight: 700; }
.team-name { color: var(--muted); font-size: var(--fs-sm); }
.score { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.team.winner .score { color: var(--accent); }
.team.winner .team-abbr::after { content: " ▸"; color: var(--accent); }

/* ---- Tables (Standings, box scores) ---- */
.conf { margin-bottom: 2rem; }
.beasts-of-game { margin-bottom: 2rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-card); -webkit-overflow-scrolling: touch; }
.table-wrap > table { margin-bottom: 0; }
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--fs-sm); }
.data-table th, .data-table td { padding: 0.55rem 0.7rem; text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child,
.data-table th:nth-child(2), .data-table td:nth-child(2) { text-align: left; }
.data-table thead th {
  background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em;
}
.data-table tbody tr { border-top: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--surface-2); }
td.rank { color: var(--muted); width: 2.5rem; }
.team-cell { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.team-cell img { width: 26px; height: 26px; object-fit: contain; }
.team-cell a { text-decoration: none; }
.team-cell a:hover { color: var(--accent); text-decoration: underline; }
tr.starter td { font-weight: 600; }
tr.dnp td { opacity: 0.55; }
td.player { font-weight: 600; }

.standings-note { font-size: var(--fs-sm); margin: -0.4rem 0 1.2rem; }

/* Standings cut lines: solid purple under the last playoff seed (6),
   dashed under the last play-in seed (10). Rows are in seed order. */
.conf .data-table tbody tr:nth-child(6) td { border-bottom: 2px solid var(--accent); }
.conf .data-table tbody tr:nth-child(10) td { border-bottom: 2px dashed var(--border-strong); }

/* ---- Game detail ---- */
.game-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.2rem; margin: 1.6rem 0 2rem;
}
.game-team { display: flex; align-items: center; gap: 0.9rem; padding: 0.5rem 0; }
.game-team img { width: 56px; height: 56px; object-fit: contain; }
.game-team-meta { flex: 1; }
.big-score { font-size: var(--fs-3xl); font-weight: 800; }
.game-team.winner .big-score { color: var(--accent); }
.game-detail { text-align: center; padding: 0.4rem 0; font-weight: 600; }
.back-link { display: inline-block; margin-top: 1.2rem; color: var(--muted); text-decoration: none; font-size: var(--fs-sm); }
.back-link:hover { color: var(--text); }

/* ---- Leaderboards (StatBeasts home) ---- */
.section-title { font-size: var(--fs-xl); margin: 2.5rem 0 1rem; }
.strip-head h2 { font-size: var(--fs-xl); margin-bottom: 0.25rem; }
.strip-head .muted { margin: 0 0 1rem; }

.boards-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding-bottom: 3rem;
}
.board {
  background: linear-gradient(180deg, #151231 0%, #100e20 100%);
  border: 1px solid #2e2952;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-card); padding: 1rem 1.1rem;
}
.board h2 { margin-bottom: 0.15rem; }
.board-sub { font-size: var(--fs-sm); margin: 0 0 0.7rem; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.45rem 0.35rem; margin: 0 -0.35rem;
  border-top: 1px solid var(--border); border-radius: 8px;
  font-size: var(--fs-sm); cursor: pointer;
}
.board li:active { background: var(--surface-2); }
.board li:first-child { border-top: none; }
.board .rank { color: var(--muted); width: 1.4rem; flex-shrink: 0; text-align: center; }
.board li:nth-child(-n+3) .rank {
  background: var(--accent); color: #fff; border-radius: 6px;
  width: 1.35rem; height: 1.35rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 800;
}
.board li:nth-child(1) .rank { background: #ffb020; color: #14100a; }
.board .pname { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.board a.pname:hover { color: var(--accent); text-decoration: underline; }
/* Player-name links: box scores, roster, spotlights, Beast of the Week. */
td.player a, table.nice td.pname a, .bw-crown a {
  color: inherit;
  text-decoration: none;
}
td.player a:hover, table.nice td.pname a:hover, .bw-crown a:hover {
  color: var(--accent);
  text-decoration: underline;
}
/* Subtle jump back to the box score where a name used to link to the game. */
.game-link {
  color: var(--muted);
  font-size: var(--fs-xs);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.game-link::after { content: " ↗"; font-size: 0.9em; }
.game-link:hover { color: var(--accent); }
.board .pteam { color: var(--muted); font-size: var(--fs-xs); flex-shrink: 0; }
.board .pval { font-weight: 700; flex-shrink: 0; }
.board .pdetail { flex-basis: 100%; margin: -0.15rem 0 0.15rem 2rem; color: var(--muted); font-size: var(--fs-xs); }
.board .pflag {
  display: inline-block; margin: 0.1rem 0 0 0.3rem; padding: 0.05rem 0.5rem;
  border: 1px solid var(--accent); border-radius: var(--radius-pill);
  color: var(--accent); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}

/* ---- Performer cards (horizontal strips) ---- */
.card-strip {
  display: flex; gap: 1rem; overflow-x: auto;
  padding: 0.25rem 0.25rem 1.25rem;
  scroll-snap-type: x proximity;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
}
.pcard {
  flex: 0 0 264px; scroll-snap-align: start;
  background: linear-gradient(180deg, #151231 0%, #100e20 100%);
  border: 1px solid #2e2952;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-card); padding: 1rem 1.1rem 1.1rem;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.pcard:active { transform: scale(0.985); }
/* The night's #1 gets crowned; Brick Watch's worst gets the shame glow. */
.card-strip .pcard:first-child {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 32px rgba(139, 61, 255, 0.28);
}
.card-strip .pcard.brick:first-child {
  border-color: var(--brick);
  box-shadow: 0 0 0 1px var(--brick), 0 12px 32px rgba(207, 111, 102, 0.25);
}
.pcard-hero {
  font-size: 2rem; font-weight: 800; font-style: italic;
  line-height: 1.05; margin: 0.1rem 0 0.35rem;
}
.pcard-hero small {
  font-size: var(--fs-sm); font-style: normal; font-weight: 700;
  color: var(--muted); letter-spacing: 0.08em; margin-left: 0.3rem;
}
.pcard.brick .pcard-hero { color: var(--brick); }
.pcard-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.prank { font-weight: 800; font-size: var(--fs-lg); color: var(--accent); }
.pgs { font-size: var(--fs-sm); color: var(--muted); }
.pgs.neg { color: var(--brick); }
.phead {
  width: 100%; height: 150px; object-fit: cover; object-position: top;
  border-radius: var(--radius-control); margin-bottom: 0.6rem;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--tc, #8b3dff) 38%, transparent), transparent 72%);
}
.pcard-name { margin: 0; font-size: var(--fs-lg); }
.pcard-name a { color: inherit; text-decoration: none; }
.pcard-name a:hover { color: var(--accent); text-decoration: underline; }
.pcard-sub { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 0.55rem; }
.pcard-line { font-size: var(--fs-sm); margin-bottom: 0.2rem; }
.pcard-line.dim { color: var(--muted); }
.pcard-flags { margin-top: 0.5rem; min-height: 1.4rem; }
.pcard.brick { border-color: #7a3b36; }
.pcard.brick .prank { color: var(--brick); }

/* ---- Beast of the Week ---- */
.beast-week { margin: 2.5rem 0 3rem; }
.bw-winner {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1rem; margin: 0.9rem 0 1rem;
}
.bw-winner .phead {
  width: 96px; height: 96px; object-fit: cover; object-position: top;
  border-radius: 50%; margin: 0; flex-shrink: 0;
}
.bw-crown { font-size: var(--fs-xl); font-weight: 800; }
.bw-avgs { color: var(--muted); font-size: var(--fs-sm); margin-top: 0.15rem; }
.bw-list { list-style: none; margin: 0; padding: 0; }
.bw-list li {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.32rem 0; border-top: 1px solid var(--border); font-size: var(--fs-sm);
}
.bw-list li:first-child { border-top: none; }
.bw-list .rank { color: var(--muted); width: 1.4rem; flex-shrink: 0; }
.bw-list li:nth-child(-n+2) .rank { color: var(--accent); font-weight: 700; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .wrap { padding: 0 0.8rem; }

  /* Header: brand on top, nav becomes a swipeable row of the same pills */
  .header-inner { flex-wrap: wrap; gap: 0.5rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
  .site-nav {
    width: 100%; overflow-x: auto;
    padding-bottom: 0.15rem; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex-shrink: 0; }

  h1 { font-size: var(--fs-xl); }
  .page-head { flex-direction: column; align-items: stretch; margin: 1.2rem 0 0.9rem; }
  .page-head .dp, .page-head .dp-btn { width: 100%; }

  /* Grids collapse to a single comfortable column on phones */
  .games-grid, .boards-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

  /* Performer cards: slightly narrower so the next card peeks */
  .pcard { flex: 0 0 225px; }
  .phead { height: 135px; }

  /* Wide tables scroll instead of squishing */
  .table-wrap table { min-width: 600px; }
  .data-table th, .data-table td { padding: 0.5rem 0.6rem; }

  /* Game detail */
  .game-header { padding: 1rem; margin: 1.2rem 0 1.5rem; }
  .big-score { font-size: var(--fs-2xl); }
  .game-team img { width: 40px; height: 40px; }

  /* Board lists: let the detail line use full width */
  .board .pdetail { margin-left: 0; }
}

/* ---- Your-team highlight ----
   The team picked on the Your Team tab gets gold styling everywhere
   it appears: leaderboard rows, cards, standings, scores, box scores. */
:root { --gold: #f5c518; }
.my-team-tag {
  display: inline-block; vertical-align: middle;
  background: var(--gold); color: #1a1a1a;
  font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: var(--radius-pill); padding: 0.15rem 0.55rem; margin-left: 0.4rem;
}
/* Leaderboard list rows */
.board li.my-team {
  background: rgba(245, 197, 24, 0.07);
  border-radius: var(--radius-control);
  box-shadow: inset 3px 0 0 var(--gold);
  padding-left: 0.6rem;
}
.board li.my-team .pteam { color: var(--gold); font-weight: 800; }
/* Table rows (standings, box scores) */
.data-table tr.my-team td { background: rgba(245, 197, 24, 0.07); }
.data-table tr.my-team td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
/* Cards */
.pcard.my-team, .bw-winner.my-team, .game-card.my-team {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
/* Team blocks on Scores and the box-score header */
.team.my-team .team-abbr { color: var(--gold); font-weight: 800; }
.game-team.my-team .team-name { color: var(--gold); }
.conf.my-team > h2 { color: var(--gold); }

/* ---- Trend Report ---- */
.trend-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 700px) {
  .trend-cols { grid-template-columns: 1fr; }
}
.trend-col h3 {
  font-size: var(--fs-base);
  margin: 0 0 0.5rem;
}
.trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.trend-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.trend-row.my-team {
  border-left: 4px solid var(--gold);
}
.trend-head {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}
.trend-main { flex: 1; min-width: 0; }
.trend-line { font-size: var(--fs-base); margin-top: 0.15rem; }
.trend-stats {
  text-align: right;
  flex-shrink: 0;
}
.hit-rate {
  font-weight: 700;
  font-size: var(--fs-base);
}
.hit-bar {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  margin: 0.25rem 0;
}
.hit-seg {
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: var(--border);
}
.hit-seg.on { background: var(--accent); }
.trend-col:last-child .hit-seg.on { background: #38bdf8; }
.trend-avg { font-size: var(--fs-sm); }
.trend-loading { margin-top: 0.75rem; }

/* ---- Stat-tile popup ----
   Clicking a single-game performance opens one screenshot-ready tile
   (js/tile.js). The tile itself is the share image; the buttons live
   outside it so they never end up in the PNG. */
[data-tile] { cursor: pointer; }
.board li[data-tile]:hover { background: rgba(249, 115, 22, 0.05); }
.box-table tr[data-tile]:hover td { background: rgba(249, 115, 22, 0.05); }
.pcard[data-tile]:hover { border-color: var(--border-strong); }

.tile-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 12, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; overflow-y: auto;
}
.tile-overlay[hidden] { display: none; }
.tile-modal { position: relative; width: 460px; max-width: 94vw; }
.tile-x {
  position: absolute; top: -0.6rem; right: -0.6rem; z-index: 2;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); cursor: pointer;
  font-size: var(--fs-sm); line-height: 1;
}
.tile-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.9rem; justify-content: center;
}
.tile-actions .btn { text-decoration: none; }

.stile {
  background: #0d1220;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.1rem 1.2rem 1rem;
  color: var(--text);
}
.st-top { display: flex; align-items: center; gap: 0.9rem; }
.st-head {
  width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; object-position: top;
  background: var(--team, var(--surface-2));
}
.st-id { flex: 1; min-width: 0; }
.st-name { font-size: var(--fs-xl); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-big { font-size: 2rem; line-height: 1.15; margin-top: 0.15rem; white-space: nowrap; }
.st-big strong { font-weight: 800; }
.st-big span { color: var(--muted); font-size: var(--fs-lg); font-weight: 500; }
.st-flagsrow {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.7rem;
  min-height: 2rem;
}
.st-flags .pflag {
  display: inline-block; margin: 0.1rem 0.3rem 0.1rem 0; padding: 0.1rem 0.55rem;
  border: 1px solid var(--accent); border-radius: var(--radius-pill);
  color: var(--accent); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.st-brand { font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.st-brand img { height: 22px; width: auto; display: block; }
.st-gamerow {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  margin-top: 0.55rem;
}
.st-teampos { color: var(--muted); font-weight: 700; font-size: var(--fs-lg); }
.st-scorebox { display: flex; align-items: center; gap: 0.45rem; }
.st-abbr { font-size: var(--fs-lg); font-weight: 800; letter-spacing: 0.03em; }
.st-score { font-size: var(--fs-xl); color: var(--muted); }
.st-score strong { color: var(--text); }
.st-grid {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.7rem 0.3rem; margin-top: 0.9rem;
}
.st-cell { min-width: 0; }
.st-val { font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; white-space: nowrap; }
.st-val.pos { color: var(--green); }
.st-val.neg { color: var(--red); }
/* Shooting splits and percentages ("13/22", "100.0") are the widest values
   in the grid — at the standard size they overflow their column and run
   into the next cell, so they render one step smaller. */
.st-val.sm { font-size: var(--fs-base); letter-spacing: -0.02em; }
.st-lab { color: var(--muted); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; }
.st-bottom {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  margin-top: 0.9rem;
}
.st-gs-num { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
.st-date { color: var(--muted); font-size: var(--fs-sm); }

@media (max-width: 520px) {
  .st-head { width: 68px; height: 68px; }
  .st-big { font-size: 1.55rem; }
  .st-big span { font-size: var(--fs-base); }
  .st-val { font-size: var(--fs-base); }
  .st-val.sm { font-size: 0.75rem; }
  .st-grid { column-gap: 0.2rem; }
  .st-name { font-size: var(--fs-lg); }
  .stile { padding: 0.9rem 0.8rem 0.85rem; }
}
