/* =============================================================================
   SHARED STYLESHEET - /assets/css/styles.css
   Used across all pages (leaderboards, matches, profiles, etc).
   Depends on /assets/css/fonts.css (self-hosted Inter / IBM Plex Mono / Teko).
   Profile-only rules live in sections/profiles.css; leaderboard controls in
   sections/lb-controls.css; per-tab rules in pages/profiles-player-*.css.
   ============================================================================= */

/* ── Reset ────────────────────────────────────────────────────────────────── */

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

/* ── Design tokens ────────────────────────────────────────────────────────────
   Central place for colors/spacing/fonts. Change a value here and it updates
   everywhere the variable is used, across every page that links this file. */

:root {
  /* backgrounds */
  --bg:       #0a0d10;  /* page background */
  --surface:  #141a1e;  /* card / panel background */
  --surface2: #1a2126;  /* slightly lighter surface, e.g. table headers */

  /* borders */
  --border:   rgba(255,255,255,.07);  /* standard hairline border */
  --border2:  rgba(255,255,255,.05);  /* subtler border, e.g. table row dividers */

  /* text */
  --text:     #e6f2f5;  /* primary text */
  --muted:    #7c96a0;  /* secondary text */
  --muted2:   #4e6771;  /* tertiary / label text */

  /* accent + status colors */
  --accent:        #ffff00;
  --accent-dim:    rgba(255,204,0,.12);
  --accent-border: rgba(255,204,0,.3);
  --green:  #6fcf97;  /* positive values, e.g. K/D ratio */
  --gold:   #c5922a;  /* rank #1 */
  --silver: #7a8898;  /* rank #2 */
  --bronze: #8a5c2e;  /* rank #3 */

  /* spacing scale - use these for new padding/gap values so density stays consistent */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 40px;

  /* shape */
  --r: 8px;  /* standard border-radius for cards/panels */

  /* fonts */
  /* NOTE: --mono is no longer an actual monospace stack. It used to be
     (ui-monospace, SFMono-Regular, Menlo, Consolas, monospace), but every
     one of those renders "0" with a diagonal slash through it, which reads
     as a typo/ugly at the sizes we use it (table headers, stat numbers,
     player IDs, timestamps, etc). Rather than hunt down and edit the 90+
     `font-family: var(--mono)` rules across this file one by one, we just
     point the variable at Inter instead - same variable name so nothing
     else has to change, but zeros are now plain zeros everywhere.
     Do NOT point this back at a real monospace font. If a specific rule
     ever genuinely needs monospace/tabular alignment, set that font-family
     explicitly on that one rule - don't reintroduce it here. */
  --mono: 'Inter', sans-serif;  /* used for numbers, labels, codes */
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

html {
  font-size: 15px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }

::-webkit-scrollbar-track { background: var(--surface); }

::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* =============================================================================
   TOP NAV
   Sticky bar loaded via src/_includes/partials/nav.njk into #nav-placeholder.
   ============================================================================= */

.topbar-outer {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(19,21,26,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px; /* matches .page's side padding so content lines up */
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 30px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 620;
  font-size: 1.24rem;
  color: var(--text);
  letter-spacing: -.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}

.nav-links::-webkit-scrollbar { height: 0; }

/* hide scrollbar, keep swipe on mobile */

.nav-link {
  padding: 0 16px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  font-size: .98rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }

.nav-link.active { color: var(--text); font-weight: 500; }

/* ── Nav dropdowns (Leaderboards, Updates) ─────────────────────────────────── */

.nav-dropdown { position: relative; flex-shrink: 0; }

.nav-link-dd {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  gap: 5px;
}

.nav-dd-caret { transition: transform .15s; flex-shrink: 0; width: 11px; height: 11px; }

.nav-dropdown.open .nav-dd-caret { transform: rotate(180deg); }

.nav-dd-menu {
  display: none;
  position: fixed;
  min-width: 178px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.nav-dropdown.open .nav-dd-menu { display: flex; }

/* ── Hamburger toggle (mobile only — hidden on desktop below) ── */

.nav-hamburger {
  display: none;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
}

.nav-hamburger-bar {
  width: 17px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}

.nav-hamburger:hover .nav-hamburger-bar { background: var(--text); }

.nav-hamburger.open .nav-hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }

.nav-hamburger.open .nav-hamburger-bar:nth-child(2) { opacity: 0; }

.nav-hamburger.open .nav-hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-dd-item {
  padding: 10px 13px;
  border-radius: 5px;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}

.nav-dd-item:hover { color: var(--text); background: rgba(255,255,255,.05); }

.nav-dd-item.active { color: var(--text); font-weight: 500; background: var(--accent-dim); }

/* =============================================================================
   PAGE SHELL
   Every page's main content should sit inside <main class="page">.
   ============================================================================= */

.page {
    max-width: 1060px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    animation: fadeUp .22s ease;
    flex: 1 0 auto;   /* grow to push footer down, never shrink below content */
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.page-header { margin-bottom: 20px; }

.page-eyebrow {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 6px;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.01em;
  margin-bottom: 3px;
}

.page-sub { font-size: .78rem; color: var(--muted); }

/* =============================================================================
   SERVER FILTER BAR
   Row of pill buttons for filtering by server. Hidden by default (.visible
   is toggled on via JS once there's more than one server to filter by).
   ============================================================================= */

.server-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.server-bar.visible { display: flex; }

.server-bar-label {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.server-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.server-pill {
  padding: 4px 12px;
  font-size: .74rem;
  font-family: var(--mono);
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all .15s;
}

.server-pill:hover { color: var(--text); border-color: rgba(255,255,255,.15); }

.server-pill.active {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

/* =============================================================================
   TABS
   Generic tab-row pattern, reusable anywhere (leaderboard categories, profile
   sections, etc).
   ============================================================================= */

.tab-row {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  overflow-x: auto;
  flex-wrap: wrap;
}

.tab-row::-webkit-scrollbar { height: 0; }

.tab-btn {
  padding: 0 14px;
  height: 34px;
  font-size: .78rem;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
  border-radius: 5px;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}

.tab-btn:hover { color: var(--text); border-color: rgba(255,255,255,.15); }

.tab-btn.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
  font-weight: 500;
}

/* =============================================================================
   PANEL / CARD (e.g. leaderboard wrapper, any boxed content section)
   ============================================================================= */

.lb-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border2);
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface2);
}

.lb-meta-title {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.01em;
}

.lb-meta-note { font-family: var(--mono); font-size: .74rem; color: var(--muted); }

.lb-meta-refresh { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* =============================================================================
   TABLE
   Generic data table styling - used for leaderboards, and reusable for any
   other tabular data (match history, player lists, etc).
   ============================================================================= */

.table-scroll { overflow-x: auto; flex: 1; display: flex; flex-direction: column; }

.table-scroll > table { flex-shrink: 0; }

table { width: 100%; border-collapse: collapse; font-size: .84rem; }

thead tr { background: var(--surface2); }

th {
  padding: 10px 16px;
  text-align: left;
  font-family: var(--mono);
  font-size: .63rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}

th.num, td.num { text-align: right; white-space: nowrap; }

th.center, td.center { text-align: center; white-space: nowrap; }

tr.row-click { cursor: pointer; }

tr.row-click:hover { background: rgba(255,255,255,.03); }

/* Stat columns (Matches/Rank/Level/Achievements) on the player search table:
   no fixed widths, so a long rank name (e.g. "Lieutenant") or a large XP/
   achievement number can grow the column instead of wrapping or truncating.
   Separated by generous spacing, not ruled lines - vertical gridlines between
   every column is what made this read as a spreadsheet rather than a page. */

.stat-th, td.stat-td {
  text-align: center;
  white-space: nowrap;
  padding-left: 22px;
  padding-right: 22px;
}

td.stat-td-platform .platform-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  padding: 0;
}

td.stat-td-platform .platform-icon.platform-unknown { font-size: .8rem; border: 1px dashed rgba(255,255,255,.18); }

/* Steam is the only clickable variant here — at rest it should look
   identical to the inert (non-clickable) icons next to it: no border, no
   background. Only on hover does it reveal the clickable affordance.
   Border must stay 1px solid transparent (not `none`) at rest so the
   existing a.platform-icon.steam:hover rule — which only swaps
   border-color/background, not border-width — has something to reveal
   without the icon jumping size on hover. */

td.stat-td-platform a.platform-icon.steam {
  border: 1px solid transparent;
  background: transparent;
}

td.stat-td-platform a.platform-icon.steam:hover {
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,.025); }

/* Rank column + medal badges for top 3 */

td.rank {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted2);
  width: 52px;
  text-align: center;
}

.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--mono);
  font-weight: 500;
  font-size: .74rem;
}

.rank-1 { background: rgba(197,146,42,.12); color: var(--gold);   border: 1px solid rgba(197,146,42,.35); }

.rank-2 { background: rgba(122,136,152,.1);  color: var(--silver); border: 1px solid rgba(122,136,152,.3); }

.rank-3 { background: rgba(138,92,46,.12);   color: var(--bronze); border: 1px solid rgba(138,92,46,.3); }

/* Player cell: avatar + name + hover-revealed action buttons.
   Reusable anywhere a player needs to be displayed inline (tables, lists). */

.player-cell {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lb-wrap .player-cell { gap: 10px; }

.list-av {
  width: 44px;
  height: 44px;
  /* No rounded corners on avatars anywhere in the product — keep this square. */
  border-radius: 0;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--surface2);
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.lb-wrap .list-av { width: 44px; height: 44px; }

@media (max-width: 640px) {
  .list-av { width: 32px; height: 32px; }
  .pid-mini-wrap { width: 115px; }
}

.player-name {
  font-weight: 500;
  font-size: .86rem;
  color: var(--text);
  text-decoration: none;
  transition: color .15s;
  /* Was unset, inheriting the browser's default line-height (~1.5), which
     padded extra whitespace under the text on top of player-id-block's own
     gap below — the id/icon row read as farther from the name than the
     gap value alone suggested. 1.2 matches what .results-panel already
     sets on this same element (see override further down); pulled up here
     so every use of .player-name gets it, not just the search results panel. */
  line-height: 1.2;
}

/* Player identity block: name on top, platform ID + copy/steam buttons
   underneath as a quiet secondary line. Buttons stay small and low-contrast
   at rest, matching the row's baseline chrome, and only sharpen on hover -
   same principle as .act-btns but permanently visible (not hover-revealed),
   since the ID is core identifying info, not an incidental action. */

.player-id-block {
  display: flex;
  flex-direction: column;
  /* Was 3px. .results-panel already tightens this exact relationship to
     1px (see override further down) — brought the base value in line so
     every page showing a name-over-id/icon block gets the same tight
     spacing, not just the search results panel. */
  gap: 1px;
  min-width: 0;
}

.player-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.results-panel .act-btn-mini {
  width: 32px;
  height: 32px;
  padding: 4px;
  position: relative;
  top: -1px;
}

.results-panel .act-btn-mini svg { width: 24px; height: 24px; }

.results-panel .player-sub { gap: 12px; }

.pid-mini-wrap {
  /* Fixed-width column so the platform icon that follows always starts at
     the same x on every row, regardless of that row's ID string length -
     the pill itself (.pid-mini, nested inside) still hugs its own text
     rather than stretching to fill this.
     NOTE: this only lines up correctly because .pid-mini has
     font-variant-numeric: tabular-nums - if that's ever removed, same-length
     IDs will render at different pixel widths (Inter is proportional) and
     this fixed width will stop being reliable. Width bumped up from the old
     158px: tabular digits in Inter render wider per-character than the
     previous monospace font did, so the full "SteamNWI:xxxxxxxxxxxxxxxxx"
     string was landing right at (sometimes past) the old box edge, leaving
     ~0px of breathing room before the platform icon that follows. */
  display: inline-block;
  width: 186px;
  flex-shrink: 0;
}

.pid-mini {
  font-family: var(--mono);
  /* Inter is proportional (a "1" is narrower than an "8"), unlike the old
     monospace stack --mono used to point to. The platform icon after this
     pill relies on every same-length ID rendering at the same pixel width
     (see .pid-mini-wrap's fixed width below) to line up consistently -
     tabular-nums forces Inter's digits to a uniform width so that still
     holds, without reintroducing a real monospace font (and its slashed
     zeros). */
  font-variant-numeric: tabular-nums;
  font-size: .68rem;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color .12s, background .12s;
  max-width: 100%;
  width: max-content;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  padding: 1px 6px;
}

.pid-mini:hover { color: var(--text); background: rgba(255,255,255,.07); }

.pid-mini.copied { color: #6fcf97; }

.act-btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, border-color .12s, background .12s;
}

.act-btn-mini:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
}

.act-btn-mini.copy.copied { color: #6fcf97; border-color: rgba(111,207,151,.35); background: rgba(111,207,151,.08); }

.act-btn-mini svg { width: 15px; height: 15px; }

a.act-btn-mini.steam:hover { color: #a0b8cc; border-color: rgba(160,184,204,.3); background: rgba(160,184,204,.08); }

/* Numeric cell color variants - apply alongside td.num */

td.num {
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: -.01em;
}

td.num.hi, td.center.hi { color: var(--text); }

/* primary stat, e.g. kills */

td.num.lo, td.center.lo { color: var(--muted); }

/* secondary stat, e.g. deaths */

td.num.em, td.center.em { color: var(--text); font-weight: 600; }

/* emphasized-but-neutral stat */

td.num.kd, td.center.kd { color: var(--green); }

/* ratio-style positive stat */

/* Level badge (e.g. XP leaderboard) */

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--accent);
}

.title-str { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* Rank icon (chevron/star badge) + level pill, shown together in tables.
   Icon source assets are arbitrary native resolution (pre-generated webp,
   see build_rank_assets.py) - always constrain display size here, never
   rely on the asset's own dimensions. */

.rank-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.rank-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 640px) {
  .rank-icon { width: 18px; height: 18px; }
}

/* Rank display: two rows, no box/border - icon + tier name on top,
   level/xp underneath. Sits inline in the table like any other cell.
   Tier name and level/xp share the same mono font as the rest of the
   table (.pid, td.num, etc.) rather than a heavier display font. */

.rank-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rank-block-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rank-inline-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.rank-inline-tier {
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.rank-inline-meta {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  line-height: 1;
}

.level-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.level-lv {
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.2;
}

.level-xp {
  font-size: .96rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

/* Achievements cell: count / total on one line, small progress bar below -
   replaces the old bare "X / 128" text so partial progress reads at a glance. */

.ach-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  text-align: center;
}

.ach-count {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: .98rem;
  color: var(--text);
  line-height: 1;
}

.ach-count small {
  font-weight: 500;
  font-size: .78rem;
  color: var(--muted2);
  margin-left: 1px;
}

.ach-bar {
  display: block;
  width: 52px;
  height: 5px;
  border-radius: 2.5px;
  background: var(--surface2);
  overflow: hidden;
}

.ach-bar i {
  display: block;
  height: 100%;
  background: var(--green);
}

@media (max-width: 640px) {
  .rank-inline-icon { width: 22px; height: 22px; }
  .rank-inline-tier { font-size: .76rem; }
  .rank-inline-meta { font-size: .62rem; }
}

/* Platform ID cell: platform icon (links out where possible) + copyable ID.
   Icon is a link for platforms we can deep-link (Steam); a plain non-link
   glyph otherwise, so the column layout stays consistent either way. */

.platform-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.platform-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  color: var(--text);
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}

.platform-icon img,
.act-btn-mini img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
}

/* Text stand-in used if a hosted platform icon fails to load, and an inline SVG
   badge for platforms with no hosted icon at all - see assets/js/platform-id.js. */
.platform-badge-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font: 700 .6rem/1 var(--mono, monospace);
}
.platform-icon svg.platform-badge,
.act-btn-mini svg.platform-badge {
  display: block;
  width: 100%;
  height: 100%;
}

a.platform-icon.steam {
  border: 1px solid rgba(255,255,255,.14);
  background: var(--surface2);
}

a.platform-icon.steam:hover {
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
}

/* Non-Steam platforms (Epic/Windows today) show their real icon but can't
   deep-link anywhere yet - keep them visually quiet and non-interactive
   rather than styled like a clickable control. Still carries the same
   transparent 1px border as the Steam variant above so the icon box is the
   exact same size either way and every row's badge lines up in the same
   spot instead of the borderless ones sitting inset. */

span.platform-icon.not-clickable,
span.act-btn-mini.not-clickable {
  cursor: default;
  opacity: .75;
  border: 1px solid transparent;
}

span.platform-icon.not-clickable:hover,
span.act-btn-mini.not-clickable:hover {
  border-color: transparent;
  background: transparent;
  opacity: .75;
}

.platform-icon.platform-unknown {
  font-family: var(--mono);
  font-size: .7rem;
  border: 1px dashed rgba(255,255,255,.18);
}

/* =============================================================================
   LOADING / EMPTY / ERROR STATES
   Generic centered state box - reuse for any async content area.
   ============================================================================= */

@keyframes spin { to { transform: rotate(-360deg); } }

.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px;
  gap: 10px;
  flex: 1;
  min-height: min(60vh, 480px);
}

/* Accent-filled spinner: solid accent color masked to spinner_thumb.webp's
   shape, rather than a bordered ring. Using mask-image (not a plain <img>
   or background-image) so the glyph's fill tracks var(--accent) instead of
   being baked into the asset's own pixel colors - same trick as any other
   single-color icon that needs to follow the theme. */

.spinner {
  width: 20px;
  height: 20px;
  background-color: var(--accent);
  -webkit-mask-image: url('/assets/img/misc/spinner_thumb.webp');
          mask-image: url('/assets/img/misc/spinner_thumb.webp');
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  animation: spin .7s linear infinite;
}

.state-icon { font-size: 1.4rem; color: var(--muted2); }

.state-msg { font-family: var(--mono); font-size: .76rem; color: var(--muted); text-align: center; }

.state-err .state-msg { color: #e05555; }

/* error variant, add class="state-box state-err" */

/* =============================================================================
   FOOTER
   Loaded via src/_includes/partials/footer.njk into #footer-placeholder.
   ============================================================================= */

footer {
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--muted2);
    flex-shrink: 0;
}

footer a { color: var(--muted2); text-decoration: none; transition: color .15s; }

footer a:hover { color: var(--accent); }

/* ── Shared animations ───────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================================
   ACTION BUTTONS (e.g. "open Steam profile", "copy ID")
   Small icon buttons that appear inline with a row, revealed on hover by
   default; add .always to keep them visible without hovering.
   ============================================================================= */

.act-btns {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

tr:hover .act-btns { opacity: 1; pointer-events: auto; }

.act-btns.always { opacity: 1; pointer-events: auto; }

.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  width: 26px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.14);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, border-color .12s, background .12s;
  white-space: nowrap;
}

.act-btn:hover { color: var(--text); border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }

.act-btn.steam:hover { color: #a0b8cc; border-color: rgba(160,184,204,.35); background: rgba(160,184,204,.08); }

.act-btn.copy.copied { color: #6fcf97; border-color: rgba(111,207,151,.4); background: rgba(111,207,151,.1); }

/* =============================================================================
   RESPONSIVE
   Add page-specific breakpoints below this shared block, or in a page's own
   <style> if truly one-off - keep this file for rules shared across pages.
   ============================================================================= */

/* Below this width the nav items (Home / Matches / Profiles / Leaderboards ▾
   / Updates ▾ / About) no longer comfortably fit as a horizontal scroll
   strip, so it collapses into a hamburger-triggered drawer instead. */

@media (max-width: 780px) {
  /* .nav-links is positioned against .topbar-outer (already a positioned
     element via position:sticky), not .topbar itself, so the drawer sits
     flush against the viewport edges instead of inheriting .topbar's
     side padding. */
  .nav-hamburger { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 68px);
    background: rgba(15,16,20,.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0,0,0,.35);
    padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; height: 46px; padding: 0 12px; font-size: .96rem; }
  .nav-dropdown { position: static; width: 100%; }
  .nav-link-dd { width: 100%; justify-content: space-between; }
  .nav-dd-menu {
    display: none;
    position: static;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    background: rgba(255,255,255,.03);
    border: none;
    box-shadow: none;
    border-radius: 7px;
    padding: 3px;
    margin: 0 0 4px;
  }
  .nav-dropdown.open .nav-dd-menu { display: flex; }
  .nav-dd-item { padding: 11px 12px; border-radius: 6px; }
}

@media (max-width: 640px) {
  .page { padding: 18px 12px 40px; }
  .topbar { padding: 0 16px; height: 68px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 1.08rem; }
  th, td { padding: 9px 10px; }
  .list-av { width: 22px; height: 22px; }
}

/* =============================================================================
   MATCHES PAGE  (body[data-page="matches"])
   Page-specific rules only - resets, topbar/nav, .page, spinner, state-box,
   and fadeUp are already defined above and are reused as-is.
   ============================================================================= */

/* .page-title / .page-sub are already defined globally (used by leaderboards),
   but this page wants a bigger, bolder header - scope the override to this page
   only so leaderboards is untouched. */

body[data-page="matches"] .page-title {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -.4px;
  line-height: 1;
}

body[data-page="matches"] .page-sub {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Section label ── */

.section-label {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Views ── */

#view-detail { display: none; }

/* ── Breadcrumb ── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: .78rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--muted); text-decoration: none; cursor: pointer; }

.breadcrumb a:hover { color: var(--text); }

.breadcrumb .sep { opacity: .4; }

.breadcrumb .cur { color: var(--text); }

/* ════════════════════════════════
   LIVE CARDS
════════════════════════════════ */

@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.live-section { margin-bottom: 24px; }

.live-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.lmc {
  display: block;
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  min-height: 80px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s;
}

/* Border drawn as its own top layer instead of on .lmc itself. When the
   border lives on the same box that overflow:hidden clips the bg/overlay
   to, the border curve and the clip curve are computed a hair differently
   and the corner ends up looking unfilled. A pseudo-element with
   border-radius: inherit sitting above everything shares the exact same
   curve as the clip, so it always lines up. */

.lmc::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  border-radius: inherit;
  border: 1px solid rgba(111,207,151,.3);
  transition: border-color .15s;
  pointer-events: none;
}

.lmc:hover { transform: translateY(-2px); }

.lmc:hover::after { border-color: rgba(111,207,151,.6); }

.lmc-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: 170% auto; background-repeat: no-repeat; background-position: center;
  background-color: var(--bg);
  filter: brightness(.55) saturate(1);
}

.lmc-overlay {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(19,21,26,.65), rgba(19,21,26,.3));
}

.lmc-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; min-height: 108px; flex-wrap: wrap;
}

.lmc-server { font-weight: 800; font-size: 1.3rem; letter-spacing: -.3px; color: #fff; flex-shrink: 0; min-width: 300px; }

/* The stripe art fades to flat color at a fixed ~75% mark, purpose-built
   as a legible zone for the round/player block. The separator is pinned
   there (not placed via flex order) so it always lines up with that
   fade regardless of how long the server/mode/map text is. */

.lmc-vsep {
  position: absolute;
  left: 75%;
  top: 18px; bottom: 18px;
  width: 1px;
  background: rgba(255,255,255,.16);
}

.lmc-info {
  position: absolute;
  left: calc(75% + 20px);
  right: 100px;
  top: 18px; bottom: 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}

.lmc-mode {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem;
  color: rgba(255,255,255,.88); letter-spacing: -.1px;
}

.lmc-map { font-weight: 600; font-size: .92rem; color: rgba(255,255,255,.55); letter-spacing: -.1px; display: flex; align-items: center; gap: 5px; }

.lmc-night-icon { width: 20px; height: 20px; flex-shrink: 0; display: block; }

.lmc-meta { order: 4; display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; margin-left: auto; }

.lmc-round { font-family: 'Inter', sans-serif; font-weight:600; font-size:.92rem; letter-spacing:normal; color:rgba(255,255,255,.6); white-space:nowrap; }

.lmc-players { font-weight: 800; font-size: 1.6rem; letter-spacing: -.5px; color: #fff; white-space: nowrap; }

/* ════════════════════════════════
   CARD / TABLE  (matches variant - .lb-wrap/.table-scroll already exist for
   leaderboards; this page uses its own lighter-weight .card pattern which is
   reused across list + detail views, so it earns its own name)
════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
}

.card-hd {
  font-family: var(--mono); font-size: .63rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted2);
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.card-hd::after { content:''; flex:1; height:1px; background:var(--border); min-width:20px; }

.table-wrap { overflow-x: auto; }

.table-wrap table { width: 100%; border-collapse: collapse; font-size: .83rem; }

.table-wrap thead tr { background: var(--surface2); }

.table-wrap th {
  padding: 9px 10px; text-align: left;
  font-family: var(--mono); font-size: .6rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted2);
  border-bottom: 1px solid var(--border2); white-space: nowrap;
}

.table-wrap th.th-group-start { border-left: 1px solid var(--border); }

.table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--border2); vertical-align: middle; }

.table-wrap td.td-group-start { border-left: 1px solid var(--border); }

.table-wrap tr:last-child td { border-bottom: none; }

.table-wrap tr.clickable { cursor: pointer; }

.table-wrap tr.clickable:hover td { background: rgba(255,255,255,.025); }

.table-wrap td.num { font-family: var(--mono); font-weight: 500; font-size: .84rem; }

.th-group {
  background: rgba(255,255,255,.02);
  font-family: var(--mono); font-size: .56rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted2);
  padding: 5px 10px; text-align: center; border-bottom: 1px solid var(--border2);
}

.th-group.th-group-start { border-left: 1px solid var(--border); }

.map-cell { display: flex; align-items: center; gap: 12px; text-align: left; }

.map-thumb { width:46px; height:26px; border-radius:4px; object-fit:cover; flex-shrink:0; background:var(--surface2); border:1px solid var(--border2); display:block; }

.map-thumb-ph { width:46px; height:26px; border-radius:4px; flex-shrink:0; background:var(--surface2); border:1px solid var(--border2); }

.map-thumb-lg { width:56px; height:34px; border-radius:5px; }

.map-text { display: flex; flex-direction: column; gap: 1px; }

.map-text .sub { font-family: var(--mono); font-size: .63rem; color: var(--muted); }

.mode-cell { display: inline-flex; align-items: center; justify-content: center; }

/* Match-history table: map column is snapped left (thumbnail always at a
   fixed x, header left-aligned to match); mode/score/date/duration/state
   stay centered under their headers. */

.mh-history-table th:not(:first-child),
.mh-history-table td:not(:first-child) { text-align: center; }

.mh-history-table th:first-child,
.mh-history-table td:first-child { text-align: left; }

.mh-history-table td.num { text-align: center; }

.badge { display:inline-block; padding:2px 7px; border-radius:3px; font-family:var(--mono); font-size:.62rem; font-weight:500; letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; }

.badge-muted { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.num-zero { color: var(--muted2) !important; opacity: .5; }

.num-warn { color: var(--yellow) !important; }

.num-bad  { color: var(--red)    !important; }

/* ════════════════════════════════
   BROWSE BAR
════════════════════════════════ */

.browse-bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }

.browse-bar .input { max-width:200px; flex:1; min-width:140px; }

.input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 12px;
  color: var(--text); font-family: var(--mono); font-size: .82rem;
  outline: none; transition: border-color .15s;
}

.input:focus { border-color: var(--accent-border); }

.input::placeholder { color: var(--muted2); opacity: .6; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r); font-family: var(--mono);
  font-size: .78rem; cursor: pointer; transition: border-color .15s, color .15s; border: none; white-space: nowrap;
}

.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }

.btn-secondary:hover { border-color: rgba(255,255,255,.15); }

.browse-count { font-family: var(--mono); font-size: .7rem; color: var(--muted2); margin-left: auto; white-space: nowrap; }

/* ════════════════════════════════
   PAGINATION
════════════════════════════════ */

.pagination { display:flex; gap:6px; align-items:center; justify-content:center; padding:14px 0 0; }

.page-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 6px 12px; color: var(--muted); font-family: var(--mono); font-size: .72rem;
  cursor: pointer; transition: border-color .15s, color .15s;
}

.page-btn:hover:not(:disabled) { border-color: rgba(255,255,255,.15); color: var(--text); }

.page-btn:disabled { opacity: .3; cursor: not-allowed; }

.page-cur { padding: 6px 10px; font-family: var(--mono); font-size: .72rem; color: var(--muted2); }

/* ════════════════════════════════
   MATCH DETAIL HERO
════════════════════════════════ */

.mh-hero {
  position: relative; border-radius: var(--r); overflow: hidden;
  min-height: 200px; margin-bottom: 20px; border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center;
}

.mh-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: brightness(.22) saturate(.6);
}

.mh-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 28px;
  padding: 24px 32px; width: 100%; flex-wrap: wrap; justify-content: center;
}

.mh-mapimg-wrap {
  width: 107px; border-radius: 6px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}

.mh-mapimg-wrap img { width:100%; height:107px; object-fit:cover; display:block; }

.mh-mapimg-wrap .ph { width:100%; height:107px; display:flex; align-items:center; justify-content:center; color:var(--muted2); font-size:.72rem; }

/* Players / Rounds detail tables: every column's values centered under its
   header, Player/Winner/Reason (identity & prose columns) stay left. */

.mh-stat-table th,
.mh-stat-table td { text-align: center; }

.mh-stat-table th:first-child,
.mh-stat-table td:first-child { text-align: left; }

.mh-stat-table td.mh-text-cell { text-align: left; }

/* th.num/td.num (global, line ~331) forces text-align:right, which would
   otherwise fight this table's centered layout depending on source order.
   Pin every numeric cell here explicitly so K:A:D and friends always sit
   centered under their headers regardless of rule order elsewhere. */

.mh-stat-table th.num,
.mh-stat-table td.num { text-align: center; }

.mh-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }

.mh-map-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -.4px; color: var(--text); }

.mh-mode-line {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .04em; color: var(--muted);
}

.mh-meta { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: .72rem; color: var(--muted); }

.mh-score {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 14px 28px; flex-shrink: 0;
}

.mh-score-val { font-weight: 800; font-size: 2.2rem; letter-spacing: -.5px; line-height: 1; color: var(--text); font-family: var(--mono); }

.mh-score-lbl { font-family: var(--mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted2); margin-top: 4px; }

/* ── Detail tabs ── */

.mh-tabs { display: flex; border-bottom: 1px solid var(--border2); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }

.mh-tabs::-webkit-scrollbar { display: none; height: 0; }

.mh-tab {
  padding: 0 16px; height: 40px; background: none; border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s; margin-bottom: -1px;
}

.mh-tab:hover { color: var(--text); }

.mh-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.mh-tabcontent { display: none; }

.mh-tabcontent.active { display: block; }

/* ── Round pips ── */

.round-pip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.round-pip {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .78rem;
  flex-shrink: 0; border: 1px solid var(--border);
}

.round-pip.t1   { background: rgba(74,158,255,.15); color: var(--blue); border-color: rgba(74,158,255,.3); }

.round-pip.t2   { background: rgba(224,85,85,.15);  color: var(--red);  border-color: rgba(224,85,85,.3); }

.round-pip.draw { background: var(--surface2); color: var(--muted); }

/* ── Player link (distinct from .player-name used in leaderboards' hover-card) ── */

.player-link { color: var(--text); text-decoration: none; }

.player-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Session lines ──
   One "start > end" pair per session, stacked vertically in a single
   Session column. A player present the whole match gets one line; a player
   who reconnected gets one line per session, so each gap reads as its own
   self-contained pair rather than two ambiguous "start" labels split across
   separate Join/Leave columns. */

.session-stack { display: flex; flex-direction: column; gap: 3px; align-items: center; }

.session-line {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: var(--mono); font-size: .72rem; white-space: nowrap;
}

.session-line-main { display: inline-flex; align-items: baseline; gap: 6px; }

.sc-join { font-weight: 600; color: var(--green); }

.sc-leave { font-weight: 600; color: var(--red); }

.sc-arrow { color: var(--muted2); font-weight: 400; }

.sc-dur { display: block; color: var(--muted2); font-weight: 400; font-size: .82em; }

.sc-dur .sc-dur-lbl { text-transform: uppercase; letter-spacing: .04em; font-size: .92em; margin-right: 3px; }

.reconnect-note {
  font-family: var(--mono); font-size: .58rem; color: var(--muted2);
  letter-spacing: .04em; text-transform: uppercase; margin-top: 2px;
}

/* ── Legend ── */

/* accent colors used only on this page */

:root {
  --blue:   #4a9eff;
  --red:    #e05555;
  --yellow: #f2c94c;
}

@media (max-width: 640px) {
  .live-cards-grid { grid-template-columns: 1fr; }

  /* The desktop .lmc layout pins .lmc-vsep/.lmc-info at "75% across" and
     .lmc-info's right edge 100px from the card edge - both assume a card
     that's at least ~360px wide. Below that, those fixed/percentage
     offsets crush the map/mode text into a sliver and can even force
     .lmc-players off the visible card. Mobile drops the absolute
     positioning entirely and stacks everything as a normal flex column
     instead. */
  .lmc-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    min-height: 0;
  }
  .lmc-server { min-width: 0; font-size: 1.1rem; }
  .lmc-vsep { display: none; }
  .lmc-info {
    position: static;
    left: auto; right: auto; top: auto; bottom: auto;
    width: 100%;
  }
  .lmc-meta {
    order: 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-left: 0;
    width: 100%;
  }
  .lmc-players { font-size: 1.15rem; }
  .lmc-round { font-size: .8rem; }

  .mh-content { padding: 16px; gap: 16px; }
  .mh-replay-row { padding: 0 16px 16px; }
  .mh-mapimg-wrap { width: 90px; }
  .mh-mapimg-wrap img { height: 68px; }
  .mh-mapimg-wrap .ph { height: 68px; }

  /* ── Match history table (index.html) ──
     .table-wrap already scrolls horizontally, but at phone widths that
     forces every visitor to swipe just to see the Date/Duration/State
     columns. Trim the least essential columns (Duration, State) out of
     the flow and shrink what's left, so the map/mode/score/date — the
     part people actually glance at — fits without scrolling on a common
     ~375–414px phone screen. */
  .mh-history-table th:nth-child(5), .mh-history-table td:nth-child(5), /* Duration */
  .mh-history-table th:nth-child(6), .mh-history-table td:nth-child(6) { /* State */
    display: none;
  }
  .table-wrap table { font-size: .76rem; }
  .table-wrap th, .table-wrap td { padding: 7px 6px; }
  .map-thumb.map-thumb-lg { width: 44px; height: 28px; }
  .map-text .sub, .mutator-chip { font-size: .56rem; }
  .mh-search-form { padding: 10px 12px !important; }
}

/* =============================================================================
   LIVE MATCH PAGE  (body[data-page="live"])
   Reuses .breadcrumb, .state-box, .spinner, .state-icon, .state-msg,
   .state-err, and the dotPulse/fadeUp/spin keyframes already defined above.
   ============================================================================= */

/* This page wants a slightly wider, tighter-padded .page than the matches
   list page - scoped so it doesn't affect index.html, which shares the
   generic .page rule. */

body[data-page="live"] .page {
    max-width: 1320px;
    padding: 12px 28px 8px;
    display: flex; flex-direction: column;
}

/* ── Topbar live indicator ── */

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

/* Colors sampled directly from server_online.png / server_offline.png
   (the check-circle / x-circle badges baked into the status thumbs), so the
   ring and offline label match the artwork exactly instead of the site's
   generic --green/--red accents. */

.live-chip {
  display: inline-flex; align-items: center;
}

/* Fixed-size wrapper keeps the ring+thumb from nudging the topbar layout
   on every countdown tick - only the ring's dash-offset animates. */

.chip-img-wrap {
  position: relative;
  width: 34px; height: 34px;
  flex-shrink: 0;
}

.live-chip-dot {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px; object-fit: contain;
}

.chip-ring {
  position: absolute; inset: 0;
  width: 34px; height: 34px;
  transform: rotate(-90deg); /* start the fill at 12 o'clock, sweep clockwise */
}

.chip-ring-bg {
  fill: none;
  stroke: rgba(75,171,80,.18);
  stroke-width: 2.5;
}

.chip-ring-progress {
  fill: none;
  stroke: #4bab50; /* server_online.png check-circle green */
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 100.53; /* 2 * PI * r(16) */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.offline-chip {
  display: inline-flex; align-items: center; gap: 8px;
  color: #c94242; /* server_offline.png x-circle red */
  font-family: var(--mono); font-size: .64rem;
  letter-spacing: .12em; text-transform: uppercase;
}

.offline-chip-dot {
  width: 22px; height: 22px; object-fit: contain;
}

/* ══════════════════════════════
   MATCH HERO
══════════════════════════════ */

.match-hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 0;
  background: var(--surface);
  display: flex; flex-direction: column;
  flex: 1;
  margin-bottom: 12px;
  min-height: 0; /* flex-fills .page instead of guessing viewport math */
}

.match-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: brightness(.22) saturate(.7) blur(4px);
  transform: scale(1.05);
  pointer-events: none;
}

/* ── Hero top bar ── */

.hero-topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 20px; background: #000;
  border-bottom: 1px solid rgba(255,255,255,.07);
  gap: 12px; flex-wrap: wrap; min-height: 46px;
}

.ht-left {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: .78rem; color: #fff;
}

.ht-left #ht-left-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.ht-back {
  display: inline-flex; align-items: center; flex-shrink: 0;
  color: rgba(255,255,255,.4); text-decoration: none;
  transition: color .15s ease, transform .15s ease;
}

.ht-back svg { width: 15px; height: 15px; display: block; }

.ht-back:hover { color: #fff; transform: translateX(-2px); }

.ht-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 120px; text-align: center; }

.ht-center .map-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: #fff; line-height: 1.1; }

.ht-center .map-mode { font-family: 'Inter', sans-serif; font-size: .72rem; font-weight: 500; color: #fff; letter-spacing: .04em; margin-top: 2px; }

.ht-right {
  flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  text-align: right; font-family: var(--mono); font-size: .7rem; color: var(--muted2); white-space: nowrap;
}

/* ── Match ID chip (click-to-copy) sitting under the server/map info on
   the right of the hero topbar ── */

.match-id-wrap { display: inline-flex; align-items: center; gap: 6px; }

.match-id-chip {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: .81rem; color: #fff;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 3px 8px;
  transition: background .15s ease, color .15s ease;
  user-select: none;
}

.match-id-chip:hover { background: rgba(255,255,255,.08); color: #e6e8ea; }

.match-id-chip.copied { color: #4ade80; border-color: #4ade8055; }

.match-id-chip.no-id { cursor: default; color: rgba(255,255,255,.35); }

.match-id-chip.no-id:hover { background: rgba(255,255,255,.04); color: rgba(255,255,255,.35); }

.match-id-chip svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Hero body: 4-column grid ── */

.hero-body {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  grid-template-rows: 1fr;
  flex: 1;
  min-height: 0;
}

/* ── Team panels ── */

.team-panel { display: flex; flex-direction: column; background: rgba(0,0,0,.55); height: 100%; min-height: 0; }

.team-panel.insurgents { border-right: 1px solid var(--border); }

.team-panel.security   { border-left: 1px solid var(--border); }

.team-panel .team-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 14px 18px; flex-shrink: 0;
  position: relative; overflow: hidden; background: transparent; min-height: 80px;
}

.team-panel .team-header::before {
  content: ''; position: absolute; inset: 0;
  background: url('/assets/img/misc/scoreboard_stripe.webp') center/cover no-repeat;
  opacity: .04; pointer-events: none;
}

.team-panel .team-header::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.85) 0%, rgba(0,0,0,.85) 45%, rgba(0,0,0,.15) 100%);
  pointer-events: none;
}

.team-panel.insurgents .team-header { border-top: 4px solid #ff5050; }

.team-panel.security   .team-header { border-top: 4px solid #4a8cff; }

.team-left { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }

.team-icon { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }

.team-label { display: flex; flex-direction: column; }

.team-name  { font-weight: 800; font-size: 1.65rem; letter-spacing: -.5px; line-height: 1.1; color: #fff; }

.team-role  { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.65); font-weight: 500; }

.team-wins { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }

.team-wins-val {
  font-weight: 400; font-size: 2.9rem; letter-spacing: -1px; line-height: 1; color: #fff;
  margin-top: 4px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), color .3s;
}

.team-wins-val.bumped { transform: scale(1.35); color: var(--green); }

.team-wins-lbl { font-family: 'Inter', sans-serif; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.45); margin-bottom: 1px; }

/* ── Player list ── */

.team-players-wrap { flex: 1; overflow-y: auto; padding: 0 0 4px; display: flex; flex-direction: column; }

.team-players-wrap::-webkit-scrollbar { width: 3px; }

.team-players-wrap::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.team-players-header {
  display: grid; grid-template-columns: 1fr 60px 40px 40px 70px;
  padding: 9px 10px 9px 12px;
  font-family: 'Inter', sans-serif; font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em;
  color: #fff; background: #000;
  border-top: 1px solid #e63946; border-bottom: 1px solid #e63946;
}

.team-player-row {
  display: grid; grid-template-columns: 1fr 60px 40px 40px 70px;
  padding: 5px 10px 5px 12px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .1s; font-size: .88rem;
}

.team-player-row:last-child { border-bottom: none; }

.team-player-row:hover { background: rgba(255,255,255,.04); }

@keyframes statFlash { 0%{color:var(--accent)} 100%{color:var(--text)} }

.team-player-row.stat-changed .tp-stat,
.team-player-row.stat-changed .tp-kda { animation: statFlash .8s ease forwards; }

.tp-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }

.tp-name-col { display: flex; flex-direction: column; min-width: 0; gap: 1px; }

.tp-name-col span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.tp-name-link { color: inherit; text-decoration: none; display: block; }

.tp-name-link:hover { color: var(--accent); }

.tp-av {
  width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--surface2); border: 1px solid rgba(255,255,255,.1); display: block;
}

.tp-stat { font-family: var(--mono); font-weight: 500; font-size: .78rem; text-align: center; color: var(--text); }

.tp-kda  { font-family: var(--mono); font-size: .64rem; color: rgba(255,255,255,.45); text-align: center; letter-spacing: -.2px; }

.tp-kda b { color: var(--text); font-weight: 500; }

.team-empty-row { padding: 18px 14px; font-size: .75rem; color: var(--muted); text-align: center; opacity: .5; flex: 1; display: flex; align-items: center; justify-content: center; }

.team-players-body { flex: 1; display: flex; flex-direction: column; }

/* ── Center column ── */

.hero-center {
  display: flex; flex-direction: column; align-items: stretch;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  height: 100%; min-height: 0;
}

.hero-state-block {
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(180deg, rgba(232,103,58,.14), rgba(232,103,58,.02) 70%);
  border-bottom: 1px solid rgba(232,103,58,.2);
  box-shadow: inset 0 -1px 0 rgba(232,103,58,.15), inset 0 1px 0 rgba(255,255,255,.03);
  padding: 10px 12px; text-align: center;
  min-height: 58px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.hero-state-name {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .18em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 7px;
  text-shadow: 0 0 12px rgba(232,103,58,.35);
}

.hero-state-name::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 1px rgba(232,103,58,.7);
  animation: dotPulse 1.4s ease infinite;
  flex-shrink: 0;
}

.hero-match-timer {
  font-family: var(--mono); font-size: .58rem; color: rgba(232,103,58,.55);
  letter-spacing: .1em; margin-top: 3px;
}

.hero-center-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: 10px 10px 8px; gap: 2px; overflow-y: auto;
}

.hero-round {
  font-weight: 400; font-size: 3.7rem; letter-spacing: -1.5px; line-height: 1;
  color: var(--text); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  margin-top: 6px;
}

.hero-round.bumped { transform: scale(1.18); }

.hero-round-label {
  font-family: 'Inter', sans-serif; font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .15em; color: rgba(255,255,255,.3); margin-top: 10px;
}

.hero-round-timer {
  font-family: var(--mono); font-size: .88rem; font-weight: 500;
  color: rgba(255,255,255,.4); letter-spacing: .05em; margin-top: 4px;
  transition: color .3s;
}

.hero-round-timer.active { color: var(--green); }

.hero-round-timer.hidden { opacity: 0; }

.hero-mode-img-wrap {
  width: 100%; margin-top: 28px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}

.hero-mode-img-wrap img { display: block; width: 100%; height: auto; object-fit: cover; object-position: center; }

.hero-mode-img-wrap .ph {
  padding: 12px 10px; display: flex; align-items: center; justify-content: center;
  color: var(--muted2); font-size: .68rem; background: var(--surface2); border-radius: 8px;
}

/* ── Short gamemode description under the mode illustration ── */

.hero-mode-desc {
  width: 100%; padding: 10px 18px 0;
  font-family: 'Inter', sans-serif; font-size: .68rem; font-weight: 400; color: rgba(255,255,255,.45);
  text-align: left; line-height: 1.6; flex-shrink: 0;
}

.mode-desc-item { display: flex; align-items: flex-start; }

.mode-desc-item + .mode-desc-item { margin-top: 10px; }

.mode-desc-bullet { flex: 0 0 auto; width: 14px; }

.mode-desc-text { flex: 1 1 auto; min-width: 0; }

/* ── Platform column: just the platform icon, pushed to the far right of
   its column. The platform ID itself now renders as a second line under
   the player name (see .tp-name-col / .tp-pid-copy). ── */

.tp-platform { display: flex; align-items: center; justify-content: center; min-width: 0; transform: translateX(-14px); }

.tp-pid-copy {
  font-family: var(--mono); font-size: .62rem; color: var(--muted2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; cursor: pointer; transition: color .12s, background .12s;
  /* Same gray pill treatment as .pid-mini in the profiles search list — keep
     the platform ID visually consistent everywhere it's shown. */
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  padding: 1px 6px;
  width: max-content;
}

.tp-pid-copy:hover { color: var(--text); background: rgba(255,255,255,.07); }

.tp-pid-copy.copied { color: #4ade80; }

.hero-spec-mini {
  width: 100%; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}

.spec-mini-hd {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: .58rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; justify-content: center;
}

.spec-mini-hd img { width: 13px; height: 13px; border-radius: 3px; object-fit: cover; }

.spec-row {
  display: flex; align-items: center; gap: 6px; padding: 2px 6px;
  border-radius: 4px; font-size: .68rem; color: var(--muted); justify-content: center;
}

/* ── No live / error states (page-specific empty state, distinct from the
   generic .state-box which is reused above for loading/error) ── */

.no-live-box {
  border: 1px dashed var(--border); border-radius: var(--r);
  padding: 48px 20px; text-align: center;
}

.no-live-icon { font-size: 2rem; color: var(--muted2); margin-bottom: 10px; }

.no-live-msg  { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-bottom: 4px; }

.no-live-sub  { font-family: var(--mono); font-size: .7rem; color: var(--muted2); }

.back-link    { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: .74rem; color: var(--accent); text-decoration: none; }

.back-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  body[data-page="live"] .page { padding: 16px 12px 40px; }
  .hero-body { grid-template-columns: 1fr; }
  .team-panel.insurgents { border-right: none; border-bottom: 1px solid var(--border); }
  .team-panel.security   { border-left: none; border-top: 1px solid var(--border); }
  .hero-center { border-left: none; border-right: none; order: -1; } /* score/round block first, teams below */
  .hero-topbar { padding: 8px 14px; flex-wrap: wrap; }
  .ht-left, .ht-right { flex: 1 1 auto; min-width: 0; }
  .ht-center { flex: 1 1 100%; order: 3; }
  .hero-round  { font-size: 1.8rem; }

  /* Team header: smaller icon/name so it doesn't crowd a narrow viewport */
  .team-panel .team-header { padding: 10px 14px; min-height: 60px; }
  .team-icon { width: 28px; height: 28px; }
  .team-name { font-size: 1.2rem; }
  .team-role { font-size: .68rem; }
  .team-wins-val { font-size: 2rem; }
  .team-wins-lbl { font-size: .64rem; }

  /* Roster grid: the JS emits an inline grid-template-columns on both the
     header row and each player row (see playerRowHtml/playerHeadersHtml in
     live.html) — those inline styles win over a plain class rule, so this
     override needs !important to actually take effect on mobile. Score/OBJ/
     K:A:D columns shrink, and the platform id text (already truncated to 26
     chars server-side) is hidden here since even truncated it doesn't fit
     next to a real name column at this width — the platform icon (still
     inside .tp-platform) stays visible. */
  .team-players-header,
  .team-player-row {
    grid-template-columns: 1fr 26px 34px 34px 56px !important;
    gap: 4px !important;
    padding: 6px 6px 6px 8px !important;
  }
  .team-players-header { padding-top: 8px !important; padding-bottom: 8px !important; }
  .tp-av { width: 24px; height: 24px; }
  .tp-name-col span { font-size: .78rem; }
  .tp-pid-copy { display: none; }
  .tp-platform { transform: none; justify-content: center; }
  .team-players-header > span:nth-child(2) { transform: none; font-size: .58rem; }
  .tp-stat { font-size: .72rem; }
  .tp-kda { font-size: .58rem; }

  /* Mode illustration / description column shrinks along with the rest of
     the center column once it's no longer squeezed between two side rails */
  .hero-mode-img-wrap { max-width: 160px; }
  .hero-mode-desc { font-size: .64rem; padding: 8px 14px 0; }
}

@media (max-width: 420px) {
  /* At the very narrowest widths, drop the OBJ column too rather than
     crushing K:A:D and score into illegible slivers. */
  .team-players-header,
  .team-player-row {
    grid-template-columns: 1fr 34px 56px !important;
  }
  .team-players-header > span:nth-child(3),
  .team-player-row > .tp-stat[data-f="captures"] { display: none; }
  .team-name { font-size: 1.05rem; }
  .team-wins-val { font-size: 1.7rem; }
}

/* ── Search ──
   One seamless pill: icon, input, and button share a single rounded
   boundary with no internal seam - the button is visually just the
   "hot end" of the same field, not a separate control bolted on. */

.search-wrap {
  display: flex; align-items: stretch; gap: 0; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
  transition: border-color .15s, box-shadow .15s;
  height: 46px;
}

.search-wrap:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-icon {
  flex-shrink: 0;
  align-self: center;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 18px; color: var(--muted2);
  transition: color .15s;
}

.search-icon svg { display: block; width: 100%; height: 100%; }

.search-wrap:focus-within .search-icon { color: var(--accent); }

.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  -webkit-appearance: none; appearance: none;
  padding: 0 14px 0 10px; margin: 0;
  height: 100%;
  font-family: 'Inter', sans-serif; font-size: .84rem; font-weight: 400; line-height: normal;
  color: var(--text);
  letter-spacing: normal;
}

.search-input::placeholder { color: var(--muted2); }

.search-btn {
  padding: 0 26px; margin: 0; background: var(--accent); border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: .8rem; line-height: normal;
  color: #06171c; transition: background .15s; flex-shrink: 0; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}

.search-btn:hover { background: #9ce3ef; }

/* Match-history filter bar: same seamless pill as the profiles search, but
   with two stacked text fields (map + gamemode) separated by a hairline
   instead of one. */

.mh-search-form { margin-bottom: 6px; }

.mh-search-wrap { margin-bottom: 0; }

.mh-search-sep { flex-shrink: 0; width: 1px; align-self: stretch; margin: 8px 0; background: var(--border2); }

.mh-search-wrap .search-input { flex: 1; min-width: 0; }

.pid {
  font-family: var(--mono); font-size: .78rem; color: var(--text);
}

/* ── Results panel polish ──
   The plain bordered box read as flat, so this gives it an accent top edge,
   a subtle lift off the page, and a bit more texture in the rows. Scoped to
   .results-panel (search page only) so it can't affect other .lb-wrap uses. */

.results-panel {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  position: relative;
}

.results-panel thead tr { background: transparent; }

.results-panel th { border-bottom: 1px solid var(--border); padding-top: 10px; padding-bottom: 10px; }

.results-panel td { padding-top: 14px; padding-bottom: 14px; }

.results-panel .player-cell { gap: 12px; }

.results-panel .player-id-block { gap: 6px; min-height: 44px; justify-content: flex-start; padding-top: 1px; }

.results-panel .player-name { font-size: .92rem; line-height: 1.2; margin-top: 0; display: inline-block; }

.results-panel .player-sub { line-height: 1; }

.results-panel tr:hover td { background: rgba(255,204,0,.05); }

/* Avatar gets a subtle ring instead of sitting flat against the row bg */

.results-panel .list-av {
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 0 3px rgba(0,0,0,.15);
  width: 44px;
  height: 44px;
}

/* Matches/Level/Achievements as soft chips instead of bare table cells,
   matching Rank - the whole row reads as grouped stat pills, not ruled
   spreadsheet columns. */

/* Secondary line under a state message (e.g. "Try a different name or ID").
   Used in the markup but was never actually styled before - without this it
   rendered as plain unstyled inline text. */

.state-sub {
  font-family: var(--mono); font-size: .68rem; color: var(--muted2); text-align: center;
}

/* The generic .state-err rule only reddens the message text; give the icon
   the same treatment for a consistent error state. */

.state-err .state-icon { color: #e05555; }

.page-info { font-family: var(--mono); font-size: .68rem; color: var(--muted2); padding: 0 6px; }

.pid-copy {
  font-family: var(--mono); font-size: .74rem; color: var(--muted); cursor: pointer; transition: color .12s, background .12s;
  /* Same gray pill treatment as .pid-mini in the profiles search list — keep
     the platform ID visually consistent everywhere it's shown. */
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  padding: 1px 6px;
}

.pid-copy:hover { color: var(--text); background: rgba(255,255,255,.07); }

.profile-meta-row .platform-icon { width: 32px; height: 32px; padding: 4px; border: none; background: none; border-radius: 0; margin-left: 4px; }

.profile-meta-row a.platform-icon.steam,
.profile-meta-row a.platform-icon.steam:hover { border: none; background: none; }

.profile-streak-row:empty { display: none; }

.profile-streak-row { margin-top: 5px; }

.streak-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .74rem; color: var(--muted); }

.streak-chip svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); }

.streak-chip b { color: var(--text); font-weight: 600; }

body[data-page="profiles"] .stat-card-val,
.level-box-num { font-family: 'Inter', sans-serif; font-weight: 800; }

.level-box {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 4px 0 4px 20px; border: none; border-left: 1px solid var(--border2); border-radius: 0;
  background: transparent; min-width: 0;
}

.level-box-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.level-box-num { font-size: 1.05rem; line-height: 1; color: var(--text); letter-spacing: -.02em; }

.level-box-pct { font-family: 'Inter', sans-serif; font-size: .72rem; font-weight: 600; color: var(--text); letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }

.level-box-pct .pct-num { color: var(--muted); font-weight: 500; }

.level-box-track { height: 3px; background: rgba(255,255,255,.07); border-radius: 2px; }

.level-box-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .5s ease; }

.level-box-next { display: none; }

.level-box-rank { display: flex; align-items: center; gap: 7px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border2); }

.level-box-rank img { width: 22px; height: 22px; object-fit: contain; display: block; flex-shrink: 0; }

.level-box-rank-name { font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: -.01em; text-transform: uppercase; }

/* Full-screen loader shown before the profile shell is revealed - distinct
   from the shared inline .state-box (which is used for per-tab loading). */

#loading-screen {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}

#loading-screen .spinner { width: 24px; height: 24px; }

#loading-screen .msg { font-size: .74rem; color: var(--muted); font-family: var(--mono); }

@keyframes rankPulse { 0%,100% { background: rgba(255,204,0,.16); } 50% { background: rgba(255,204,0,.05); } }

/* ============================================================================
    REPLAYS DOWNLOAD BUTTON
   ============================================================================= */

.mh-replay-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 32px 20px;
}

.btn-disabled-muted {
  opacity: .5;
  cursor: default;
}

.team-panel .team-header{
  position: relative;
  padding-left: 100px; /* room for the icon watermark */
}

.team-icon-lg{
  position: absolute !important;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 74px !important;
  height: 74px !important;
  object-fit: contain;
  z-index: 2; /* above ::before/::after overlays */
  flex-shrink: 0;
}

.team-left{
  padding-left: 0;
}


/* =============================================================================
   ACCESSIBILITY
   Skip link, keyboard focus ring, reduced-motion.
   ============================================================================= */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--accent); color: #000; font-weight: 700; font-size: .85rem;
  padding: 10px 16px; border-radius: var(--r); text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
:where([role="link"], [role="button"]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; } /* keep the loader visibly alive */
}
