/* === Reset & base === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Neutral palette (constant across all teams) */
  --color-bg:             #0a0e14;
  --color-surface:        #141a22;
  --color-surface-raised: #1c2430;
  --color-border:         #2a3444;
  --color-text:           #e0e4ea;
  --color-text-muted:     #94a0b2;
  --color-text-faint:     #6b7a8e;

  /* Team palette: overridden per-page via inline <style> */
  --team-primary:         #032E62;
  --team-secondary:       #21C6D9;
  --team-tertiary:        #FC1896;
  --team-quaternary:      #FD9F28;

  /* Semantic roles: mapped per-team in inline <style> */
  --color-home:           var(--team-secondary);
  --color-away:           var(--team-tertiary);
  --color-playoff:        #94a0b2;

  /* Derived faint variants (auto-computed from semantic roles) */
  --color-home-faint:     color-mix(in srgb, var(--color-home) 20%, transparent);
  --color-away-faint:     color-mix(in srgb, var(--color-away) 20%, transparent);
  --color-playoff-faint:  color-mix(in srgb, var(--color-playoff) 20%, transparent);

  /* Layout */
  --content-max-width:    1200px;
  --nav-height:           52px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Site header === */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header__brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* === Team selector (details/summary dropdown) === */
.team-selector {
  position: relative;
}

.team-selector__current {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}

.team-selector__current::-webkit-details-marker { display: none; }

.team-selector__current::after {
  content: '';
  border: 4px solid transparent;
  border-top-color: var(--color-text-muted);
  margin-left: 4px;
  margin-top: 3px;
}

.team-selector[open] .team-selector__current::after {
  border-top-color: transparent;
  border-bottom-color: var(--color-text-muted);
  margin-top: -3px;
}

.team-selector__logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.team-selector__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  list-style: none;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
}

.team-selector__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--color-text-muted);
  transition: background 0.1s, color 0.1s;
}

.team-selector__item:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.team-selector__item--active {
  color: var(--color-text);
  font-weight: 600;
}

.team-selector__item--all {
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.team-selector__item-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* === Viz type nav === */
.viz-nav {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
}

.viz-nav__link {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

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

.viz-nav__link--active {
  color: var(--color-home);
  border-bottom-color: var(--color-home);
}

.viz-nav__link--disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
  opacity: 0.5;
}

/* === Page content === */
.page-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* === Footer === */
.site-footer {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-faint);
}

/* Timezone selector */
.site-header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tz-selector {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.tz-selector:focus {
  outline: 2px solid var(--color-home);
  outline-offset: 1px;
}
