@font-face {
  font-family: "Bebas Neue";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ac4947db-a1e9-4314-964c-7dd67237f138.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/a1581d89-8589-44be-8a4d-92457d1334a3.woff2") format("woff2");
}

:root {
  --bg: #0b0b0c;
  --bg2: #131315;
  --bg3: #1c1c1f;
  --bg4: #242428;
  --border: rgba(255,255,255,0.10);
  --gold: #e8a020;
  --gold2: #c8861a;
  --white: #f0ede8;
  --gray: rgba(240,237,232,0.85);
  --gray2: rgba(240,237,232,0.62);
  --green: #60c981;
  --green-bg: #1a3a2a;
  --amber-bg: #2a1a10;
  --blue-bg: #1a1a2e;
  --violet-bg: #262030;
  --font-head: "Bebas Neue", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--white);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  content: "";
  inset: 0;
  opacity: 0.032;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

::selection { background: var(--gold); color: #000; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); }

.topbar {
  align-items: center;
  background: rgba(11,11,12,0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  height: 64px;
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  align-items: center;
  color: var(--white);
  display: inline-flex;
  gap: 10px;
  justify-self: start;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  border: 1.8px solid var(--gold);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 26px;
  overflow: hidden;
  position: relative;
  width: 26px;
}

.brand-mark::before,
.brand-mark::after {
  border: 1.4px solid var(--gold);
  border-left: 0;
  border-right: 0;
  content: "";
  height: 16px;
  left: -2px;
  opacity: 0.9;
  position: absolute;
  top: 4px;
  width: 30px;
}

.brand-mark::before { transform: rotate(90deg); }
.brand-mark::after { border-radius: 50%; }

.topbar h1 {
  color: var(--white);
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 3px;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.topbar h1 span { color: var(--gold); }
.tagline {
  color: var(--gray2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  line-height: 1;
  margin: 4px 0 0;
  text-transform: uppercase;
}

.map-nav {
  align-items: center;
  display: flex;
  gap: 30px;
  justify-content: center;
}

.map-nav a {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.map-nav a:hover,
.map-nav a[aria-current="page"] {
  color: var(--white);
}

.stat-chip {
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  justify-self: end;
  letter-spacing: 1px;
  max-width: 100%;
  overflow: hidden;
  padding: 7px 14px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-summary-bar {
  display: flex;
  justify-content: flex-end;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 24px 48px;
  position: relative;
  z-index: 1;
}

.controls {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 16px;
}

#searchForm {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(112px, 1fr)) minmax(112px, auto) auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label {
  color: var(--gray);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1;
  text-transform: uppercase;
}

.field input[type=text],
.field select,
.source-filter,
.submit-form input[type=text],
.submit-form select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  height: 42px;
  min-width: 0;
  outline: none;
  padding: 0 12px;
}

.field select,
.source-filter,
.submit-form select {
  cursor: pointer;
}

.field input::placeholder,
.submit-form input::placeholder {
  color: rgba(240,237,232,0.45);
}

.field input:focus,
.field select:focus,
.source-filter:focus,
.submit-form input:focus,
.submit-form select:focus {
  border-color: var(--gold);
}

.field.checkbox {
  justify-content: end;
}

.field.checkbox label {
  align-items: center;
  border: 1px solid var(--border);
  color: var(--gray);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
  height: 42px;
  justify-content: center;
  letter-spacing: 0.2px;
  padding: 0 12px;
  text-transform: none;
  white-space: nowrap;
}

.field.checkbox input {
  accent-color: var(--gold);
}

.go {
  background: var(--gold);
  border: 0;
  color: #000;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 17px;
  height: 42px;
  letter-spacing: 2px;
  padding: 0 22px;
  text-transform: uppercase;
  transition: background 0.15s;
  white-space: nowrap;
}

.go:hover { background: var(--gold2); }

.results-layout {
  display: grid;
  flex: 0 0 auto;
  gap: 16px;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  height: calc(100vh - 225px);
  min-height: 460px;
  overflow: hidden;
}

.list-pane {
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.list-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--gray);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  justify-content: space-between;
  letter-spacing: 1.2px;
  padding: 12px 14px;
  text-transform: uppercase;
}

.source-filter {
  color: var(--gray);
  font-size: 12px;
  height: 34px;
  max-width: 205px;
}

.results {
  flex: 1;
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}

.results li {
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  padding: 14px 16px 15px 13px;
  transition: background 0.12s, border-color 0.12s;
}

.results li.partner {
  background: rgba(232, 160, 32, 0.06);
  border-left-color: var(--gold);
}

.results li:hover,
.results li.active {
  background: var(--bg3);
  border-left-color: var(--gold);
}

.r-top {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.r-name {
  color: var(--white);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 1.4px;
  line-height: 1.08;
  text-transform: uppercase;
}

.r-dist {
  color: var(--gold);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.r-loc {
  color: var(--gray2);
  font-size: 13px;
  margin-top: 4px;
}

.r-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.tag {
  background: var(--bg3);
  color: var(--gray);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
}

.tag.league { background: var(--green-bg); color: #bde9c8; }
.tag.pickup { background: var(--amber-bg); color: var(--gold); }
.tag.facility { background: var(--blue-bg); color: #bfc8ff; }
.tag.association { background: var(--violet-bg); color: #d9bfff; }
.tag.audience { background: var(--bg4); color: var(--gray); }
.tag.live { background: rgba(232,160,32,0.16); color: var(--gold); }
.tag.season { background: rgba(224,80,80,0.13); color: #ffb0a9; }

.r-link {
  color: var(--gold);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  margin-right: 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.r-link:hover { color: var(--white); }

.map-pane {
  background: var(--bg3);
  border: 1px solid var(--border);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  z-index: 0;
}

.empty,
.spinner {
  color: var(--gray2);
  font-size: 14px;
  padding: 44px 22px;
  text-align: center;
}

.submit-box {
  padding: 0 48px 18px;
  position: relative;
  z-index: 1;
}

.submit-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 10px 14px;
  text-transform: uppercase;
}

.submit-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.submit-form {
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
}

.submit-form #s_name { min-width: 220px; }
.submit-form #s_notes,
.submit-form #s_url { min-width: 220px; }
.submit-msg {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  color: var(--gray2);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px 18px;
  justify-content: space-between;
  padding: 13px 48px;
  position: relative;
  z-index: 1;
}

.leaflet-container {
  background: var(--bg3);
  color: var(--white);
  font-family: var(--font-body);
}

.leaflet-tile-pane {
  filter: grayscale(0.72) invert(0.9) contrast(0.82) brightness(0.72) hue-rotate(180deg);
}

.leaflet-control-zoom a,
.leaflet-control-attribution {
  background: rgba(19,19,21,0.92) !important;
  border-color: var(--border) !important;
  color: var(--gray) !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg4) !important;
  color: var(--white) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.32);
  color: var(--white);
}

.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.45;
  margin: 13px 14px;
}

.leaflet-popup-content b,
.map-popup-title {
  color: var(--white);
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 1.3px;
  line-height: 1.05;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.map-popup-meta {
  color: var(--gray2);
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}

.map-popup-kind {
  color: var(--gold);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.leaflet-popup-content a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.leaflet-popup-content a:hover { color: var(--white); }

.map-marker {
  background: var(--marker, var(--gold));
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(232,160,32,0.35), 0 6px 16px rgba(0,0,0,0.45);
  height: 16px;
  width: 16px;
}

.marker-league { box-shadow: 0 0 0 2px rgba(96,201,129,0.38), 0 6px 16px rgba(0,0,0,0.45); }
.marker-facility { box-shadow: 0 0 0 2px rgba(130,146,255,0.38), 0 6px 16px rgba(0,0,0,0.45); }
.marker-association { box-shadow: 0 0 0 2px rgba(190,140,255,0.38), 0 6px 16px rgba(0,0,0,0.45); }

@media (max-width: 1180px) {
  #searchForm {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .field.grow {
    grid-column: span 2;
  }
}

@media (max-width: 880px) {
  .topbar {
    gap: 12px;
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 64px;
    padding: 12px 20px;
  }

  .map-nav {
    display: none;
  }

  .stat-chip {
    font-size: 11px;
  }

  main {
    padding: 16px 20px;
  }

  #searchForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field.grow {
    grid-column: 1 / -1;
  }

  .results-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .list-pane {
    height: 520px;
  }

  .map-pane {
    height: 360px;
    min-height: 360px;
    order: -1;
  }

  .submit-box,
  footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 560px) {
  #searchForm {
    grid-template-columns: 1fr;
  }

  .field.grow {
    grid-column: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .stat-chip {
    display: none;
  }

  .source-filter {
    max-width: none;
    width: 100%;
  }

  .list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .map-pane {
    height: 300px;
    min-height: 300px;
  }

  .list-pane {
    height: 460px;
  }

  .submit-form {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-form input[type=text],
  .submit-form select,
  .submit-form button,
  .submit-form #s_name,
  .submit-form #s_notes,
  .submit-form #s_url {
    min-width: 0;
    width: 100%;
  }

  .r-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 360px) {
  #searchForm {
    grid-template-columns: 1fr;
  }

  .field.grow {
    grid-column: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .stat-chip {
    display: none;
    justify-self: start;
  }
}
