/* 🌻 Allgemeines Styling */
body {
  background-color: #fef4e0;
  margin: 0;
  font-family: sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

a {
  pointer-events: auto !important;
  z-index: 9999 !important;
}

/* 🔝 Header & Logo */
header {
  text-align: center;
  padding: 10px;
  background-color: #fef4e0;
}

#logo {
  max-height: 100px;
  display: block;
  margin: 0 auto 10px;
  width: auto;
  height: auto;
}

@media screen and (max-width: 768px) {
  #logo {
    max-width: 90vw;
  }
}

/* 🗺️ Karte */
#map {
  width: 100%;
  height: 70vh;
}

/* Abdunklung */
.popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
}
.popup-backdrop.hidden { display: none; }

/* Overlay-Box */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 9999;              /* über Backdrop */
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Desktop Overlay */
#spotOverlay {
  max-width: 650px;       /* gleiche Breite wie andere Popups */
  margin: 40px auto;      /* schön zentriert */
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* Mobil: fast Vollbild */
@media (max-width: 600px) {
  #spotOverlay {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    height: auto;
    max-width: none;
    border-radius: 10px;
  }
}


.gesture-hint {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin: 10px;
}


/* 🧙‍♂️ Allgemeine Klassen */
.hidden {
  display: none !important;
}

/* 📦 Popups */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 5000;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

@media screen and (max-width: 768px) {
  .popup {
    width: 80vw !important;
    max-width: 80vw !important;
    max-height: 70vh !important;
	height: auto;       /* passt sich Inhalt an */
    max-height: 85vh;   /* wenn Inhalt groß wird → scrollen */
  }
}

.popup h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.popup p,
.popup ul,
.popup li {
  font-size: 0.95rem;
  line-height: 1.5;
}

.popup a {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

/* ❌ Popup-Schließen-Buttons */
.popup-close {
  display: block;
  width: 100%;
  margin: 10px auto 0 auto;
  background: #105237;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
}

.popup-cancel {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  color: #000;
  font-size: 22px;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* 📤 Melden-Button */
#reportBtn {
  padding: 12px 24px;
  font-size: 1.05rem;
  background: #55b96b;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

#reportBtn:hover {
  background: #3f9f56;
}

/* 📋 Tabellen (Spots & Nearby) */
#spotTable th, #spotTable td,
#nearbyTable th, #nearbyTable td {
  padding: 6px;
  border-bottom: 1px solid #ccc;
  text-align: left;
}

#spotTable tr, #nearbyTable tr {
  cursor: pointer;
}

#spotTable tr:hover,
#nearbyTable tr:hover {
  background-color: #eefbe4;
}

/* 🧾 Formulare */
input[type="text"],
input[type="file"] {
  width: 100%;
  margin: 5px 0 10px;
  padding: 6px;
  box-sizing: border-box;
  font-size: 16px;
}

/* 🦶 Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #fff;
  font-size: 0.9rem;
}

.footer-link {
  cursor: pointer;
  color: #105237;
  display: inline-block;
  margin: 5px 10px;
  transition: color 0.2s;
}

footer a {
  text-decoration: none;
}

.footer-link:hover {
  color: #000;
}

/* 🛠️ Admin-Bereich */
.admin-box {
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 20px;
  color: #ccc;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.admin-box h2 {
  font-size: 1.4rem;
  color: #00f2ff;
  margin-bottom: 15px;
}

.admin-box p,
.admin-box li {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ccc;
}

.admin-box strong {
  color: #fff;
}

.admin-box table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.admin-box table th,
.admin-box table td {
  padding: 8px;
  border: 1px solid #333;
  text-align: left;
  font-size: 0.85rem;
  color: #eee;
}

.admin-box .button {
  margin-top: 15px;
  background-color: #333;
  color: #00f2ff;
  border: 1px solid #00f2ff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s all;
}

.admin-box .button:hover {
  background-color: #00f2ff;
  color: #000;
}

/* 📱 Mobile Buttons (Button-Group) */
@media (max-width: 768px) {
  .button-group,
  .spot-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    margin: 10px 0;
  }

  .button-group button,
  .spot-button,
  #reportBtn {
    width: 90vw;
    max-width: 90vw;
    font-size: 1rem;
    text-align: center;
  }
}

/* 🖥️ Desktop Buttons (schmal) */
@media (min-width: 769px) {
  .button-group,
  .spot-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 0;
  }

  .button-group button,
  .spot-button,
  #reportBtn {
    width: 350px;
    max-width: 350px;
    font-size: 1rem;
    padding: 10px 16px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 8px;
    white-space: nowrap;
  }
}

/* 🧭 Install-Hinweis */
#installHintBanner {
  background: #fffbe6;
  color: #666;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  max-width: 250px;
  margin: 0 auto 6px auto;
  text-align: center;
  box-shadow: 0 0 4px rgba(0,0,0,0.05);
  cursor: pointer;
}


#burgerToggle {
  margin-top: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #105237;
  text-align: center;
  cursor: pointer;
  user-select: none;
}


.field{margin:8px 0}
.field .hint{display:block;font-size:12px;color:#666;margin-top:4px}
.check{display:flex;align-items:center;gap:8px;margin:8px 0}

/* 🏆 Toplisten 2-Spalten-Layout */
/* 🏆 Toplisten 2-Spalten-Layout */
.toplist-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .toplist-columns {
    grid-template-columns: 1fr;
  }
}

.toplist-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px; /* mehr Luft zwischen den Kacheln */
}

/* 🏆 Container für Top 3 */
.toplist-top3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px; /* Abstand zwischen den Kacheln */
  margin-bottom: 16px;
}

@media (min-width: 480px) {
  .toplist-top3 {
    grid-template-columns: 1fr; /* untereinander */
  }
}

/* 🎴 Karten */
.top-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 6px rgba(0, 0, 0, 0.15),
              0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 6px rgba(0, 0, 0, 0.15),
              0 8px 16px rgba(0, 0, 0, 0.25);
}

.top-card h4 {
  margin: 8px 0;
  font-size: 1.05rem;
  font-weight: bold;
  color: #105237;
}

.top-card .count {
  font-size: 1.15rem;
  font-weight: bold;
  color: #000;
}

/* 🥇 Platznummer */
.top-card .rank {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: bold;
  background: #fff;
  color: #333;
  padding: 4px 10px;
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toplist-rest {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
}

.toplist-rest li {
  font-size: 0.95rem;
  margin: 4px 0;
}

/* Einheitliche Höhe & Layout */
.top-card {
  min-height: 130px;              /* gleiche Höhe für alle */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

/* Name dominanter */
.top-card h4 {
  font-size: 1.4rem;              /* größer */
  font-weight: 700;               /* fett */
  color: #000;                    /* schwarz */
  margin: 6px 0 4px;
}

/* Spots groß, aber untergeordnet */
.top-card .count {
  font-size: 1.1rem;              /* größer als vorher */
  font-weight: 600;               /* fett */
  color: #222;                    /* dunkles Grau, nicht so dominant wie Name */
  margin-top: 2px;
}

/* Score extra Zeile */
.top-card .score {
  margin-top: 4px;
  font-size: 1.1rem;     /* größer */
  font-weight: 700;      /* fett */
  color: #000;           /* schwarz (gut lesbar auf allen Karten) */
}

/* 🥇 Gold */
.top-card.gold {
  background: linear-gradient(145deg, #FFD700, #FFC107, #FFB300);
  background-size: 200% 200%;
  color: #000;
  animation: gradientShift 6s ease infinite;
}

/* 🥈 Silber */
.top-card.silver {
  background: linear-gradient(145deg, #E0E0E0, #C0C0C0, #A9A9A9);
  background-size: 200% 200%;
  color: #000;
  animation: gradientShift 8s ease infinite;
}

/* 🥉 Bronze */
.top-card.bronze {
  background: linear-gradient(145deg, #CD7F32, #B87333, #8B4513);
  background-size: 200% 200%;
  color: #000;
  animation: gradientShift 10s ease infinite;
}

/* 🌈 Animation für dynamischen Verlauf */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 📋 Restliche Plätze (Platz 4–10) */
.toplist-rest {
  margin-top: 10px;
  padding-left: 20px;
}
.toplist-rest li {
  margin: 4px 0;
  font-size: 0.95rem;
}

.score-info {
  margin: 15px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff8d1;          /* leicht gelber Hintergrund */
  border: 1px solid #f0d75a;    /* goldener Rand */
  font-size: 0.9rem;
  color: #333;
  text-align: left;
  line-height: 1.4;
}
.score-info strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.comments-box {
  margin-top: 5px;
  max-height: 80px;
  overflow-y: auto;
  font-size: 16px;
  border-top: 1px solid #333;
  padding-top: 3px;
}

.warnBox {
  display: none;
  font-size: 0.85rem;
  color: red;
  margin: 4px auto 8px;   /* gleiche Logik wie Input-Felder */
  width: 90%;             /* bündig mit Inputs */
  max-width: 500px;
}



/* 🎉 Quick Reactions */
.quick-reactions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;   /* bricht mobil automatisch um */
  gap: 8px;
}

.quick-reactions button {
  background: #f4f4f4;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, transform 0.15s;
}
.quick-reactions button:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}
.quick-reactions span {
  font-size: 14px;
  color: #555;
}

#datenschutzPopup h2,
#datenschutzPopup h3 {
  text-align: center;
}

#datenschutzPopup p,
#datenschutzPopup ul {
  text-align: left;
}

.input-field,
.file-input {
  width: 100%;          /* volle Breite */
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 12px;
}


.file-label {
  background: #eee;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #ccc;
}
.file-label:hover {
  background: #ddd;
}

#photoTable tbody tr {
  border-bottom: 1px solid #ddd;
}

#photoTable th,
#photoTable td {
  text-align: left;
  vertical-align: middle;
  padding: 6px;
  border-bottom: 1px solid #ccc;
}

/* Spot-Liste einspaltig auf Mobil */
.spots-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Spot-Karte */
.spot-card {
  display: grid;
  grid-template-columns: 100px 1fr; /* Mobil kleineres Bild */
  gap: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.spot-card:hover { background: #f9f9f9; }

/* Bild flexibel */
.spot-thumb {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

/* Ab Desktop 2-Spalten-Layout */
@media (min-width: 769px) {
  .spots-list {
    grid-template-columns: 1fr 1fr;
  }
  .spot-card {
    grid-template-columns: 140px 1fr; /* Desktop: etwas größeres Bild */
  }
}


/* grüner, mittiger Load-More-Button */
#allSpots_loadMore {
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
#allSpots_loadMore:hover { background-color: #218838; }


/* 🌍 Allgemeine Popup-Regeln */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 9999;
  max-height: 90vh;
  overflow-y: auto;
}

/* 📐 Standardbreite für ALLE Popups auf Desktop */
@media (min-width: 769px) {
  .popup {
    width: 600px;
    max-width: 600px;
  }
}

/* 📐 Spot-Overlay soll auf Desktop dynamisch bleiben */
@media (min-width: 769px) {
  #spotOverlay {
    width: auto;         /* nimmt nur so viel wie nötig */
    max-width: 95vw;     /* Sicherheitsbegrenzung */
    display: inline-block;
  }
}

/* 📱 Mobilgeräte */
@media (max-width: 768px) {
  .popup {
    width: 95%;
    max-width: none;
    height: auto;
    max-height: 85vh;
  }
}

.hint-box {
  background:#fff8e1;
  color:#444;
  font-size:14px;
  text-align:center;
  padding:6px 10px;
  border-radius:6px;
  margin:8px 0;
  border:1px solid #ffe082;
}
.hint-link {
  color:#2e7d32;
  font-weight:500;
  margin-left:5px;
  text-decoration:none;
}
.hint-link:hover {
  text-decoration:underline;
  
}

.hidden {
  display: none !important;
}

#photoOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);   /* leicht transparent, nicht komplett schwarz */
  z-index: 9999999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#photoOverlay img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  cursor: pointer;  /* zeigt an: klickbar zum Schließen */
}

#photoOverlay .closeBtn {
  position: relative;
  top: -10px;          /* etwas Abstand über dem Bild */
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#photoOverlay .closeBtn:hover {
  color: #ff4444;
}

/* Alle Standard-Popups */
/* Basis-Popup (alle Popups) */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 1000; /* Standard */
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
}

/* SpotOverlay bekommt nur den höheren Z-Index */
.overlay-popup {
  z-index: 200000;
}


/* AllSpots */
#allSpotsPopup {
  z-index: 9500;
}

/* Spot-Overlay immer ganz oben */
#spotOverlayBackdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 99998;
}

#spotOverlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 99999;   /* ✅ über allem */
  width: 90%;
  max-width: 350px;
  max-height: 90vh;
  overflow-y: auto;
}

#spotOverlay input[type="text"],
#spotOverlay textarea {
  font-size: 16px !important; /* verhindert iOS Zoom */
}

/* ❌ X-Button oben rechts (falls noch nicht global) */
.popup .popup-cancel{
  position:absolute;
  top:8px;
  right:8px;
  background:#00000066;
  color:#fff;
  border:0;
  width:32px;height:32px;border-radius:50%;
  font-size:18px;line-height:32px;cursor:pointer;
}

/* 🔻 Footer-Buttons unten */
.popup .popup-footer{
  margin-top:12px;
  display:flex;gap:10px;justify-content:center;flex-wrap:wrap;
}

/* 🌾 Popup-Struktur */
#allPhotosPopup {
  max-width: 900px;
  width: 95%;
  max-height: 85vh;           /* Popup darf bis 85% der Fensterhöhe gehen */
  margin: 0 auto;
  background: #fffdf8;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow-y: auto;           /* Popup selbst scrollt */
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
}

/* 📸 Galerie-Grid */
#allPhotosGrid.photo-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr); 
  gap: 14px;
  padding: 12px;
}

/* 💻 Desktop: 3 Spalten mit gleichgroßen Quadraten */
@media (min-width: 768px) {
  #allPhotosGrid.photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 🧱 Foto-Karte */
.photo-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* 📷 Bilddarstellung */
.photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;       /* quadratische Kacheln */
  object-fit: cover;
  display: block;
  background: #eee;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.photo-card img:hover {
  opacity: 0.9;
}

/* 🗓️ Datum + Uhrzeit */
.photo-date {
  text-align: center;
  font-size: 14px;
  color: #333;
  padding: 8px 0 6px;
  background: #fafafa;      /* ← kein border mehr */
}

/* 👍👎👁️ + 🚨 Meta-Bereich */
.photo-meta {
  text-align: center;
  font-size: 13px;
  color: #444;
  padding: 10px 0 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  background: #fafafa;
}

/* 🚨 Melden-Link (neutral wie andere Links auf der Seite) */
/* ❗ Melden-Link */
.photo-meta .emoji {
  color: #d10000;       /* rotes Ausrufezeichen */
  font-weight: bold;
}

.photo-report {
  color: inherit;        /* gleiche Farbe wie der restliche Text */
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.photo-report:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* 🧭 Sortiermenü */
#photoSort {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 5px 8px;
  font-size: 13px;
  margin-top: 6px;
  cursor: pointer;
}

#photoSort:hover {
  border-color: #999;
}

#photoSort:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.3);
}

/* 📦 Popup-Footer */
.popup-footer {
  text-align: center;
  padding: 12px;
}

/* ⏳ Lazy Load – Ladeindikator unten */
#allPhotosGrid.loading::after {
  content: '📸 Lade weitere Fotos...';
  text-align: center;
  color: #888;
  display: block;
  padding: 10px;
  font-size: 13px;
}

/* 📜 Scrollbar Styling */
#allPhotosPopup::-webkit-scrollbar {
  width: 8px;
}

#allPhotosPopup::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

#allPhotosPopup::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

#allPhotosPopup::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* 📱 Mobile Anpassung */
@media (max-width: 480px) {
  .photo-date,
  .photo-meta {
    font-size: 12px;
    gap: 12px;
  }
}
/* Einheitlicher Popup-Kopf */
.popup {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* damit nichts rausragt */
}

/* Kopfzeile fixieren */
.popup-header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 10px 15px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  z-index: 2;
}

/* Überschrift */
.popup-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

/* Schließen-Button (X) */
.popup-header .popup-cancel {
  position: absolute;            /* wichtig: kein absolutes/fixed */
  transform: translate(40%, -40%); /* leicht rausstehend */
  margin-right: 5px;         /* damit’s halb außen sitzt */
  margin-top: 5px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}

.popup-header .popup-cancel:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: translate(40%, -40%) scale(1.1);
}

/* Inhaltsbereich scrollt */
.popup-body {
  overflow-y: auto;
  padding: 15px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}