/* ==========================================================================
   Grusel-Labyrinth – Styles

   1. Tokens          5. Unterhalb des Hero
   2. Basis           6. Startseite und Finale
   3. Bausteine       7. Wege-Inhalte – enthalten ABSICHTLICHE Barrieren!
   4. Hero (Wald)     8. Bewegung und Kontrastmodus

   Farben aus den Designvorlagen: Nachtwald und Farne (Grusel2.afdesign),
   Tannengrün (Labyrinth.afdesign), Fußspuren (Fussstapfen.afdesign) im
   Mondlicht, dazu Kürbis und Mondblau.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

/* Jolly Lodger (SIL Open Font License), lokal eingebunden – keine Anfrage an Google */
@font-face {
  font-family: "Jolly Lodger";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jolly-lodger.woff2") format("woff2");
}

:root {
  --night: #0b1210;
  --sky-top: #060a0a;
  --sky: #0c1a16;
  --floor: #173022;
  --ground: var(--floor);
  --text: #f4ecdc;
  --muted: #c4c9bd;
  --moon: #ccf0fc;
  --pumpkin: #ff9a3c;
  --pumpkin-ink: #1b0f05;
  --good: #9ee37d;
  --bad: #ff8a7a;
  --lantern: #ffd75e;
  --line: rgba(244, 236, 220, 0.16);
  --line-strong: rgba(204, 240, 252, 0.4);

  /* Fußspuren in der Illustration */
  --foot: #3e5872;
  --foot-lit: #8fb1d4;
  --foot-open: #cbe9f7;
  --foot-dead: #0a1310;
  --step-todo: #2a3a32;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Jolly Lodger", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-hand: Noteworthy, "Bradley Hand", "Segoe Print", "Ink Free", "Iowan Old Style", Georgia, serif;

  --max: 76rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  color-scheme: dark;
}

/* 2. Basis ----------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--night);
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--moon);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--moon);
  outline-offset: 3px;
}

/* Nur per Skript fokussierte Ziele (Überschriften, Hinweise) */
[tabindex="-1"]:focus {
  outline: none;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.05em 0.3em;
  border-radius: 0.25em;
  background: rgba(244, 236, 220, 0.1);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--moon);
  color: var(--night);
  font-weight: 700;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

#main:focus {
  outline: none;
}

/* Fußzeile als Waldboden mit Farnen und Fliegenpilzen */
.site-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-edge {
  display: block;
  width: 100%;
  max-width: none;
  height: clamp(3.5rem, 8vw, 6rem);
}

.footer-floor {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0.75rem var(--gutter) 2.5rem;
  background: var(--floor);
}

.site-footer p {
  margin: 0;
}

/* Rechtliches: Impressum und Datenschutz (Klickziele mindestens 24 × 24 px) */
.legal ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.noscript-title {
  padding: 3rem var(--gutter) 0;
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 1.5rem + 4.5vw, 5rem);
  text-align: center;
}

.noscript {
  padding: 2rem var(--gutter);
  text-align: center;
}

/* 3. Bausteine -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0.625rem 1.375rem;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Schwarzes Band zwischen Button und Fokusrahmen */
.btn:focus-visible {
  box-shadow: 0 0 0 3px #000;
}

.btn-lg {
  min-height: 3.375rem;
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
}

.btn-primary {
  background: var(--pumpkin);
  color: var(--pumpkin-ink);
}

.btn-primary:hover {
  background: #ffb066;
}

.btn-ghost {
  background: transparent;
  border-color: var(--moon);
  color: var(--moon);
}

.btn-ghost:hover {
  background: var(--moon);
  color: var(--night);
}

.btn-text {
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--text);
}

.foot-icon {
  flex: none;
  width: 0.75em;
  height: 1.2em;
}

.steps-icon {
  flex: none;
  width: 1.375em;
  height: 1.375em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
}

.actions--start {
  justify-content: flex-start;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.section-title .icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--moon);
}

.kicker {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moon);
}

/* 4. Hero (Wald) ------------------------------------------------------------- */

/* Der Wald füllt die ganze Szene, die Überschrift steht im Nachthimmel darüber.
   Unter der Überschrift bleibt Platz für Wege und Fußspuren (etwa ein Viertel
   der Breite) – bei zweizeiligen Namen wird die Szene einfach höher. */
.hero-scene {
  position: relative;
  min-height: clamp(22rem, 40vw, 34rem);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 60%, #10231b 100%);
}

.hero-head {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) calc(25vw + 1.5rem);
  text-align: center;
}

.hero-title {
  max-width: 16ch;
  margin-inline: auto;
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 1.5rem + 4.5vw, 5rem);
  line-height: 1.05;
  text-shadow: 0 0.125rem 1.5rem rgba(0, 0, 0, 0.7);
}

.hero-title--brand {
  max-width: none;
  font-size: clamp(2.75rem, 1.4rem + 6.5vw, 6rem);
  line-height: 1;
}

.hero-sub {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: max(0.875rem, 0.2em);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--moon);
}

.forest {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
}

/* Nur die Fußspuren, ohne Weg darunter: Sackgassen dunkel, der richtige Weg hell */
.foot {
  color: var(--foot);
}

.trail.is-blocked .foot {
  color: var(--foot-dead);
}

.trail.is-open .foot,
.forest:has(.is-open) .trail-stem .foot {
  color: var(--foot-open);
}

/* Fährt man über einen Weg oder steht der Fokus darin, leuchten seine Fußspuren im Wald auf. */
.room:has(.path[data-path="0"]:is(:hover, :focus-within)) .trail-0:not(.is-blocked, .is-open) .foot,
.room:has(.path[data-path="1"]:is(:hover, :focus-within)) .trail-1:not(.is-blocked, .is-open) .foot,
.room:has(.path[data-path="2"]:is(:hover, :focus-within)) .trail-2:not(.is-blocked, .is-open) .foot,
.room:has(.path:not(.is-wrong):is(:hover, :focus-within)) .forest:not(:has(.is-open)) .trail-stem .foot {
  color: var(--foot-lit);
}

.room:has(.path[data-path="0"]:is(:hover, :focus-within)) .trail-0.is-blocked .foot,
.room:has(.path[data-path="1"]:is(:hover, :focus-within)) .trail-1.is-blocked .foot,
.room:has(.path[data-path="2"]:is(:hover, :focus-within)) .trail-2.is-blocked .foot {
  color: #22303a;
}

.ground {
  background: var(--floor);
}

.ground-edge {
  display: block;
  width: 100%;
  max-width: none;
  height: clamp(2rem, 5vw, 3.5rem);
  fill: var(--night);
}

.hero-actions {
  padding: 1.5rem var(--gutter) 1.25rem;
}

.paths {
  display: grid;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 1.5rem;
}

.path {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 2.5rem;
}

.path + .path {
  border-top: 1px solid var(--line);
}

/* Breit: drei Spalten, deren Zeilen (Titel, Inhalt, Hinweise, Button) per Subgrid fluchten */
@media (min-width: 60rem) {
  .paths {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    column-gap: clamp(2rem, 4vw, 4rem);
  }

  .path {
    padding-block: 1.5rem;
  }

  .path + .path {
    border-top: 0;
  }

  .specimen {
    min-height: 11rem;
  }

  @supports (grid-template-rows: subgrid) {
    .path {
      display: grid;
      grid-row: span 5;
      grid-template-rows: subgrid;
      row-gap: 0;
    }

    .path > .path-title { grid-row: 1; margin-bottom: 1.5rem; }
    .path > .specimen { grid-row: 2; }
    .path > .specimen-note { grid-row: 3; }
    .path > .specimen-note:not(:empty) { margin-top: 1rem; }
    .path > .path-verdict { grid-row: 4; margin-top: 1.25rem; }
    .path > .btn-choose { grid-row: 5; margin-top: 1.25rem; }
  }
}

.path-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.path-sign {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--moon);
  border-radius: 50%;
  color: var(--moon);
}

.path-sign .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.specimen {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
  font-size: 1rem;
  line-height: 1.5;
}

.specimen p {
  margin: 0;
}

.specimen-note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.path-verdict {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.path-verdict:empty {
  display: none;
}

.path-verdict .icon {
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.1em;
}

.is-wrong .path-verdict { color: var(--bad); }
.is-right .path-verdict { color: var(--good); }

.btn-choose {
  width: 100%;
}

/* 5. Unterhalb des Hero ----------------------------------------------------------- */

.after {
  display: grid;
  gap: clamp(3rem, 7vw, 4.5rem);
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 4rem;
}

.after--wide {
  max-width: 68rem;
}

/* Geschichte und Frage der Kammer */
.tale {
  display: grid;
  gap: 1.25rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.25rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.fear {
  display: inline-flex;
  gap: 0.125rem;
}

.fear .icon {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--step-todo);
}

.fear .is-lit {
  color: var(--pumpkin);
}

.story {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.6;
}

.question {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--moon);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.3;
  scroll-margin-top: 1.5rem;
}

#feedback-slot {
  display: grid;
  gap: clamp(3rem, 7vw, 4.5rem);
}

#feedback-slot:empty {
  display: none;
}

.feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.feedback-art {
  width: 4rem;
  height: 4.75rem;
  color: var(--text);
}

.feedback.is-right .feedback-art {
  height: 4rem;
  color: var(--moon);
}

.feedback-title {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  scroll-margin-top: 1.5rem;
}

.is-wrong .feedback-title { color: var(--bad); }
.is-right .feedback-title { color: var(--good); }

.feedback-lead {
  font-size: 1.1875rem;
}

.feedback .btn {
  margin-top: 0.5rem;
}

.word {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--pumpkin);
}

.criteria,
.res-extra {
  color: var(--muted);
}

.criteria {
  font-size: 0.9375rem;
}

@media (max-width: 40rem) {
  .feedback {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

.resolution > .section-title {
  margin-bottom: 1.5rem;
}

.res-list {
  display: grid;
  gap: 2rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.res-list p:last-child {
  margin-bottom: 0;
}

.res-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.res-title .icon {
  width: 1.25em;
  height: 1.25em;
}

.is-wrong .res-title .icon { color: var(--bad); }
.is-right .res-title .icon { color: var(--good); }

.lantern > p:not(.hint) {
  color: var(--muted);
}

.hint {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--lantern);
}

.journey {
  display: grid;
  gap: 3rem;
}

.journey p {
  margin: 0;
}

/* Fortschritt als Fußspur: 13 Schritte, abwechselnd links und rechts */
.progress-bar {
  display: flex;
  gap: 0.125rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.progress-bar li {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 2.5rem;
  color: var(--step-todo);
}

.progress-bar .foot-icon {
  width: clamp(0.6875rem, 2.6vw, 1rem);
  height: clamp(1.1rem, 4.2vw, 1.6rem);
  transform: translateY(0.4rem) rotate(90deg);
}

.progress-bar li:nth-child(even) .foot-icon {
  transform: translateY(-0.4rem) rotate(90deg) scaleX(-1);
}

.progress-bar .is-done { color: var(--pumpkin); }
.progress-bar .is-current { color: var(--moon); }

.spell {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.8;
}

.spell-gap {
  display: inline-block;
  width: 2.25em;
  border-bottom: 2px dotted #6d7d74;
}

.restart {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.hero .restart {
  padding-top: 0;
  border-top: 0;
}

.restart-question {
  margin-bottom: 1rem;
}

/* 6. Startseite und Finale ------------------------------------------------------ */

.lead {
  max-width: 44rem;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.5;
  text-align: center;
}

.intro-cols {
  display: grid;
  gap: 3rem;
}

@media (min-width: 52rem) {
  .intro-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem;
  }
}

.steps,
.gear {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding-left: 1.25rem;
}

.steps li::marker,
.gear li::marker {
  color: var(--moon);
  font-weight: 700;
}

.rank {
  display: grid;
  gap: 1rem;
}

.rank-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--pumpkin);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.5rem;
  margin: 0;
}

.stats div {
  padding-top: 0.75rem;
  border-top: 2px solid var(--line);
}

.stats dt {
  font-size: 0.9375rem;
  color: var(--muted);
}

.stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
}

.solution {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  line-height: 1.35;
}

.bestiary {
  display: grid;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bestiary h3 {
  font-size: 1.0625rem;
}

.bestiary p {
  margin: 0;
}

.bestiary-topic {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.bestiary-monsters {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ==========================================================================
   7. Wege-Inhalte
   Hier stecken die ABSICHTLICHEN Barrieren. Bitte nicht „reparieren“ –
   sie sind das Rätsel.
   ========================================================================== */

/* Kammer 1: Wegweiser */
.sp-signpost {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-plank {
  min-width: 11rem;
  max-width: 100%;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(180deg, #7c532c, #6a4524);
  box-shadow: inset 0 -0.25rem 0 #4a2f1a;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.sp-plank--left { padding-left: 2.5rem; clip-path: polygon(14% 0, 100% 0, 100% 100%, 14% 100%, 0 50%); }
.sp-plank--right { padding-right: 2.5rem; clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%); }
.sp-plank--up { border-radius: 0.375rem; }

.specimen .sp-plank a {
  color: #fff3d6;
  text-decoration-thickness: 2px;
}

.sp-post {
  width: 0.875rem;
  height: 4.5rem;
  background: linear-gradient(90deg, #3d2615, #5c3b21, #3d2615);
}

/* Kammer 2: Anleitungen */
.sp-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 10rem;
}

.sp-instruction {
  font-size: 1.0625rem;
  font-weight: 600;
}

.sp-btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sp-btnrow--corner {
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}

.sp-btn {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid #e9e2d6;
  border-radius: 0.375rem;
  background: #e9e2d6;
  color: #1a1210;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sp-btn--grey { border-color: #a39a92; background: #a39a92; }
.sp-btn--green { border-color: #2e7031; background: #2e7031; color: #fff; }
.sp-btn--square { border-radius: 0; }
.sp-btn--round { width: 5.5rem; height: 5.5rem; padding: 0.5rem; border-radius: 50%; line-height: 1.2; }

/* Kammer 3: Grabsteine (Kontrast) – Farben bewusst gewählt, siehe rooms.js */
.sp-grave {
  position: relative;
  display: flex;
  justify-content: center;
  padding-bottom: 0.5rem;
}

.sp-tomb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 13.5rem);
  min-height: 11.5rem;
  padding: 2.75rem 1.25rem 2rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

.sp-tomb--a { background: #2b2a29; color: #a19992; border-radius: 48% 52% 6px 6px / 38% 42% 6px 6px; }
.sp-tomb--b { background: #7a7372; color: #262222; border-radius: 1.75rem 2.75rem 6px 6px; transform: rotate(-1.2deg); }
.sp-tomb--c { background: #8e8987; color: #d6d1cd; border-radius: 50% 50% 6px 6px / 32% 32% 6px 6px; }

.sp-tuft {
  position: absolute;
  bottom: 0.125rem;
  width: 3.25rem;
  height: 2rem;
  color: #1e6c3c;
}

.sp-tuft--l { left: calc(50% - 7.25rem); }
.sp-tuft--r { left: calc(50% + 4rem); color: #0c4e18; }

/* Kammer 4: Gästebuch */
.sp-book {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sp-label {
  font-weight: 700;
}

.sp-input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #f7f2ea;
  border-radius: 0.375rem;
  background: #f7f2ea;
  color: #1a1210;
  font: inherit;
}

.sp-input::placeholder {
  color: #6b5a4a;
  opacity: 1;
}

/* Kammer 5: Gemälde */
.sp-painting {
  padding: 0.625rem;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #b88a2e, #f1d18a 30%, #8a6420 60%, #e6c06a);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
  transform: rotate(-0.6deg);
}

.sp-painting--tilt-left { transform: rotate(-1.8deg); }
.sp-painting--tilt-right { transform: rotate(1.2deg); }

.sp-painting img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid #3b2a12;
}

/* Kammer 6: Zutatenzettel – alle drei sehen gleich aus */
.sp-note {
  font-family: var(--font-hand);
  font-size: 1.125rem;
  line-height: 1.6;
}

.sp-note-title {
  font-weight: 700;
}

.sp-list {
  margin: 0;
  padding: 0;
  list-style-type: "– ";
  list-style-position: inside;
}

/* Kammer 7: Schriftrollen – Überschrift und Betonung sehen überall gleich aus */
.sp-scroll {
  font-family: var(--font-display);
}

.specimen .sp-h {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: wrap;
  color: var(--moon);
}

.sp-scroll p {
  margin: 0 0 0.5rem;
}

.specimen .sp-emph {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: normal;
  text-wrap: wrap;
  color: var(--text);
}

.specimen .sp-emph strong {
  font-weight: 700;
}

/* Kammer 8: Geister mit Sprechblasen */
.sp-whisper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.sp-ghost-icon {
  width: 3.5rem;
  height: 4.125rem;
  color: var(--moon);
}

.sp-bubble {
  position: relative;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: var(--text);
  color: #1a1210;
  font-style: italic;
  text-align: center;
}

.sp-bubble::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 50%;
  width: 1rem;
  height: 1rem;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

/* Kammer 9: Türklopfer */
.sp-door-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.sp-door {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: min(100%, 13rem);
  min-height: 12rem;
  padding-top: 4rem;
  border: 0.375rem solid #2a1a10;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 35% 35% 0 0;
  background: repeating-linear-gradient(90deg, #6b4426 0 22px, #5a381e 22px 24px);
}

.sp-knocker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 3px solid #141414;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #6f6f6f, #2e2e2e);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.sp-knock-result {
  font-size: 0.9375rem;
  text-align: center;
}

/* Kammer 10: scheinbar leere Durchgänge */
.sp-hall {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 13rem);
  min-height: 11rem;
  margin-inline: auto;
  padding: 1rem;
  border: 0.5rem solid #5a504b;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  background: #120c0e;
}

.sp-spacer,
.sp-ghostlink {
  display: block;
  width: 100%;
  height: 5rem;
}

/* Kammer 11: Menüs (Fokus) */
.sp-menu {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-menu li {
  position: relative;
}

.sp-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid #6e645d;
  color: var(--text);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.specimen .sp-menu--nofocus a:focus,
.specimen .sp-menu--nofocus a:focus-visible {
  outline: none;
}

.specimen .sp-menu--clear a:focus-visible {
  outline: 3px solid var(--moon);
  outline-offset: 2px;
  background: rgba(204, 240, 252, 0.14);
}

.sp-fog {
  position: absolute;
  inset: -0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2rem;
  background:
    radial-gradient(circle at 25% 40%, #ffffff 0 15%, transparent 45%),
    radial-gradient(circle at 75% 60%, #f1f3f6 0 18%, transparent 50%),
    #cfd4dc;
  box-shadow: 0 0 1rem 0.625rem #cfd4dc;
  color: #1a1210;
  font-style: italic;
  font-weight: 700;
}

/* Kammer 12: Spinnennetz (Zielgröße) – Maße bewusst in px */
.sp-web {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
}

.sp-web::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 16px, rgba(244, 236, 220, 0.2) 16px 17px),
    repeating-conic-gradient(from 0deg at 50% 50%, transparent 0 21.5deg, rgba(244, 236, 220, 0.2) 21.5deg 22.5deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 40%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 50%, #000 40%, transparent 70%);
}

.sp-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--t-gap);
  padding: 6px;
  border-radius: 6px;
  background: var(--ground);
}

.sp-toolbar--spaced { --t-size: 16px; --t-gap: 10px; }
.sp-toolbar--packed { --t-size: 22px; --t-gap: 0px; }
.sp-toolbar--tight { --t-size: 18px; --t-gap: 4px; }

.sp-tool {
  display: grid;
  place-items: center;
  width: var(--t-size);
  height: var(--t-size);
  padding: 0;
  border: 1px solid #e9e2d6;
  border-radius: 3px;
  background: #e9e2d6;
  color: #1a1210;
  cursor: pointer;
}

.sp-toolbar--packed .sp-tool {
  border-color: var(--ground);
}

.sp-tool svg {
  width: 70%;
  height: 70%;
}

/* Kammer 13: Tore mit Knöpfen */
.sp-gate {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(100%, 13rem);
  min-height: 12rem;
  margin-inline: auto;
  padding: 1rem 0.75rem;
  border: 0.375rem solid #1c1416;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  background: repeating-linear-gradient(90deg, transparent 0 18px, #1c1416 18px 23px), #2a2224;
}

.sp-gatebtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid #e9e2d6;
  border-radius: 0.5rem;
  background: #e9e2d6;
  color: #1a1210;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sp-gatebtn > span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.sp-door-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* 8. Bewegung und Kontrastmodus -------------------------------------------------- */

/* Nur einmalige, kurze Animationen – und nur, wenn keine reduzierte Bewegung gewünscht ist. */
@media (prefers-reduced-motion: no-preference) {
  .hero-head > * {
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .forest .moon {
    transform-box: fill-box;
    animation: moon-rise 1.8s ease-out both;
  }

  /* Die Fußspuren erscheinen Schritt für Schritt (insgesamt unter zwei Sekunden). */
  .forest .foot {
    animation: step-in 0.35s ease-out both;
    animation-delay: calc(0.3s + var(--step, 0) * 90ms);
  }

  .feedback.is-wrong .feedback-art {
    animation: boo 0.6s ease-out 2;
  }

  .btn,
  .btn-text {
    transition: background-color 0.15s, color 0.15s;
  }

  .forest .foot {
    transition: color 0.3s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes moon-rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@keyframes step-in {
  from {
    opacity: 0;
  }
}

@keyframes boo {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (forced-colors: active) {
  .btn,
  .btn-ghost {
    border: 2px solid ButtonText;
  }

  .path-sign,
  .tags li {
    border-color: CanvasText;
  }

  :focus-visible {
    outline-color: Highlight;
  }
}
