:root {
  --bg: #10241b;
  --panel: #16342650;
  --accent: #2f9e63;
  --text: #f2f5f3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
}

#sidebar {
  background: var(--bg);
  color: var(--text);
  padding: 1.25rem;
  overflow-y: auto;
}

#sidebar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin: 0.2rem 0 1.4rem;
  opacity: 0.7;
  font-size: 0.85rem;
}

#sidebar label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

#sidebar input[type="search"] {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid #ffffff22;
  border-radius: 6px;
  background: #ffffff10;
  color: var(--text);
  font-size: 0.95rem;
}

/* Multi-select filter dropdowns (accordion-style so they never clip in the
   scrolling sidebar). */
.dropdown {
  margin-top: 0.7rem;
}

.dropdown-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid #ffffff22;
  border-radius: 6px;
  background: #16342a;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.dropdown-toggle::after {
  content: "▾";
  opacity: 0.6;
  margin-left: 0.5rem;
}

.dropdown.open .dropdown-toggle::after {
  content: "▴";
}

.dropdown.disabled .dropdown-toggle {
  opacity: 0.45;
  cursor: not-allowed;
}

.dropdown-panel {
  display: none;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.3rem;
  border: 1px solid #ffffff1a;
  border-radius: 6px;
  background: #12281f;
}

.dropdown.open .dropdown-panel {
  display: block;
}

.dropdown-panel label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.dropdown-panel label:hover {
  background: #ffffff12;
}

.count {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

#map {
  height: 100%;
}

/* Club-crest markers: a white circle backing (also the fallback when a crest
   fails to load) with the logo contained inside. */
.club-marker {
  background: #fff;
  border: 2px solid #ffffffee;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.club-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.popup {
  min-width: 210px;
  max-width: 320px;
}

.popup-head {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.popup img {
  object-fit: contain;
  flex: none;
}

.popup .venue {
  font-size: 0.8rem;
  opacity: 0.75;
}

.popup ul.teams {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid #00000018;
  max-height: 220px;
  overflow-y: auto;
}

.popup ul.teams li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.15rem 0;
  font-size: 0.85rem;
}

.popup ul.teams .lvl {
  flex: none;
  min-width: 1.9em;
  text-align: center;
  font-weight: 600;
  color: #2f9e63;
}

.popup ul.teams .tmeta {
  margin-left: auto;
  opacity: 0.7;
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}
