*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --teams-max: 1140px;
  --teams-radius: 20px;
  --teams-radius-sm: 14px;
  --teams-border: rgba(15, 23, 42, 0.08);
  --teams-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  --teams-shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.06);
  --teams-card: #ffffff;
  --teams-card-soft: #f8fafc;
  --teams-text: #0f172a;
  --teams-muted: #475569;
  --teams-muted-2: #64748b;
  --teams-brand: var(--primary-color, #1e40af);
  --teams-brand-2: #2563eb;
  --teams-brand-soft: rgba(37, 99, 235, 0.10);
  --teams-positive: #15803d;
  --teams-warn: #b45309;
  --teams-negative: #b91c1c;
}

html {
  width: 100%;
  overflow-x: clip;
}

body.fs-team-index-page {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--light-bg, #f8fafc);
  color: var(--teams-text);
}

.container {
  max-width: var(--teams-max);
  margin: 0 auto;
  padding: 0 18px;
  min-width: 0;
}

.team-index-hero {
  padding: 48px 0 20px;
  background:
    radial-gradient(960px 320px at 15% -10%, rgba(255,255,255,0.22), transparent 60%),
    radial-gradient(820px 260px at 100% 0%, rgba(191, 219, 254, 0.22), transparent 60%),
    linear-gradient(135deg, #163993 0%, #1d4ed8 48%, #1e40af 100%);
  color: #fff;
}

.team-index-hero__card {
  display: grid;
  gap: 14px;
  border-radius: var(--teams-radius);
  padding: clamp(18px, 2.3vw, 24px);
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
}

.team-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-index-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1.85rem, 3.8vw, 2.65rem);
  line-height: 1.02;
  color: #fff;
  text-wrap: balance;
  text-align: center;
}

.team-index-hero__subtitle {
  max-width: 700px;
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 0.96rem;
  line-height: 1.55;
  text-align: center;
}

.team-index-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 2px;
}

.team-index-hero-stat {
  padding: 10px 12px;
  border-radius: var(--teams-radius-sm);
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
}

.team-index-hero-stat span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin-bottom: 2px;
}

.team-index-hero-stat strong {
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.1;
}

.team-index-section {
  padding: 14px 0;
}

.team-index-section--toolbar {
  padding-top: 14px;
  padding-bottom: 4px;
}

.team-index-section--seo {
  background: var(--teams-card-soft);
  border-top: 1px solid var(--teams-border);
  border-bottom: 1px solid var(--teams-border);
}

.team-index-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--teams-border);
  border-radius: var(--teams-radius);
  box-shadow: var(--teams-shadow-soft);
  padding: 14px;
  backdrop-filter: blur(10px);
}

.team-index-toolbar__filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.team-index-toolbar__actions {
  display: flex;
  justify-content: flex-end;
}

.team-index-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--teams-muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.team-index-searchbox {
  position: relative;
}

.team-index-searchbox svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: var(--teams-muted-2);
  pointer-events: none;
}

.team-index-searchbox input,
.team-index-toolbar select {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--teams-border);
  background: rgba(248, 250, 252, 0.9);
  color: var(--teams-text);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.team-index-searchbox input {
  padding: 0 12px 0 38px;
}

.team-index-toolbar select {
  padding: 0 12px;
}

.team-index-searchbox input:focus,
.team-index-toolbar select:focus,
.team-index-reset:focus-visible,
.team-index-row__link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.team-index-searchbox input:focus,
.team-index-toolbar select:focus {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
  background: #fff;
}

.team-index-reset {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--teams-brand);
  font: inherit;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.team-index-reset:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}

.team-index-active-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 4px 0;
}

.team-index-results-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--teams-muted);
  font-size: 0.92rem;
}

.team-index-results-meta strong {
  color: var(--teams-text);
  font-size: 1.02rem;
}

.team-index-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-index-active-chip,
.team-index-chip,
.team-index-form-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 700;
}

.team-index-active-chip,
.team-index-chip {
  padding: 5px 9px;
  background: rgba(226, 232, 240, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #475569;
  font-size: 0.74rem;
}

.team-index-chip--soft {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.06);
  color: var(--teams-muted);
}

.team-index-feedback {
  padding: 18px 14px;
  text-align: center;
  color: var(--teams-muted);
  border: 1px dashed var(--teams-border);
  border-radius: var(--teams-radius);
  background: var(--teams-card);
}

.team-index-list {
  display: grid;
  gap: 10px;
}

.team-index-row {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--teams-radius);
  box-shadow: var(--teams-shadow-soft);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.team-index-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.42), rgba(30, 64, 175, 0.12));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.team-index-row:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.team-index-row:hover::before,
.team-index-row:focus-within::before {
  opacity: 1;
}

.team-index-row__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}

.team-index-row__main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.team-index-row__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-index-row__logo-wrap,
.team-index-row__logo {
  width: 46px;
  height: 46px;
}

.team-index-row__logo {
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 4px;
}

.team-index-row__logo--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--teams-brand);
  background: rgba(37, 99, 235, 0.08);
  font-size: 0.84rem;
}

.team-index-row__content,
.team-index-row__topline {
  min-width: 0;
}

.team-index-row__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.team-index-row__topline h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--teams-text);
}

.team-index-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-index-row__summary {
  margin: 6px 0 0;
  color: var(--teams-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.team-index-row__form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.team-index-form-chip {
  min-width: 0;
  padding: 4px 8px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.team-index-form-chip--win {
  background: rgba(21, 128, 61, 0.10);
  border-color: rgba(21, 128, 61, 0.16);
  color: #166534;
}

.team-index-form-chip--draw {
  background: rgba(180, 83, 9, 0.10);
  border-color: rgba(180, 83, 9, 0.16);
  color: #b45309;
}

.team-index-form-chip--loss {
  background: rgba(185, 28, 28, 0.10);
  border-color: rgba(185, 28, 28, 0.16);
  color: #b91c1c;
}

.team-index-row__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, auto));
  gap: 8px;
  align-items: stretch;
  flex: 0 0 auto;
}

.team-index-stat-box {
  min-width: 82px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.team-index-stat-box span {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teams-muted-2);
  margin-bottom: 3px;
}

.team-index-stat-box strong {
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.15;
}

.team-index-row__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(248, 250, 252, 0.88);
  color: var(--teams-brand);
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  align-self: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.team-index-row__link:hover .team-index-row__cta {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
  transform: translateX(1px);
}

.team-index-row__cta span {
  font-size: 0.82rem;
}

.team-index-seo-copy {
  max-width: 900px;
}

.team-index-seo-copy h2 {
  margin: 0 0 10px;
  color: var(--teams-text);
}

.team-index-seo-copy p {
  color: var(--teams-muted);
}

.team-index-seo-copy code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--teams-text);
}

[data-theme="dark"] {
  --teams-card: #172131;
  --teams-card-soft: #1a2637;
  --teams-text: #e2e8f0;
  --teams-muted: #94a3b8;
  --teams-muted-2: #a8b3c7;
  --teams-border: rgba(96, 165, 250, 0.16);
  --teams-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
  --teams-shadow-soft: 0 10px 22px rgba(2, 6, 23, 0.18);
}

[data-theme="dark"] body.fs-team-index-page {
  background: var(--light-bg, #111827);
}

[data-theme="dark"] .team-index-searchbox input,
[data-theme="dark"] .team-index-toolbar select {
  background: #0f172a;
  color: var(--teams-text);
  border-color: rgba(148, 163, 184, 0.20);
}

[data-theme="dark"] .team-index-feedback,
[data-theme="dark"] .team-index-toolbar,
[data-theme="dark"] .team-index-row,
[data-theme="dark"] .team-index-seo-copy code {
  background: var(--teams-card);
}

[data-theme="dark"] .team-index-chip,
[data-theme="dark"] .team-index-active-chip {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

[data-theme="dark"] .team-index-chip--soft,
[data-theme="dark"] .team-index-stat-box {
  background: var(--teams-card-soft);
  border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .team-index-row__logo {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .team-index-reset {
  background: rgba(15, 23, 42, 0.62);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.18);
}

[data-theme="dark"] .team-index-stat-box strong {
  color: var(--teams-text);
}

[data-theme="dark"] .team-index-form-chip--win {
  color: #86efac;
  background: rgba(21, 128, 61, 0.18);
  border-color: rgba(34, 197, 94, 0.16);
}

[data-theme="dark"] .team-index-form-chip--draw {
  color: #fdba74;
  background: rgba(180, 83, 9, 0.18);
  border-color: rgba(249, 115, 22, 0.16);
}

[data-theme="dark"] .team-index-form-chip--loss {
  color: #fca5a5;
  background: rgba(185, 28, 28, 0.18);
  border-color: rgba(248, 113, 113, 0.16);
}

[data-theme="dark"] .team-index-row__cta {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .team-index-row__link:hover .team-index-row__cta {
  background: rgba(37, 99, 235, 0.18);
}

@media (max-width: 1100px) {
  .team-index-toolbar {
    grid-template-columns: 1fr;
  }

  .team-index-toolbar__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 940px) {
  .team-index-row__link {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .team-index-row__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-index-row__cta {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .team-index-hero__stats,
  .team-index-toolbar__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .team-index-hero {
    padding: 42px 0 18px;
  }

  .team-index-hero__card {
    text-align: center;
    justify-items: center;
  }

  .team-index-hero__stats,
  .team-index-toolbar__filters {
    grid-template-columns: 1fr;
  }

  .team-index-row__main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-index-row__summary {
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
  }

  .team-index-row__media,
  .team-index-row__chips,
  .team-index-row__form {
    justify-content: center;
  }

  .team-index-row__topline {
    justify-content: center;
  }

  .container {
    padding: 0 14px;
  }
}

@media (max-width: 768px) {
  .team-index-row__link {
    align-items: stretch;
    gap: 10px;
  }

  .team-index-row__main {
    gap: 9px;
  }

  .team-index-row__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .team-index-stat-box {
    min-width: 0;
    text-align: center;
    padding: 9px 8px;
  }

  .team-index-row__cta {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    padding: 11px 14px;
    border-radius: 14px;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
  }
}
