/* ── BACK BUTTON (same as privacy/schedule pages) ── */
.hl-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light-mid);
  border: 1px solid var(--dark-3);
  padding: 0.4em 1em;
  margin-bottom: 2rem;
  transition: color var(--transition), border-color var(--transition);
}
.hl-back-btn:hover { color: var(--white); border-color: var(--red); }

/* ── HERO ── */
.an-hero {
  background: var(--dark);
  padding: calc(var(--nav-h) + 2.5rem) 0 2rem;
  border-bottom: 1px solid var(--dark-3);
  position: relative;
  overflow: hidden;
}
.an-hero::before {
  content: 'ANALYTICS';
  position: absolute;
  right: -0.05em;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Anton', sans-serif;
  font-size: clamp(70px, 13vw, 160px);
  font-style: italic;
  color: rgba(204,0,0,0.04);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.an-hero-meta { position: relative; z-index: 2; max-width: 720px; }
.an-hero-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1;
  margin-bottom: 0.7rem;
}
.an-hero-sub {
  font-size: clamp(13px, 2vw, 15px);
  color: var(--light-mid);
  line-height: 1.6;
}

.an-disclaimer {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.6em 1em;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: #ffc94d;
  background: rgba(255,193,7,0.08);
  border: 1px solid rgba(255,193,7,0.25);
}
.an-disclaimer svg { flex-shrink: 0; }

/* ── MAIN SECTION ── */
.an-section {
  padding: clamp(2rem, 4vw, 3.5rem) 0 5rem;
  background: var(--black);
}

/* filter bar — Gender, Age/Competition, and Team all share the exact
   same combo-box chrome so they read as one consistent control group */
.an-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--dark-3);
  margin-bottom: 1.25rem;
}
.an-filter { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 180px; }
.an-filter-team { flex: 2 1 260px; }
.an-filter label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light-mid);
}

.an-combo { position: relative; }
.an-combo input {
  width: 100%;
  padding-right: 2.4em;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  background: var(--dark-2);
  color: var(--white);
  border: 1px solid var(--dark-3);
  padding-top: 0.6em;
  padding-bottom: 0.6em;
  padding-left: 0.8em;
  outline: none;
  transition: border-color var(--transition);
}
.an-combo input:focus, .an-combo input:hover { border-color: var(--red); }
.an-combo input::placeholder { color: var(--mid); }
.an-combo-caret {
  position: absolute;
  top: 50%;
  right: 0.8em;
  transform: translateY(-50%);
  color: var(--light-mid);
  pointer-events: none;
  transition: color var(--transition);
}
.an-combo input:focus ~ .an-combo-caret,
.an-combo input:hover ~ .an-combo-caret { color: var(--red); }

/* dropdown — shows ~5 rows at a time, scrolls for the rest */
.an-combo-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 195px;
  overflow-y: auto;
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.an-combo-option {
  padding: 0.55em 0.8em;
  font-size: 14px;
  color: var(--light);
  cursor: pointer;
  border-bottom: 1px solid var(--dark-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.an-combo-option .an-combo-option-sub {
  color: var(--light-mid);
  font-size: 12px;
  margin-left: 0.4em;
}
.an-combo-option:last-child { border-bottom: none; }
.an-combo-option:hover,
.an-combo-option.is-active { background: var(--red); color: var(--white); }
.an-combo-option:hover .an-combo-option-sub,
.an-combo-option.is-active .an-combo-option-sub { color: rgba(255,255,255,0.75); }
.an-combo-empty {
  padding: 0.6em 0.8em;
  font-size: 13px;
  color: var(--mid);
}
.an-combo-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6em 0.8em;
  font-size: 13px;
  color: var(--mid);
}

.an-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--mid);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 1rem 0;
}
.an-status[hidden] { display: none; }

.an-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--light-mid);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── SPINNER ── */
.an-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--dark-3);
  border-top-color: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  animation: an-spin 0.7s linear infinite;
}
.an-spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes an-spin { to { transform: rotate(360deg); } }

/* full loading state that swaps in for the dashboard while a team's
   detail is being fetched */
.an-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  color: var(--light-mid);
  font-size: 14px;
}
.an-loading[hidden] { display: none; }

/* ── DASHBOARD ── */
.an-dashboard { padding-top: 1rem; }

.an-dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--dark-3);
}
.an-dash-head-left { display: flex; align-items: center; gap: 1rem; }
.an-dash-head-main { display: flex; flex-direction: column; gap: 0.5rem; }
.an-club-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid var(--dark-3);
  border-radius: 50%;
  padding: 6px;
  flex-shrink: 0;
}
.an-club-logo[hidden] { display: none; }
.an-team-name {
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 3.5vw, 34px);
  line-height: 1;
}
.an-club-sub {
  font-size: 13px;
  color: var(--light-mid);
  letter-spacing: 0.02em;
}
.an-club-sub[hidden] { display: none; }
.an-team-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.an-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  background: rgba(255,255,255,0.06);
  color: var(--light);
}
.an-tag-gender { background: rgba(204,0,0,0.15); color: var(--red-light); }
.an-site-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.5em; }
.an-site-btn[hidden] { display: none; }

/* stat cards */
.an-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--dark-3);
  margin-bottom: 1.5rem;
}
.an-stat {
  background: var(--dark);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.an-stat-rank { background: var(--dark-2); }
.an-stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light-mid);
}
.an-stat-value {
  font-family: 'Anton', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--white);
}
.an-stat-value.is-good { color: #4caf50; }
.an-stat-value.is-bad  { color: var(--red-light); }
.an-stat-sub {
  font-size: 11.5px;
  color: var(--light-mid);
  letter-spacing: 0.02em;
}

/* club + ranking detail cards */
.an-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--dark-3);
  margin-bottom: 1.5rem;
}
.an-info-card { background: var(--dark); padding: 1.25rem 1.5rem 1.5rem; }
.an-info-card[hidden] { display: none; }
.an-info-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--light-mid);
  margin-bottom: 1rem;
}
.an-info-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 13.5px; }
.an-info-list dt { color: var(--light-mid); }
.an-info-list dd { color: var(--white); text-align: right; }
.an-info-list dd a { color: var(--red-light); }
.an-info-list dd a:hover { color: var(--red); }

/* cup points mini-grid inside the ranking card */
.an-cups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1px;
  background: var(--dark-3);
  margin-top: 1rem;
}
.an-cups:empty { display: none; }
.an-cup {
  background: var(--dark-2);
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.an-cup-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-mid);
}
.an-cup-value { font-family: 'Anton', sans-serif; font-size: 16px; color: var(--white); }

/* charts */
.an-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--dark-3);
  margin-bottom: 1.5rem;
}
.an-chart-card {
  background: var(--dark);
  padding: 1.25rem 1.5rem 1.5rem;
}
.an-chart-wide { grid-column: 1 / -1; }
.an-chart-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--light-mid);
  margin-bottom: 1rem;
}
.an-chart-wrap { position: relative; height: 240px; }
.an-chart-wide .an-chart-wrap { height: 220px; }

/* recent games table */
.an-recent h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--light-mid);
  margin-bottom: 0.75rem;
}
.an-recent-table-wrap {
  overflow-x: auto;
  background: var(--dark-3);
}
.an-recent-table { min-width: 520px; }
.an-comp-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  background: rgba(255,255,255,0.06);
  color: var(--light);
  white-space: nowrap;
}
.an-recent-table .result-t { color: var(--light-mid); font-weight: 700; }

/* responsive */
@media (max-width: 760px) {
  .an-charts { grid-template-columns: 1fr; }
  .an-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .an-filters { flex-direction: column; }
  .an-dash-head { align-items: flex-start; }
}
