/* Karte der Spielorte (VmvSamsApi, Skript map.js). Farben der Gruppen (Frauen, Männer, Mixed, Jugend) kommen aus den Daten (MapAssembler::CATEGORIES). */
.sapi-map { margin: 1rem 0 2rem; }
.sapi-map [hidden] { display: none !important; }

.sapi-map__stage {
  position: relative;
  /* Höhe: 65 % der Fensterhöhe, mindestens 440 und höchstens 600 px (kleine Fenster bekommen weniger, große nicht mehr als 600) */
  box-sizing: border-box;
  width: 100%;
  height: clamp(440px, 65vh, 600px);
  overflow: hidden;
  border: 1px solid var(--sapi-border, #C8E5F1);
  border-radius: .75rem;
  background: #e8eef2;
  box-shadow: var(--vmv-shadow, 0 10px 20px -5px #0B1F3A25);
}
.sapi-map__canvas { position: absolute; inset: 0; z-index: 0; }
.sapi-map__canvas:focus-visible { outline: 3px solid var(--vmv-blau, #205094); outline-offset: -3px; }
.sapi-map .leaflet-container { font-family: inherit; background: #e8eef2; }
.sapi-map .leaflet-container a { color: var(--vmv-blau, #205094); }
/* Die Seite unterstreicht Links; die Knöpfe der Karte (Zoom, Gesamtansicht, Quellenangabe) bleiben ohne Unterstreichung */
body.vmv2 #vmvmain .sapi-map .leaflet-bar a,
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:hover,
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:focus { text-decoration: none; }
/* Zoom und Gesamtansicht bleiben auch beim Überfahren weiß und deckend (allgemeine Linkregeln der Seite würden sie sonst abdunkeln oder durchscheinen lassen) */
body.vmv2 #vmvmain .sapi-map .leaflet-bar a,
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:hover,
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:focus {
	background-color: #fff;
	opacity: 1;
	color: var(--vmv-tiefsee, #0B1F3A);
}
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:hover,
body.vmv2 #vmvmain .sapi-map .leaflet-bar a:focus { color: var(--vmv-blau, #205094); }
body.vmv2 #vmvmain .sapi-map .leaflet-bar a.leaflet-disabled { background-color: #f4f4f4; color: #bbb; }



/* Marker: Kreis in der Farbe der Gruppe (bei mehreren als Kreisdiagramm), Zahl = Spiele am Ort */
.sapi-pin-wrap { background: none; border: 0; }
.sapi-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(11, 31, 58, .5);
  color: #fff;
}
.sapi-pin b { font-family: var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif); font-size: .95rem; line-height: 1; text-shadow: 0 0 3px rgba(0, 0, 0, .75), 0 0 1px rgba(0, 0, 0, .9); }
.leaflet-marker-icon:focus-visible .sapi-pin { outline: 3px solid var(--vmv-tiefsee, #0B1F3A); outline-offset: 2px; }

.sapi-dot { display: inline-block; width: .8em; height: .8em; margin-right: .4em; border-radius: 50%; vertical-align: -.05em; box-shadow: 0 0 0 1px rgba(11, 31, 58, .25); }

/* Bedienelemente */
.sapi-map__home a { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--vmv-tiefsee, #0B1F3A); }
.sapi-map__home a:hover { color: var(--vmv-blau, #205094); }

.sapi-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .8rem;
  margin: 0 0 .4rem .6rem;
  padding: .3rem .6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(11, 31, 58, .3);
  font-size: .85rem;
  line-height: 1.3;
}

.sapi-map__filterbtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 34px;
  padding: .3rem .8rem;
  border: 2px solid rgba(0, 0, 0, .2);
  border-radius: 6px;
  background: #fff;
  color: var(--vmv-tiefsee, #0B1F3A);
  font: 700 1rem var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif);
  cursor: pointer;
}
.sapi-map__filterbtn:hover, .sapi-map__filterbtn[aria-expanded="true"] { background: var(--vmv-tiefsee, #0B1F3A); color: #fff; }
.sapi-map__badge { min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--vmv-rot, #BB2728); color: #fff; font-style: normal; font-size: .85rem; line-height: 1.4; text-align: center; }

.sapi-map__panel {
  position: absolute;
  top: 54px;
  right: 10px;
  z-index: 1000;
  box-sizing: border-box;
  width: 290px;
  max-height: calc(100% - 64px);
  overflow-y: auto;
  padding: .8rem .9rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 31, 58, .35);
  font-size: .95rem;
}
.sapi-map__ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; font-size: 1.1rem; }
.sapi-map__close { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.sapi-map__close:hover { background: var(--vmv-duene-hell, #FAF7F3); }
.sapi-map__panel fieldset { margin: 0 0 .7rem; padding: 0; border: 0; }
.sapi-map__panel legend { margin: 0 0 .25rem; padding: 0; color: var(--sapi-muted, #48566B); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sapi-map__panel fieldset label { display: flex; align-items: center; gap: .3rem; min-height: 2rem; cursor: pointer; }
.sapi-map__panel fieldset input { width: 1.1rem; height: 1.1rem; margin: 0 .35rem 0 0; accent-color: var(--vmv-blau, #205094); }
.sapi-map__panel small { color: var(--sapi-muted, #48566B); }
.sapi-map__field { display: block; margin: 0 0 .7rem; color: var(--sapi-muted, #48566B); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sapi-map__field select { display: block; box-sizing: border-box; width: 100%; min-height: 2.4rem; margin-top: .25rem; padding: .35rem .5rem; border: 1px solid var(--sapi-border, #C8E5F1); border-radius: 6px; background: #fff; color: var(--vmv-tiefsee, #0B1F3A); font: inherit; letter-spacing: normal; text-transform: none; }
.sapi-map__sum { margin: 0 0 .6rem; color: var(--sapi-muted, #48566B); font-size: .85rem; }
.sapi-map__reset { width: 100%; min-height: 2.4rem; border: 1px solid var(--vmv-blau, #205094); border-radius: 6px; background: #fff; color: var(--vmv-blau, #205094); font: 700 1rem var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif); cursor: pointer; }
.sapi-map__reset:hover { background: var(--vmv-blau, #205094); color: #fff; }

.sapi-map__empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 900;
  padding: .7rem 1.1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(11, 31, 58, .3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sapi-map__note { margin: .6rem 0 0; color: var(--sapi-muted, #48566B); font-size: .85rem; }

/* Fenster eines Spielorts */
.sapi-map .leaflet-popup-content { margin: .75rem .9rem; font-size: .95rem; line-height: 1.35; }
.sapi-pop { max-height: min(48vh, 340px); overflow-y: auto; padding-right: .2rem; }
/* Karte der Heimspielstätten einer Liga: Vereinslogos als Marker (ein Logo, bei mehreren Vereinen ab einer Zoomstufe nebeneinander) */
.sapi-pin-wrap--logo { background: none; border: 0; }
.sapi-logopins { position: relative; display: block; }
.sapi-logopin { position: absolute; top: 0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 11%; border: 3px solid; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(11, 31, 58, .5); }
/* body.vmv2 img setzt height: auto und max-width: 100%; das Logo soll den Kreis ausfüllen und nie angeschnitten werden (object-fit: contain) */
body.vmv2 .sapi-logopin img { display: block; flex: none; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.sapi-logopin b { font-family: var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif); font-size: .95rem; line-height: 1; color: var(--vmv-tiefsee, #0B1F3A); }
.sapi-logopin.is-more { background: var(--vmv-tiefsee, #0B1F3A); }
.sapi-logopin.is-more b { color: #fff; }
.sapi-logopin__n { position: absolute; top: -4px; right: -6px; z-index: 20; min-width: 1.35em; padding: 0 .3em; border: 2px solid #fff; border-radius: 999px; color: #fff; font: 700 .8rem/1.3 var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif); font-style: normal; text-align: center; box-shadow: 0 1px 3px rgba(11, 31, 58, .5); }
.leaflet-marker-icon:focus-visible .sapi-logopin { outline: 3px solid var(--vmv-tiefsee, #0B1F3A); outline-offset: 2px; }
/* Mannschaften des Spielorts im Fenster */
.sapi-pop__teams-list { margin: .35rem 0 0; padding: 0; list-style: none; }
.sapi-pop__teams-list li { display: flex; align-items: center; gap: .5rem; padding: .25rem .1rem; }
.sapi-pop__teams-list li:nth-child(even) { background: var(--vmv-gischt-hell, #E3F2F8); }
.sapi-pop__teams-list img { flex: none; width: 24px; height: 24px; object-fit: contain; }
.sapi-pop__nologo { flex: none; width: 24px; height: 24px; }
.sapi-pop__teams-list .sapi-pop__count { margin-left: auto; white-space: nowrap; }
.sapi-pop__venue + .sapi-pop__venue { margin-top: .9rem; padding-top: .6rem; border-top: 2px solid var(--sapi-border, #C8E5F1); }
.sapi-pop__head { display: flex; align-items: flex-start; gap: .5rem; padding-right: 1.2rem; }
/* Zoom-Symbol links neben dem Namen der Halle: zoomt auf rund 500 m Umkreis */
.sapi-pop__zoom { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--sapi-border, #C8E5F1); border-radius: 50%; background: #fff; color: var(--vmv-blau, #205094); text-decoration: none; }
body.vmv2 #vmvmain .sapi-pop__zoom, body.vmv2 #vmvmain .sapi-pop__zoom:hover { text-decoration: none; }
.sapi-pop__zoom:hover, .sapi-pop__zoom:focus { background: var(--vmv-blau, #205094); border-color: var(--vmv-blau, #205094); color: #fff; }
.sapi-pop__name { display: block; font-size: 1.05rem; }
.sapi-pop__addr { margin-bottom: .4rem; color: var(--sapi-muted, #48566B); font-size: .85rem; }
.sapi-pop__comp { margin-top: .5rem; padding-left: .55rem; border-left: 4px solid; }
.sapi-pop__title { font-weight: 700; cursor: pointer; }
.sapi-pop__comp:not([open]) > .sapi-pop__title { cursor: pointer; }
.sapi-pop__comp > summary { list-style: none; }
.sapi-pop__comp > summary::-webkit-details-marker { display: none; }
.sapi-pop__comp > summary::before { content: '\25B8'; display: inline-block; width: 1em; color: var(--sapi-muted, #48566B); }
.sapi-pop__comp[open] > summary::before { content: '\25BE'; }
.sapi-pop__count { margin-left: .2rem; color: var(--sapi-muted, #48566B); font-size: .85rem; font-weight: 400; }
.sapi-pop__title a { margin-left: .4rem; font-size: .85rem; font-weight: 400; }
.sapi-pop__games { margin: .15rem 0 0; padding: 0; list-style: none; }
.sapi-pop__games li { padding: .3rem .45rem; }
.sapi-pop__games li:nth-child(even) { background: var(--vmv-gischt-hell, #E3F2F8); }
.sapi-pop__row { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.sapi-pop__teams { min-width: 0; }
.sapi-pop__when { display: block; color: var(--sapi-muted, #48566B); font-family: var(--vmv-font-head, 'Barlow Condensed', Arial, sans-serif); font-size: .8rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sapi-pop .is-win { font-weight: 700; }
.sapi-pop__score { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sapi-pop__score.is-open { color: var(--sapi-muted, #48566B); font-weight: 400; }
.sapi-pop .is-done .sapi-pop__teams { color: var(--vmv-tiefsee, #0B1F3A); }

/* Handy: Filterfenster über die ganze Breite, etwas höhere Karte */
@media (max-width: 600px) {
  .sapi-map__stage { height: clamp(420px, 74vh, 640px); border-radius: .5rem; }
  .sapi-map__panel { left: 10px; right: 10px; width: auto; max-height: calc(100% - 64px); }
  .sapi-map__legend { font-size: .78rem; }
}
