:root {
  --cream: #f6f1e4;
  --paper: #ffffff;
  --ink: #2f2f2f;
  --muted: #6b6457;
  --navy: #3b5670;
  --navy-dark: #2b4156;
  --rust: #9a6a3c;
  --rule: #ddd5c3;
  --link: #2a6eb5;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream) url("img/background.jpg") center top / 1600px auto repeat;
}

.page {
  max-width: 820px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 28px 40px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 0 40px rgba(0,0,0,.18);
}

.banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

h1, h2 {
  color: var(--navy);
  line-height: 1.2;
}
h1 { font-size: 1.6rem; margin: 1.4rem 0 .6rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; }

p { margin: 0 0 1rem; }

a { color: var(--link); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.6rem 0;
}

.lead { font-size: 1.05rem; }

/* Auswahl */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 1.4rem 0 1rem;
}
@media (max-width: 620px) {
  .choices { grid-template-columns: 1fr; }
  .page { padding: 16px 16px 32px; }
}

.choice {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 20px 20px 18px;
  border: 2px solid var(--rule);
  border-radius: 8px;
  background: #fbf8f0;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.choice:hover, .choice:focus-visible {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59,86,112,.18);
  outline: none;
}
.choice .icon {
  width: 44px; height: 44px;
  color: var(--rust);
}
.choice .title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.choice .sub {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rust);
}
.choice .desc { color: var(--muted); font-size: .95rem; }
.choice .go {
  margin-top: auto;
  padding-top: .4rem;
  font-weight: 700;
  color: var(--navy);
}

/* Schritte */
.step {
  margin: 1.6rem 0;
}
.step h2 { margin-top: 0; }
.step-no {
  display: inline-block;
  min-width: 1.8em;
  color: var(--rust);
}

audio, video {
  display: block;
  width: 100%;
  margin: .4rem 0 .6rem;
}
video { background: #000; border-radius: 4px; }

details {
  margin: .6rem 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fbf8f0;
}
details summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--navy);
}
details .body { padding: 0 16px 8px; }
.dialog p { margin: 0 0 .7rem; }
.dialog .who { font-weight: 700; }
.dialog .dir { color: var(--muted); font-style: italic; }

.downloads { font-size: .9rem; color: var(--muted); }

.note {
  background: #fbf3e2;
  border: 1px solid #ecd9b0;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 1.2rem 0;
}

.back {
  display: inline-block;
  margin-top: 1.2rem;
  font-weight: 600;
}

footer {
  margin-top: 2.4rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

/* Startseite */
.cta { margin: 1.6rem 0 .5rem; text-align: center; }
.button {
  display: inline-block;
  padding: 14px 34px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--navy-dark);
  transition: background .15s, transform .1s;
}
.button:hover, .button:focus-visible { background: var(--navy-dark); }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy-dark); }

/* Kopfzeile ohne Banner */
.site-title {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}
.site-title + h1 { margin-top: .6rem; }

.choice { position: relative; }
.badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--rust);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Mobil: Banner randlos */
@media (max-width: 620px) {
  .banner {
    width: calc(100% + 32px);
    max-width: none;
    margin: -16px -16px 0;
    border-radius: 0;
  }
}

/* Breadcrumb-Navigation */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: -28px -28px 1.4rem;
  padding: 12px 28px;
  border-bottom: 1px solid var(--rule);
  background: #fbf8f0;
  font-size: .95rem;
  font-weight: 600;
}
.crumbs a { color: var(--navy); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs a:first-child { color: var(--rust); }
.crumbs .sep { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }
.crumbs + h1 { margin-top: 0; }
@media (max-width: 620px) {
  .crumbs { margin: -16px -16px 1.2rem; padding: 12px 16px; }
}

/* Indoor-Einstieg */
.intro-text em { color: var(--muted); }
.checker {
  margin: 1.6rem 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.checker p { margin: 0 0 .5rem; font-weight: 600; color: var(--navy); }
.checker img { display: block; max-width: 100%; height: auto; }
.button { line-height: 1.35; }

/* Animierte Icons */
.icon .leg, .icon .arm {
  transform-box: view-box;
  animation: swing 1s ease-in-out infinite alternate;
}
.icon .leg { transform-origin: 24px 27px; }
.icon .arm { transform-origin: 24px 15px; }
/* Ruhepose (auch bei reduzierter Bewegung) */
.icon .leg.a, .icon .arm.b { transform: rotate(-22deg); }
.icon .leg.b, .icon .arm.a { transform: rotate(22deg); }
.icon .leg.b, .icon .arm.a { animation-direction: alternate-reverse; }
.icon .walker { animation: bob .5s ease-in-out infinite alternate; transform: translateY(1.3px); }
.icon .ground { animation: ground 1s linear infinite; }
@keyframes swing { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
/* Körper senkt sich bei gespreizten Beinen, damit die Füße am Boden bleiben */
@keyframes bob { from { transform: translateY(1.3px); } to { transform: translateY(0); } }
@keyframes ground { from { transform: translateX(0); } to { transform: translateX(-10px); } }

.icon .cursor { animation: cursor 5s ease-in-out infinite; }
@keyframes cursor {
  0%   { transform: translate(12px, 13px); }
  25%  { transform: translate(30px, 16px); }
  45%  { transform: translate(24px, 19px); }
  55%  { transform: translate(24px, 19px) scale(.85); }
  60%  { transform: translate(24px, 19px); }
  80%  { transform: translate(10px, 18px); }
  100% { transform: translate(12px, 13px); }
}

@media (prefers-reduced-motion: reduce) {
  .icon * { animation: none !important; }
}

.nowrap { white-space: nowrap; }
footer a { color: inherit; }

/* Footer immer unten und abgesetzt */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
footer {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.page > *:nth-last-child(2) { margin-bottom: 2.4rem; }
.back { align-self: flex-start; }

.intro-start { margin-top: 1.4rem; }

/* Straßenansicht */
.streetview { margin: 1.2rem 0 1.6rem; }
.streetview .sv-desktop, .streetview .sv-mobile { display: none; }
.streetview.is-desktop .sv-desktop { display: block; }
.streetview.is-mobile .sv-mobile { display: block; text-align: center; }
.sv-desktop iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  border-radius: 6px;
  background: #e8e2d2;
}
.sv-newtab { margin: .5rem 0 0; text-align: right; font-size: .9rem; }

/* Koordinaten-Checker */
.checker label { display: block; margin: 0 0 .6rem; font-weight: 600; color: var(--navy); }
.checker input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: 6px;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  background: #fff;
}
.checker input:focus { outline: none; border-color: var(--navy); }
.cf-turnstile-box { margin: .6rem 0 0; }
.checker .button[type=submit] { margin-top: .8rem; }
.checker .button { border: 0; cursor: pointer; font-family: inherit; }
.checker .button:disabled { background: #8d9aa6; box-shadow: none; cursor: default; }
.result { margin: .9rem 0 0; font-weight: 600; }
.result:empty { display: none; }
.result.good { color: #2e7d32; }
.result.bad { color: #b23b2e; }
.result.hint { color: var(--rust); }
.result .button { margin-top: .7rem; }

/* Ergebnis-Modal */
.modal {
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  padding: 28px 24px 22px;
  border: 0;
  border-radius: 12px;
  text-align: center;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal::backdrop { background: rgba(30, 36, 42, .55); }
.modal h2 { margin: .4rem 0 .5rem; font-size: 1.4rem; }
.modal p { margin: 0 0 1.3rem; }
.modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 700; color: #fff;
  background: var(--navy);
}
.modal.good .modal-icon { background: #2e7d32; }
.modal.good h2 { color: #2e7d32; }
.modal.bad .modal-icon { background: #b23b2e; }
.modal.bad h2 { color: #b23b2e; }
.modal.hint .modal-icon { background: var(--rust); }
.modal.hint h2 { color: var(--rust); }
.modal.wait .modal-icon { background: #8d9aa6; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .button { border: 0; cursor: pointer; font-family: inherit; }
.button.secondary { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 2px var(--rule); }
.page > dialog.modal { margin: auto; }
.video-note { margin: .2rem 0 .6rem; font-size: .95rem; color: var(--muted); }
.step + .checker { margin-top: 2rem; }

/* Blöcke ohne farbigen Rand (Final-Seite) */
.block { margin: 0 0 1.4rem; }
.block p:last-child { margin-bottom: 0; }
.block h2 { margin: 0 0 .4rem; }
.coords { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.audio-todo { margin: .4rem 0 .8rem; padding: 12px 16px; border: 2px dashed var(--rule); border-radius: 8px; color: var(--muted); font-weight: 600; }

/* hidden-Attribut immer respektieren (z. B. bei .button) */
[hidden] { display: none !important; }

/* Verschlüsselte Hinweise (ROT13, wie auf geocaching.com) */
.hint-text { margin: 0 0 .6rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; color: var(--muted); }
.hint-text.plain { font-family: inherit; font-size: 1rem; color: inherit; }
.hint-toggle { border: 0; background: none; padding: 0; color: var(--navy); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Hilfe-Icon rechts in der Breadcrumb-Leiste: Message Center auf geocaching.com */
.crumbs .help {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%;
  border: 2px solid var(--navy); color: var(--navy);
  font-weight: 700; line-height: 1; text-decoration: none;
}
.crumbs .help:hover, .crumbs .help:focus-visible { background: var(--navy); color: #fff; text-decoration: none; }
