/* ===== Schriften (lokal, keine Verbindung zu Google) ===== */
@font-face { font-family: "Baloo 2"; font-weight: 700; font-display: swap; src: url(fonts/baloo-2-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-024F; }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url(fonts/nunito-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+20AC; }

:root {
  --night: #2E1A47;
  --night-2: #3E2266;
  --purple: #6B35A8;
  --purple-dark: #4A1F7A;
  --lilac: #F1E6FB;
  --lilac-line: #E6D6F5;
  --muted: #5E4B75;
  --cream: #FFF8F0;
  --orange: #F28C28;
  --orange-shadow: #C96A12;
  --orange-soft: #FFF1E2;
  --gold: #FFC83D;
  --gold-soft: #FFF6D6;
  --gold-line: #F5D77A;
  --moon: #FFE9A8;
  --leaf: #8FD16A;
  --danger: #B3261E;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--night);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.12; margin: 0; }
p { margin: 0; }
a { color: var(--purple); font-weight: 700; }
a:hover { color: var(--purple-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading, .noscript { padding: 80px 24px; text-align: center; color: var(--muted); font-weight: 700; }

/* ===== Nacht-Kopf (Startseiten, Rückblick) ===== */
.night { background: var(--night); color: #fff; }
.night-head {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 24px 24px;
}
.hero-art { width: 100%; max-width: 334px; height: auto; }
.brand-title { font-size: 38px; color: #fff; }
.brand-sub { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--moon); margin-top: -10px; }
.night-head p { color: #F1E6FB; font-weight: 600; max-width: 34ch; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 14px;
  border-radius: 17px; background: var(--moon); color: var(--night); font-size: 14px; font-weight: 800;
}
.sheet {
  background: var(--cream); border-radius: 32px 32px 0 0; padding: 22px 18px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex; flex-direction: column; gap: 14px; color: var(--night);
}

/* ===== Karten / Boxen ===== */
.box { background: #fff; border: 2px solid var(--lilac); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.box h2 { font-size: 21px; }
.box p { color: var(--muted); font-size: 15px; }
.box.orange { background: var(--orange-soft); border-color: #F8C892; }
.box.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.box.dark { background: var(--night-2); border-color: var(--night-2); color: #fff; }
.box.dark p { color: #E3D3F5; }
.kicker { font-size: 13px; font-weight: 800; color: var(--muted); }
.box.orange .kicker { color: #8A4208; }

.countdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.countdown div { background: rgba(255,255,255,.12); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; }
.countdown b { font-family: var(--display); font-size: 28px; line-height: 1; }
.countdown span { font-size: 12px; font-weight: 700; color: #E3D3F5; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 100px minmax(0,1fr) 32px; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.bar .track { height: 12px; border-radius: 6px; background: var(--lilac); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 6px; }
.bar b { text-align: right; }

.rules { display: flex; flex-direction: column; gap: 10px; }
.rule { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 2px solid var(--lilac); border-radius: 18px; padding: 12px 14px; }
.rule .ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.rule b { display: block; font-size: 16px; }
.rule span { font-size: 14px; color: var(--muted); }

/* ===== Knöpfe ===== */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 8px 18px;
  border-radius: 18px; border: none; background: var(--orange); color: var(--night);
  font-family: var(--display); font-weight: 800; font-size: 19px; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--orange-shadow); width: 100%;
}
.btn:hover { color: var(--night); filter: brightness(1.03); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--orange-shadow); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.secondary { background: var(--lilac); color: var(--purple-dark); box-shadow: none; font-family: var(--body); font-size: 15px; min-height: 48px; }
.btn.outline { background: #fff; color: var(--purple); border: 2px solid var(--purple); box-shadow: none; font-family: var(--body); font-size: 15px; min-height: 48px; }
.btn.danger { background: #fff; color: var(--danger); border: 2px solid #E8B4B4; box-shadow: none; font-family: var(--body); font-size: 16px; min-height: 52px; }
.btn.danger.solid { background: var(--danger); color: #fff; border: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--lilac); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; text-decoration: none; }
.foot { text-align: center; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); font-weight: 600; }

/* ===== Seiten mit Kopfzeile ===== */
.page { padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 28px); display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: center; gap: 10px; }
.page-head h1 { font-size: 26px; }
.lead { color: var(--muted); font-size: 15px; }
.prose h2 { font-size: 20px; margin-top: 10px; }
.prose p, .prose li { color: var(--night); font-size: 15px; }
.prose p + p { margin-top: 8px; }

/* ===== Formulare ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 14px; font-weight: 800; }
.opt { font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  min-height: 50px; border-radius: 14px; border: 2px solid var(--lilac-line); background: #fff;
  padding: 10px 14px; font-size: 16px; width: 100%;
}
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--purple); outline: none; }
.help { font-size: 12px; color: var(--muted); }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.choice label {
  min-height: 56px; border-radius: 16px; border: 3px solid var(--lilac-line); background: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 8px;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + label, .choice label:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.choice input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { min-height: 42px; padding: 0 14px; border-radius: 21px; border: 2px solid var(--lilac-line); background: #fff; display: inline-flex; align-items: center; font-size: 14px; font-weight: 800; cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips input:checked + label { border-color: var(--orange); background: var(--orange-soft); }
.chips input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 2px; }
.sub-box { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 2px dashed #DCCBEB; border-radius: 16px; padding: 12px 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--lilac); border-radius: 16px; padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--purple-dark); line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--purple); flex: 0 0 auto; }
.check.plain { background: #fff; border: 2px solid var(--lilac); color: var(--night); }
.error { background: #FFF0EF; color: #8C1D18; border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 14px; }
.ok-box { background: #E2F4E6; color: #1E5A2E; border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 14px; }

/* ===== Karte ===== */
.map-screen { display: flex; flex-direction: column; height: 100dvh; min-height: 560px; }
.map-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--night); }
.logo .tile { width: 44px; height: 44px; border-radius: 14px; background: var(--night); display: flex; align-items: center; justify-content: center; }
.logo b { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; display: block; }
.logo small { display: block; font-size: 12px; font-weight: 800; color: #A8520A; line-height: 1.25; }
.logo i { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.safety-strip { margin: 0 16px 10px; padding: 9px 14px; border-radius: 14px; background: var(--lilac); color: var(--purple-dark); font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.map-wrap { position: relative; flex: 1 1 auto; margin: 0 12px; border-radius: 22px; overflow: hidden; border: 2px solid var(--lilac-line); min-height: 280px; }
#map { position: absolute; inset: 0; background: #F3EAFB; }
.map-badge { position: absolute; z-index: 500; left: 10px; top: 10px; min-height: 32px; padding: 4px 12px; border-radius: 16px; background: #fff; box-shadow: 0 3px 8px rgba(46,26,71,.15); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.live-dot { width: 10px; height: 10px; border-radius: 5px; background: #2FA84F; box-shadow: 0 0 0 4px rgba(47,168,79,.2); }
.map-banner { position: absolute; z-index: 600; left: 8px; right: 8px; top: 8px; min-height: 60px; padding: 6px 4px 6px 10px; border-radius: 18px; background: #fff; box-shadow: 0 4px 12px rgba(46,26,71,.18); display: flex; align-items: center; gap: 8px; }
.map-banner .txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.map-banner b { font-size: 13px; }
.map-banner span { font-size: 12px; color: var(--muted); font-weight: 600; }
.map-banner a { min-height: 44px; padding: 0 14px; border-radius: 14px; background: var(--lilac); color: var(--purple-dark); font-size: 13px; text-decoration: none; display: flex; align-items: center; }
.locate { position: absolute; z-index: 500; right: 10px; bottom: 10px; width: 48px; height: 48px; border-radius: 24px; border: none; background: #fff; box-shadow: 0 3px 8px rgba(46,26,71,.18); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.map-bottom { padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 14px); display: flex; flex-direction: column; gap: 8px; }
.progress { font-size: 15px; font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 7px; display: inline-block; }
.map-empty { position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 16px; padding: 14px 16px; text-align: center; font-weight: 700; color: var(--muted); width: 80%; box-shadow: 0 4px 12px rgba(46,26,71,.15); }

/* Pins */
.pin { width: 44px; height: 44px; border-radius: 22px; background: #fff; border: 3px solid var(--orange); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(46,26,71,.2); position: relative; }
.pin.visited { background: var(--purple); border-color: #fff; }
.pin.empty { background: #ECE6F1; border-color: #B9AECA; opacity: .8; }
.pin.golden { width: 52px; height: 52px; border-radius: 26px; background: var(--night-2); border-color: var(--gold); box-shadow: 0 0 0 6px rgba(255,200,61,.35), 0 3px 8px rgba(46,26,71,.25); }
.pin .count { position: absolute; top: -9px; right: -10px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--purple); border: 2px solid #fff; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.pin .star { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 11px; background: var(--gold); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; }
.leaflet-div-icon { background: none; border: none; }
.me-ghost { filter: drop-shadow(0 3px 4px rgba(46,26,71,.3)); }
.me-label { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); background: var(--night); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 10px; }

/* Haus-Details (Bottom-Sheet) */
.detail-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(46,26,71,.35); display: flex; align-items: flex-end; justify-content: center; }
.detail { width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto; background: var(--cream); border-radius: 28px 28px 0 0; padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 22px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -6px 20px rgba(46,26,71,.15); }
.grab { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: #DCCBEB; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 12px; border-radius: 16px; font-size: 14px; font-weight: 800; }
.chip.orange { background: #FFE4CC; color: #8A4208; }
.chip.lilac { background: var(--lilac); color: var(--purple-dark); }
.chip.gold { background: var(--gold-soft); color: #7A5200; border: 2px solid var(--gold-line); }
.chip.grey { background: #ECE6F1; color: var(--muted); }
.unit { background: #fff; border: 2px solid var(--lilac); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.unit-title { font-weight: 800; font-size: 16px; }
.hint-box { background: var(--lilac); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.gold-btn { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; border: 3px solid var(--gold-line); background: var(--gold-soft); text-align: left; cursor: pointer; width: 100%; }
.gold-btn.done { border-color: #E8A300; background: #FFE9A0; cursor: default; }
.gold-btn b { display: block; font-family: var(--display); font-size: 19px; line-height: 1.15; }
.gold-btn span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.visit-btn { min-height: 52px; border-radius: 16px; border: 3px solid var(--purple); background: #fff; color: var(--purple); font-family: var(--display); font-weight: 800; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.visit-btn.on { background: var(--purple); color: #fff; }
.linkish { background: none; border: none; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 10px; align-self: center; }

/* Schild zum Drucken */
.sign { display: none; }
@media print {
  body { background: #fff; }
  #app > *:not(.sign) { display: none !important; }
  .sign { display: flex !important; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; min-height: 95vh; color: #2E1A47; }
  .sign h1 { font-size: 64px; }
  .sign p { font-size: 26px; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
[hidden] { display: none !important; }
.gold-btn svg { flex: 0 0 auto; }
.box svg, .rule svg, .unit svg, .chip svg { flex: 0 0 auto; }
/* Bei weit herausgezoomter Karte kleinere Pins, damit sie sich weniger überlappen */
.map-far .pin { transform: scale(.72); }
.map-far .pin.golden { transform: scale(.8); }
/* Karte im Kürbis-Kompass-Look statt „offizieller Stadtplan“ */
.leaflet-container { background: #F3EAFB; font-family: var(--body); }
.leaflet-tile-pane { filter: url(#kk-map-tint) saturate(.65) brightness(1.02); }
.leaflet-control-attribution { background: rgba(255,248,240,.85) !important; border-radius: 8px 0 0 0; font-size: 10px; }
