/* HlyupLadder v4.7 — TEAM HLYUPIKI Brand Design System (#090711 / #141022 / #8012CC) */
:root {
  color-scheme: dark;

  /* Core Palette: Matched verbatim to faceit_bot/render.py */
  --bg: #090711;
  --bg-grad-top: #140B26;
  --surface-1: #141022;
  --surface-2: #181329;
  --surface-3: #1E1535;
  --header-bg: #110D1D;
  --surface: var(--surface-1);
  --bg-2: var(--surface-3);

  --border: #2B2246;
  --border-hi: #4C3380;

  --text: #F6F5FA;
  --text-dim: #C9C2DC;
  --muted: #9B93B4;
  --text-muted: var(--muted);

  /* Strict Brand Accent */
  --accent: #8012CC;
  --accent-hover: #962BE0;
  --accent-active: #6B0FA8;
  --accent-ink: #C084FC;
  --accent-soft: rgba(128, 18, 204, 0.22);
  --accent-border: #6B21A8;

  /* Token aliases kept for view compatibility */
  --purple: var(--accent);
  --purple-hi: var(--accent-hover);
  --purple-glow: var(--accent-ink);

  /* Functional Semantics Only (always paired with text or symbol) */
  --green: #34D399;
  --red: #FB7185;
  --gold: #F5C451;
  --ct: #5B9BF8;
  --t: #E6A13C;

  /* Spacing & Radii (4/8px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Safe-area Insets & Dynamic Virtual Viewport Height */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --vvh: 100dvh;

  /* Unified z-index scale */
  --z-sticky-col: 2;
  --z-sticky-th: 3;
  --z-overlay-ctrl: 10;
  --z-topbar: 40;
  --z-nav: 50;
  --z-render-bar: 65;
  --z-modal: 80;
  --z-toast: 95;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Consolas, monospace;

  /* Motion */
  --t-fast: 120ms;
  --t-base: 170ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg) 320px),
    radial-gradient(ellipse 75% 280px at 85% -40px, rgba(168, 85, 247, 0.14) 0%, rgba(128, 18, 204, 0) 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  font-variant-numeric: tabular-nums;
  scrollbar-color: rgba(192, 132, 252, 0.34) transparent;
  scrollbar-width: thin;
}

.modal-body, .table-wrap, .subtabs, .map-strip {
  scrollbar-color: rgba(192, 132, 252, 0.34) transparent;
  scrollbar-width: thin;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: #FFFFFF; text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

[role="button"][tabindex="0"] {
  cursor: pointer;
}

.img-fallback {
  background: var(--surface-2);
  opacity: 0.92;
}

.hidden { display: none !important; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.neu { color: var(--muted); }

/* Monochrome Inline SVG Icons */
.ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.18em;
}
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }
.nav-svg { width: 18px; height: 18px; display: block; }

/* App Shell */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-shell-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  min-height: calc(54px + var(--safe-top));
  padding: var(--safe-top) calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  background: rgba(17, 13, 29, 0.94);
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 4px 0;
  color: inherit;
  text-align: left;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-text { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.brand-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-title span { color: var(--accent-ink); }
.brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.layout-body {
  display: flex;
  flex: 1;
  min-width: 0;
}

.sidenav {
  width: 212px;
  flex-shrink: 0;
  background: var(--header-bg);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(54px + var(--safe-top));
  height: calc(100dvh - 54px - var(--safe-top));
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-border);
}
.nav-item.active .nav-ic { color: var(--accent-ink); }
.nav-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.viewport {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  padding: 18px calc(24px + var(--safe-right)) calc(52px + var(--safe-bottom)) calc(24px + var(--safe-left));
}

/* Section Headers & Branded Banners */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.section-head-main { min-width: 0; flex: 1 1 240px; }
.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text);
}
.section-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.section-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background:
    linear-gradient(125deg, rgba(128, 18, 204, 0.26) 0%, #1D1536 56%, #18112D 100%);
  padding: 14px 16px;
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.hero-banner h1 { margin: 0 0 4px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hero-banner p { margin: 0; color: var(--text-dim); font-size: 12.5px; overflow-wrap: anywhere; }

/* Cards & Surfaces */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--sp-3);
  min-width: 0;
}

.card-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Progress Track */
.progress-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 260ms var(--ease);
}

/* Grids & Compact Metrics */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.kpi {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 0;
}
.kpi-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1.2;
}
.kpi-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.3); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary, .replay-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled), .replay-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #FCA5A5;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(239, 68, 68, 0.65);
}

.btn-steam {
  background: var(--surface-2);
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-steam:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--surface-3);
}

.btn-lg { padding: 11px 18px; min-height: 46px; font-size: 14px; font-weight: 700; }
.btn-sm { padding: 6px 11px; min-height: 34px; font-size: 12.5px; }
.btn-xs { padding: 5px 9px; min-height: 28px; font-size: 11.5px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

.input, .select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 6px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
}
textarea.input { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
select.select { cursor: pointer; }

/* Prevent full-width stretching of filter selects on desktop */
.filters-bar > .select,
.more-filters-panel > .select,
.hero-banner > .select {
  width: auto;
  min-width: 155px;
  max-width: 260px;
  flex: 0 1 auto;
}

/* Pills & Tags (Neutral/Brand by default, semantic only with meaning + text) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.pill-neutral { background: var(--surface-2); border-color: var(--border-hi); color: var(--text-dim); }
.pill-purple, .pill-major { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-ink); }
.pill-amber { background: var(--surface-3); border-color: var(--border-hi); color: var(--text); }
.pill-green { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.36); color: #86EFAC; }
.pill-red { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.36); color: #FCA5A5; }
.pill-ct { background: rgba(91, 155, 248, 0.14); border-color: rgba(91, 155, 248, 0.36); color: #93C5FD; }
.pill-t { background: rgba(230, 161, 60, 0.14); border-color: rgba(230, 161, 60, 0.36); color: #FCD34D; }
.pill-smoke { background: rgba(156, 163, 175, 0.16); border-color: rgba(156, 163, 175, 0.35); color: #E5E7EB; }
.pill-molotov { background: rgba(249, 115, 22, 0.15); border-color: rgba(249, 115, 22, 0.36); color: #FDBA74; }
.pill-flashbang { background: rgba(250, 204, 21, 0.14); border-color: rgba(250, 204, 21, 0.36); color: #FDE047; }
.pill-hegrenade { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.36); color: #FCA5A5; }
.pill-decoy { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); color: #7DD3FC; }

/* Sub-tabs with Visible Overflow Indicator + Auto-Scroll */
.subtabs-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.subtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  scroll-behavior: smooth;
  padding: 2px;
}
.subtabs::-webkit-scrollbar { display: none; }

.subtabs-scroll-btn {
  display: none;
  width: 30px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.subtabs-shell.can-left .subtabs-scroll-btn[data-dir="left"],
.subtabs-shell.can-right .subtabs-scroll-btn[data-dir="right"] {
  display: inline-flex;
}

.subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.subtab:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-hi); }
.subtab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.filter-chip:hover { border-color: var(--border-hi); color: var(--text); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Empty & Error States */
.empty-state {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-title { font-size: 15px; font-weight: 800; color: var(--text); }
.empty-state-desc { font-size: 13px; color: var(--text-dim); max-width: 460px; margin: 0; }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.inline-error-box {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Home — Broadcast Esports Stage & Team Results */
.home-broadcast-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(360px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.home-match-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hi);
  background: var(--surface-1);
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-match-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 45%;
  pointer-events: none;
  z-index: 0;
}

.home-match-hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(9, 7, 17, 0.90) 0%, rgba(9, 7, 17, 0.72) 34%, rgba(9, 7, 17, 0.24) 68%, rgba(9, 7, 17, 0.08) 100%),
    linear-gradient(180deg, rgba(9, 7, 17, 0.04) 0%, rgba(9, 7, 17, 0.18) 52%, rgba(9, 7, 17, 0.88) 100%);
}

.home-match-hero-body {
  position: relative;
  z-index: 2;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.home-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.home-hero-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(9, 7, 17, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.home-hero-center {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: auto;
}

.home-hero-title-group { min-width: 0; }
.home-hero-map {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--text);
}

.home-hero-sub {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.home-hero-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: clamp(36px, 3.8vw, 56px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 2px 16px rgba(9, 7, 17, 0.85);
}

.home-hero-score .sep { color: var(--accent-ink); font-weight: 700; }
.home-hero-score--compact { font-size: clamp(28px, 3vw, 40px); }

.home-hero-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-hero-player {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(17, 13, 29, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.home-hero-player .avatar { width: 28px; height: 28px; }
.home-hero-pnick { font-weight: 700; color: var(--text); }
.home-hero-pstat { color: var(--text-dim); font-weight: 600; }
.home-hero-pmmr { color: var(--accent-ink); font-weight: 700; font-family: var(--mono); font-size: 11.5px; }

.home-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-hero-cta {
  min-height: 44px;
  padding-inline: 18px;
  font-weight: 800;
}

.home-hero-sec {
  min-height: 44px;
  background: rgba(17, 13, 29, 0.84);
  border-color: rgba(255, 255, 255, 0.14);
}
.home-hero-sec:hover {
  background: rgba(34, 24, 58, 0.96);
}

.home-game-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.game-entry {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
  min-height: 170px;
  display: flex;
  flex-direction: column;
}

.game-entry--cs2 {
  background: linear-gradient(125deg, #130F21 0%, #1B1330 100%);
}
.game-entry--dota {
  background:
    radial-gradient(circle at 82% 44%, rgba(168, 85, 247, 0.44) 0%, rgba(56, 189, 248, 0.18) 38%, rgba(17, 13, 29, 0.98) 74%);
}

.game-entry-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% center;
  pointer-events: none;
  z-index: 0;
}

.game-entry-hero-render {
  position: absolute;
  right: -8px;
  top: -12%;
  height: 132%;
  width: auto;
  max-width: 56%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(-8px 8px 20px rgba(0, 0, 0, 0.7));
}

.game-entry-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(90deg, rgba(9, 7, 17, 0.94) 0%, rgba(9, 7, 17, 0.80) 56%, rgba(9, 7, 17, 0.24) 100%);
}
.game-entry-scrim--dota {
  background: linear-gradient(90deg, rgba(9, 7, 17, 0.92) 0%, rgba(9, 7, 17, 0.66) 44%, rgba(9, 7, 17, 0.0) 76%);
}

.game-entry-body {
  position: relative;
  z-index: 2;
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.game-entry-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  max-width: 78%;
}

.game-entry-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.game-entry-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.game-entry-av-stack {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.game-entry-av-stack .avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  margin-left: -6px;
  border: 1.5px solid var(--surface-1);
  background: var(--surface-1);
}
.game-entry-av-stack .avatar:first-child { margin-left: 0; }

.game-entry-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(17, 13, 29, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  margin: 0;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.game-entry-av {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1.5px solid rgba(168, 85, 247, 0.55);
}
.game-entry-stat .medal-wrap {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.game-entry-stat .medal-wrap img {
  width: 22px;
  height: 22px;
}
.game-entry-stat:hover {
  color: var(--accent-ink);
  border-color: var(--accent-border);
}
.game-entry-av-stack:focus-visible,
.game-entry-stat:focus-visible,
.result-row:focus-visible,
.roster-row:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.game-entry-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 68%;
}

.game-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}
.game-entry-actions .btn-sm {
  min-height: 36px;
}

/* Row 2 — Team Results & Roster */
.home-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.home-results-card {
  margin-bottom: 0;
}

.home-results-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.results-list,
.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 112px 86px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.result-row:hover {
  border-color: var(--border-hi);
  background: var(--surface-3);
}

.result-thumb {
  width: 56px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.result-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-stat {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.result-date {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.result-pill {
  justify-self: end;
}

.home-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.roster-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.roster-row:hover {
  border-color: var(--border-hi);
  background: var(--surface-3);
}
.roster-av { width: 32px; height: 32px; }
.roster-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.roster-nick {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.home-drill-card {
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
}
.home-drill-thumb-wrap {
  width: 140px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.home-drill-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-drill-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-drill-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.home-drill-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-drill-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 7px;
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.feed-row:last-child { margin-bottom: 0; }
.feed-row:hover { border-color: var(--border-hi); background: var(--surface-3); }
.feed-thumb {
  width: 44px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.feed-main { flex: 1; min-width: 0; }
.feed-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mobile Compact Table View & Desktop Data Tables */
.table-mode-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.table-scroll-hint {
  font-size: 11.5px;
  color: var(--muted);
  display: none;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.mobile-table-list {
  display: none;
  flex-direction: column;
  gap: 6px;
}
.mobile-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  min-height: 54px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.mobile-player-row:hover { border-color: var(--border-hi); background: var(--surface-2); }
.mobile-player-row.row-podium-1 { border-left: 3px solid var(--accent); background: rgba(128, 18, 204, 0.10); }
.mobile-player-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.mobile-player-info {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.mobile-player-nick {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-player-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-player-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mobile-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}
.mobile-metric-val {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.mobile-metric-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.data-table th {
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--text); }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.col-active { color: var(--accent-ink); }
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:hover td { background: rgba(168, 85, 247, 0.08); }
.row-podium-1 td { background: rgba(128, 18, 204, 0.13); }

.sticky-col {
  position: sticky;
  left: 0;
  max-width: 210px;
  background: var(--surface-1);
  background-clip: padding-box;
  z-index: var(--z-sticky-col);
  padding-right: 12px !important;
  border-right: 1px solid var(--border-hi);
  box-shadow: 6px 0 12px rgba(9, 7, 17, 0.52);
}
.data-table th.sticky-col {
  background: var(--surface-2);
  background-clip: padding-box;
  z-index: var(--z-sticky-th);
}
.data-table td.sticky-col {
  background: var(--surface-1);
}
.data-table tbody tr:nth-child(even) td.sticky-col {
  background: var(--surface-2);
}
.data-table tbody tr:hover td.sticky-col {
  background: var(--surface-3);
}
.data-table tbody tr.row-podium-1 td.sticky-col {
  background: #1D1234;
}
.data-table tbody tr.row-podium-1:hover td.sticky-col {
  background: #261642;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.player-name-wrap {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.player-name {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-hi);
  flex-shrink: 0;
  background: var(--surface-3);
}
.avatar-lg { width: 54px; height: 54px; }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: var(--surface-3);
  color: var(--text-dim);
}
.rank-badge.r1 { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-border); }
.rank-badge.r2 { background: rgba(255, 255, 255, 0.12); color: #F7F7FA; }
.rank-badge.r3 { background: rgba(255, 255, 255, 0.07); color: var(--text-dim); }

.lvl-icon { width: 22px; height: 22px; vertical-align: middle; display: inline-block; }
.wl-strip { display: inline-flex; gap: 3px; align-items: center; }
.wl-dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.wl-dot.w { background: var(--green); }
.wl-dot.l { background: var(--red); }

/* Premier Badge & Tiers */
.premier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid var(--border-hi);
}
.premier-bars { display: inline-block; width: 3px; height: 11px; border-radius: 1px; background: currentColor; }
.premier-tier-grey { color: #9CA3AF; background: rgba(156,163,175,0.12); }
.premier-tier-light_blue { color: #67E8F9; background: rgba(103,232,249,0.12); border-color: rgba(103,232,249,0.3); }
.premier-tier-blue { color: #60A5FA; background: rgba(96,165,250,0.14); border-color: rgba(96,165,250,0.35); }
.premier-tier-purple { color: #C084FC; background: rgba(192,132,252,0.14); border-color: rgba(192,132,252,0.35); }
.premier-tier-pink { color: #F472B6; background: rgba(244,114,182,0.14); border-color: rgba(244,114,182,0.35); }
.premier-tier-red { color: #F87171; background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.35); }
.premier-tier-gold { color: #FBBF24; background: rgba(251,191,36,0.16); border-color: rgba(251,191,36,0.45); }
.premier-tier-unranked { color: var(--muted); }

/* Match Cards */
.match-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
  margin-bottom: 12px;
}
.match-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.22; pointer-events: none; }
.match-hero-inner {
  position: relative;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.match-score-big { font-size: 24px; font-weight: 800; font-family: var(--mono); }
.match-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  padding: 12px 14px;
}
.match-card:hover { border-color: var(--border-hi); }
.match-card.is-win { border-left: 3px solid var(--green); }
.match-card.is-loss { border-left: 3px solid var(--red); }
.match-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.14; pointer-events: none; }
.match-card-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.match-card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.match-card-score { font-family: var(--mono); font-size: 15px; font-weight: 800; }
.match-card-stats { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.match-card-stat, .match-owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(20, 14, 38, 0.74);
  border: 1px solid var(--border);
  font-size: 11.5px;
}
.match-mini-av { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.match-card-actions { position: relative; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.pm-score-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.pm-score-num { font-size: 26px; font-weight: 900; font-family: var(--mono); }
.team-board, .premier-match-board { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.team-head, .pm-team-header {
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.scoreboard-row-hlyup td, .pm-row-roster td { background: rgba(128, 18, 204, 0.14); }
.data-table tbody tr.scoreboard-row-hlyup td.sticky-col,
.data-table tbody tr.pm-row-roster td.sticky-col { background: #251845; }
.data-table tbody tr.scoreboard-row-hlyup:hover td.sticky-col,
.data-table tbody tr.pm-row-roster:hover td.sticky-col { background: #2E1F56; }
.scoreboard-row-self td { background: rgba(34, 197, 94, 0.10); }
.data-table tbody tr.scoreboard-row-self td.sticky-col { background: #182934; }
.data-table tbody tr.scoreboard-row-self:hover td.sticky-col { background: #1F3542; }
.tag-hlyup, .tag-self { font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 700; }
.tag-hlyup { background: var(--accent-soft); color: var(--accent-ink); }
.tag-self { background: rgba(34, 197, 94, 0.16); color: var(--green); }

/* Map Selector Strip & Filters */
.map-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.map-strip::-webkit-scrollbar { display: none; }
.map-chip {
  position: relative;
  min-width: 112px;
  height: 54px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px 8px;
  text-align: left;
  transition: border-color var(--t-fast) var(--ease);
}
.map-chip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
}
.map-chip.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.map-chip-name { position: relative; font-size: 12px; font-weight: 700; color: var(--text); text-shadow: 0 1px 4px #000; }
.map-chip-cnt { position: relative; font-size: 10.5px; color: var(--text-dim); text-shadow: 0 1px 4px #000; }

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.more-filters-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-1);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

/* Nades Grid & Cards */
.nade-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface-1);
  border: 1px solid var(--border);
  font-size: 12px;
  margin-bottom: 10px;
}

.nade-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nade-card:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.nade-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.nade-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nade-badges {
  position: absolute;
  top: 7px; left: 7px; right: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.nade-badges .pill {
  background: rgba(20, 14, 38, 0.86);
  backdrop-filter: blur(4px);
}
.nade-play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(20, 14, 38, 0.86);
  border: 1px solid var(--border-hi);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nade-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.nade-route { font-size: 13px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.nade-route-arrow { color: var(--accent-ink); }
.nade-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.nade-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); margin-top: auto; }
.nade-title { font-size: 13px; font-weight: 700; }
.nade-sub { font-size: 11.5px; color: var(--muted); }

/* Console Command Block (no cyan, no mid-word break) */
.cmd-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.cmd-code {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre;
  overflow-x: auto;
}

/* Priority 1: Focused Sequential Training Mode */
.train-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-3);
}
.train-toolbar .select {
  width: auto;
  min-width: 170px;
  max-width: 240px;
  flex: 0 1 auto;
}
.train-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 340px);
  gap: 14px;
  align-items: start;
}
.train-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.train-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.train-target {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.train-origin {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.train-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.train-media {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0D0919;
  border: 1px solid var(--border);
}
.train-media .video-box,
.train-media video,
.train-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 430px;
  object-fit: contain;
  display: block;
  border: none;
  border-radius: 0;
}
.train-media-fallback {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.train-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.train-img-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.train-img-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.train-img-cap {
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.train-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.train-cmd-details {
  flex: 1 1 200px;
  min-width: 0;
}
.train-cmd-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
}
.train-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.train-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.train-queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.train-queue-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.train-queue-item:hover { border-color: var(--border-hi); background: var(--surface-3); }
.train-queue-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.train-queue-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.train-queue-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Radar */
.radar-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: var(--z-overlay-ctrl);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.radar-floor-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: var(--z-overlay-ctrl);
  display: flex;
  gap: 6px;
  margin: 0;
}
.radar-stage {
  position: relative;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hi);
  background: #0D0919;
  overflow: hidden;
  touch-action: pan-y;
}
.radar-stage.is-zoomed { touch-action: none; }
.radar-inner { position: relative; width: 100%; height: 100%; transform-origin: 0 0; }
.radar-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.radar-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar-marker { cursor: pointer; }
.radar-marker:hover circle { stroke: var(--accent-ink); }
.radar-route { stroke-width: 3.5; stroke-linecap: round; opacity: 0.92; pointer-events: none; }
.radar-leader { stroke: var(--accent-ink); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.7; pointer-events: none; }
.radar-callout {
  fill: var(--text);
  stroke: rgba(19, 13, 36, 0.95);
  stroke-width: 3.5px;
  paint-order: stroke;
  text-anchor: middle;
  font-weight: 700;
  pointer-events: none;
}
.radar-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 4px 0 10px;
}
.callout-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.callout-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.callout-chip:hover { border-color: var(--border-hi); color: var(--text); }
.callout-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.callout-chip-cnt { font-family: var(--mono); color: var(--accent-ink); font-weight: 700; }

/* Tactics */
.tactic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tactic-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  overflow: hidden;
  margin-bottom: 10px;
}
.tactic-card-featured { border-left: 3px solid var(--accent); }
.tactic-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.tactic-body { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.tactic-desc-box { font-size: 13px; color: var(--text-dim); margin: 10px 0; overflow-wrap: anywhere; }
.tactic-util-bar { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.tactic-util-chip { padding: 2px 7px; border-radius: 4px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 4px; }
.step-item { display: flex; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.step-item:last-child { border-bottom: none; }
.step-num, .slot-dot {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-hi);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.slot-1 { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-ink); }
.slot-2, .slot-3, .slot-4, .slot-5 { background: var(--surface-3); color: var(--text); }

.match-quick-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 4px;
  border: 1px solid var(--border-hi); background: var(--surface-2);
  color: var(--text); font-size: 11.5px; cursor: pointer;
}
.match-quick-btn:hover { background: var(--surface-3); border-color: var(--accent); }
.demo-timing { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.demo-timing b { color: var(--text); font-family: var(--mono); }
.replay-signin { text-align: center; padding: 26px 16px; }
.replay-signin-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.replay-feedback { font-size: 12px; color: var(--text-dim); margin: 4px 0 0; }
.replay-link { color: var(--accent-ink); text-decoration: underline; }

/* Demos */
.replay-workspace { display: flex; flex-direction: column; gap: 12px; }
.demo-topbar, .replay-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
}
.demo-topbar-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 240px; }
.demo-topbar-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-hero-status { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demo-topbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--surface-1);
  border: 1px solid var(--border);
}
.demo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.demo-subpills { display: flex; gap: 6px; flex-wrap: wrap; }
.replay-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.replay-title-row h2 { margin: 0; font-size: 15px; font-weight: 800; }
.replay-count-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700;
}
.replay-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.replay-surface {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
  padding: 14px 16px;
}

.steam-auth-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px 14px;
}
.steam-auth-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.steam-auth-inputs { display: flex; flex-wrap: wrap; gap: 8px; }
.steam-auth-inputs .input { flex: 1 1 220px; }
.steam-guide {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.match-picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.match-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.demo-source-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2);
}
.demo-source-row .input { flex: 1 1 180px; }

.replay-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 16px; border-radius: var(--radius);
  border: 1.5px dashed var(--border-hi); background: var(--surface-2);
  cursor: pointer; text-align: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.replay-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.replay-file-input { display: none; }
.replay-filename { font-family: var(--mono); font-size: 12px; color: var(--text-dim); overflow-wrap: anywhere; }
.demo-progress { width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.demo-progress > div, .render-progress-fill { height: 100%; background: var(--accent); transition: width 0.25s ease; }

.demo-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.demo-history-card {
  padding: 11px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.demo-history-card:hover, .demo-history-card.active { border-color: var(--accent); }
.demo-history-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.demo-history-map { font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.demo-history-file { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.demo-result-hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap;
}
.demo-result-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.18; pointer-events: none; }
.demo-result-actions { position: relative; display: flex; gap: 6px; flex-wrap: wrap; }

.premier-updates-box {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin: 10px 0;
  display: grid;
  gap: 8px;
}
.premier-updates-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.premier-update-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-1); font-size: 12px;
}
.premier-update-chip.in-roster { border-color: var(--accent-border); background: var(--accent-soft); }

.demo-ally-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; }
.demo-ally-card {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; text-align: left; color: var(--text);
}
.demo-ally-card:hover { border-color: var(--border-hi); }
.demo-ally-card.active { border-color: var(--accent); background: var(--accent-soft); }
.demo-ally-avatar, .demo-ally-avatar-fallback {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  border: 1px solid var(--border-hi);
}
.demo-ally-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); font-weight: 800; font-size: 12px;
}
.demo-ally-meta { flex: 1; min-width: 0; }
.demo-ally-name { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-ally-sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.demo-ally-badges { display: flex; gap: 4px; flex-shrink: 0; }

.demo-mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.demo-mode-tabs button {
  min-height: 34px;
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.demo-mode-tabs button.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

/* 3D Replay Studio Panel */
.studio-panel, .replay-clip-tools {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.studio-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.studio-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}
.crosshair-studio {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
}
.crosshair-preview-box {
  width: 110px;
  height: 76px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: linear-gradient(180deg, #1E2530 0%, #4E463B 56%, #3A332A 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.crosshair-swatches { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.ch-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid transparent; cursor: pointer; }
.ch-swatch.active { border-color: #FFFFFF; transform: scale(1.1); }
.ch-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ch-sliders label { font-size: 11px; color: var(--text-dim); display: flex; flex-direction: column; gap: 3px; }
.ch-sliders input[type=range] { width: 100%; accent-color: var(--accent); }

.demo-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.demo-filters label { font-size: 11.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.demo-moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.demo-moment {
  padding: 11px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  content-visibility: auto; contain-intrinsic-size: auto 112px;
}
.match-card {
  content-visibility: auto; contain-intrinsic-size: auto 148px;
}
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.clip-card {
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); display: flex; flex-direction: column; gap: 8px;
  content-visibility: auto; contain-intrinsic-size: auto 130px;
}
.clip-card.is-active { border-color: var(--accent); background: linear-gradient(135deg, rgba(128,18,204,.18), rgba(29,21,54,.95)); }
.demo-moment-action { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.demo-guest-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 12px;
  align-items: start;
}
.demo-showcase-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.custom-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 8px;
}
.custom-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width 160ms var(--ease);
}

.global-render-bar {
  position: fixed;
  right: 18px;
  left: auto;
  bottom: calc(18px + var(--safe-bottom));
  z-index: var(--z-render-bar);
  width: min(344px, calc(100vw - 32px));
  background: var(--surface-2);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(8, 8, 14, 0.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.global-render-bar.hidden,
body.modal-open .global-render-bar { display: none; }
.global-render-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.global-render-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.global-render-track { width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.global-render-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-ink)); transition: width .25s ease; }
.global-render-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
@media (max-width: 820px) {
  .global-render-bar { left: 10px; right: 10px; width: auto; bottom: calc(64px + var(--safe-bottom)); }
  body.has-render-bar .viewport { padding-bottom: calc(168px + var(--safe-bottom)); }
}

.video-box, .video-box video {
  width: 100%;
  max-width: 100%;
  max-height: 440px;
  display: block;
  border-radius: var(--radius);
  background: #0D0919;
  border: 1px solid var(--border-hi);
}
.demo-clip-markers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.render-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  margin: 10px 0 6px;
}

/* Dota & Heroes */
.hero-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-1); cursor: pointer;
  min-width: 0;
  transition: border-color var(--t-fast) var(--ease);
}
.hero-card:hover { border-color: var(--accent-border); }
.hero-img { width: 52px; height: 30px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.hero-img-lg { width: 104px; height: 59px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.item-icon { width: 28px; height: 21px; border-radius: 3px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: var(--surface-2); }
.medal-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; }
.medal-base { width: 28px; height: 28px; object-fit: contain; }
.medal-star { position: absolute; inset: 0; width: 28px; height: 28px; object-fit: contain; }
.chart-svg { width: 100%; height: auto; display: block; }

/* Unified Accessible Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(9, 7, 17, 0.80);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom));
  animation: modalFadeIn var(--t-fast) var(--ease);
}
.modal-sheet {
  width: 100%;
  max-width: 760px;
  max-height: min(90dvh, calc(var(--vvh, 100dvh) - max(28px, var(--safe-top)) - var(--safe-bottom)));
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.62);
  animation: modalSlideIn var(--t-base) var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-title {
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.modal-header .icon-btn {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
}
.modal-body {
  padding: 14px 16px calc(18px + var(--safe-bottom));
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
.toast-box {
  position: fixed;
  right: 18px;
  bottom: calc(20px + var(--safe-bottom));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}
body.has-render-bar .toast-box {
  bottom: calc(120px + var(--safe-bottom));
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--accent-border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

/* Skeletons with stable geometry */
.skeleton-wrap { display: flex; flex-direction: column; gap: 12px; }
.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: skShimmer 1.3s infinite linear;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.sk-hero { height: 148px; }
.sk-card { height: 92px; }
@keyframes skShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Responsive Breakpoints (1440, 1024, 768, 680, 480, 390, 320 + Landscape) */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-guest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  .train-layout { grid-template-columns: 1fr; }
  .home-decks, .home-split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .layout-body { flex-direction: column; }
  .sidenav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: auto;
    z-index: var(--z-nav);
    flex-direction: row;
    justify-content: space-around;
    padding: 4px calc(4px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(4px + var(--safe-left));
    border-right: none;
    border-top: 1px solid var(--border);
    background: rgba(17, 13, 29, 0.96);
    backdrop-filter: blur(12px);
  }
  .nav-item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 5px 4px;
    font-size: 10.5px;
    text-align: center;
    border: none;
  }
  .nav-item.active { background: transparent; color: var(--accent-ink); }
  .viewport {
    max-width: none;
    margin-inline: 0;
    padding: 10px calc(12px + var(--safe-right)) calc(82px + var(--safe-bottom)) calc(12px + var(--safe-left));
  }
  .tactic-grid, .match-picker-grid, .demo-history-grid { grid-template-columns: 1fr; }
  .toast-box,
  body.has-render-bar .toast-box {
    top: calc(58px + var(--safe-top));
    bottom: auto;
    right: 10px;
    left: 10px;
    max-width: none;
    align-items: center;
  }
  .modal-overlay { padding: max(12px, var(--safe-top)) 0 0; align-items: flex-end; }
  .modal-sheet {
    max-height: calc(var(--vvh, 100dvh) - max(14px, var(--safe-top)));
    border-radius: 14px 14px 0 0;
  }
  .subtab { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .train-actions { grid-template-columns: 1fr 1fr; }
  .train-actions .btn-primary { grid-column: 1 / -1; min-height: 48px; }
}

@media (max-width: 1080px) {
  .home-broadcast-stage { grid-template-columns: 1fr; }
  .home-game-stack { grid-template-rows: auto; grid-template-columns: 1fr 1fr; }
  .home-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .table-mode-bar { display: flex; }
  .table-shell.mode-compact .table-wrap { display: none; }
  .table-shell.mode-compact .mobile-table-list { display: flex; }
  .table-shell.mode-full .mobile-table-list { display: none; }
  .table-shell.mode-full .table-scroll-hint { display: flex; }
  .sticky-col { min-width: 144px; max-width: 168px; }
  .home-broadcast-stage { gap: 10px; margin-bottom: 10px; }
  .home-match-hero { min-height: 224px; }
  .home-match-hero-body { padding: 14px 15px; gap: 10px; }
  .home-hero-map { font-size: 25px; }
  .home-hero-score { font-size: 32px; }
  .home-hero-player { font-size: 11.5px; padding: 4px 8px 4px 4px; }
  .home-hero-actions .home-hero-cta { flex: 1 1 auto; justify-content: center; }
  .home-game-stack { grid-template-columns: 1fr 1fr; gap: 8px; }
  .game-entry { min-height: 152px; }
  .game-entry-body { padding: 11px 11px; gap: 6px; }
  .game-entry-top { max-width: 100%; gap: 5px; }
  .game-entry-av-stack { display: none; }
  .game-entry-stat { font-size: 11.5px; padding: 2px 8px 2px 3px; gap: 6px; }
  .game-entry-av { width: 22px; height: 22px; }
  .game-entry-stat .medal-wrap,
  .game-entry-stat .medal-wrap img { width: 18px; height: 18px; }
  .game-entry-meta { display: none; }
  .game-entry-hero-render { max-width: 48%; right: -12px; opacity: 0.78; }
  .game-entry-actions { gap: 5px; }
  .game-entry-actions .btn-sm { padding: 5px 8px; min-height: 36px; font-size: 11.5px; }
  .game-entry-actions .btn-sm:last-child { display: none; }
  .result-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 10px;
  }
  .result-thumb { width: 44px; height: 30px; }
  .result-stat, .result-date { display: none; }
  .home-drill-card { grid-template-columns: 106px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .home-drill-thumb-wrap { width: 106px; }
  .nades-mobile-compact .section-sub { display: none; }
  .nades-mobile-compact .section-head { margin-bottom: 8px; }
  .nades-mobile-compact .map-strip { margin-bottom: 6px; padding-bottom: 4px; }
  .nades-mobile-compact .map-chip { height: 46px; min-width: 100px; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .studio-controls-grid { grid-template-columns: 1fr; }
  .filters-bar > .select,
  .more-filters-panel > .select,
  .hero-banner > .select,
  .train-toolbar .select {
    flex: 1 1 145px;
    max-width: 100%;
    width: 100%;
  }
  .crosshair-studio { grid-template-columns: 1fr; }
  .crosshair-preview-box { width: 100%; }
  .ch-sliders { grid-template-columns: 1fr; }
  .section-title { font-size: 16.5px; }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
}

@media (max-width: 380px) {
  .topbar { padding: var(--safe-top) 10px 0; min-height: calc(50px + var(--safe-top)); }
  .brand-logo { width: 30px; height: 30px; }
  .brand-title { font-size: 13.5px; }
  .viewport { padding: 9px 9px calc(80px + var(--safe-bottom)); }
  .card, .replay-surface, .game-deck, .train-card, .demo-showcase-card { padding: 11px; }
  .sticky-col { min-width: 120px; max-width: 140px; padding-right: 9px !important; }
  .btn { padding: 7px 10px; font-size: 12.5px; }
  .demo-moments { grid-template-columns: 1fr; }
  .card-title .pill { white-space: normal; }
  .table-wrap { max-width: 100%; }
  .mobile-player-row { padding: 9px; gap: 8px; }
  .mobile-player-metrics { gap: 8px; }
}

@media (max-height: 500px) and (max-width: 920px) {
  .topbar { min-height: 44px; }
  .sidenav { padding-top: 3px; padding-bottom: calc(3px + var(--safe-bottom)); }
  .nav-item { min-height: 40px; flex-direction: row; gap: 5px; font-size: 11px; }
  .viewport { padding-bottom: calc(62px + var(--safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton { animation: none; background: var(--surface-2); }
}

/* Action-First Demos & Throw-First Training Layout Utilities */
.demo-pane-stack { display: grid; gap: 12px; }
.demo-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.demo-tabs-grid { display: grid; gap: 8px; }
.demo-primary-tabs, .demo-library-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-primary-tabs .subtab { flex: 1 1 150px; min-height: 40px; justify-content: center; }
.demo-library-tabs .subtab { min-height: 36px; font-size: 12.5px; background: var(--surface-1); }
.demo-guest-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.demo-context-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.demo-moment.is-selected { border-color: var(--accent-hover); background: var(--accent-soft); }
.demo-composer {
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-border);
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.demo-composer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.demo-composer-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.demo-composer-range label { font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.demo-status-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.train-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.train-top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.train-progress-inline {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}
.train-tip { font-size: 13px; color: var(--text-dim); margin: 2px 0 0; line-height: 1.4; }
.train-copy-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.train-guest-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.45;
}
.train-util-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 680px) {
  .train-card { padding: 12px 13px; gap: 10px; }
  .train-media .video-box,
  .train-media video,
  .train-media iframe { max-height: 235px; }
  .train-target { font-size: 16.5px; }
  .catalog-nades-grid, .catalog-heroes-grid { grid-template-columns: 1fr; }
}

/* QHD & Wide Desktop Adaptation */
.train-workspace { width: 100%; }
.train-head-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.train-controls-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.catalog-nades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.catalog-heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}

.modal-sheet--wide {
  max-width: min(1180px, calc(100vw - 48px));
}
.profile-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 14px;
  align-items: start;
}
.profile-modal-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.profile-modal-col > .card { margin-bottom: 0; }

@media (max-width: 960px) {
  .profile-modal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .modal-sheet--wide { max-width: 100%; }
}

.demo-moments-stage { display: grid; gap: 14px; }

@media (min-width: 1024px) {
  .data-table { font-size: 14.5px; }
  .data-table th { font-size: 12.5px; padding: 11px 14px; }
  .data-table td { padding: 11px 14px; }
  .data-table .player-name { font-size: 14.5px; }
  .data-table td.num { font-size: 14.5px; font-weight: 600; }
  .sticky-col { max-width: 280px; }

  .demo-tabs-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .demo-primary-tabs .subtab { flex: 0 1 auto; min-width: 168px; }
  #demo-local { max-width: 980px; }
  .match-picker-grid, .demo-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  }
}

@media (min-width: 1100px) {
  .demo-guest-grid {
    max-width: 1180px;
    margin-inline: auto;
    grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
    gap: 16px;
  }
  .train-workspace {
    max-width: 1700px;
    margin-inline: auto;
  }
  .train-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 24%, 400px);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "media head"
      "media controls";
    column-gap: 18px;
    row-gap: 12px;
    align-items: start;
    padding: 18px;
  }
  .train-stage .train-media { grid-area: media; }
  .train-stage .train-head-block { grid-area: head; }
  .train-stage .train-controls-block { grid-area: controls; gap: 12px; }
  .train-stage .train-target { font-size: 20px; }
  .train-stage .train-tip { font-size: 14px; }
  .train-stage .train-media .video-box,
  .train-stage .train-media .video-box video,
  .train-stage .train-media video,
  .train-stage .train-media iframe {
    max-height: min(720px, calc(100dvh - 200px));
    object-fit: contain;
  }
  .train-stage .train-copy-bar .btn { width: 100%; justify-content: center; }
  .train-stage .train-actions { grid-template-columns: 1fr 1fr; }
  .train-stage .train-actions .btn-primary { grid-column: 1 / -1; min-height: 48px; }
}

@media (min-width: 1200px) {
  .section-title { font-size: 22px; }
  .section-sub { font-size: 13.5px; }
  .card-title { font-size: 13.5px; }
  .nav-item { font-size: 14.5px; }
  .subtab { font-size: 13.5px; }
  .filter-chip { font-size: 13px; }
  .home-broadcast-stage {
    grid-template-columns: minmax(0, 1.92fr) minmax(420px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
  }
  .home-match-hero { min-height: 372px; }
  .game-entry { min-height: 180px; }
  .home-content-grid {
    grid-template-columns: minmax(0, 1.42fr) minmax(420px, 1fr);
    gap: 16px;
  }
  .feed-title { font-size: 14.5px; }
  .feed-sub { font-size: 12.5px; }
  .feed-thumb { width: 56px; height: 36px; }
}

@media (min-width: 1280px) {
  .demo-moments-stage:has(#demo-clip-composer:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: start;
  }
  .demo-moments-stage:has(#demo-clip-composer:not([hidden])) #demo-clip-composer {
    order: 2;
    position: sticky;
    top: 72px;
  }
  .demo-moments-stage:has(#demo-clip-composer:not([hidden])) .demo-moments {
    order: 1;
  }
}

@media (min-width: 1440px) {
  .data-table { font-size: 15px; }
  .data-table th { font-size: 13px; padding: 12px 15px; }
  .data-table td { padding: 12px 15px; }
  .data-table .player-name { font-size: 15px; }
  .data-table td.num { font-size: 15px; }
  .sticky-col { max-width: 320px; }
}
