/* XingXing Viewer V1.2 — shell and shared presentation tokens. */
:root {
  color-scheme: dark;
  --xx-color-canvas: #090b0d;
  --xx-color-surface: #101317;
  --xx-color-surface-raised: #15191e;
  --xx-color-surface-soft: #1a1f25;
  --xx-color-border: #252b32;
  --xx-color-border-strong: #343d46;
  --xx-color-text: #f1f4f0;
  --xx-color-text-muted: #98a19b;
  --xx-color-text-dim: #66706a;
  --xx-color-accent: #c8ff57;
  --xx-color-accent-soft: rgba(200, 255, 87, 0.1);
  --xx-color-live: #ff5c63;
  --xx-color-success: #65d98b;
  --xx-color-warning: #f6c65b;
  --xx-color-danger: #ff7379;

  --xx-space-1: 0.25rem;
  --xx-space-2: 0.5rem;
  --xx-space-3: 0.75rem;
  --xx-space-4: 1rem;
  --xx-space-5: 1.25rem;
  --xx-space-6: 1.5rem;
  --xx-space-8: 2rem;

  --xx-font-xs: 0.6875rem;
  --xx-font-sm: 0.8125rem;
  --xx-font-md: 0.9375rem;
  --xx-font-lg: 1.125rem;
  --xx-font-xl: 1.5rem;
  --xx-leading-tight: 1.2;
  --xx-leading-normal: 1.5;

  --xx-radius-sm: 0.25rem;
  --xx-radius-md: 0.375rem;
  --xx-radius-lg: 0.625rem;
  --xx-control-height: 2.25rem;
  --xx-row-height: 3.25rem;
  --xx-content-max: 90rem;

  /* Legacy aliases remain available to every existing Viewer component. */
  --xx-bg: var(--xx-color-canvas);
  --xx-surface: var(--xx-color-surface);
  --xx-surface-2: var(--xx-color-surface-raised);
  --xx-panel: var(--xx-color-surface);
  --xx-line: var(--xx-color-border);
  --xx-line-soft: rgba(200, 255, 87, 0.28);
  --xx-text: var(--xx-color-text);
  --xx-muted: var(--xx-color-text-muted);
  --xx-dim: var(--xx-color-text-dim);
  --xx-accent: var(--xx-color-accent);
  --xx-danger: var(--xx-color-danger);
  --xx-green: var(--xx-color-success);
}

html {
  scroll-padding-top: 5rem;
}

body {
  background:
    radial-gradient(circle at 50% -20rem, rgba(200, 255, 87, 0.07), transparent 42rem),
    var(--xx-color-canvas);
  font-size: var(--xx-font-md);
  line-height: var(--xx-leading-normal);
}

.viewer-skip-link {
  position: fixed;
  z-index: 10000;
  inset: var(--xx-space-2) auto auto var(--xx-space-2);
  padding: var(--xx-space-2) var(--xx-space-3);
  color: var(--xx-color-canvas);
  background: var(--xx-color-accent);
  border-radius: var(--xx-radius-md);
  font-weight: 800;
  transform: translateY(-200%);
}

.viewer-skip-link:focus {
  transform: translateY(0);
}

.viewer-shell {
  width: min(var(--xx-content-max), calc(100% - 1.5rem));
  margin: var(--xx-space-3) auto var(--xx-space-8);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.viewer-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: block;
  padding: var(--xx-space-2);
  background: color-mix(in srgb, var(--xx-color-surface) 94%, transparent);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-lg);
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(1rem);
}

.viewer-topbar {
  display: grid;
  grid-template-columns: auto minmax(31rem, 1fr) minmax(9rem, 13rem) auto;
  gap: var(--xx-space-2);
  align-items: center;
}

.viewer-brand {
  display: inline-flex;
  gap: var(--xx-space-2);
  align-items: center;
  min-height: 2.5rem;
  padding: 0 var(--xx-space-2) 0 0;
  color: var(--xx-color-text);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--xx-color-border);
  cursor: pointer;
}

.viewer-brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--xx-color-canvas);
  background: var(--xx-color-accent);
  border-radius: var(--xx-radius-md);
  font-size: var(--xx-font-xs);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.viewer-brand-copy {
  display: grid;
  text-align: left;
}

.viewer-brand-copy strong {
  font-size: var(--xx-font-sm);
  line-height: var(--xx-leading-tight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viewer-brand-copy small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  line-height: var(--xx-leading-tight);
}

.viewer-primary-nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--xx-color-border-strong) transparent;
}

.viewer-tabs {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  list-style: none;
}

.viewer-tabs > li {
  display: flex;
  flex: 0 0 auto;
}

.viewer-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0 var(--xx-space-3);
  color: var(--xx-color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--xx-radius-sm);
  font: 750 var(--xx-font-sm)/1 var(--xx-font-ui);
  text-transform: none;
  white-space: nowrap;
}

.viewer-tab::after {
  position: absolute;
  right: var(--xx-space-3);
  bottom: 0.125rem;
  left: var(--xx-space-3);
  height: 0.125rem;
  background: var(--xx-color-accent);
  border-radius: 999px;
  content: "";
  opacity: 0;
}

.viewer-tab:is(:hover, .active) {
  color: var(--xx-color-text);
  background: var(--xx-color-accent-soft);
  border-color: transparent;
}

.viewer-tab.active::after {
  opacity: 1;
}

.viewer-live-tab:is(:hover, .active) {
  background: rgba(255, 92, 99, 0.1);
}

.viewer-live-tab.active::after {
  background: var(--xx-color-live);
}

.viewer-live-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  background: var(--xx-color-text-dim);
  border-radius: 50%;
}

.viewer-live-tab.has-live .viewer-live-dot {
  background: var(--xx-color-live);
  box-shadow: 0 0 0 0.2rem rgba(255, 92, 99, 0.14);
}

.viewer-live-count {
  min-width: 1.25rem;
  padding: 0.125rem 0.3rem;
  color: var(--xx-color-text-muted);
  background: var(--xx-color-surface-soft);
  border-radius: 999px;
  font-size: 0.625rem;
  line-height: 1.2;
  text-align: center;
}

.viewer-global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.viewer-global-search i {
  position: absolute;
  left: var(--xx-space-3);
  color: var(--xx-color-text-dim);
  pointer-events: none;
}

.viewer-global-search input {
  width: 100%;
  height: var(--xx-control-height);
  padding: 0 var(--xx-space-3) 0 2rem;
  color: var(--xx-color-text);
  background: var(--xx-color-canvas);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
  outline: 0;
}

.viewer-global-search input::placeholder {
  color: var(--xx-color-text-dim);
}

.viewer-status {
  min-height: var(--xx-control-height);
  max-width: 10rem;
  padding: 0 var(--xx-space-2);
  overflow: hidden;
  color: var(--xx-color-text-muted);
  background: transparent;
  border: 0;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
}

.viewer-context-filters {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) repeat(3, minmax(8rem, 0.55fr));
  gap: var(--xx-space-2);
  align-items: end;
  margin: var(--xx-space-3) 0;
  padding: var(--xx-space-3);
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-lg);
}

.viewer-context-filters[hidden] {
  display: none;
}

.viewer-context-filters label {
  display: grid;
  gap: var(--xx-space-1);
}

.viewer-context-filters label > span {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 750;
}

.viewer-context-filters select,
.viewer-context-filters input {
  width: 100%;
  height: var(--xx-control-height);
  padding: 0 var(--xx-space-2);
  color: var(--xx-color-text);
  background: var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
  outline: 0;
}

.viewer-content {
  margin-top: var(--xx-space-3);
}

.viewer-content:focus {
  outline: 0;
}

.summary-grid {
  gap: var(--xx-space-2);
  margin-bottom: var(--xx-space-3);
}

.summary-grid[hidden] {
  display: none;
}

.summary-card {
  padding: var(--xx-space-3);
  background: var(--xx-color-surface);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.summary-card strong {
  margin-top: var(--xx-space-1);
  font-size: var(--xx-font-xl);
}

.viewer-panel {
  padding: var(--xx-space-3);
  background: var(--xx-color-surface-raised);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-lg);
}

.panel-header {
  min-height: 2rem;
  margin-bottom: var(--xx-space-2);
}

.panel-header h2 {
  margin: 0;
  font-size: var(--xx-font-lg);
}

.panel-header > span {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
}

.match-grid,
.match-list,
.team-ranking-list,
.tournament-grid,
.transfers-list {
  gap: var(--xx-space-1);
}

.match-date-group {
  gap: var(--xx-space-1);
  margin-bottom: var(--xx-space-3);
}

.match-date-header {
  min-height: 2rem;
  padding: var(--xx-space-1) var(--xx-space-2);
  background: var(--xx-color-surface-soft);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
}

.match-date-header h3 {
  font-size: var(--xx-font-sm);
  text-transform: none;
}

/* Shared component primitives used by current and future V1 pages. */
.ui-flag,
.country-flag {
  width: 1.125rem;
  height: 0.8125rem;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.125rem;
}

.ui-team-logo,
.team-logo,
.team-logo-fallback {
  flex: 0 0 auto;
  object-fit: contain;
}

.ui-status {
  display: inline-flex;
  gap: var(--xx-space-1);
  align-items: center;
  min-height: 1.25rem;
  padding: 0 var(--xx-space-2);
  color: var(--xx-color-text-muted);
  background: var(--xx-color-surface-soft);
  border: 1px solid var(--xx-color-border);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-status[data-status="LIVE"],
.ui-status[data-status="PAUSED"] {
  color: var(--xx-color-live);
  border-color: rgba(255, 92, 99, 0.36);
}

.ui-scoreline {
  display: inline-flex;
  gap: var(--xx-space-1);
  align-items: baseline;
  color: var(--xx-color-text);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.ui-match-row,
.match-row-card {
  min-height: var(--xx-row-height);
  padding: var(--xx-space-2) var(--xx-space-3);
  background: var(--xx-color-surface);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
}

.match-row-card {
  grid-template-columns: minmax(11rem, 0.72fr) minmax(27rem, 1.65fr) minmax(9rem, 0.55fr);
}

.match-row-team {
  min-height: 2.25rem;
  padding: var(--xx-space-1) var(--xx-space-2);
  background: var(--xx-color-surface-raised);
  border-radius: var(--xx-radius-sm);
}

.match-row-team span,
.match-row-team strong {
  font-size: var(--xx-font-sm);
}

.match-row-team .team-logo,
.match-row-team .team-logo-fallback {
  width: 1.625rem;
  height: 1.625rem;
  flex-basis: 1.625rem;
}

.ui-player-row,
.stats-player-row {
  min-height: var(--xx-row-height);
}

.team-ranking-row {
  min-height: var(--xx-row-height);
  padding: var(--xx-space-2) var(--xx-space-3);
  background: var(--xx-color-surface);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
}

.stats-filter-panel {
  gap: var(--xx-space-3);
  margin-bottom: var(--xx-space-3);
  padding: var(--xx-space-3);
  background: var(--xx-color-surface);
  border-color: var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.stats-filter-grid {
  gap: var(--xx-space-2);
}

.stats-filter-grid select,
.stats-filter-grid input,
.player-compare-controls select {
  height: var(--xx-control-height);
}

.stats-table th {
  height: 2.5rem;
  padding: 0 var(--xx-space-3);
  background: var(--xx-color-surface-soft);
}

.stats-table td {
  height: var(--xx-row-height);
  padding: var(--xx-space-2) var(--xx-space-3);
}

.table-wrap {
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.viewer-shell.detail-open .viewer-context-filters,
.viewer-shell.detail-open .summary-grid {
  display: none;
}

.viewer-shell.detail-open .viewer-tabs {
  display: flex;
}

.viewer-shell.detail-open {
  width: min(var(--xx-content-max), calc(100% - 1.5rem));
  margin: var(--xx-space-3) auto var(--xx-space-8);
  padding: 0;
}

.viewer-shell.detail-open .viewer-header {
  display: block;
}

@media (max-width: 75rem) {
  .viewer-topbar {
    grid-template-columns: auto minmax(0, 1fr) minmax(8rem, 11rem);
  }

  .viewer-status {
    display: none;
  }
}

@media (max-width: 56rem) {
  .viewer-topbar {
    grid-template-columns: auto minmax(8rem, 1fr);
  }

  .viewer-primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid var(--xx-color-border);
  }

  .viewer-tabs {
    padding-top: var(--xx-space-1);
  }

  .viewer-context-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-row-card {
    grid-template-columns: minmax(9rem, 0.7fr) minmax(22rem, 1.5fr) minmax(8rem, 0.5fr);
    overflow-x: auto;
  }
}

@media (max-width: 47.5rem) {
  .viewer-shell {
    width: calc(100% - 0.75rem);
    margin: 0.375rem auto 1.5rem;
    padding: 0;
  }

  .viewer-header {
    padding: var(--xx-space-1);
    border-radius: var(--xx-radius-md);
  }

  .viewer-brand-copy small {
    display: none;
  }

  .viewer-global-search input {
    min-width: 0;
  }

  .viewer-context-filters {
    grid-template-columns: 1fr 1fr;
    margin: var(--xx-space-2) 0;
    padding: var(--xx-space-2);
  }

  .viewer-content {
    margin-top: var(--xx-space-2);
  }

  .viewer-panel {
    padding: var(--xx-space-2);
  }

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

  .match-row-card {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .match-row-teams {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .match-row-side {
    grid-template-columns: auto minmax(0, 1fr);
    text-align: left;
  }

  .match-row-side small {
    justify-self: end;
    text-align: right;
  }

  .stats-filter-grid,
  .stats-filter-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 26rem) {
  .viewer-brand-copy {
    display: none;
  }

  .viewer-context-filters {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .viewer-tab,
  .viewer-brand,
  .viewer-global-search input,
  .viewer-context-filters :is(input, select) {
    min-height: 2.75rem;
  }
}

@media (forced-colors: active) {
  .viewer-header,
  .viewer-context-filters,
  .viewer-panel,
  .ui-status,
  .ui-match-row,
  .ui-player-row {
    border: 1px solid CanvasText;
  }
}

/* V1.3 — XingXing Hub sports overview. */
#panel-home {
  padding: 0;
  background: transparent;
  border: 0;
}

.home-content {
  display: grid;
  gap: var(--xx-space-3);
}

.summary-card-live strong {
  color: var(--xx-color-live);
}

.hub-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem);
  gap: var(--xx-space-3);
  align-items: center;
  min-height: 5.75rem;
  padding: var(--xx-space-4) var(--xx-space-5);
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(200, 255, 87, 0.09), transparent 48%),
    var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-lg);
}

.hub-lead-copy {
  min-width: 0;
}

.hub-lead-copy > small,
.hub-card-header small,
.hub-broadcast-button small {
  display: block;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hub-lead h1 {
  margin: var(--xx-space-1) 0;
  color: var(--xx-color-text);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  line-height: var(--xx-leading-tight);
}

.hub-lead p {
  margin: 0;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-sm);
}

.hub-broadcast-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--xx-space-3);
  align-items: center;
  min-height: 3.75rem;
  padding: var(--xx-space-3) var(--xx-space-4);
  color: var(--xx-color-text);
  text-align: left;
  background: var(--xx-color-canvas);
  border: 1px solid var(--xx-color-border-strong);
  border-radius: var(--xx-radius-md);
  cursor: pointer;
}

.hub-broadcast-button:hover,
.hub-broadcast-button:focus-visible {
  border-color: var(--xx-color-accent);
  box-shadow: inset 0 0 0 1px var(--xx-color-accent-soft);
}

.hub-broadcast-button strong {
  display: block;
  margin-top: var(--xx-space-1);
  font-size: var(--xx-font-md);
}

.hub-broadcast-button > i {
  color: var(--xx-color-accent);
}

.hub-live-pulse {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--xx-color-live);
  border-radius: 50%;
  box-shadow: 0 0 0 0.25rem rgba(255, 92, 99, 0.12);
}

.hub-dashboard {
  display: grid;
  grid-template-columns: minmax(13rem, 0.7fr) minmax(30rem, 1.65fr) minmax(15rem, 0.85fr);
  gap: var(--xx-space-3);
  align-items: start;
}

.hub-column {
  container-type: inline-size;
  display: grid;
  gap: var(--xx-space-3);
  min-width: 0;
}

.hub-card {
  min-width: 0;
  overflow: hidden;
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.hub-card-header {
  display: flex;
  gap: var(--xx-space-3);
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  padding: var(--xx-space-3);
  background: var(--xx-color-surface-raised);
  border-bottom: 1px solid var(--xx-color-border);
}

.hub-card-header > span {
  min-width: 0;
}

.hub-card-header h2 {
  margin: var(--xx-space-1) 0 0;
  color: var(--xx-color-text);
  font-size: var(--xx-font-md);
  line-height: var(--xx-leading-tight);
}

.hub-card-header .home-link-button {
  flex: 0 0 auto;
  min-height: 1.875rem;
  padding: 0 var(--xx-space-2);
  color: var(--xx-color-accent);
  background: transparent;
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  cursor: pointer;
}

.hub-card-header .home-link-button:hover,
.hub-card-header .home-link-button:focus-visible {
  background: var(--xx-color-accent-soft);
  border-color: var(--xx-color-accent);
}

.hub-list,
.hub-ranking-list,
.hub-player-list,
.hub-event-list,
.hub-transfer-list {
  display: grid;
}

.hub-match-row.home-match-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.55fr) minmax(17rem, 1.7fr) minmax(7rem, 0.65fr);
  gap: var(--xx-space-3);
  align-items: center;
  width: 100%;
  min-height: 3.85rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  color: var(--xx-color-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--xx-color-border);
  border-radius: 0;
  cursor: pointer;
}

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

.hub-match-row.home-match-row:hover,
.hub-match-row.home-match-row:focus-visible {
  background: var(--xx-color-surface-raised);
  outline-offset: -2px;
}

.hub-match-context,
.hub-match-meta {
  display: flex;
  gap: var(--xx-space-2);
  align-items: center;
  min-width: 0;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
}

.hub-match-context {
  flex-wrap: wrap;
}

.hub-match-context time {
  color: var(--xx-color-text);
  font-weight: 800;
}

.hub-match-date {
  font-weight: 700;
}

.hub-match-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--xx-space-2);
  align-items: center;
  min-width: 0;
}

.hub-match-team {
  display: flex;
  gap: var(--xx-space-2);
  align-items: center;
  min-width: 0;
}

.hub-match-team-away {
  justify-content: flex-end;
  text-align: right;
}

.hub-match-team strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--xx-font-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-match-team .team-logo,
.hub-match-team .team-logo-fallback,
.hub-ranking-row .team-logo,
.hub-ranking-row .team-logo-fallback {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
}

.hub-match-row .ui-scoreline {
  min-width: 3.5rem;
  font-size: var(--xx-font-sm);
  white-space: nowrap;
}

.hub-versus {
  color: var(--xx-color-text-dim);
  font-size: var(--xx-font-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.hub-match-meta {
  justify-content: flex-end;
  text-align: right;
}

.hub-match-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-watch-label {
  display: inline-flex;
  gap: var(--xx-space-1);
  align-items: center;
  color: var(--xx-color-live);
  font-weight: 900;
  text-transform: uppercase;
}

.hub-ranking-row,
.hub-player-row {
  display: grid;
  grid-template-columns: 1.5rem 1.75rem minmax(0, 1fr) auto;
  gap: var(--xx-space-2);
  align-items: center;
  width: 100%;
  min-height: 3rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  color: var(--xx-color-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--xx-color-border);
  cursor: pointer;
}

.hub-ranking-row:last-child,
.hub-player-row:last-child {
  border-bottom: 0;
}

.hub-ranking-row:hover,
.hub-ranking-row:focus-visible,
.hub-player-row:hover,
.hub-player-row:focus-visible {
  background: var(--xx-color-surface-raised);
}

.hub-rank-number {
  color: var(--xx-color-text-dim);
  font-size: var(--xx-font-xs);
  font-weight: 900;
}

.hub-ranking-row strong,
.hub-player-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--xx-font-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-ranking-row em,
.hub-player-row em {
  color: var(--xx-color-accent);
  font-size: var(--xx-font-sm);
  font-style: normal;
  font-weight: 900;
}

.hub-player-row .home-player-photo {
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  object-fit: cover;
  border-radius: 50%;
}

.hub-player-row > span:nth-child(3) {
  display: grid;
  min-width: 0;
}

.hub-player-row small {
  overflow: hidden;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-event-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: var(--xx-space-3);
  align-items: center;
  width: 100%;
  min-height: 4rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  color: var(--xx-color-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--xx-color-border);
  cursor: pointer;
}

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

.hub-event-row:hover,
.hub-event-row:focus-visible {
  background: var(--xx-color-surface-raised);
}

.hub-event-logo {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  background: var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
}

.hub-event-logo img,
.hub-event-logo .team-logo,
.hub-event-logo .team-logo-fallback {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
}

.hub-event-copy {
  display: grid;
  min-width: 0;
}

.hub-event-copy strong,
.hub-event-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-event-copy strong {
  font-size: var(--xx-font-sm);
}

.hub-event-copy small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
}

.hub-event-state {
  padding: var(--xx-space-1) var(--xx-space-2);
  color: var(--xx-color-text-muted);
  background: var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border);
  border-radius: 999px;
  font-size: var(--xx-font-xs);
  font-weight: 800;
  white-space: nowrap;
}

.hub-event-state.is-active {
  color: var(--xx-color-success);
  background: rgba(101, 217, 139, 0.08);
  border-color: rgba(101, 217, 139, 0.3);
}

.hub-transfer-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: var(--xx-space-2);
  align-items: center;
  min-height: 3.4rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  border-bottom: 1px solid var(--xx-color-border);
}

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

.hub-transfer-row .transfer-feed-avatar {
  width: 2rem;
  height: 2rem;
  object-fit: cover;
  border-radius: 50%;
}

.hub-transfer-copy {
  min-width: 0;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  line-height: 1.35;
}

.hub-transfer-copy button {
  color: var(--xx-color-text);
  font: inherit;
  font-weight: 800;
}

.hub-transfer-row time {
  align-self: start;
  color: var(--xx-color-text-dim);
  font-size: var(--xx-font-xs);
  white-space: nowrap;
}

.hub-empty-state {
  padding: var(--xx-space-5) var(--xx-space-3);
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-sm);
  text-align: center;
}

@container (max-width: 17rem) {
  .hub-match-row.home-match-row {
    grid-template-columns: 1fr;
    gap: var(--xx-space-2);
  }

  .hub-match-context,
  .hub-match-meta {
    justify-content: space-between;
  }
}

@media (max-width: 72rem) {
  .hub-dashboard {
    grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.5fr);
  }

  .hub-column-right {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 52rem) {
  .hub-lead,
  .hub-dashboard,
  .hub-column-right {
    grid-template-columns: 1fr;
  }

  .hub-column-right {
    grid-column: auto;
  }

  .hub-match-row.home-match-row {
    grid-template-columns: minmax(5.5rem, 0.5fr) minmax(15rem, 1.5fr) minmax(6rem, 0.5fr);
  }
}

@media (max-width: 36rem) {
  .hub-lead {
    padding: var(--xx-space-3);
  }

  .hub-match-row.home-match-row {
    grid-template-columns: 1fr;
    gap: var(--xx-space-2);
  }

  .hub-match-context,
  .hub-match-meta {
    justify-content: space-between;
  }

  .hub-card-header {
    align-items: flex-end;
  }

  .hub-event-row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .hub-event-state {
    grid-column: 2;
    justify-self: start;
  }

  .hub-transfer-row {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .hub-transfer-row time {
    grid-column: 2;
  }
}

@media (forced-colors: active) {
  .hub-lead,
  .hub-card,
  .hub-broadcast-button {
    border: 1px solid CanvasText;
  }
}

/* V1.4 — separate Matches and Results directories. */
.catalog-page-header {
  align-items: flex-end;
  min-height: 3.75rem;
  margin-bottom: var(--xx-space-3);
  padding-block-end: var(--xx-space-3);
  border-bottom: 1px solid var(--xx-color-border);
}

.catalog-page-header > span:first-child {
  display: grid;
  gap: var(--xx-space-1);
}

.catalog-page-header small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-page-header h1 {
  margin: 0;
  font-size: var(--xx-font-xl);
  line-height: var(--xx-leading-tight);
}

.catalog-filter-bar {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(14rem, 1.4fr) minmax(10rem, 0.8fr) auto;
  gap: var(--xx-space-2);
  align-items: end;
  margin-block-end: var(--xx-space-3);
  padding: var(--xx-space-3);
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.catalog-filter-bar label {
  display: grid;
  gap: var(--xx-space-1);
  min-inline-size: 0;
}

.catalog-filter-bar label > span {
  display: inline-flex;
  gap: var(--xx-space-1);
  align-items: center;
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-filter-bar label > span i {
  color: var(--xx-color-accent);
}

.catalog-filter-bar :is(input, select),
.catalog-filter-reset {
  min-inline-size: 0;
  block-size: var(--xx-control-height);
  padding-inline: var(--xx-space-3);
  color: var(--xx-color-text);
  background: var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border-strong);
  border-radius: var(--xx-radius-sm);
}

.catalog-filter-reset {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.catalog-filter-reset:hover,
.catalog-filter-reset:focus-visible {
  color: var(--xx-color-accent);
  border-color: var(--xx-color-accent);
}

.catalog-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--xx-space-2);
  margin-block-end: var(--xx-space-3);
}

.catalog-stat {
  display: flex;
  gap: var(--xx-space-3);
  align-items: center;
  justify-content: space-between;
  min-block-size: 3rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-sm);
}

.catalog-stat small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-stat strong {
  color: var(--xx-color-accent);
  font-size: var(--xx-font-lg);
}

.catalog-stat.is-live strong {
  color: var(--xx-color-live);
}

.catalog-match-directory,
.catalog-results-directory,
.catalog-phase,
.catalog-tournament-groups,
.catalog-results-day,
.catalog-row-list {
  display: grid;
  gap: var(--xx-space-3);
}

.catalog-phase,
.catalog-results-day {
  min-inline-size: 0;
}

.catalog-phase-header,
.catalog-results-day-header {
  display: flex;
  gap: var(--xx-space-3);
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--xx-space-3);
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.catalog-phase-header > span {
  display: grid;
  gap: var(--xx-space-1);
}

.catalog-phase-header h2,
.catalog-results-day-header h2 {
  margin: 0;
  font-size: var(--xx-font-lg);
}

.catalog-phase-header small,
.catalog-results-day-header span {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-phase-header > strong {
  display: grid;
  place-items: center;
  min-inline-size: 2rem;
  block-size: 2rem;
  color: var(--xx-color-text);
  background: var(--xx-color-surface-raised);
  border: 1px solid var(--xx-color-border-strong);
  border-radius: 999px;
}

.catalog-phase.is-live .catalog-phase-header {
  border-inline-start: 0.25rem solid var(--xx-color-live);
}

.catalog-tournament-group {
  min-inline-size: 0;
  overflow: clip;
  background: var(--xx-color-surface);
  border: 1px solid var(--xx-color-border);
  border-radius: var(--xx-radius-md);
}

.catalog-tournament-group > header {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: var(--xx-space-2);
  align-items: center;
  min-block-size: 3rem;
  padding: var(--xx-space-2) var(--xx-space-3);
  background: var(--xx-color-surface-raised);
  border-block-end: 1px solid var(--xx-color-border);
}

.catalog-tournament-group > header > span {
  display: grid;
  place-items: center;
}

.catalog-tournament-group > header :is(.team-logo, .team-logo-fallback) {
  inline-size: 1.75rem;
  block-size: 1.75rem;
}

.catalog-tournament-group h3 {
  min-inline-size: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--xx-font-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-tournament-group > header small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
}

.catalog-row-list {
  gap: 0;
}

.catalog-match-row.match-row-card {
  display: grid;
  grid-template-columns: minmax(6rem, 0.55fr) minmax(20rem, 1.7fr) minmax(14rem, 1fr);
  gap: var(--xx-space-3);
  align-items: center;
  min-inline-size: 0;
  min-block-size: 5rem;
  padding: var(--xx-space-3);
  background: transparent;
  border: 0;
  border-block-end: 1px solid var(--xx-color-border);
  border-radius: 0;
}

.catalog-row-list > .catalog-match-row:last-child {
  border-block-end: 0;
}

.catalog-match-row.match-row-card:hover,
.catalog-match-row.match-row-card:focus-visible {
  background: var(--xx-color-surface-raised);
}

.catalog-match-when,
.catalog-match-information,
.catalog-match-information > span,
.catalog-match-team > span {
  display: grid;
  min-inline-size: 0;
}

.catalog-match-when {
  gap: var(--xx-space-1);
  justify-items: start;
}

.catalog-match-when time {
  font-size: var(--xx-font-lg);
  font-weight: 900;
}

.catalog-match-when > small,
.catalog-match-information small,
.catalog-match-team small {
  color: var(--xx-color-text-muted);
  font-size: var(--xx-font-xs);
}

.catalog-match-when .ui-status {
  margin-block-start: var(--xx-space-1);
}

.catalog-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--xx-space-2);
  align-items: center;
  min-inline-size: 0;
}

.catalog-match-team {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: var(--xx-space-2);
  align-items: center;
  min-inline-size: 0;
}

.catalog-match-team :is(.team-logo, .team-logo-fallback) {
  inline-size: 2rem;
  block-size: 2rem;
}

.catalog-match-team strong,
.catalog-match-information strong,
.catalog-match-information small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-match-team strong {
  font-size: var(--xx-font-sm);
}

.catalog-match-team.is-winner strong {
  color: var(--xx-color-success);
}

.catalog-match-team small i {
  color: var(--xx-color-warning);
}

.catalog-match-divider {
  min-inline-size: 2.75rem;
  color: var(--xx-color-text-dim);
  font-size: var(--xx-font-xs);
  font-weight: 900;
  text-align: center;
}

.catalog-match-divider .ui-scoreline {
  font-size: var(--xx-font-sm);
}

.catalog-match-information {
  grid-template-columns: minmax(4rem, 0.55fr) minmax(0, 1fr);
  gap: var(--xx-space-3);
}

.catalog-match-information > span:first-child b {
  color: var(--xx-color-accent);
}

.catalog-match-maps {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--xx-space-2);
  padding-block-start: var(--xx-space-2);
  color: var(--xx-color-text-muted);
  border-block-start: 1px dashed var(--xx-color-border);
  font-size: var(--xx-font-xs);
}

@media (max-width: 62rem) {
  .catalog-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-match-row.match-row-card {
    grid-template-columns: minmax(5.5rem, 0.5fr) minmax(18rem, 1.5fr);
  }

  .catalog-match-information {
    grid-column: 1 / -1;
  }
}

@media (max-width: 42rem) {
  .catalog-filter-bar,
  .catalog-stat-strip,
  .catalog-match-row.match-row-card {
    grid-template-columns: 1fr;
  }

  .catalog-filter-reset {
    inline-size: 100%;
  }

  .catalog-match-row.match-row-card {
    gap: var(--xx-space-2);
  }

  .catalog-match-when {
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
  }

  .catalog-match-when .ui-status {
    justify-self: end;
    margin-block-start: 0;
  }

  .catalog-match-information,
  .catalog-match-maps {
    grid-column: auto;
  }
}

@media (max-width: 28rem) {
  .catalog-match-team {
    grid-template-columns: 1.75rem minmax(0, 1fr);
  }

  .catalog-match-team :is(.team-logo, .team-logo-fallback) {
    inline-size: 1.75rem;
    block-size: 1.75rem;
  }

  .catalog-match-information {
    grid-template-columns: 1fr;
  }
}

@media (forced-colors: active) {
  .catalog-filter-bar,
  .catalog-stat,
  .catalog-phase-header,
  .catalog-results-day-header,
  .catalog-tournament-group {
    border: 1px solid CanvasText;
  }
}
