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

:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faf8;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --green: #16a34a;
  --red: #dc2626;
  --draw: #9ca3af;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* tier colors — muted, professional palette */
  --tier-fresh: #16a34a;
  --tier-growing: #65a30d;
  --tier-shaggy: #ca8a04;
  --tier-wild: #ea580c;
  --tier-caveman: #dc2626;
  --tier-bigfoot: #9333ea;
  --tier-lost: #6b7280;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Hero Header === */
.hero {
  position: relative;
  height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 40, 20, 0.65) 0%,
    rgba(0, 20, 10, 0.80) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
}

.hero-content h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  font-weight: 400;
  margin-top: 0.75rem;
  letter-spacing: 0.01em;
}

/* === Main === */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* === Controls === */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.league-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.league-tab {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.league-tab:hover {
  background: #e5e7eb;
}

.league-tab.active {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: var(--accent-dark);
}

.league-badge {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.updated {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Language Picker === */
.lang-picker {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.lang-link {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.lang-link:hover {
  background: #e5e7eb;
  color: var(--text);
}

.lang-link.active {
  background: #f0fdf4;
  color: var(--accent-dark);
  border: 1px solid #bbf7d0;
}

/* === Team Cards === */
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  display: grid;
  grid-template-columns: 2.5rem 3.5rem 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  align-items: center;
  transition: box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.team-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* Rank */
.rank {
  grid-row: 1 / 3;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

/* Avatar */
.avatar {
  grid-row: 1 / 3;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Team info (top-left) */
.team-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  overflow: hidden;
}

.team-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

a.team-name {
  text-decoration: none;
  color: inherit;
}
a.team-name:hover {
  text-decoration: underline;
}

.tier-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Hair metric (top-right) */
.hair-metric {
  text-align: right;
}

.days-number {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.days-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.days-human {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  font-style: italic;
}

/* Details row (below team info) */
.team-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.streak-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.streak-info strong {
  color: var(--text);
}

/* Form dots */
.form {
  display: flex;
  gap: 3px;
  align-items: center;
}

.form-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
}

.form-dot.W { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.form-dot.D { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.form-dot.L { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Matches-since (bottom-right) */
.matches-since {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* Competitions in streak */
.competitions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.comp-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #f9fafb;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Notes / footnotes */
.note {
  font-size: 0.7rem;
  color: var(--tier-bigfoot);
  font-style: italic;
}

.data-warning {
  font-size: 0.7rem;
  color: var(--tier-lost);
}

/* === Tier badge colors === */
.tier-fresh      { background: #dcfce7; color: #15803d; }
.tier-growing    { background: #ecfccb; color: #3f6212; }
.tier-shaggy     { background: #fef9c3; color: #854d0e; }
.tier-wild       { background: #ffedd5; color: #9a3412; }
.tier-caveman    { background: #fef2f2; color: #b91c1c; }
.tier-bigfoot  { background: #f3e8ff; color: #7e22ce; }
.tier-lost       { background: #f3f4f6; color: #4b5563; }

/* Days number colors — slightly bolder for contrast on white */
.days-fresh      { color: var(--tier-fresh); }
.days-growing    { color: var(--tier-growing); }
.days-shaggy     { color: var(--tier-shaggy); }
.days-wild       { color: var(--tier-wild); }
.days-caveman    { color: var(--tier-caveman); }
.days-bigfoot  { color: var(--tier-bigfoot); }
.days-lost       { color: var(--tier-lost); }

/* === Match Detail Panel === */
.team-card-wrapper {
  margin-bottom: 0.6rem;
}

.team-card-wrapper .team-card {
  margin-bottom: 0;
  cursor: pointer;
}

.team-card.expanded {
  border-color: var(--accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.match-detail {
  background: #f9fafb;
  border: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

.detail-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
}

/* === Hair Growth Strip === */
.strip-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.strip-stats {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.strip-streak-label {
  font-weight: 600;
  color: var(--text);
}

.strip-hint {
  font-size: 0.65rem;
  color: #b0b4bc;
  margin-bottom: 0.4rem;
}

.growth-strip {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
}

.strip-block {
  min-width: 14px;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: default;
  flex-shrink: 0;
  transition: transform 0.1s;
}

.strip-block:hover {
  transform: scaleY(1.4);
  z-index: 1;
  font-size: 0.5rem;
  font-weight: 800;
}

.strip-block.W { background: #bbf7d0; border: 1px solid #86efac; color: #15803d; }
.strip-block.D { background: #e5e7eb; border: 1px solid #d1d5db; color: #6b7280; }
.strip-block.L { background: #fecaca; border: 1px solid #fca5a5; color: #dc2626; }

.strip-block.streak-highlight {
  background: #fef08a;
  border: 2px solid #eab308;
  color: #a16207;
  height: 34px;
  min-width: 16px;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.4);
}

.strip-block.streak-highlight:hover {
  font-size: 0.55rem;
}

/* Match table toggle */
.match-table-toggle {
  margin-top: 0.75rem;
}

.match-table-toggle summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0;
}

.match-table-toggle summary:hover {
  color: var(--text);
}

/* Streak row highlight in table */
.streak-row {
  background: #fefce8 !important;
}

.streak-row td {
  border-bottom-color: #fef08a;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.match-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.match-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.match-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.match-result-dot {
  width: 24px;
  text-align: center;
}

.match-opponent {
  font-weight: 500;
}

.match-ha {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.7rem;
}

.match-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.match-opp-logo {
  width: 18px; height: 18px; border-radius: 2px;
  vertical-align: middle; margin-right: 4px;
}
.match-comp {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.match-source {
  color: #c0c4cc;
  font-size: 0.65rem;
}

/* === Streak Detail === */
.streak-detail {
  margin: 1rem 0;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 1rem;
}
.streak-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem;
}
.streak-detail-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem; font-weight: 700; color: var(--accent-dark);
}
.streak-detail-dates {
  font-size: 0.75rem; color: var(--text-muted);
}
.streak-matches {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.streak-match {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(255,255,255,0.7);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  font-size: 0.85rem;
}
.streak-match-num {
  font-weight: 800; color: var(--accent); min-width: 1.2rem; text-align: center;
}
.streak-match-date {
  color: var(--text-muted); font-size: 0.75rem; min-width: 5.5rem;
}
.streak-match-ha { font-size: 0.8rem; }
.streak-match-logo {
  width: 22px; height: 22px; border-radius: 3px; flex-shrink: 0;
}
.streak-match-logo-placeholder {
  width: 22px; height: 22px; flex-shrink: 0;
}
.streak-match-opp {
  flex: 1; font-weight: 600; color: var(--text-dark);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.streak-match-score {
  font-weight: 700; color: var(--accent-dark);
  font-variant-numeric: tabular-nums; min-width: 2.5rem;
}
.streak-match-comp {
  color: var(--text-muted); font-size: 0.72rem; min-width: 5rem;
}
.streak-match-yt {
  text-decoration: none; font-size: 0.9rem; opacity: 0.6;
  transition: opacity 0.2s;
}
.streak-match-yt:hover { opacity: 1; }

@media (max-width: 600px) {
  .streak-match { font-size: 0.78rem; gap: 0.3rem; padding: 0.4rem; }
  .streak-match-comp { display: none; }
  .streak-match-date { min-width: 4.5rem; font-size: 0.7rem; }
}

.no-matches {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}

/* === Teams to Watch === */
.watch-section { display: none; }
.watch-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4rem; font-weight: 700; color: #92400e;
  margin-bottom: 0.75rem;
}
.watch-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.watch-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #f59e0b; border-radius: var(--radius);
  padding: 1rem; transition: transform 0.2s;
}
.watch-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.watch-card { cursor: pointer; position: relative; }
.watch-card.watch-expanded { border-color: #d97706; box-shadow: 0 4px 16px rgba(217,119,6,0.2); grid-column: 1 / -1; }
.watch-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.watch-logo { width: 36px; height: 36px; border-radius: 4px; }
.watch-team-name { font-weight: 700; font-size: 0.95rem; color: #78350f; }
.watch-days { font-size: 0.7rem; color: #92400e; }
.watch-streak-badge {
  font-size: 1.4rem; font-weight: 900; color: #d97706;
  line-height: 1; margin: 4px 0;
}
.watch-streak-label { font-size: 0.7rem; font-weight: 600; color: #92400e; }
.watch-remaining { font-size: 0.75rem; color: #a16207; }

/* Expanded detail */
.watch-expanded .watch-header { margin-bottom: 0; }
.watch-detail { margin-top: 10px; border-top: 1px solid rgba(217,119,6,0.2); padding-top: 8px; }
.watch-matches-title { font-size: 0.7rem; color: #92400e; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.watch-match {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0; font-size: 0.78rem;
  border-bottom: 1px solid rgba(217,119,6,0.1);
}
.watch-match-date { color: #92400e; font-size: 0.7rem; min-width: 70px; }
.watch-match-logo { width: 18px; height: 18px; border-radius: 2px; }
.watch-match-opp { flex: 1; color: #78350f; font-weight: 500; }
.watch-match-score { font-weight: 700; color: #78350f; font-variant-numeric: tabular-nums; }
.watch-next {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(217,119,6,0.1); border-radius: 6px;
  text-align: center;
}
.watch-next-label { font-size: 0.75rem; font-weight: 700; color: #d97706; display: block; margin-bottom: 4px; }
.watch-next .watch-next-match { justify-content: center; background: rgba(217,119,6,0.08); border-radius: 4px; padding: 4px 8px; margin-top: 2px; }
.watch-no-data { font-size: 0.75rem; color: #a16207; text-align: center; padding: 8px; }

/* === Share Button === */
.team-card { position: relative; }
.share-btn {
  position: absolute; bottom: 0.5rem; right: 0.5rem;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 0.75rem; cursor: pointer; opacity: 0.3;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, background 0.2s;
}
.share-btn:hover { opacity: 0.8; background: #f0fdf4; }
.share-btn.share-copied { opacity: 1; background: #dcfce7; color: var(--accent); border-color: var(--accent); }

/* === YouTube Link === */
.match-yt { width: 24px; text-align: center; }
.yt-link { text-decoration: none; opacity: 0.35; transition: opacity 0.2s; font-size: 0.8rem; }
.yt-link:hover { opacity: 0.85; }

/* === Avatar Hover === */
.avatar-img { transition: transform 0.2s ease; }
.avatar:hover .avatar-img { transform: scale(1.05); }

/* === League Flag Badge === */
.league-flag {
  font-size: 0.9rem;
  margin-left: -2px;
}

/* === League Position Badge === */
.position-badge {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.2rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
}
.position-badge.zone-cl {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.position-badge.zone-el {
  color: #1e40af;
  background: #dbeafe;
  border-color: #93c5fd;
}
.position-badge.zone-rel-playoff {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fdba74;
}
.position-badge.zone-rel {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}

/* === Standings Table === */
.standings-toggle {
  margin: 2rem 0;
}
.standings-toggle summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  padding: 0.75rem 0;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.standings-table th {
  background: var(--bg);
  font-weight: 700;
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.standings-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.standings-table tr:hover {
  background: var(--bg);
}
.standings-table tr.zone-cl td:first-child {
  border-left: 3px solid #22c55e;
}
.standings-table tr.zone-el td:first-child {
  border-left: 3px solid #3b82f6;
}
.standings-table tr.zone-rel-playoff td:first-child {
  border-left: 3px solid #f97316;
}
.standings-table tr.zone-rel td:first-child {
  border-left: 3px solid #ef4444;
}

/* === Team Profile Page === */
.team-page {
  max-width: 900px;
  margin: 0 auto;
}

.team-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0 1rem;
  flex-wrap: wrap;
}

.team-hero-logo {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.team-hero-jersey {
  width: 90px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
}

.team-hero-info {
  flex: 1;
  min-width: 180px;
}

.team-hero-info h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.team-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.team-hero-league {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.team-hero-founded {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.team-hero-hashtags {
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.team-hero-tier {
  margin-top: 0.4rem;
}

/* Stat cards row */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.stat-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

/* Form section on team page */
.team-form-section {
  margin-bottom: 1.5rem;
}

.team-form-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.team-form-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Rivalries section */
.rivalries-section {
  margin: 1.5rem 0;
}

.rivalries-section h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.rivalry-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.rivalry-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}

.rivalry-card:hover {
  box-shadow: var(--shadow-md);
}

.rivalry-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.rivalry-info {
  min-width: 0;
}

.rivalry-name-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.rivalry-name-link:hover {
  text-decoration: underline;
}

.rivalry-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rivalry-hashtags {
  font-size: 0.7rem;
  color: var(--accent-dark);
  font-weight: 600;
}

/* Standings snippet on team page */
.standings-snippet {
  margin: 1.5rem 0;
}

.standings-snippet h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.standings-snippet .standings-table tr.highlight-row {
  background: #f0fdf4;
  font-weight: 700;
}

.standings-snippet .standings-table tr.highlight-row td {
  border-bottom-color: #bbf7d0;
}

/* Full standings on team page */
.standings-full {
  margin: 1.5rem 0;
}

.standings-full h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.standings-table .highlight-row td {
  background: #f0fdf4;
  font-weight: 700;
}

.standings-table .highlight-row td:first-child {
  border-left: 3px solid var(--accent) !important;
}

/* === Strip Tooltip === */
.strip-tooltip {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  max-width: 200px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  font-size: 0.8rem;
  line-height: 1.4;
}

.strip-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.strip-tooltip-logo {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.strip-tooltip-score {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.strip-tooltip-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* === Season Stats === */
.season-stats {
  margin: 1.25rem 0;
}

.season-stats h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.season-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  text-align: center;
}

.stat-item-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.stat-item-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

@media (max-width: 600px) {
  .season-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Share section on team page */
.team-share-section {
  margin: 1.5rem 0;
  text-align: center;
}

.team-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: #f0fdf4;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.team-share-btn:hover {
  background: var(--accent);
  color: #fff;
}

.team-share-btn.copied {
  background: var(--accent);
  color: #fff;
}

/* Back link */
.team-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.team-back-link:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }

  .team-hero {
    gap: 1rem;
  }

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

  .team-hero-info h1 {
    font-size: 1.5rem;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .rivalry-cards {
    grid-template-columns: 1fr;
  }
}

/* === Load More === */
.load-more {
  text-align: center;
  padding: 1.5rem;
}

.load-more-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: #f0fdf4;
  border-color: var(--accent);
}

/* === Footer === */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer p { margin-bottom: 0.75rem; }

.footnotes {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.error {
  text-align: center;
  padding: 2rem;
  color: var(--red);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

/* === Responsive === */
@media (max-width: 600px) {
  .league-tabs {
    gap: 0.2rem;
  }
  .league-tab {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
  }

  .hero {
    height: 280px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .team-card {
    grid-template-columns: 2rem 2.8rem 1fr auto;
    padding: 0.8rem 0.75rem;
    gap: 0.2rem 0.6rem;
  }

  .avatar {
    width: 2.8rem;
    height: 2.8rem;
  }

  .rank {
    font-size: 1.1rem;
  }

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

  .days-number {
    font-size: 1.3rem;
  }

  .tier-badge {
    font-size: 0.6rem;
  }

  .streak-info {
    font-size: 0.75rem;
  }

  .form-dot {
    width: 15px;
    height: 15px;
    font-size: 0.5rem;
  }

  .team-info {
    min-width: 0;
    overflow: hidden;
  }

  .team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  .tier-badge {
    flex-shrink: 0;
  }

  .hair-metric {
    max-width: 5rem;
  }

  .team-details {
    min-width: 0;
    overflow: hidden;
  }

  .match-table {
    font-size: 0.7rem;
  }

  .match-source {
    display: none;
  }

  .match-comp {
    display: none;
  }
}

@media (max-width: 400px) {
  .team-card {
    grid-template-columns: 1.8rem 2.4rem 1fr auto;
    padding: 0.6rem 0.5rem;
    gap: 0.15rem 0.4rem;
  }

  .avatar {
    width: 2.4rem;
    height: 2.4rem;
  }

  .rank {
    font-size: 0.95rem;
  }

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

  .tier-badge {
    font-size: 0.55rem;
    padding: 0.1rem 0.4rem;
  }

  .days-number {
    font-size: 1.15rem;
  }

  .days-label {
    font-size: 0.6rem;
  }

  .form-dot {
    width: 13px;
    height: 13px;
  }
}
