/* Grundlegendes Design – wird von allen Seiten genutzt */
:root, [data-theme="sand"], [data-theme="rose"] {
  --bg: #f5f1e8;
  --bg-soft: #ebe4d6;
  --card: #fffdf8;
  --ink: #1f1c18;
  --ink-soft: #6f675c;
  --line: #e2d9c8;
  --accent: #d9542a;
  --accent-soft: #f7dccf;
  --accent-ink: #ffffff;
  --note: #f6d76b;       /* Zettel-Farbe für Running Gags */
  --note-ink: #2a2414;
  --hero-overlay: linear-gradient(180deg, rgba(20, 16, 10, 0) 35%, rgba(20, 16, 10, 0.6) 100%);
  --hero-fallback: linear-gradient(135deg, #f2c48d 0%, #e88a5b 50%, #d9542a 100%);
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 8px 24px -12px rgba(40, 30, 10, .22);
  --radius: 16px;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
[data-theme="nacht"] {
  --bg: #15171f;
  --bg-soft: #1f2230;
  --card: #232737;
  --ink: #f0ebe1;
  --ink-soft: #a29d92;
  --line: #343a50;
  --accent: #e9b949;
  --accent-soft: #3b3524;
  --accent-ink: #17150f;
  --note: #e9b949;
  --note-ink: #17150f;
  --hero-overlay: linear-gradient(180deg, rgba(10, 12, 20, 0.05) 30%, rgba(10, 12, 20, 0.75) 100%);
  --hero-fallback: linear-gradient(135deg, #3c4170 0%, #222538 60%, #15171f 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-theme="salbei"] {
  --bg: #f1f2ea;
  --bg-soft: #e3e7da;
  --card: #fcfdf8;
  --ink: #1e2a20;
  --ink-soft: #66735f;
  --line: #d6dccb;
  --accent: #3f7a52;
  --accent-soft: #d9e8d9;
  --accent-ink: #ffffff;
  --note: #f3df8f;
  --note-ink: #2b2a14;
  --hero-overlay: linear-gradient(180deg, rgba(15, 25, 15, 0) 35%, rgba(15, 25, 15, 0.6) 100%);
  --hero-fallback: linear-gradient(135deg, #d7e3c3 0%, #8fb08c 50%, #3f7a52 100%);
  --shadow: 0 1px 2px rgba(20,40,20,.06), 0 8px 24px -12px rgba(20, 40, 20, .22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }

/* Logo: ein kleiner Anstecker */
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.mark svg { width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 20px; font: 500 15px/1 var(--sans);
  background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--accent-soft); color: var(--ink); }
.btn.danger { background: transparent; color: #b3261e; border-color: #e7c2bf; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-soft); letter-spacing: .02em; }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  padding: 12px 14px; font: 16px/1.5 var(--sans);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 160px; resize: vertical; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-soft); }
.error-text { color: #b3261e; font-size: 14px; min-height: 1.2em; }
.hidden { display: none !important; }

/* Karten (Leaflet) */
.leaflet-container { font-family: var(--sans); background: var(--bg-soft); }
.leaflet-container img { max-width: none !important; }
.leaflet-tile-pane { filter: saturate(.7) sepia(.12) brightness(1.02); }
[data-theme="nacht"] .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.85) contrast(.9) saturate(.6); }
[data-theme="salbei"] .leaflet-tile-pane { filter: saturate(.6) hue-rotate(-8deg); }
.map-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3);
  display: grid; place-items: center; transition: transform .2s ease, background .2s ease;
}
.map-pin span { transform: rotate(45deg); color: var(--accent-ink); font: 700 13px/1 var(--sans); }
.map-pin.active { background: var(--ink); transform: rotate(-45deg) scale(1.18); }
.map-pin.active span { color: var(--bg); }
.pin-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font: 700 13px var(--sans);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
