/* CSP design system — single source of truth for the whole site.
   The public and admin templates all share these class names, so the visual
   language lives entirely here.

   Themes: [data-theme="dark"] (default, esports-style dark UI) and
   [data-theme="light"], set on <html> by the inline script in base.html.
   All component rules below reference tokens only — never raw colors — so a
   theme switch is a pure variable swap.

   Palette follows the NTDevLab Design System v1: emerald primary accent
   (#42e8ac, shared across the ecosystem) and CS orange (#f0a03c) as the
   product-specific secondary accent. */

:root {
  /* Theme-independent structure tokens */
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-xs: 0.25rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  /* Typography: Manrope is the NTDevLab DS v1 typeface; when the local copy
     or a user-installed Manrope is absent, fall back to the system stack —
     no webfonts are fetched from third-party CDNs. */
  --font-sans: Manrope, Roboto, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces & text (ODP dark palette) */
  --bg: #121212;
  --bg-grad: radial-gradient(1100px 480px at 50% -180px, rgba(66, 232, 172, 0.06), transparent 70%),
    linear-gradient(180deg, #161616 0, #121212 300px, #121212 100%);
  --surface: #1e1e1e;
  --surface-soft: #2d2d2d;
  --surface-hover: #363636;
  --surface-panel: #1e1e1e;
  --inset: #161616;
  --inset-soft: rgba(0, 0, 0, 0.3);
  --text: #e5e5e5;
  --muted: #adb5bd;
  --placeholder: #6c757d;
  --line: #2d2d2d;
  --line-strong: #444444;
  --bar-bg: rgba(26, 26, 26, 0.88);

  /* Sidebar (ODP-style app shell) */
  --sidebar-bg: linear-gradient(180deg, #15171c 0%, #101215 100%);
  --sidebar-active-grad: linear-gradient(135deg, #1bc989 0%, #12906a 100%);
  --sidebar-active-text: #04110b;
  --sidebar-active-shadow: 0 2px 10px rgba(66, 232, 172, 0.25);
  --hero-bg:
    radial-gradient(circle at 85% 8%, rgba(66, 232, 172, 0.14), transparent 42%),
    linear-gradient(145deg, #1e1e1e, #161616);

  /* Accent (NTDevLab emerald, matches the ecosystem brand) */
  --accent: #42e8ac;
  --accent-strong: #1bc989;
  --accent-soft: #8af0cf;
  --accent-deep: #12906a;
  --accent-bg: rgba(66, 232, 172, 0.14);
  --accent-border: rgba(66, 232, 172, 0.45);
  --accent-contrast: #04110b;

  /* Product secondary accent: CS orange (NTDevLab DS v1) */
  --cs: #f0a03c;
  --cs-strong: #ffb85c;
  --cs-bg: rgba(240, 160, 60, 0.14);
  --cs-border: rgba(240, 160, 60, 0.42);

  /* Links (ecosystem blue, brightened for dark surfaces) */
  --link: #4d9fff;
  --link-strong: #80bdff;

  /* Secondary accent (team two / gradients) */
  --blue: #4d9fff;
  --blue-deep: #0069d9;
  --blue-bg: rgba(0, 123, 255, 0.16);
  --blue-border: rgba(77, 159, 255, 0.4);

  /* Semantic */
  --green: #28a745;
  --green-strong: #4cc86a;
  --green-deep: #1e7e34;
  --green-bg: rgba(40, 167, 69, 0.15);
  --green-border: rgba(40, 167, 69, 0.42);
  --amber: #ffc107;
  --amber-strong: #ffcd39;
  --amber-bg: rgba(255, 193, 7, 0.14);
  --amber-border: rgba(255, 193, 7, 0.4);
  --red: #dc3545;
  --red-strong: #e4606d;
  --red-deep: #a71d2a;
  --red-bg: rgba(220, 53, 69, 0.16);
  --red-border: rgba(220, 53, 69, 0.42);
  --red-glow: rgba(220, 53, 69, 0.45);

  --shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  color-scheme: light;

  /* Surfaces & text */
  --bg: #f4f5f7;
  --bg-grad: radial-gradient(1100px 480px at 50% -180px, rgba(61, 139, 61, 0.05), transparent 70%),
    linear-gradient(180deg, #eceff3 0, #f4f5f7 300px, #f4f5f7 100%);
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --surface-hover: #e9ecef;
  --surface-panel: #ffffff;
  --inset: #e9ecef;
  --inset-soft: rgba(33, 37, 41, 0.04);
  --text: #212529;
  --muted: #6c757d;
  --placeholder: #adb5bd;
  --line: #dee2e6;
  --line-strong: #ced4da;
  --bar-bg: rgba(255, 255, 255, 0.88);

  /* Sidebar (ODP-style app shell) */
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%);
  --sidebar-active-grad: linear-gradient(135deg, #12906a 0%, #0d6e50 100%);
  --sidebar-active-text: #ffffff;
  --sidebar-active-shadow: 0 2px 10px rgba(18, 144, 106, 0.25);
  --hero-bg:
    radial-gradient(circle at 85% 8%, rgba(18, 144, 106, 0.1), transparent 42%),
    linear-gradient(145deg, #ffffff, #f1f3f5);

  /* Accent — deepened for contrast on white */
  --accent: #0e7d5b;
  --accent-strong: #0a5c43;
  --accent-soft: #0a523c;
  --accent-deep: #1a9d76;
  --accent-bg: rgba(14, 125, 91, 0.1);
  --accent-border: rgba(14, 125, 91, 0.42);
  --accent-contrast: #ffffff;

  /* Product secondary accent: CS orange (deepened for white surfaces) */
  --cs: #b26310;
  --cs-strong: #8a4c0a;
  --cs-bg: rgba(178, 99, 16, 0.1);
  --cs-border: rgba(178, 99, 16, 0.38);

  /* Links (ODP blue, deepened for white surfaces) */
  --link: #0062cc;
  --link-strong: #004a99;

  /* Secondary accent */
  --blue: #0062cc;
  --blue-deep: #3385d6;
  --blue-bg: rgba(0, 98, 204, 0.09);
  --blue-border: rgba(0, 98, 204, 0.38);

  /* Semantic */
  --green: #1e7e34;
  --green-strong: #155d27;
  --green-deep: #28a745;
  --green-bg: rgba(40, 167, 69, 0.1);
  --green-border: rgba(40, 167, 69, 0.38);
  --amber: #b8860b;
  --amber-strong: #996f00;
  --amber-bg: rgba(255, 193, 7, 0.14);
  --amber-border: rgba(184, 134, 11, 0.4);
  --red: #c82333;
  --red-strong: #a71d2a;
  --red-deep: #e4606d;
  --red-bg: rgba(220, 53, 69, 0.09);
  --red-border: rgba(220, 53, 69, 0.38);
  --red-glow: rgba(220, 53, 69, 0.45);

  --shadow: 0 1px 2px rgba(23, 27, 34, 0.06), 0 10px 26px rgba(23, 27, 34, 0.07);
  --shadow-sm: 0 1px 2px rgba(23, 27, 34, 0.07);
}

* {
  box-sizing: border-box;
}

.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;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-strong);
  text-decoration: none;
}

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

/* ---- App shell: fixed left sidebar + content column ------------------------
   Layout follows the ODP project: navigation lives in a 252px fixed sidebar,
   content sits in a column to its right; on mobile the sidebar becomes a
   drawer toggled by the burger in the sticky mobile bar. */
:root {
  --sidebar-w: 252px;
  --mobile-bar-h: 52px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  scrollbar-width: thin;
}

.sidebar-brand {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar-bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
  color: var(--text);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xs);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent) 55%, var(--accent-deep));
  color: var(--accent-contrast);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-copy {
  display: grid;
  gap: 0;
  min-width: 0;
  line-height: 1.05;
}

/* The sidebar brand must not be clipped by the fixed column width: the copy
   shrinks (and ellipsises) instead of overflowing the navigation column. */
.sidebar-brand {
  min-width: 0;
}

.sidebar-brand .brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Sidebar navigation -------------------------------------------------- */
.side-nav {
  flex: 1 1 auto;
  padding: 0.5rem;
}

.side-nav-label {
  display: block;
  padding: 0.85rem 0.75rem 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1px 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.side-link.active {
  background: var(--sidebar-active-grad);
  color: var(--sidebar-active-text);
  box-shadow: var(--sidebar-active-shadow);
}

.side-icon {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.9;
}

.side-link.active .side-icon {
  opacity: 1;
}

.sidebar-footer {
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--line);
}

/* Экосистема NTDevLab в футере сайдбара — отдельная карточка под навигацией. */
.sidebar-footer .side-nav-group--eco {
  padding: 0.45rem 0.35rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.sidebar-footer .side-nav-group--eco .side-nav-label {
  padding: 0.15rem 0.4rem 0.3rem;
}
.sidebar-footer .side-nav-group--eco .side-link {
  min-height: 32px;
  padding: 5px 8px;
}

.sidebar-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sidebar-controls .locale-switch {
  margin-left: auto;
}

/* Mobile bar with the burger: hidden on desktop, sticky on narrow screens. */
.mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  height: var(--mobile-bar-h);
  padding: 0 0.8rem;
  border-bottom: 1px solid var(--line);
  background: var(--bar-bg);
  backdrop-filter: saturate(125%) blur(10px);
}

.burger {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.burger svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-bar-brand {
  margin-right: auto;
}

.mobile-bar-login {
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 44;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.55);
}

.app-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

.app-content > .site-footer {
  margin-top: auto;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .app-content {
    margin-left: 0;
  }

  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  /* Sticky sub-navigation clears the mobile bar instead of the old topbar. */
  .match-subnav {
    top: calc(var(--mobile-bar-h) + 0.5rem);
  }
}

/* Shared quiet control base for links-as-buttons and generic buttons. */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.34rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.button:hover,
button:hover {
  background: var(--surface-hover);
  border-color: var(--line);
}

.button:active,
button:active {
  transform: translateY(1px);
}

/* Primary CTA: solid brand green. Generic <button> stays a quiet ghost so
   admin/forms do not turn into a wall of green. */
.button {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent) 60%, var(--accent-deep));
  color: var(--accent-contrast);
  font-weight: 750;
  text-shadow: none;
}

.button:hover {
  border-color: var(--accent-strong);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent-strong) 60%, var(--accent));
  color: var(--accent-contrast);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--accent-border);
  background: var(--surface-hover);
  color: var(--text);
}

button {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-soft);
}

.locale-switch {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.locale-switch a {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.locale-switch a:hover,
.locale-switch a.active {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

/* ---- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-soft);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ---- Admin nav ----------------------------------------------------------- */
.admin-nav {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.55rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  box-shadow: var(--shadow);
}

.admin-nav-group {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  min-width: max-content;
  padding-right: 0.55rem;
  border-right: 1px solid var(--line);
}

.admin-nav-group:last-child {
  border-right: 0;
}

.admin-nav-group > span {
  padding-left: 0.4rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav-group > div {
  display: flex;
  gap: 0.25rem;
}

.admin-nav-account {
  margin-left: auto;
}

.admin-nav a,
.admin-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.34rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.admin-nav a:hover,
.admin-nav button:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--text);
}

.admin-nav a.active {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-soft);
}

.admin-nav form,
.row-actions form,
.job-grid form {
  margin: 0;
}

.admin-surface .page {
  width: min(1480px, calc(100% - 2rem));
}

.admin-surface .panel,
.admin-surface .filters,
.admin-surface .metric {
  border-color: var(--line-strong);
}

.admin-surface .metric {
  position: relative;
  overflow: hidden;
}

.admin-surface .metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 75%);
}

.admin-kpi-grid .metric {
  min-height: 74px;
  background:
    linear-gradient(180deg, var(--accent-bg), transparent 70%),
    var(--surface-panel);
}

.admin-kpi-grid .metric strong {
  font-size: 1.55rem;
}

.admin-health-panel,
.admin-ml-panel {
  border-color: var(--line-strong);
}

.admin-health-panel {
  background:
    linear-gradient(90deg, var(--green-bg), transparent 32%),
    var(--surface-panel);
}

.admin-premium-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  background:
    linear-gradient(90deg, var(--amber-bg), transparent 36%),
    var(--surface-panel);
}

.admin-premium-panel h2,
.admin-premium-panel p {
  margin-bottom: 0.35rem;
}

.admin-premium-panel form {
  margin: 0;
}

.admin-ml-panel {
  background:
    linear-gradient(180deg, var(--accent-bg), transparent 210px),
    var(--surface-panel);
}

/* ---- Layout -------------------------------------------------------------- */
.page {
  width: min(1400px, calc(100% - 1.4rem));
  margin: 1.25rem auto 3rem;
}

.page-head,
.section-head,
.match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-head {
  padding-bottom: 0.4rem;
}

/* 404 shell (task 8.4/R5) */
.not-found-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.8rem;
  font-size: 1.12rem;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

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

/* ---- Entities / avatars -------------------------------------------------- */
.entity-inline,
.entity-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  vertical-align: middle;
}

.entity-title {
  display: flex;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
}

.avatar.logo {
  border-radius: 7px;
}

.avatar.small {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}

.avatar.hero-logo {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.avatar.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

/* ---- Notices ------------------------------------------------------------- */
.notice {
  margin: 1rem 0;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--amber-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--amber-bg);
  color: var(--amber-strong);
}

.notice.danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-strong);
}

/* ---- Badges / pills ------------------------------------------------------ */
.badge,
.status-pill,
.coverage,
.status-text {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge.production,
.status-pill.production,
.status-text.production,
.status-text.finished,
.status-text.ok,
.coverage.high,
.badge.won,
.badge.finished,
.badge.best-of-known {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.badge.experimental,
.badge.pending,
.badge.scheduled,
.badge.map-unknown,
.status-text.experimental,
.status-text.skipped,
.coverage.medium {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.lost,
.badge.failed,
.badge.void,
.status-text.failed,
.status-text.error,
.coverage.low {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.badge.live {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.badge.running,
.coverage.unknown {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
}

/* Pulsing live indicator for added emphasis. */
.badge.live {
  position: relative;
  padding-left: 1.1rem;
}

.badge.live::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: csp-pulse 1.6s infinite;
}

/* Locked (final) prediction marker — accent, without the live pulse. */
.badge.locked {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
}

/* "Will not be played" maps and other de-emphasised badges. */
.badge.muted {
  opacity: 0.7;
}

/* Donation wallet addresses: wrap long strings instead of overflowing. */
code.wallet {
  word-break: break-all;
}

@keyframes csp-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--red-glow);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* ---- Cards / metrics ----------------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0;
}

.metric,
.panel,
.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 84px;
  padding: 0.95rem;
}

.metric span,
.kv-grid span,
.summary-list dt {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.panel {
  margin: 1.1rem 0;
  padding: 1rem;
  overflow-x: auto;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(80px, 1fr);
  gap: 0.5rem 1rem;
  margin: 0;
}

.summary-list dd {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* ---- Filters / forms ----------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
  margin: 1.1rem 0;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
}

.stack-form {
  display: grid;
  gap: 0.8rem;
}

.login-panel {
  width: min(420px, 100%);
  margin: 4rem auto;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.filters .check {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--text);
}

/* ---- Tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.1rem 0;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-panel);
  color: var(--muted);
  font-weight: 650;
}

.tabs a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tabs a.active {
  background: var(--accent-bg);
  color: var(--accent-soft);
  border-color: var(--accent-border);
}

.tabs .tabs-caption {
  align-self: center;
  font-size: 0.84rem;
}

select,
input {
  min-height: 36px;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

::placeholder {
  color: var(--placeholder);
}

/* ---- Tables -------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr.map-live {
  background: color-mix(in srgb, var(--red) 12%, transparent);
}

tbody tr.map-upcoming {
  opacity: 0.62;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--accent-soft);
}

pre {
  margin: 0.6rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--inset);
  color: var(--text);
}

/* ---- Match cards --------------------------------------------------------- */
.match-list {
  display: grid;
  gap: 0.9rem;
}

.match-card {
  padding: 0.95rem 1rem;
  transition: border-color 0.15s ease, transform 0.08s ease;
}

.match-card:hover {
  border-color: var(--line-strong);
}

.right-meta {
  display: grid;
  justify-items: end;
  gap: 0.3rem;
  min-width: 170px;
  text-align: right;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}

.job-grid button,
.row-actions button {
  width: 100%;
}

.admin-job-groups {
  display: grid;
  gap: 1rem;
}

.admin-job-group {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.admin-job-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-job-group h3 {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-job-group button {
  display: grid;
  justify-items: start;
  min-height: 64px;
  padding: 0.65rem 0.75rem;
  border-color: var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.admin-job-group button:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.admin-job-group button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.ml-control-grid {
  margin: 0.5rem 0 0.9rem;
}

.ml-control-grid button {
  display: grid;
  justify-items: start;
  min-height: 62px;
  padding: 0.65rem 0.75rem;
  border-color: var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.ml-control-grid button:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.ml-control-grid button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.admin-wide-action {
  margin-top: 0.65rem;
}

.admin-wide-action button {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 54px;
  padding: 0.65rem 0.8rem;
  border-color: var(--accent-border);
  background: var(--accent-bg);
  text-align: left;
}

.admin-wide-action button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.quality-table td,
.quality-table th {
  white-space: nowrap;
}

.quality-table tr.featured-line td {
  background: var(--accent-bg);
}

.compact-list {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---- Predictions --------------------------------------------------------- */
.prediction-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.8rem;
}

.prediction-block {
  min-height: 118px;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.signal {
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
  font-weight: 650;
}

.model-line,
.reason {
  color: var(--muted);
  font-size: 0.86rem;
}

.round-totals {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.map-row {
  padding: 0.45rem 0;
}

.line-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
}

.market-board {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(210px, 0.85fr);
  gap: 0.85rem 1rem;
  margin-top: 0.8rem;
}

.market-board-compact {
  grid-template-columns: minmax(0, 1fr);
}

.market-board-compact .winner-market {
  max-width: 760px;
}

.market-section {
  min-width: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.market-section-wide {
  grid-column: 1 / -1;
}

.market-section-head {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 24px;
  margin-bottom: 0.45rem;
}

.market-section-head .badge {
  max-width: 100%;
  white-space: normal;
}

.market-section-head h3 {
  margin: 0;
  font-size: 0.88rem;
}

.market-section-head .muted {
  font-size: 0.74rem;
}

.winner-market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.winner-side,
.winner-pick {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.winner-side span,
.winner-pick span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-side strong {
  color: var(--accent);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.winner-side.right {
  text-align: right;
}

.winner-side.right strong {
  color: var(--blue);
}

.winner-pick {
  min-width: 110px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.winner-pick strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prob-bar.compact-line {
  height: 7px;
  margin-top: 0.55rem;
}

.market-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.28rem;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.market-table th {
  padding: 0 0.4rem 0.12rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.market-table td {
  padding: 0.32rem 0.45rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: center;
}

.market-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 7px 0 0 7px;
}

.market-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
}

.market-line {
  color: var(--text);
  font-weight: 800;
}

.market-under {
  color: var(--amber);
  font-weight: 800;
}

.market-over {
  color: var(--green);
  font-weight: 800;
}

.market-table tr.featured-line td {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

/* Over/Under probability bars (replace the text-only market-table on the
   public prediction board). Each line shows its threshold, a horizontal bar
   sized by P(over) and the over percentage, so a glance beats reading numbers. */
.ou-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ou-bar-list.compact {
  gap: 0.22rem;
}

.ou-bar-legend {
  display: grid;
  grid-template-columns: 34px 1fr 44px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.1rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ou-bar-legend span:last-child {
  text-align: right;
}

.ou-bar-row {
  display: grid;
  grid-template-columns: 34px 1fr 44px;
  gap: 0.5rem;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.ou-bar-line {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.ou-bar-track {
  position: relative;
  display: block;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

.ou-bar-list.compact .ou-bar-track {
  height: 11px;
}

.ou-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-deep), var(--green));
  transition: width 0.4s ease;
}

.ou-bar-over {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.ou-bar-row.featured-line .ou-bar-track {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.ou-bar-row.featured-line .ou-bar-line {
  color: var(--accent);
}

.ou-bar-row.featured-line .ou-bar-fill {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

/* Confidence pill: tiered (high/medium/low) read of how decisive the pick is. */
.confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.confidence-dots {
  display: inline-flex;
  gap: 2px;
}

.confidence-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
}

.confidence-dots i.on {
  background: currentColor;
}

.confidence-pill.confidence-high {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.confidence-pill.confidence-medium {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.confidence-pill.confidence-low {
  color: var(--muted);
}

.round-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

.round-market {
  min-width: 0;
}

.round-market header {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}

.round-market header strong,
.round-market header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-market header strong {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.prediction-audit {
  background: var(--surface-panel);
}

.audit-market-list {
  display: grid;
  gap: 0.55rem;
}

.audit-market {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.audit-market summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 42px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.audit-market summary::-webkit-details-marker {
  display: none;
}

.audit-market summary span {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-market summary strong {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
}

.audit-market[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.audit-table {
  min-width: 920px;
}

.audit-table code {
  color: var(--accent-soft);
}

.audit-hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* ---- Quick links / summaries -------------------------------------------- */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.quick-links a {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-links a:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.run-summary {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.metrics-row td {
  padding-top: 0;
  background: var(--surface-soft);
}

/* ---- Public match center ------------------------------------------------ */
.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compact-filters {
  padding: 0.75rem;
}

.empty-state {
  margin: 1rem 0;
  padding: 2.2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.schedule {
  display: grid;
  gap: 1.1rem;
}

.schedule-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.day-heading h2 {
  margin: 0;
  font-size: 0.94rem;
}

.day-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.match-row {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(360px, 1fr) minmax(210px, 0.65fr) 18px;
  align-items: center;
  gap: 1rem;
  min-height: 92px;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.match-row:last-child {
  border-bottom: 0;
}

.match-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Live rows get a left accent stripe + tint so they pop in a long schedule,
   mirroring the .map-card.is-live treatment rather than relying only on the
   pulsing badge. */
.match-row.is-live {
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  box-shadow: inset 3px 0 0 var(--red);
}

.match-row.is-live:hover {
  background: color-mix(in srgb, var(--red) 12%, var(--surface-hover));
}

.match-time {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding-right: 0.8rem;
  border-right: 1px solid var(--line);
}

.match-time strong {
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.match-teams {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 54px minmax(120px, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 13px;
}

.match-team {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.match-team.reverse {
  justify-content: flex-start;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--inset);
  font-variant-numeric: tabular-nums;
}

.match-context {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.match-context > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.row-chevron {
  color: var(--muted);
  font-size: 1.5rem;
}

.badge.featured {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.prob-bar {
  display: flex;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

/* Inline probability row on match cards: a small % label on each side of a
   taller bar, so the prediction is legible at a glance instead of a 5px sliver. */
.prob-row {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.prob-row-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.prob-row-label.team-one {
  color: var(--accent);
  text-align: right;
}

.prob-row-label.team-two {
  color: var(--blue);
  text-align: left;
}

.prob-bar.compact {
  position: relative;
  height: 8px;
}

.prob-bar.large {
  height: 14px;
}

.prob-side.team-one {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.prob-side.team-two {
  background: linear-gradient(90deg, var(--blue-deep), var(--blue));
}

.prob-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.prob-labels.large {
  font-size: 1rem;
}

.prediction-card {
  overflow: hidden;
}

.market-page-head {
  align-items: center;
}

.market-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0.8rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-panel);
}

.market-summary-strip span {
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-summary-strip span:last-child {
  border-right: 0;
}

.market-summary-strip strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.prediction-match-title {
  min-width: 0;
}

.prediction-versus {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
}

.prediction-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prediction-team.reverse {
  flex-direction: row-reverse;
}

.versus-mark {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ---- Home --------------------------------------------------------------- */
.home-head {
  align-items: center;
  margin-bottom: 0.9rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 1rem;
}

.home-main {
  min-width: 0;
}

.home-sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.side-panel {
  position: relative;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* A thin accent stripe on top of each sidebar panel gives the otherwise
   identical boxes a touch of hierarchy. */
.side-panel::before {
  position: absolute;
  top: 0;
  right: 0.9rem;
  left: 0.9rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue-deep));
  content: "";
  opacity: 0.55;
}

.side-panel.home-scoreboard::before {
  background: linear-gradient(90deg, var(--green), var(--accent));
}

.section-head.compact {
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-head.compact h2 {
  margin: 0;
  font-size: 0.98rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.score-grid div {
  min-width: 0;
  padding: 0.15rem 0.55rem 0.15rem 0;
  border-right: 1px solid var(--line);
}

.score-grid div:last-child {
  border-right: 0;
}

.score-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.score-grid strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.ranking-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 26px 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.ranking-list li:last-child {
  border-bottom: 0;
}

.ranking-list a {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list a:hover {
  color: var(--accent-soft);
}

.ranking-list li > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* The HLTV official rank is an external signal distinct from the internal
   strength rating, so it gets its own chip colour. */
.rank-hltv {
  margin-left: auto;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 0.66rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ranking-list .rating {
  min-width: 32px;
  text-align: right;
}

.rank-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-summary {
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 0.4rem 0.75rem;
}

.latest-model-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.latest-model-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-block.first-block {
  margin-top: 0;
}

.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--hero-bg);
  box-shadow: var(--shadow);
}

.hero-banner h1 {
  max-width: 720px;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-banner > div > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.hero-status {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.2rem;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--inset-soft);
  text-align: center;
}

.hero-status strong {
  font-size: 3rem;
  line-height: 1;
}

.hero-status > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-status-sub {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.section-block {
  margin: 1.5rem 0;
}

.section-head h2 {
  margin: 0;
}

/* ---- Match detail ------------------------------------------------------- */
.match-hero,
.prediction-spotlight {
  margin-bottom: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.match-hero {
  overflow: hidden;
  padding: 0;
}

.match-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--inset-soft);
}

.match-hero-scoreboard {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 138px minmax(180px, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.45rem 1rem 1.1rem;
}

.hero-team {
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  text-align: right;
}

.hero-team.reverse {
  justify-items: start;
  text-align: left;
}

.hero-team-name {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-team-name a {
  color: var(--text);
}

.hero-team-name a:hover {
  color: var(--accent-soft);
}

.hero-team-logo {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.hero-team-logo.fallback {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 800;
}

.hero-score {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.hero-score strong {
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
}

.hero-score span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-match-actions {
  justify-content: center;
  padding: 0.8rem 0.95rem 0.95rem;
  border-top: 1px solid var(--line);
}

.match-hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(110px, auto));
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--inset-soft);
}

.match-hero-strip span {
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-hero-strip span:last-child {
  border-right: 0;
}

.prediction-spotlight {
  padding: 1rem;
}

/* On the match page the prediction is the reason the page exists, so the
   winner market inside the spotlight gets a hero-sized probability bar and a
   larger model pick instead of the compact list treatment. */
.prediction-spotlight .winner-market-row {
  gap: 0.9rem;
}

.prediction-spotlight .winner-side strong {
  font-size: 1.25rem;
}

.prediction-spotlight .winner-pick {
  min-width: 140px;
  padding: 0.55rem 0.8rem;
}

.prediction-spotlight .winner-pick strong {
  font-size: 1rem;
}

.prediction-spotlight .prob-bar.compact-line {
  height: 14px;
  margin-top: 0.7rem;
}

.prediction-spotlight .confidence-pill {
  font-size: 0.7rem;
}

/* Per-map team win rates inside the prediction spotlight (from map_profile).
   One row per map: the map name on the left, two stacked comparison bars on
   the right — team one in the brand accent, team two in the blue token. */
.map-winrates {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.map-winrates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-winrates-head .eyebrow {
  margin: 0;
}

.map-winrate-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.map-winrate-map {
  font-weight: 700;
  text-transform: capitalize;
}

.map-winrate-teams {
  display: grid;
  gap: 0.3rem;
}

.map-winrate-team {
  display: grid;
  grid-template-columns: minmax(72px, 128px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.map-winrate-team-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-winrate-track {
  height: 8px;
  border-radius: 999px;
  background: var(--inset-soft);
  overflow: hidden;
}

.map-winrate-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

.map-winrate-team.team-b .map-winrate-fill {
  background: linear-gradient(90deg, var(--blue-deep), var(--blue));
}

.map-winrate-value {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 86px;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.map-winrate-value small {
  font-size: 0.72rem;
}

.player-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lineup-subs {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
}

@media (max-width: 640px) {
  .map-winrate-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding-bottom: 0.4rem;
  }

  .map-winrate-team {
    grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) auto;
  }

  .map-winrate-value {
    min-width: 74px;
  }
}

.mobile-bottom-nav,
.mobile-sheet,
.mobile-sheet-backdrop,
.mobile-filter-button,
.prediction-filter-backdrop,
.prediction-filter-sheet-head { display: none; }

.mobile-search-button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
}

.mobile-search-dialog {
  width: min(92vw, 440px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-panel);
  color: var(--text);
}

.mobile-search-dialog::backdrop { background: rgb(0 0 0 / 65%); }
.mobile-search-dialog form,
.mobile-search-dialog label { display: grid; gap: 0.8rem; }

@media (max-width: 767.98px) {
  .public-surface .app-content { padding-bottom: 76px; }
  .mobile-search-button { display: block; margin-left: auto; }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 80;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 64px;
    padding: 0.35rem max(0.35rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-panel) 94%, transparent);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.15rem;
    padding: 0.25rem 0.1rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.68rem;
    text-decoration: none;
  }

  .mobile-bottom-nav span { color: var(--text); font-size: 1rem; }

  .mobile-sheet-backdrop,
  .prediction-filter-backdrop {
    position: fixed;
    z-index: 88;
    inset: 0;
    border: 0;
    background: rgb(0 0 0 / 56%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .mobile-sheet-backdrop.open,
  .prediction-filter-backdrop.open { display: block; opacity: 1; pointer-events: auto; }

  .mobile-sheet {
    position: fixed;
    z-index: 90;
    inset: auto 0 0;
    display: grid;
    gap: 0.8rem;
    max-height: min(70vh, 560px);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: var(--surface-panel);
    transform: translateY(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease;
  }

  .mobile-sheet.open { transform: translateY(0); visibility: visible; pointer-events: auto; }
  .mobile-sheet header,
  .prediction-filter-sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .mobile-sheet header h2 { margin: 0; }
  .mobile-sheet header button,
  .prediction-filter-sheet-head button { border: 0; background: transparent; color: var(--text); font-size: 1.7rem; }
  [data-mobile-favorites-list] { display: grid; gap: 0.5rem; overflow: auto; }
  [data-mobile-favorites-list] a { padding: 0.7rem; border-radius: 8px; background: var(--surface); }

  .mobile-filter-button {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0.75rem 0;
  }

  .public-surface .prediction-filters {
    position: fixed;
    z-index: 90;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 86vh;
    overflow-y: auto;
    margin: 0;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: var(--surface-panel);
    transform: translateY(105%);
    transition: transform 180ms ease;
  }

  .public-surface .prediction-filters.open { transform: translateY(0); }
  .prediction-filter-sheet-head { grid-column: 1 / -1; }
  .prediction-filters .check,
  .prediction-filters button[type="submit"] { grid-column: 1 / -1; }

  .public-surface .table-scroll,
  .public-surface .panel:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 359px) {
  .public-surface .prediction-filters { grid-template-columns: 1fr; }
  .prediction-filter-sheet-head,
  .prediction-filters .check,
  .prediction-filters button[type="submit"] { grid-column: 1; }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button { font-size: 0.6rem; }
}

.map-hub-grid .entity-card { align-items: center; overflow: hidden; }
.map-hub-grid .entity-card h2 { margin: 0 0 0.25rem; }
.map-hub-visual {
  grid-column: 1 / -1;
  display: block;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  margin: -0.9rem -0.9rem 0;
  background: var(--surface-soft);
}
.map-hub-visual img,
.map-card-visual img,
.map-detail-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.map-detail-hero > img {
  width: min(46vw, 520px);
  aspect-ratio: 16 / 7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.map-match-list { display: grid; gap: 0.5rem; }
.map-match-list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.map-match-list span { display: grid; gap: 0.2rem; }

.compact-notice {
  margin: 0.8rem 0;
  padding-block: 0.55rem;
  font-size: 0.84rem;
}

.match-subnav {
  position: sticky;
  top: 0.5rem;
  z-index: 8;
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bar-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.match-subnav a {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.match-subnav a:hover {
  background: var(--accent-bg);
  color: var(--accent-soft);
}

.match-section {
  scroll-margin-top: 120px;
  margin-block: 1.35rem;
}

.team-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.team-insight-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.team-insight-card > header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.team-insight-card h3 {
  margin: 0;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

/* ---- Team detail page ---------------------------------------------------- */
.team-hero {
  align-items: center;
}

.team-rating-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.team-rating {
  display: grid;
  gap: 0.1rem;
  min-width: 120px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-panel);
}

.team-rating span {
  color: var(--muted);
  font-size: 0.75rem;
}

.team-rating strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.team-rating small {
  font-size: 0.72rem;
}

.team-next-match {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
}

.team-next-match-names,
.team-next-match-probabilities {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.team-next-match-names strong:first-child,
.team-next-match-probabilities strong:first-child {
  text-align: left;
}

.team-next-match-names strong:last-child,
.team-next-match-probabilities strong:last-child {
  text-align: right;
}

.team-next-match-probabilities i {
  display: block;
  width: min(140px, 24vw);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-panel);
}

.team-next-match-probabilities i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.match-minimal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: -0.3rem 0 0.8rem;
}

.match-minimal-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.match-minimal-form > div > span {
  display: flex;
  gap: 0.25rem;
}

.form-dot {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-panel);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.form-dot.win {
  background: var(--green-bg);
  color: var(--green);
}

.form-dot.loss {
  background: var(--red-bg);
  color: var(--red);
}

.tournament-match-prediction {
  display: block;
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.tier-badge.tier-s {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
}

.tier-badge.tier-a {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.tier-badge.tier-b {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.tier-badge.tier-c,
.tier-badge.tier-d {
  opacity: 0.8;
}

.accuracy-note {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
}

.roster-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.roster-kd {
  text-align: right;
}

.roster-kd strong,
.roster-kd small {
  display: block;
  font-variant-numeric: tabular-nums;
}

.team-map-stats {
  display: grid;
  gap: 0.55rem;
}

/* Results table stays on one line and scrolls inside the panel on narrow
   screens instead of wrapping headers mid-word. */
.team-results-table th,
.team-results-table td {
  white-space: nowrap;
}

.team-map-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
}

.team-map-row .map-winrate-value {
  min-width: 92px;
}

@media (max-width: 640px) {
  .team-hero {
    align-items: stretch;
  }

  .team-rating-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-map-row {
    grid-template-columns: 76px minmax(0, 1fr) auto;
  }

  .team-map-row .map-winrate-value {
    min-width: 0;
  }

  .team-map-row .map-winrate-value small {
    display: none;
  }
}

.team-stat-grid > div {
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--inset-soft);
}

.team-stat-grid span,
.team-stat-grid strong {
  display: block;
}

.team-stat-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.team-stat-grid strong {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.form-strip {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  overflow-x: auto;
}

.form-result {
  display: grid;
  grid-template-columns: 24px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  min-width: 145px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.76rem;
}

.form-result strong {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.form-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-result.win strong {
  background: var(--green-bg);
  color: var(--green);
}

.form-result.loss strong {
  background: var(--red-bg);
  color: var(--red);
}

.form-result.draw strong,
.form-result.unknown strong {
  background: var(--amber-bg);
  color: var(--amber);
}

.player-stats-grid .panel {
  margin: 0;
}

.player-stats-card h3 {
  margin-top: 0;
}

.stats-table td:not(:first-child),
.stats-table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-tournament-table {
  min-width: 440px;
}

.prediction-table {
  min-width: 900px;
}

.stat-diff.positive {
  color: var(--green);
}

.stat-diff.negative {
  color: var(--red);
}

.h2h-score {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 260px;
  text-align: center;
}

.h2h-score strong {
  font-size: 1.5rem;
  color: var(--accent);
}

.h2h-score span {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) minmax(160px, 0.7fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row:hover {
  background: var(--surface-hover);
}

.history-row > span:last-child {
  color: var(--muted);
  text-align: right;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer a {
  color: var(--link);
  font-weight: 650;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--link-strong);
  text-decoration: underline;
}

/* Telegram entry points follow the ODP convention: blue, not the brand
   green, so users recognise the messenger at a glance. */
.footer-telegram {
  color: var(--blue);
}

.footer-telegram:hover {
  color: var(--blue);
  text-decoration: underline;
}

.button.telegram {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.button.telegram:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue);
}

/* ---- Site user auth (Telegram login) ------------------------------------- */
.sidebar-login {
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.sidebar-user:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bar-user {
  padding: 0.3rem 0.6rem;
}

.badge.pro {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber-strong);
}

.account-card,
.account-login {
  max-width: 640px;
}

/* Green site-wide banner shown while premium is open to everyone. */
.premium-banner {
  margin: 0 0 1rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--green-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--green-bg);
  color: var(--green-strong);
  font-weight: 650;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .admin-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
  }

  .admin-nav-group {
    flex: 0 0 auto;
  }

  .admin-nav-account {
    justify-self: auto;
  }

  .metric-grid,
  .kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .prediction-columns,
  .market-board,
  .team-insight-grid,
  .home-layout {
    grid-template-columns: 1fr;
  }

  .market-section-wide {
    grid-column: auto;
  }

  .home-sidebar {
    position: static;
  }

  .market-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-summary-strip span:nth-child(2) {
    border-right: 0;
  }

  .market-summary-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .match-hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-hero-strip span:nth-child(2) {
    border-right: 0;
  }

  .match-hero-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .match-row {
    grid-template-columns: 72px minmax(0, 1fr) 18px;
  }

  /* Narrower team/score columns so long names ellipsize instead of
     spilling over the time column on tablets and small laptops. */
  .match-teams {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 0.5rem;
  }

  .match-context {
    grid-column: 2;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
  }

  .row-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .history-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .history-row > span:last-child {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .match-minimal-form {
    grid-template-columns: 1fr;
  }

  .match-minimal-form > div > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-minimal-form > div > span {
    flex: 0 0 auto;
  }

  .page-head,
  .match-head,
  .home-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-actions {
    justify-content: flex-start;
  }

  .page {
    width: min(100% - 1rem, 1400px);
  }

  .metric-grid,
  .kv-grid,
  .line-grid {
    grid-template-columns: 1fr;
  }

  .winner-market-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .winner-pick {
    grid-column: 1 / -1;
    order: 3;
  }

  .right-meta {
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .hero-banner {
    grid-template-columns: 1fr;
  }

  .hero-status {
    display: none;
  }

  .match-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.65rem;
  }

  .match-time {
    padding-right: 0.45rem;
  }

  .match-time strong {
    font-size: 0.95rem;
  }

  .match-teams {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 0.35rem;
  }

  .match-team {
    gap: 0.3rem;
  }

  .match-team .avatar {
    width: 26px;
    height: 26px;
  }

  .team-name {
    font-size: 0.84rem;
  }

  .match-context {
    grid-column: 1 / -1;
  }

  .row-chevron {
    display: none;
  }

  .match-subnav {
    position: static;
  }

  .team-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .h2h-score {
    min-width: 0;
  }

  .match-hero-scoreboard {
    grid-template-columns: 1fr 76px 1fr;
    gap: 0.7rem;
    padding-inline: 0.65rem;
  }

  .hero-team-logo {
    width: 52px;
    height: 52px;
  }

  .hero-team-name {
    font-size: 1rem;
  }

  .hero-score strong {
    font-size: 1.65rem;
  }

  .prediction-versus {
    align-items: flex-start;
    flex-direction: column;
  }

  .prediction-team.reverse {
    flex-direction: row;
  }

  /* Teams ranking becomes a stack of cards on phones: the team cell is the
     card header, the remaining columns turn into label/value rows so long
     names no longer squeeze into vertical syllables. */
  .teams-table thead {
    display: none;
  }

  .teams-table,
  .teams-table tbody,
  .teams-table tr,
  .teams-table td {
    display: block;
  }

  .teams-table tr {
    margin-bottom: 0.6rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .teams-table tr:last-child {
    margin-bottom: 0;
  }

  .teams-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0;
    border-bottom: 0;
  }

  .teams-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .teams-table td:first-child {
    display: block;
    margin-bottom: 0.3rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
  }

  .teams-table td:first-child::before {
    content: none;
  }
}

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

/* ---- Match map cards (series view) ------------------------------------- */
.series-total-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.map-card-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.map-profile-list {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 0.9rem;
}

.map-profile {
  min-width: 0;
  overflow-x: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.map-profile header {
  margin-bottom: 0.35rem;
}

.map-profile-table {
  font-size: 0.78rem;
}

.map-profile-table th,
.map-profile-table td {
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
}

.map-card {
  display: grid;
  gap: 0.6rem;
  overflow: hidden;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.map-card-visual {
  display: block;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  margin: -0.85rem -0.95rem 0;
  background: var(--surface-soft);
}

.map-card-visual img {
  display: block;
  transition: transform 180ms ease;
}

.map-card:hover .map-card-visual img {
  transform: scale(1.025);
}

.map-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.map-card.is-live {
  border-color: var(--accent-border);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.map-card.is-upcoming {
  opacity: 0.9;
}

.map-card.is-skipped {
  opacity: 0.5;
}

.map-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-order {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.map-card-name {
  display: grid;
  gap: 0.15rem;
  min-height: 2.4rem;
}

.map-card-name strong {
  font-size: 1.05rem;
}

.map-card-name small {
  font-size: 0.74rem;
}

.map-card-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.map-card-score em {
  font-style: normal;
  font-size: 1.15rem;
  color: var(--muted);
}

.map-card-total {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.inline-upload {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-upload input[type="file"] {
  width: min(240px, 28vw);
  font-size: 0.78rem;
}

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

@media (max-width: 640px) {
  .map-detail-hero { display: grid; }
  .map-detail-hero > img { width: 100%; }
  .inline-upload { align-items: stretch; flex-direction: column; }
  .inline-upload input[type="file"] { width: 100%; }
}

.ou-pair {
  display: flex;
  gap: 0.4rem;
}

.ou {
  flex: 1;
  padding: 0.22rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ou-pair.small .ou {
  font-size: 0.78rem;
}

.ou.over {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.ou.under {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.summary-list.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.2rem 1.2rem;
}

/* Homepage match cards reuse the schedule .match-row inside a rounded card. */
.card-rows {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---- Round timeline (GOTV demo history) ---- */
.round-map {
  margin-bottom: 1rem;
}

.round-map-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.round-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.round-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  cursor: pointer;
}

/* Side colours: T = amber, CT = blue — the CS side conventions. */
.round-chip.side-t {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.round-chip.side-ct {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.round-chip-num {
  font-weight: 800;
  color: var(--text);
}

.round-chip-score {
  color: var(--muted);
  font-size: 0.66rem;
}

.round-chip.type-pistol {
  box-shadow: inset 0 -2px 0 var(--green);
}

/* Expandable player breakdown. */
.round-chip-detail {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
}

.round-chip-detail summary {
  list-style: none;
  cursor: pointer;
}

.round-chip-detail summary::-webkit-details-marker {
  display: none;
}

.round-chip-detail[open] .round-players {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: var(--shadow);
}

.round-players ul {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
}

.round-players li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---- Map veto (pick / ban / decider) ---- */
.veto-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.veto-step {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.92rem;
}

.veto-step .veto-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.veto-step .veto-team {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.veto-step .veto-action {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: lowercase;
}

.veto-step .veto-map {
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.veto-step.action-pick {
  border-left-color: var(--green);
}
.veto-step.action-pick .veto-map {
  color: var(--green);
  background: var(--green-bg);
}

.veto-step.action-ban {
  border-left-color: var(--red);
}
.veto-step.action-ban .veto-map {
  color: var(--red);
  background: var(--red-bg);
  text-decoration: line-through;
  text-decoration-color: var(--red-border);
}

.veto-step.action-leftover {
  border-left-color: var(--amber);
}
.veto-step.action-leftover .veto-map {
  color: var(--amber);
  background: var(--amber-bg);
}

@media (max-width: 560px) {
  .veto-step {
    grid-template-columns: 26px 1fr auto;
    grid-template-areas:
      "num team map"
      "num action map";
  }
  .veto-step .veto-num {
    grid-area: num;
  }
  .veto-step .veto-team {
    grid-area: team;
  }
  .veto-step .veto-action {
    grid-area: action;
  }
  .veto-step .veto-map {
    grid-area: map;
    align-self: center;
  }
}

.favorite-toggle {
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.favorite-toggle.selected {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.user-vs-csp {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 14px;
  padding: 1.1rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 7%, var(--surface-panel)), var(--surface-panel));
}

.user-pick-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.user-pick-buttons button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.user-pick-buttons button.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--accent);
}

.user-pick-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.user-vs-csp[aria-busy="true"] [data-engagement-message]::before {
  content: "";
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.45rem;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: engagement-spin 0.7s linear infinite;
  vertical-align: -0.08rem;
}

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

.user-vs-csp-sync-note {
  margin-top: -0.15rem;
  font-size: 0.82rem;
}

.user-vs-csp-grid,
.my-csp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.my-csp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.user-vs-csp-grid > div,
.my-csp-stats > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border-radius: 9px;
  background: var(--surface);
}

.user-vs-csp-grid span,
.my-csp-stats span { color: var(--muted); font-size: 0.78rem; }

.notification-preferences {
  display: grid;
  gap: 0.7rem;
}

.notification-preferences label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 38px;
}

.notification-preferences input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 640px) {
  .user-vs-csp-grid,
  .my-csp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-vs-csp-profile { display: none; }
}

.entity-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
}

.entity-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.entity-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.entity-card h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.entity-card p {
  margin: 0;
}

.entity-card dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
}

.entity-card dd {
  margin: 0;
  font-weight: 700;
}

.player-card-photo,
.player-hero-photo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--inset);
}

.tournament-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.tournament-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.tournament-card:hover {
  border-color: var(--accent-border);
}

.tournament-card h3,
.tournament-card p {
  margin: 0;
}

.tournament-card > .muted {
  grid-column: 1 / -1;
}

.tournament-card-status {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.tournament-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.tournament-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
}

.player-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.player-hero-photo {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  font-size: 1.5rem;
  font-weight: 800;
}

/* ---- Prediction stats page ---- */
.stats-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  margin: 1rem 0;
}

.stats-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.stats-filters select,
.stats-filters input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--inset);
  color: var(--text);
  min-width: 7rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--inset-soft);
}

.stat-tile span {
  font-size: 0.78rem;
  color: var(--muted);
}

.stat-tile strong {
  font-size: 1.5rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

/* Touch-friendly pager targets (>= 40px). */
.pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 650;
}

.pagination a:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent-soft);
}

/* ---- Daily match-intelligence homepage ---- */
.today-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

.today-header h1 {
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.045em;
}

.today-status {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  white-space: nowrap;
}

.day-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.day-switcher a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  color: var(--muted);
  text-align: center;
}

.day-switcher a.is-current {
  background: var(--accent-bg);
  color: var(--text);
  font-weight: 750;
}

.top-picks-block {
  margin-bottom: 1.4rem;
}

.top-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.top-pick-card {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), var(--accent-bg));
  overflow: hidden;
}

.top-pick-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.95rem;
  color: var(--text);
}

.top-pick-main > .muted {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-pick-main > strong {
  font-size: 1.15rem;
}

.top-pick-probability {
  grid-row: 2 / span 2;
  grid-column: 2;
  align-self: center;
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.top-pick-main > .badge {
  justify-self: start;
}

.pick-why {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.95rem;
}

.pick-why summary,
.lazy-match-section > summary {
  cursor: pointer;
  min-height: 40px;
}

.pick-why p {
  margin: 0.65rem 0;
  font-size: 0.9rem;
}

.factor-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.badge.supports {
  color: var(--green);
  background: var(--green-bg);
}

.badge.opposes {
  color: var(--red);
  background: var(--red-bg);
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 1.25rem;
  align-items: start;
}

.today-feed {
  min-width: 0;
}

.lazy-match-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style-position: inside;
}

.lazy-match-content {
  margin-top: 0.85rem;
}

.return-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.return-value-card,
.methodology-card,
.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.return-value-card {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  padding: 1rem;
}

.return-value-card h3,
.methodology-card h2,
.faq-section h2 {
  text-wrap: balance;
}

.return-value-card p,
.methodology-card p,
.faq-list p {
  color: var(--muted);
  text-wrap: pretty;
}

.return-value-card > a {
  margin-top: auto;
  font-weight: 750;
}

.return-value-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  color: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.methodology-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem;
}

.methodology-card ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.methodology-card li + li {
  margin-top: 0.45rem;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.faq-list details {
  padding: 0.85rem 1rem;
}

.faq-list summary {
  min-height: 44px;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  text-wrap: balance;
}

.faq-list p {
  margin: 0.65rem 0 0;
}

@media (max-width: 900px) {
  .today-layout {
    grid-template-columns: 1fr;
  }

  .today-layout .home-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .return-value-grid,
  .methodology-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .today-header {
    align-items: start;
    flex-direction: column;
  }

  .day-switcher a {
    padding-inline: 0.35rem;
    font-size: 0.83rem;
  }

  .top-pick-grid {
    grid-template-columns: 1fr;
  }

  .return-value-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }
}

.prediction-movement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.prediction-movement > div {
  display: grid;
  gap: 0.15rem;
}

.prediction-movement > div span {
  color: var(--muted);
  font-size: 0.78rem;
}

.movement-arrow {
  color: var(--accent-soft);
  font-size: 1.35rem;
}

.prediction-why-summary {
  max-width: 72ch;
  font-size: 1.05rem;
}

.series-scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.series-scenario > div {
  display: grid;
  gap: 0.15rem;
}

.series-scenario > div > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.factor-table td:last-child,
.factor-table th:last-child {
  text-align: right;
}

.live-intelligence {
  border-color: var(--accent-border);
  background: linear-gradient(145deg, var(--surface), var(--accent-bg));
}

.live-probability-grid {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(160px, 2fr) minmax(110px, 1fr);
  align-items: center;
  gap: 0.8rem;
}

.live-probability-grid > div:first-child,
.live-probability-grid > div:last-child {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.live-probability-grid .reverse {
  flex-direction: row-reverse;
}

.live-last-rounds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
}

.live-last-rounds .round-chip {
  display: grid;
  min-width: 82px;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.calibration-list {
  display: grid;
  gap: 0.65rem;
}

.calibration-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(180px, 2fr) minmax(100px, 0.6fr);
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.calibration-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--inset);
  overflow: hidden;
}

.calibration-track i,
.calibration-track b {
  position: absolute;
  inset: 0 auto 0 0;
}

.calibration-track i {
  background: var(--accent);
  opacity: 0.4;
}

.calibration-track b {
  height: 3px;
  top: auto;
  bottom: 0;
  background: var(--green);
}

@media (max-width: 560px) {
  .calibration-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 560px) {
  .prediction-movement {
    align-items: stretch;
    flex-direction: column;
  }

  .movement-arrow {
    transform: rotate(90deg);
    align-self: center;
  }

  .live-probability-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   NTDevLab ecosystem additions (DS v1): product switcher + footer eco row.
   Plain crawlable links; tokens only.
   ============================================================================ */
.side-link--eco .side-eco-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.side-link--eco:hover .side-eco-icon {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.footer-eco {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.footer-eco a {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.footer-eco a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-border);
}

/* Keep admin odds columns readable on narrow screens; scroll the table only. */
@media (max-width: 768px) {
  .admin-odds-scroll { max-width: 100%; }
  .admin-odds-table { min-width: 35rem; }
  .admin-odds-table th, .admin-odds-table td { overflow-wrap: normal; word-break: normal; }
}

@media (max-width: 767.98px) {
  /* The open sidebar is modal; the bottom bar must not intercept its controls. */
  body.sidebar-open .mobile-bottom-nav { visibility: hidden; pointer-events: none; }
}
