/* Hallowo – „Laterne“: fast schwarz, eine einzige Farbe (Kerzenlicht), Serif + Mono. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/fraunces-latin-opsz-normal.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/fraunces-latin-opsz-italic.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Plex Mono';
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
}

:root {
  --ghost: #8fe3c0;
  --string: #f2e2bf;
  --bg: #0c0b09;
  --ink: #ece4d4;
  --dim: #8d8576;
  --faint: #2e2a23;
  --light: #ffb24a;
  --light-hot: #ffd79a;
  --off: #5a5348;
  --danger: #e8806b;
  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --mono: 'Plex Mono', ui-monospace, Menlo, monospace;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--serif);
  font-optical-sizing: auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--light); outline-offset: 3px; }

.mono, .kicker, .meta, .nav, .bar-date, .under, .note-mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.kicker { text-transform: uppercase; letter-spacing: 0.16em; color: var(--dim); font-size: 11px; }

/* ------------------------------------------------------------ Kopfzeile */
.bar {
  position: relative; z-index: 3;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 22px 10px;
}
.logo { font-size: 23px; font-weight: 600; text-decoration: none; letter-spacing: 0.01em; color: var(--light); }
.logo i { font-weight: 400; color: var(--ink); }
.bar-date { color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }

/* ------------------------------------------------------------ Start: Karte als Hintergrund */
.home .bar { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(var(--bg), rgba(12, 11, 9, 0)); }
.home.scrolled:not(.map-mode) .bar { background: var(--bg); border-bottom: 1px solid var(--faint); padding-bottom: 12px; }
.home #map { position: fixed; inset: 0 0 calc(var(--nav-h) + var(--safe-b)) 0; z-index: 0; background: var(--bg); }
.home .map-hit { position: fixed; left: 0; right: 0; top: 0; height: 50vh; z-index: 1; }
.home:not(.map-mode) #map { pointer-events: none; }
.home.map-mode .map-hit, .home.map-mode .sheet { display: none; }

.sheet {
  position: relative; z-index: 2;
  margin-top: 50vh;
  padding: 44px 22px 24px;
  background: linear-gradient(to bottom, rgba(12, 11, 9, 0) 0, var(--bg) 44px);
}
/* In der Liste ist die Karte nur oben im Bild, darunter gibt es nichts, was durchscheinen könnte. */
.home:not(.map-mode) #map { bottom: auto; height: 56vh; }
.home:not(.map-mode) #map::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(rgba(12, 11, 9, 0), var(--bg)); pointer-events: none; z-index: 1; }
.live { color: var(--light-hot); font-style: italic; margin-bottom: 18px; }
.note { color: var(--dim); font-size: 16px; margin: 10px 0 4px; max-width: 34ch; }
.link-btn {
  display: inline-block; margin: 14px 0 4px; padding: 12px 0;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light);
}

.rows { list-style: none; margin-top: 8px; }
.row {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--faint); text-decoration: none;
}
/* Liste: Link (Zahl + Text) und daneben der Abhak-Kreis */
.rows .row { grid-template-columns: 1fr auto; align-items: center; padding: 0; }
.row-link { display: grid; grid-template-columns: 56px 1fr; align-items: baseline; padding: 14px 0; text-decoration: none; }
.tick {
  width: 44px; height: 44px; margin-left: 8px; border-radius: 50%; position: relative; flex: none;
}
.tick::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; border: 1.5px solid var(--off); }
.tick[aria-pressed='true']::before { background: var(--light); border-color: var(--light); }
.tick[aria-pressed='true']::after {
  content: ''; position: absolute; left: 19px; top: 15px; width: 5px; height: 10px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.row.visited .n { color: var(--dim); }
.row.waiting .n { opacity: 0.6; }
.progress { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--light-hot); margin: 12px 0 0; }
.tour-btn {
  display: block; width: 100%; text-align: left; margin: 14px 0 0; padding: 14px 0;
  border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light);
}
.tour-btn small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.04em; text-transform: none; color: var(--dim); }
.tour-note { display: block; margin: 14px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--light-hot); text-align: left; padding: 6px 0; }
.tour-panel {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 4;
  padding: 16px 22px 8px; background: rgba(12, 11, 9, 0.94); border-top: 1px solid var(--faint);
}
.home:not(.map-mode) .tour-panel { display: none; }
.tour-next-text { display: block; font-size: 18px; margin-top: 6px; }
.tour-actions { display: flex; gap: 22px; }
.text-btn.muted-left { color: var(--dim); padding-top: 4px; }
.home.map-mode .map-locate { bottom: calc(var(--nav-h) + var(--safe-b) + 40px); }
.home.map-mode:has(.tour-panel:not([hidden])) .map-locate { bottom: calc(var(--nav-h) + var(--safe-b) + 170px); }
.row .n { font-size: 36px; line-height: 1; color: var(--light); font-weight: 400; font-variant-numeric: lining-nums; }
.row .t { font-size: 18px; }
.row .meta { display: block; color: var(--dim); font-size: 12px; letter-spacing: 0.04em; margin-top: 3px; }
.row .go { color: var(--dim); font-size: 24px; line-height: 1; padding-left: 8px; }
.row.out .n, .row.out .t { color: var(--off); }
.row.out .t-main { text-decoration: line-through; text-decoration-thickness: 1px; }

.empty { padding: 26px 0 10px; }
.empty h2 { font-weight: 400; font-size: 26px; line-height: 1.15; margin-bottom: 8px; }
.empty h2 em { color: var(--light); }
.empty p { color: var(--dim); margin-bottom: 6px; }
.note-small { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }

/* Karte: Steuerelemente */
.map-locate {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 40px); z-index: 3;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--faint); background: rgba(12, 11, 9, 0.85);
  display: grid; place-items: center;
}
.map-locate::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 5px rgba(236, 228, 212, 0.18); }
.home:not(.map-mode) .map-locate { display: none; }
.me-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.me-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink); text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg); }
.me { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 6px rgba(236, 228, 212, 0.16), 0 0 0 1px var(--bg); }
.map-fallback { position: fixed; top: 30dvh; left: 22px; right: 22px; color: var(--dim); font-style: italic; }

.maplibregl-popup-content {
  background: var(--bg) !important; color: var(--ink); border: 1px solid var(--faint);
  border-radius: 4px !important; padding: 14px 16px 12px !important; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  font-family: var(--serif);
}
.maplibregl-popup-tip { display: none; }
.pop-n { font-size: 30px; line-height: 1; color: var(--light); }
.pop-t { font-size: 17px; margin-top: 2px; }
.pop .meta { color: var(--dim); display: block; margin-top: 4px; }
.pop-actions { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; gap: 18px; }
.pop-route { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light); text-decoration: none; }
.pop-report { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--dim); }
.maplibregl-ctrl-attrib { background: rgba(12, 11, 9, 0.7) !important; color: var(--dim); font-family: var(--mono); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--dim) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(0.6); }

/* ------------------------------------------------------------ Navigation (unten, Daumen) */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 22px var(--safe-b);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-top: 1px solid var(--faint);
  text-transform: uppercase; letter-spacing: 0.14em;
}
.nav a { color: var(--dim); text-decoration: none; padding: 16px 0; }
.nav a.on { color: var(--ink); }
.nav a.cta { color: var(--light); }

/* ------------------------------------------------------------ Mitmachen / Textseiten */
.page { padding: 0 26px 30px; max-width: 560px; margin: 0 auto; }
.page h1 { font-weight: 400; font-size: 42px; line-height: 1.04; letter-spacing: -0.01em; margin: 44px 0 16px; }
.page h1 em { color: var(--light); }
.lead { color: var(--dim); font-size: 17px; margin-bottom: 26px; max-width: 36ch; }

.check { display: grid; grid-template-columns: 26px 1fr; gap: 14px; font-size: 15px; line-height: 1.45; margin-bottom: 30px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 1.5px solid var(--light); border-radius: 3px; margin-top: 1px; position: relative; cursor: pointer; }
.check input:checked::after {
  content: ''; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px;
  border: solid var(--light); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Die Laterne: der eine große Knopf */
.lamp {
  display: grid; place-items: center; text-align: center;
  width: 220px; height: 220px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle, #ffd28a 0%, #ffad3d 38%, rgba(255, 150, 40, 0.2) 62%, rgba(255, 150, 40, 0) 72%);
  color: #2a1600; font-family: var(--serif); font-size: 22px; line-height: 1.15;
  transition: transform 0.12s ease, filter 0.3s;
}
.lamp:active { transform: scale(0.97); }
.lamp small { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.lamp:disabled { cursor: progress; animation: flicker 1.6s ease-in-out infinite; }
.lamp.off {
  background: radial-gradient(circle, rgba(255, 178, 74, 0) 52%, rgba(255, 178, 74, 0.04) 60%, rgba(255, 178, 74, 0) 72%);
  box-shadow: inset 0 0 0 1.5px var(--off); width: 170px; height: 170px; margin-top: 25px; margin-bottom: 41px;
  color: var(--dim);
}
@keyframes flicker { 0%, 100% { filter: brightness(1); } 30% { filter: brightness(0.82); } 55% { filter: brightness(1.05); } 75% { filter: brightness(0.9); } }
.under { text-align: center; color: var(--dim); margin-bottom: 26px; }

.error { color: var(--danger); font-style: italic; margin: 6px 0 18px; text-align: center; }

.more { border-top: 1px solid var(--faint); padding: 14px 0; }
.more summary { cursor: pointer; list-style: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 6px 0; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ' +'; }
.more[open] summary::after { content: ' –'; }
.more > *:not(summary) { margin-top: 12px; }
.more p { color: var(--dim); font-size: 15px; }

.choice { border: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.choice legend { font-size: 15px; color: var(--dim); margin-bottom: 8px; }
.choice label { cursor: pointer; padding: 6px 0; font-size: 18px; color: var(--dim); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--light); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.choice label:has(input:focus-visible) { outline: 1.5px solid var(--light); outline-offset: 3px; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 15px; color: var(--dim); }
.field input, .copy {
  font: 15px var(--mono); color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--faint); padding: 10px 2px; min-height: 44px;
}
.copy { width: 100%; font-size: 12px; }
.text-btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--light);
  padding: 12px 0; display: inline-block; text-decoration: none;
}
.text-btn.danger { color: var(--danger); }
.text-btn.muted { color: var(--dim); margin-left: 18px; }

.next { margin: 6px 0 26px; padding: 18px 0; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); }
.next h2 { font-weight: 400; font-size: 22px; margin: 6px 0; }
.next p { color: var(--dim); font-size: 15px; }
.turnstile { display: flex; justify-content: center; scroll-margin-bottom: calc(var(--nav-h) + 40px); }
.lights-count { color: var(--light-hot); font-style: italic; margin: -12px 0 24px; }
.join .choice { margin: 0 0 22px; }
.join #starts-at-field { margin: -10px 0 22px; }

/* Textseiten */
.prose h1 { font-size: 36px; margin-bottom: 18px; }
.prose h2 { font-weight: 500; font-size: 20px; margin: 28px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 8px 0; color: #cfc6b5; font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: 4px 0; }
.prose a { color: var(--light); }
.prose strong { color: var(--ink); font-weight: 600; }

.foot { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 20px 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.foot a, .foot-btn { color: var(--dim); text-decoration: none; padding: 6px 0; }
.foot-btn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--light); }
.page .foot { margin-top: 26px; border-top: 1px solid var(--faint); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------ Ende der Aktion */
.big-n { color: var(--light); font-weight: 400; font-size: 1.4em; }

/* ------------------------------------------------------------ Admin */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; margin: 10px 0 30px; }
.stat .n { display: block; font-size: 40px; line-height: 1; color: var(--light); }
.stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.admin .rows .row { grid-template-columns: 56px 1fr; align-items: start; padding: 14px 0; }
.admin .rows .row .n { line-height: 1.1; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 4px; }
.admin h2.kicker { margin-top: 26px; }

/* ------------------------------------------------------------ Fenster (statt alert/confirm) + Toast */
.modal {
  margin: auto; width: min(420px, calc(100vw - 32px)); padding: 22px 22px 10px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--faint); border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.modal::backdrop { background: rgba(5, 4, 3, 0.72); }
.modal h2 { font-weight: 400; font-size: 24px; line-height: 1.15; margin-bottom: 8px; }
.modal-text { color: var(--dim); font-size: 15px; margin-bottom: 12px; }
.modal-choices { border: 0; margin: 6px 0 4px; }
.modal-choices label { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 17px; cursor: pointer; border-bottom: 1px solid var(--faint); }
.modal-choices label:last-child { border-bottom: 0; }
.modal-choices input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--off); flex: none; }
.modal-choices input:checked { border-color: var(--light); background: radial-gradient(circle, var(--light) 0 5px, transparent 6px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 24px; margin-top: 8px; }
.modal-actions .text-btn.muted { margin-left: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 30;
  transform: translate(-50%, 12px); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 11px 16px; border-radius: 4px; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-entries { list-style: none; margin: 10px 0 4px; border-top: 1px solid var(--faint); }
.admin-entry { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--faint); font-family: var(--mono); font-size: 12px; color: var(--dim); }
.admin-entry.close { color: var(--light-hot); }
.admin-entry em { font-style: normal; color: var(--danger); }
.admin .row .t { min-width: 0; }

/* ------------------------------------------------------------ Arten: Süßes (Kerze), Gruselhaus (Irrlicht), Deko (Lichterkette) */
.row.kind-haunted .n { color: var(--ghost); }
.row.kind-decor .n { color: var(--string); }
.row.out .n { color: var(--off); }
.legend {
  position: fixed; left: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 48px); z-index: 3;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: rgba(12, 11, 9, 0.82); border: 1px solid var(--faint); border-radius: 4px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--dim);
}
.lg::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.lg-candy::before { background: var(--light); box-shadow: 0 0 6px var(--light); }
.lg-haunted::before { background: var(--ghost); box-shadow: 0 0 6px var(--ghost); }
.lg-decor::before { background: var(--string); box-shadow: 0 0 6px var(--string); }
.home:not(.map-mode) .legend { display: none; }
.home.map-mode:has(.tour-panel:not([hidden])) .legend { display: none; }
