/* === LOCAL FONT CODES (@font-face) === */
  
  /* Schoolbell (Headlines) */
  @font-face {
    font-family: 'Schoolbell';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/schoolbell-v18-latin-regular.woff2') format('woff2');
  }

  /* PT Mono (Buttons / Tech-Texte) */
  @font-face {
    font-family: 'PT Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/pt-mono-v14-latin-regular.woff2') format('woff2');
  }

  /* PT Sans (Body / Fließtext) */
  @font-face {
    font-family: 'PT Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/pt-sans-v18-latin-regular.woff2') format('woff2');
  }
  @font-face {
    font-family: 'PT Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/pt-sans-v18-latin-italic.woff2') format('woff2');
  }
  @font-face {
    font-family: 'PT Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/pt-sans-v18-latin-700.woff2') format('woff2');
  }
  @font-face {
    font-family: 'PT Sans';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/pt-sans-v18-latin-700italic.woff2') format('woff2');
  }
  
  /* === RESET & BASE === */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  :root {
    /* Font-Familien Variablen */
    --font-headline: 'Schoolbell', 'Georgia', serif;
    --font-body: 'PT Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-caption: 'PT Mono', 'Courier New', monospace;
    --font-button: 'PT Mono', 'Courier New', monospace;
    --font-footer: 'PT Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Design-System Variablen */
    --color-bg: #f5f5f0;
    --color-text: #1a1a1a;
    --color-text-light: #555;
    --radius-card: 16px;
    --radius-btn: 50px;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.12);
    --transition-sheet: 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  }

  html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
  }

  /* === MAP LAYER === */
  #map {
    position: fixed;
    inset: 0;
    z-index: 0;
  }

  /* === PRIVACY GATE / PLACEHOLDER === */
  #privacy-gate {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(245,245,240,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  #map-placeholder {
    position: fixed;
    inset: 0;
    z-index: 5;
    background-image: url('../imgs/karte-platzhalter.png');
    background-size: cover;
    background-position: center;
    filter: blur(5px) brightness(0.92);
    transform: scale(1.05);
  }

  .gate-content {
    width: 100%;
    max-width: 420px;
    text-align: center;
    z-index: 10;
  }

  #btn-load-map {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-family: var(--font-button);
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-font-smoothing: antialiased;
  }
  #btn-load-map:active { transform: scale(0.97); }

  .gate-hint {
    margin-top: 14px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(255,255,255,0.8);
  }

  /* === TOP HEADER === */
  #header {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    pointer-events: none;
    z-index: 480;
  }
  #header > * { pointer-events: all; }

  #logo-container {
    position: relative;
    z-index: 480;
    display: flex;
    align-items: center;
  }

  .logo-img {
    height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
    margin-top: -12px;
  }

  #menu-btn {
    width: 46px; height: 46px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s;
    pointer-events: none;
  }

  #menu-btn span {
    display: block;
    width: 24px; 
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease, 
                background-color 0.2s ease;
    transform-origin: center;
  }

  #menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); background: #fff; }
  #menu-btn.open span:nth-child(2) { opacity: 0; }
  #menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: #fff; }
  #menu-btn.sheet-active span { background: #fff; }

  /* === FLOATING BUTTONS (FIXED BOTTOM) === */
  #help-btn, #recenter-btn {
    position: fixed;
    bottom: 20px;
    width: 48px; height: 48px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 400;
    transition: transform 0.15s, background-color 0.15s;
  }

  /* Hier steuern wir die jeweilige Seite aus */
  #help-btn { left: 20px; }
  #recenter-btn { right: 20px; }

  /* Gilt für beide Buttons bei Klick & für die Icons darin */
  #help-btn:active, #recenter-btn:active { transform: scale(0.92); }
  #help-btn img, #recenter-btn img { width: 60%; height: 60%; object-fit: contain; display: block; }

  /* === OVERLAY === */
  #location-overlay {
    position: fixed;
    inset: 0;
    z-index: 450;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  #location-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  /* === POPUP / BOTTOM SHEET === */
  #bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 500;
    padding: 20px; 
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(110%);
    transition: transform var(--transition-sheet);
    overscroll-behavior: contain;
    background: transparent;
    pointer-events: none; 
    scrollbar-width: none;
  }
  #bottom-sheet::-webkit-scrollbar { display: none; }
  #bottom-sheet.open { transform: translateY(0); }

  #menu-wrapper {
    cursor: pointer;
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding-left: 20px;
  }

  .sheet-top-spacer { height: 85px; width: 100%; pointer-events: none; }

  .sheet-content {
    pointer-events: all; 
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.22);
    width: 100%;
    max-width: 450px;
    margin: 0 auto 80px auto;
    position: relative;
    overflow: hidden;
  }

  .sheet-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 46px; height: 46px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    color: #fff;
    transition: background 0.15s;

    /* NEU: Milchglas-Hintergrund */
    background-color: color-mix(in srgb, var(--location-color) 40%, transparent) !important;
    border-radius: 50%;            /* Macht den Button kreisrund */
  }

  .sheet-hero, .history-photo {
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
  }
  .sheet-hero { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: pointer; }
  .sheet-body { padding: 20px; }

  .sheet-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
  .sheet-icon-wrapper { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

  .sheet-title {
    font-size: 26px;
    font-weight: 700;
    font-family: var(--font-headline);
  }

  .img-loaded { opacity: 1 !important; }

 /* === NEW TIP ACCORDION SYSTEM === */
  .tip-accordion-container { 
    margin: 15px 0 20px; 
    width: 100%; 
    border-radius: 28px; 
    overflow: hidden; 
  }

  .tip-trigger {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 8px;
    width: 100%; 
    height: 54px;                   
    padding: 0 20px;                
    background-color: var(--location-color) !important;
    color: #fff;
    border: none;
    font-size: 15px;
    font-family: var(--font-button);
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
  }

  .tip-text-center { 
    flex-grow: 1; 
    text-align: left; 
  }

  /* Das neue Icon-Gefäß auf der rechten Seite */
  .tip-icon-right {
    background: transparent;
    width: 38px;        
    height: 38px;       
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.25s ease; /* Falls sich das Icon beim Wechsel leicht bewegen soll */
  }

  .tip-icon-right img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin-bottom: 6px;
  }
  
  /* OPTIONAL: Lässt das Icon beim Öffnen ganz dezent federn/skalieren 
  .tip-trigger.active .tip-icon-right {
    transform: scale(1.08);
  } */

  .tip-content {
    max-height: 0;
    overflow: hidden;
    background: #f7fafc;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.65;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 20px;
  }
  .tip-content.open { padding: 18px 20px; }

  .qr-hint {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
    color: var(--color-text-light);
    margin-top: 4px;
    font-family: var(--font-body);
  }

  /* === DISCOVERED VIEW === */
  .discovered-section { display: none; }
  .discovered-section.visible { display: block; }

  .history-text { font-size: 16px; line-height: 1.7; color: var(--color-text); margin-bottom: 24px; }
  
  .history-photo { width: 100%; border-radius: 10px; margin: 16px 0 6px; cursor: pointer; display: block; }

  .history-caption {
    font-size: 10px;
    color: #999;
    margin-bottom: 16px;
    line-height: 1.4;
    font-family: var(--font-caption);
  }

  /* === INFO SHEETS ADDITIONS === */
#history-text .history-photo {
  width: 100%;
  height: auto;
  display: block !important;
  opacity: 1 !important; 
  object-fit: cover;
  cursor: pointer;
}

#history-text .history-caption {
  display: block;
  margin-top: 6px;
  margin-bottom: 20px;
}

#history-text .sheet-link {
  color: var(--location-color);
  font-family: var(--font-body);
  font-size: 18px;
  text-decoration: underline;
}

  /* === MINI-GALLERY VOLLBREITE === */
  .mini-gallery { display: flex; flex-direction: column; margin: 20px -20px -20px -20px; gap: 0; }
  .mini-gallery img { width: 100%; aspect-ratio: 1 / 1; height: auto; display: block; object-fit: cover; border-radius: 0; }
  .mini-gallery img:first-of-type { border-top-left-radius: 16px; border-top-right-radius: 16px; }
  .mini-gallery img:last-of-type { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }

  .divider { margin: 40px 0; }

  .btn-secondary, .btn-donate {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 100%;
    height: 47px;          
    padding: 0 24px;
    border-radius: var(--radius-btn);    
    font-family: var(--font-button);
    cursor: pointer;
  }

  .btn-secondary {
    gap: 8px; 
    background: transparent; 
    color: #999; 
    border: 1.5px solid #ddd; 
    font-size: 14px; 
    margin-bottom: 10px; 
    transition: border-color 0.15s, color 0.15s;
  }

  .btn-secondary:active { border-color: #999; color: #555; }

  .btn-report-img {
  width: 20px;        
  height: 20px;          

  margin-top: -10px;
  margin-bottom: -10px;
  
  object-fit: contain;
  flex-shrink: 0;
}

  .btn-donate {
    gap: 8px; padding: 16px 20px; background: var(--location-color, #68d391); color: #fff; border: none; font-size: 15px; font-weight: 700; text-decoration: none; transition: filter 0.15s;
  }
  .btn-donate:active { filter: brightness(0.9); }

  .sheet-footer {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: #ccc;
    margin-top: 30px;
    padding-bottom: 5px;
    font-family: var(--font-caption);
  }

  /* === MENU OVERLAY === */
  #menu-overlay {
    position: fixed; inset: 0; z-index: 479; background: rgba(30,30,30,0.96); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; display: flex; flex-direction: column; padding: 20px; overflow-y: auto;
  }
  #menu-overlay.open { opacity: 1; pointer-events: all; }

  .menu-section-title {
    font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 12px; margin-top: 80px;
    font-family: var(--font-caption);
  }

  .menu-lang { display: flex; gap: 20px; margin-bottom: 32px; }
  .menu-lang a { color: rgba(255,255,255,0.7); text-decoration: underline; font-size: 18px; cursor: pointer; font-family: var(--font-body); }
  .menu-lang a.active { color: #fff; font-weight: 600; }

  .menu-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 32px; }
  .menu-links a { color: rgba(255,255,255,0.85); text-decoration: underline; font-size: 18px; line-height: 2; cursor: pointer; transition: color 0.15s; font-family: var(--font-body); }
  .menu-links a:active { color: #fff; }

  .menu-projects { display: flex; flex-direction: column; gap: 4px; margin-bottom: 32px; }
  .project-logo { font-size: 13px; color: rgba(255,255,255,0.5); font-family: var(--font-button); }
  .project-name { font-size: 28px; font-style: italic; font-weight: 800; color: rgba(255,255,255,0.85); font-family: var(--font-headline); line-height: 1; margin-bottom: 10px; }

  .menu-spacer { flex: 1; min-height: 20px; }

  #btn-donate-menu {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 15px 24px; background: #fff; color: #1a1a1a; border: none; border-radius: var(--radius-btn); font-size: 15px; font-weight: 700; cursor: pointer;
    font-family: var(--font-button);
  }


  /* === BURGER MENU & LANG LABEL WRAPPER === */
#menu-wrapper {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1005; /* Stellt sicher, dass es über den Overlays liegt */
}

#menu-lang-label {
  font-family: var(--font-button);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  color: #1a1a1a; /* Standardfarbe (Schwarz) */
  transition: color 0.3s ease;
  user-select: none;
}

/* Deaktiviert die Maus-Events auf den Kindern, damit der Klick immer beim Wrapper ankommt */
#menu-lang-label,
#menu-btn {
  pointer-events: none;
}

/* Wenn das Menü offen ist oder ein Sheet aktiv ist, wird die Schrift weiß */
#menu-btn.open ~ #menu-lang-label,
#menu-btn.sheet-active ~ #menu-lang-label,
#menu-wrapper.active #menu-lang-label {
  color: #ffffff;
}

  /* === LIGHTBOX === */
  #lightbox { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,0.95); display: none; align-items: center; justify-content: center; padding: 20px; }
  #lightbox.open { display: flex; }
  #lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 8px; touch-action: none; transition: transform 0.1s ease-out; will-change: transform; }
  #lightbox-close {
    position: absolute; top: 20px; right: 20px; width: 46px; height: 46px; background: transparent; border: none; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; color: #fff; transition: background 0.15s;
  }

  /* === LEAFLET CUSTOM MARKERS === */
  .custom-marker { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.15s; }
  .custom-marker:active { transform: scale(0.9); }

  .marker-badge-check {
  position: absolute;
  top: -4px;        /* Schiebt das Badge leicht nach oben über den Rand */
  right: -4px;      /* Schiebt das Badge leicht nach rechts über den Rand */
  background: #48bb78; /* Ein schönes, knackiges Grün (z.B. Tailwind green-500) */
  color: white;
  border: 0px solid white; /* Weißer Rand, damit es sich vom Marker abhebt */
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 10;      /* Sorgt dafür, dass das Häkchen immer oben liegt */
}x

  .leaflet-container { font-family: var(--font-body); }

  /* Blendet das Bild komplett aus, wenn keine Quelle (src) geladen ist */
  .sheet-hero[src=""], .sheet-hero:not([src]),
  .history-photo[src=""], .history-photo:not([src]) {
    display: none !important;
  }

  #history-caption a {
  color: var(--location-color);
  text-decoration: underline;
  font-weight: bold;
}

#history-caption a:hover {
  opacity: 0.8;
}