:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #5b6770;
  --line: #ded9cc;
  --brand: #15803d;
  --brand-dark: #166534;
  --warn-bg: #fef3c7;
  --warn-ink: #78350f;
  --fail: #b91c1c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.5;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--brand); color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; }
.topbar nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; }
.topbar form { margin: 0; }
.linklike {
  background: none; border: 0; padding: 0; color: #fff; font: inherit;
  cursor: pointer; text-decoration: underline;
}
.testbanner {
  margin: 0; padding: 6px 16px; background: var(--warn-bg); color: var(--warn-ink);
  font-size: .85rem; text-align: center;
}

.flash {
  background: #dcfce7; border: 1px solid #86efac; color: #14532d;
  padding: 10px 14px; border-radius: 10px; margin: 0 0 16px;
}
.error {
  background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d;
  padding: 10px 14px; border-radius: 10px; margin: 0 0 12px;
}

.button {
  display: inline-block; background: var(--brand); color: #fff; border: 0;
  border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; margin: 4px 6px 4px 0;
}
.button:hover { background: var(--brand-dark); }
.button.secondary {
  background: transparent; color: var(--brand-dark);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #f59e0b; outline-offset: 2px;
}

.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 20px;
}
.hero p { max-width: 40em; color: var(--muted); }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: .5rem; }
.testbox {
  margin-top: 24px; padding: 16px 20px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-ink);
}
.testbox h2 { margin-top: 0; }
.testbox a { color: var(--warn-ink); }

.formbox {
  max-width: 440px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px;
}
label { display: block; font-weight: 600; margin: 14px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], input:not([type]) {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1px solid #9aa5ad; border-radius: 10px; background: #fff;
}
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: 20px; height: 20px; margin-top: 3px; }
.formbox .button { margin-top: 18px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 24px; }
.stats div {
  flex: 1 1 110px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.stats dt { font-size: .85rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.6rem; font-weight: 700; }

.cardgrid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.cardgrid a { display: block; text-decoration: none; border-radius: 14px; }
.status { margin: 6px 0 0; font-size: .9rem; color: var(--muted); text-align: center; }
.status.visited { color: var(--brand-dark); font-weight: 600; }
.empty {
  background: var(--surface); border: 1px dashed #9aa5ad; border-radius: 12px;
  padding: 20px;
}

.cardpage { display: grid; gap: 24px; grid-template-columns: 1fr; }
.cardholder { width: 100%; max-width: 300px; margin: 0 auto; }
@media (min-width: 720px) {
  .cardpage { grid-template-columns: 300px 1fr; align-items: start; }
  .cardholder { margin: 0; }
}
.visitbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 16px 0;
}
.visitbox.done { background: #dcfce7; border-color: #86efac; }
.visitbox p { margin: 0 0 10px; }
.visitbox p:last-child { margin-bottom: 0; }
.result { min-height: 1.5em; font-weight: 600; }
.result.ok { color: var(--brand-dark); }
.result.fail { color: var(--fail); }
.map { height: 300px; border-radius: 12px; border: 1px solid var(--line); }
.coords { font-size: .9rem; color: var(--muted); }

.status.mastered { color: #92400e; font-weight: 700; }
.stats dt a { color: inherit; }

.quizbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 16px 0;
}
.quizbox.done { background: #fef3c7; border-color: #fcd34d; }
.quizbox h2 { margin-top: 0; }
.quizbox fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.question { font-weight: 600; padding: 0; margin: 0 0 10px; }
label.answer {
  display: flex; align-items: center; gap: 10px; font-weight: 400;
  margin: 8px 0; padding: 10px 12px; border: 1px solid #9aa5ad;
  border-radius: 10px; background: #fff; cursor: pointer;
}
label.answer input { width: 20px; height: 20px; flex: none; }
label.answer:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.hint { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }

.badgegrid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.badge {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.badge p { margin: 2px 0 6px; font-size: .92rem; color: var(--muted); }
.badge.earned { background: #fef3c7; border-color: #fcd34d; }
.medal {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; background: #e5e7eb; color: #6b7280;
}
.badge.earned .medal { background: #f59e0b; color: #fff; }
.badge progress { width: 100%; height: 8px; accent-color: var(--brand); }
.progresslabel { font-size: .85rem; color: var(--muted); }

.history { padding-left: 1.3em; font-size: .95rem; }
.history li { margin-bottom: .3rem; }
.transferbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 16px 0;
}
.transferbox h2 { margin-top: 0; }

/* Redaktion */
.meta { font-size: .88rem; color: var(--muted); font-weight: 400; }
.placelist { list-style: none; margin: 0; padding: 0; }
.placelist > li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
}
.placehead { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.placelist p { margin: 4px 0 0; }
.windowlist { list-style: none; margin: 8px 0 0; padding: 0; }
.windowlist li { display: flex; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.windowlist img { width: 84px; height: 56px; object-fit: cover; border-radius: 6px; background: #e5e7eb; }
.windowlist .meta { display: block; }

.editor section {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px;
}
.editor h2 { margin-top: 0; }
.editor h3 { font-size: 1rem; margin: 1.4rem 0 .2rem; }
.editor select, .editor textarea, .editor input[type="number"], .editor input[type="url"] {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1px solid #9aa5ad; border-radius: 10px; background: #fff;
}
.editor input[type="file"] { display: block; margin-top: 4px; font: inherit; }
.editor input[type="range"] { width: 100%; }
.editor .row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .editor .row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
fieldset.choices { border: 0; margin: 14px 0 0; padding: 0; }
fieldset.choices legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
label.choice { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
label.choice input { width: 18px; height: 18px; flex: none; }
fieldset.choices.inline { display: flex; flex-wrap: wrap; gap: 4px 18px; }
fieldset.choices.inline legend { width: 100%; }
.preview { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 6px 0; }
.map.tall { height: 420px; }
.dangerzone { margin-top: 8px; }
.button.danger { background: var(--fail); }
.button.danger:hover { background: #7f1d1d; }

/* Zeitfenster */
.lead { font-size: 1.05rem; color: var(--muted); margin-top: 0; }
.previewnote {
  background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px;
  border-radius: 10px; font-size: .9rem;
}
.viewer { background: #111827; border-radius: 12px; overflow: hidden; }
.viewer .stage { position: relative; line-height: 0; }
.viewer .layer { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
/* Mit Vergleichsbild liegt das alte Foto deckungsgleich über dem heutigen. */
.viewer .layer.old { position: absolute; inset: 0; height: 100%; }
.viewerbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  color: #e5e7eb; font-size: .9rem;
}
.viewerbar label { margin: 0; font-weight: 400; }
.viewerbar input[type="range"] { flex: 1 1 auto; min-width: 80px; accent-color: #f59e0b; }
.viewerbar .button { margin: 0 0 0 auto; }
.button.small { padding: 6px 14px; font-size: .9rem; }
.viewer .button.secondary { color: #fff; box-shadow: inset 0 0 0 2px #9ca3af; }
.viewer:fullscreen { display: flex; flex-direction: column; justify-content: center; }
.viewer:fullscreen .layer { max-height: calc(100vh - 56px); }
.rotatehint {
  background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px;
  border-radius: 10px; font-size: .9rem; margin: 10px 0 0;
}
.credit { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.bodytext p { margin: 0 0 .8rem; max-width: 42em; }
.clip { display: block; width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
audio { width: 100%; }

.windowbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 16px 0;
}
.windowbox h2 { margin-top: 0; }
.windowpicks { list-style: none; margin: 0; padding: 0; }
.windowpicks a {
  display: flex; gap: 12px; align-items: center; padding: 8px 0;
  border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.windowpicks img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: #e5e7eb; flex: none; }
.windowpicks .meta { display: block; }
.newtag {
  display: inline-block; background: #f59e0b; color: #fff; font-size: .75rem;
  font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-top: 2px;
}
