@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700;800&display=swap');

:root {
  --navy: #0b1f3a;
  --accent: #ffc400;
  --background: #0a1729;
  --surface: #112947;
  --row: #142f50;
  --text: #f5f7fb;
  --muted: #c3cedf;
  --border: #38516e;
  --field-border: #67809c;
  --shadow: rgba(0, 0, 0, .16);
  color-scheme: dark;
}

body.theme-light {
  --background: #eef1f5;
  --surface: #fff;
  --row: #f7f9fb;
  --text: #0b1f3a;
  --muted: #4a5568;
  --border: #e6eaf0;
  --field-border: #b8c2d3;
  --shadow: rgba(11, 31, 58, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); font: 17px/1.4 Barlow, system-ui, sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header { background: var(--navy); color: #fff; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 22px 16px 24px; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border: 3px solid var(--accent); border-radius: 50%; font: 800 18px/1 'Barlow Condensed', sans-serif; }
.brand { margin: 0; font: 800 clamp(28px, 4vw, 36px)/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .5px; }
.season-label { margin: 3px 0 0; color: #c3cedf; font-size: 16px; }
.subtitle { margin: 18px 0 0; font-size: 20px; line-height: 1.35; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.results-link, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 15px; line-height: 1.2; text-decoration: none; }
.theme-toggle { cursor: pointer; }
.results-link:hover, .theme-toggle:hover { background: rgba(255, 255, 255, .18); }
.results-link span { margin-left: 7px; color: var(--accent); }

.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.followed-section, .catalog-section { margin: 0; }
.section-heading, .catalog-toggle { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 4px; }
.section-heading h2, .catalog-title { margin: 0; font: 800 clamp(30px, 4vw, 36px)/1.1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.followed-total, .count { flex: 0 0 auto; color: var(--muted); font-size: 17px; font-weight: 500; white-space: nowrap; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 14px; }
.team-grid:empty { display: none; }
.loading-state, .empty-state { margin: 14px 0 0; }
.loading-state { color: var(--muted); }
.empty-state { padding: 24px 20px; border: 2px dashed var(--field-border); border-radius: 18px; background: var(--surface); }
.empty-state p { margin: 0 0 16px; font-size: 19px; }
.explore-button { min-height: 48px; padding: 10px 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--navy); cursor: pointer; font-weight: 700; }

.followed-section .team-card { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 116px; padding: 18px; border-radius: 18px; background: var(--navy); color: #fff; }
.followed-section .team-copy strong { display: block; font: 800 30px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.followed-section .team-copy span { display: block; margin-top: 6px; color: #c3cedf; font-size: 17px; line-height: 1.25; }
.team-link { display: block; min-width: 0; flex: 1; color: #fff; text-decoration: none; }
.team-link:visited { color: #fff; }
.team-link::after { position: absolute; inset: 0; content: ''; }
.team-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 18px; }
.team-copy { min-width: 0; flex: 1; }
.star-button { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border: 2px solid var(--field-border); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; }
.star-button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.star-button[aria-pressed='true'] svg { fill: currentColor; }
.followed-section .star-button { flex-basis: 48px; width: 48px; height: 48px; border: 0; background: rgba(255, 255, 255, .1); color: var(--accent); }
.star-button:hover { border-color: var(--navy); }

.catalog-section { margin-top: 24px; }
.catalog-toggle { width: 100%; cursor: pointer; list-style: none; color: var(--text); }
.catalog-toggle::-webkit-details-marker { display: none; }
.catalog-toggle-copy { display: flex; align-items: baseline; justify-content: space-between; flex: 1; gap: 12px; }
.catalog-chevron { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--field-border); border-radius: 50%; }
.catalog-chevron svg, .category-chevron svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.catalog-section[open] .catalog-chevron svg, .category-group[open] .category-chevron svg { transform: rotate(180deg); }
.catalog-content { margin-top: 16px; }
.catalog-guidance { margin: 0 4px 14px; color: var(--muted); font-size: 16px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 14px; margin-bottom: 16px; }
.search-row label { grid-column: 1 / -1; font-weight: 600; }
.search-field { display: flex; align-items: center; gap: 10px; min-width: 0; height: 58px; padding: 0 16px; border: 2px solid var(--field-border); border-radius: 14px; background: var(--surface); }
.search-field:focus-within { border-color: var(--accent); outline: 2px solid var(--navy); outline-offset: 2px; }
.search-field svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.search-row input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 19px; }
.search-row input::placeholder { color: var(--muted); opacity: 1; }
.search-count { margin: 0 0 16px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.catalog-list { overflow: hidden; border-radius: 18px; background: var(--surface); }
.category-group { border-bottom: 1px solid var(--border); }
.category-group:last-child { border-bottom: 0; }
.category-toggle { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 0 18px; cursor: pointer; list-style: none; font-size: 21px; font-weight: 700; }
.category-toggle::-webkit-details-marker { display: none; }
.category-toggle > span:first-child { flex: 1; }
.category-count { padding: 4px 10px; border-radius: 999px; background: var(--background); color: var(--text); font-size: 16px; font-weight: 600; }
.category-chevron { flex: 0 0 22px; }
.category-group .team-grid { display: block; margin: 0; padding: 4px 0 8px; background: var(--row); }
.category-group .team-card { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px 12px 8px 18px; border-top: 1px solid var(--border); cursor: pointer; }
.category-group .team-card:hover { background: rgba(255, 196, 0, .07); }
.category-group .team-copy strong { display: block; font-size: 20px; font-weight: 700; }
.category-group .team-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 16px; line-height: 1.3; }
.category-group .star-button[aria-pressed='true'] { border-color: var(--navy); background: var(--navy); color: var(--accent); }
.error-state { padding: 18px; color: var(--text); }
.error-state p { margin: 0 0 10px; }
.error-state button { min-height: 44px; padding: 9px 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--navy); cursor: pointer; font-weight: 700; }
.no-results { margin: 0; padding: 20px; color: var(--muted); }
.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; }
.star-button:focus-visible, .results-link:focus-visible, .theme-toggle:focus-visible, .catalog-toggle:focus-visible, .category-toggle:focus-visible, .explore-button:focus-visible, .error-state button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 620px) {
  .header-inner { padding: 22px 16px 24px; }
  .page { padding: 16px 16px 40px; }
  .brand { font-size: 30px; }
  .controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .results-link, .theme-toggle { padding: 8px 10px; font-size: 13px; }
  .team-grid { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .search-count { margin: 0; }
  .catalog-toggle-copy { align-items: baseline; }
  .catalog-title, .section-heading h2 { font-size: 30px; }
}

@media (max-width: 370px) {
  .brand { font-size: 27px; }
  .controls { grid-template-columns: 1fr; }
  .catalog-toggle-copy { display: block; }
  .catalog-title { display: block; }
  .count { margin-left: 8px; }
}
