/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  background: #f5f7fb;
  color: #111;
  overflow: hidden; /* wir managen Scroll per Pan/Zoom */
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal__content {
  width: min(680px, 92vw);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 28px 28px 22px;
}
.modal__content h1 {
  margin: 0 0 10px 0;
  font-size: clamp(22px, 2.4vw, 36px);
  text-align: center; /* Titel mittig */
}
.modal__content p {
  line-height: 1.55;
  margin: 0 0 18px 0;
  font-size: 16px;
}
.modal__actions { display: flex; justify-content: center; }

.btn {
  border: 2px solid #0F3B88;
  color: #0F3B88;
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn--primary {
  background: #0F3B88;
  color: #fff;
  border-color: #0F3B88;
  font-weight: 700;
  padding: 12px 22px;
  font-size: 18px;
}
.btn--icon {
  width: 64px;   /* groesser auf Desktop */
  height: 64px;
  padding: 8px;
  background: #fff;
}
.btn--icon img {
  max-width: 100%;
  max-height: 100%;
}

/* Back */
.btn--back {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  width: 72px;
  height: 72px;
}

/* Zoom controls */
.zoom {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

/* Floating Legend */
.legend {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: 15;
  pointer-events: none; /* nicht anklickbar */
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12));
}
.legend img {
  width: min(360px, 40vw);
  height: auto;
  border-radius: 16px;
  border: 2px solid #000;
}

/* Viewport und Map */
.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #fff;
}
#map {
  transform-origin: 0 0; /* top-left fuer einfaches Rechnen */
  user-select: none;
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
}

/* Side arrows */
.side {
  position: fixed;
  border: none;
  background: transparent;
  padding: 0;
  width: 56px;
  height: 56px;
  z-index: 18;
  cursor: pointer;
}
.side img { width: 100%; height: 100%; object-fit: contain; }
/* Positionen (Rotationen korrigiert) */
.side--left { left: 8px; top: 50%; transform: translateY(-50%) rotate(180deg); }
.side--right { right: 8px; top: 50%; transform: translateY(-50%); }
.side--top { top: 8px; left: 50%; transform: translateX(-50%) rotate(-90deg); }
.side--bottom { bottom: 8px; left: 50%; transform: translateX(-50%) rotate(90deg); }

/* Mobile */
@media (max-width: 768px) {
  .side { display: none; }
  .btn--icon { width: 72px; height: 72px; }
  .btn--back { width: 72px; height: 72px; }
  .legend { display: none; } /* Legende auf Smartphones ausblenden */
}
