/* Seiten für echte Rätsel */

body.raetsel-seite { background: var(--nacht); }
[hidden] { display: none !important; }
.knopf.klein { padding: 0.45em 0.9em; font-size: 0.9rem; }

.raetsel-kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(14, 12, 22, 0.88);
  border-bottom: 1px solid var(--linie);
  backdrop-filter: blur(6px);
}
.marke span { margin-left: 0; }

.titelbild { position: relative; min-height: min(78vh, 720px); display: grid; align-items: end; overflow: hidden; }
.titelbild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.titelbild::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(14, 12, 22, 0.1) 30%, rgba(14, 12, 22, 0.95)); }
.titelbild-text { position: relative; z-index: 1; width: min(760px, 100%); margin: 0 auto; padding: 40px 20px 36px; }
.kicker { margin: 0 0 0.4em; color: var(--lila); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.titelbild h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); margin: 0; }
.unterzeile { font-family: var(--serif); font-size: 1.3rem; margin: 0.3em 0 1em; color: var(--text); }

.text { width: min(760px, 100%); margin: 0 auto; padding: 10px 20px 60px; font-size: 1.08rem; line-height: 1.7; }
.text h2 { font-size: 1.9rem; margin: 1.8em 0 0.5em; }
.text h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.text p { margin: 0 0 1em; }
.text q { font-family: var(--serif); font-style: italic; color: var(--bernstein-hell); }
.vorab { color: var(--text-leise); font-size: 0.95rem; border-left: 3px solid var(--lila); padding-left: 14px; }
.aussage-beispiel, .aussage-inline { background: rgba(169, 139, 232, 0.14); border-bottom: 1px dashed var(--lila); padding: 0 0.15em; }

section[data-lesen] { position: relative; }
.lesen-knopf { float: right; margin: 1.9em 0 0 12px; }

.aussage {
  margin: 0 0 1.2em;
  padding: 14px 18px 4px;
  border-radius: 12px;
  background: rgba(169, 139, 232, 0.1);
  border: 1px solid rgba(169, 139, 232, 0.35);
}
.aussage-marke { display: inline-flex; gap: 0.4em; align-items: center; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lila); font-weight: 600; margin-bottom: 6px; }

.bild { margin: 2em -20px; }
.bild img { width: 100%; display: block; border-radius: 0; }
.bild figcaption { padding: 8px 20px 0; font-size: 0.9rem; color: var(--text-leise); }
.ki { display: inline-block; margin-left: 0.4em; font-size: 0.78rem; padding: 0.05em 0.5em; border-radius: 999px; border: 1px solid var(--linie-stark); }

#zettel { scroll-margin-top: 70px; }
#zettel:target .zettel-zitat { animation: hervorheben 2.4s ease-out; }
@keyframes hervorheben { 0%, 40% { box-shadow: 0 0 0 4px var(--bernstein), 0 0 40px rgba(227, 168, 78, 0.6); } }
.zettel-zitat {
  margin: 1.2em 0 1.4em;
  padding: 22px 26px;
  background: var(--papier);
  color: var(--papier-tinte);
  border-radius: 4px;
  transform: rotate(-0.8deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.zettel-zitat p { margin: 0; font-family: 'Segoe Print', 'Ink Free', 'Bradley Hand', var(--serif); font-size: 1.35rem; line-height: 1.5; }

.steine { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stein { margin: 0; }
.stein-latein {
  margin: 0 0 10px !important;
  padding: 22px 12px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: #3a2e24;
  background: linear-gradient(160deg, #b9ad98, #8e826f);
  border-radius: 10px 10px 4px 4px;
  text-shadow: 0 1px 0 rgba(255, 245, 225, 0.4);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
}
.stein figcaption { font-size: 0.95rem; color: var(--text-leise); }
.stein figcaption strong { color: var(--text); }

.offen ul { padding-left: 1.2em; }
.offen li { margin-bottom: 0.4em; }
.offen li::marker { content: '?  '; color: var(--bernstein); font-weight: 700; }

.weiter { margin-top: 2.5em; padding: 22px 24px; border-radius: 16px; background: var(--flaeche-hell); border: 1px solid var(--linie); }
.weiter h2 { margin-top: 0; }
.links { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.links a { display: inline-flex; gap: 0.5em; align-items: center; }

@media (max-width: 640px) {
  .steine { grid-template-columns: 1fr; }
  .text { font-size: 1.02rem; }
  .text h2 { font-size: 1.6rem; }
  .lesen-knopf { margin-top: 1.6em; }
}

/* ---------- Seiten zum Erkunden: Stationen mit leuchtenden Punkten ---------- */

.raetsel-kopf { flex-wrap: wrap; row-gap: 6px; }
.zeitleiste {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px -10px;
  padding: 4px 12px 8px;
}
.zeitleiste::-webkit-scrollbar { display: none; }
.zeit-punkt {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  padding: 5px 10px;
  border-radius: 10px;
  color: var(--text-leise);
  text-decoration: none;
  line-height: 1.2;
  border: 1px solid transparent;
}
.zeit-punkt:first-child { margin-left: auto; }
.zeit-punkt:last-child { margin-right: auto; }
.zeit-jahr { font-weight: 700; font-size: 0.85rem; color: var(--bernstein); }
.zeit-ort { font-size: 0.78rem; white-space: nowrap; }
.zeit-punkt:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.zeit-punkt.aktiv { color: var(--text); background: rgba(227, 168, 78, 0.14); border-color: rgba(227, 168, 78, 0.45); }

.einleitung { width: min(760px, 100%); margin: 0 auto; padding: 42px 20px 6px; }
.einleitung h1 { font-size: clamp(2.6rem, 8vw, 4.4rem); margin: 0; line-height: 1.05; }
.einleitung .unterzeile { margin: 0.35em 0 0.9em; }
.so-gehts {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(227, 168, 78, 0.1);
  border: 1px solid rgba(227, 168, 78, 0.35);
  line-height: 1.55;
}
.so-gehts > i { font-size: 1.7rem; color: var(--bernstein); flex: 0 0 auto; }
.so-gehts p { margin: 0; }
.einleitung .vorab { margin: 0 0 1em; line-height: 1.6; }

.station { padding: 54px 0 26px; scroll-margin-top: 112px; }
.station + .station { border-top: 1px solid var(--linie); }
.station-kopf { width: min(760px, 100%); margin: 0 auto; padding: 0 20px; }
.station-kopf .kicker { margin-bottom: 0.3em; }
.station-kopf h2 { font-size: clamp(1.75rem, 4.6vw, 2.5rem); margin: 0 0 0.35em; }
.station-intro { font-size: 1.1rem; line-height: 1.65; margin: 0 0 0.4em; }
.station-kopf .lesen-knopf { margin-top: 0; }

.szene {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 20px auto 0;
  aspect-ratio: 1344 / 768;
  overflow: hidden;
  border-radius: 16px;
  background: #070609;
  box-shadow: var(--schatten);
}
.szene::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45));
}
/* Das Bild atmet ganz langsam, damit die Szene lebendig wirkt */
.szene-innen { position: absolute; inset: 0; animation: atmen 26s ease-in-out infinite alternate; }
@keyframes atmen { from { transform: scale(1); } to { transform: scale(1.045) translateY(-0.6%); } }
.szene-innen img { width: 100%; height: 100%; object-fit: cover; display: block; }

.fleck {
  position: absolute;
  z-index: 1;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff4dc;
  background: rgba(243, 199, 126, 0.94);
  color: #22180b;
  font-size: 1.35rem;
  cursor: pointer;
  animation: puls 2.6s ease-out infinite;
  animation-delay: var(--verz, 0s);
  transition: transform 0.18s ease, background 0.2s;
}
@keyframes puls {
  0% { box-shadow: 0 0 0 0 rgba(243, 199, 126, 0.8), 0 4px 14px rgba(0, 0, 0, 0.55); }
  70%, 100% { box-shadow: 0 0 0 20px rgba(243, 199, 126, 0), 0 4px 14px rgba(0, 0, 0, 0.55); }
}
.fleck:hover, .fleck:focus-visible { transform: scale(1.14); background: #fff1d2; }
.fleck:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.fleck.gesehen {
  background: rgba(19, 16, 28, 0.82);
  border-color: var(--lila);
  color: #d2c3f7;
  animation: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
.fleck.gesehen::after {
  content: '\2713';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lila);
  color: #0f0a18;
  font-size: 12px;
  font-weight: 800;
}
/* Beschriftung, wenn man mit der Maus darüberfährt */
.fleck::before {
  content: attr(data-schild);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(11, 9, 16, 0.9);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.fleck.schild-oben::before { top: auto; bottom: calc(100% + 8px); }
.fleck.schild-links::before { left: 0; transform: none; }
.fleck.schild-rechts::before { left: auto; right: 0; transform: none; }
.fleck:hover::before, .fleck:focus-visible::before { opacity: 1; }

.szene-zaehler {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  margin: 0;
  display: inline-flex;
  gap: 0.35em;
  align-items: center;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  background: rgba(11, 9, 16, 0.78);
  font-size: 0.85rem;
  pointer-events: none;
}
.szene-zaehler:empty { display: none; }
.szene-zaehler.fertig { color: var(--gruen); }

.chips {
  width: min(1180px, 100%);
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  display: inline-flex;
  gap: 0.45em;
  align-items: center;
  min-height: 40px;
  padding: 0.4em 0.95em;
  border-radius: 999px;
  border: 1px solid var(--linie-stark);
  background: var(--flaeche-hell);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  cursor: pointer;
}
.chip i { color: var(--bernstein); font-size: 1.1em; }
.chip:hover { border-color: var(--bernstein); }
.chip:focus-visible { outline: 2px solid var(--bernstein); outline-offset: 2px; }
.chip.gesehen { color: var(--text-leise); border-color: rgba(169, 139, 232, 0.5); }
.chip.gesehen i { color: var(--lila); }
.chip.gesehen::after { content: '\2713'; color: var(--lila); font-weight: 800; }

.station-weiter { text-align: center; margin: 24px 0 0; }

/* Die Karten: mit JavaScript im Fenster, ohne JavaScript als Text */
.karten { display: none; }
.karte h3 { font-size: 1.5rem; margin: 0 0 0.45em; line-height: 1.2; }
.karte p { margin: 0 0 0.9em; }
.karte .aussage { margin-bottom: 1em; }
.mundart { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--bernstein-hell); }
.mitmach-knopf { margin: 0 0 1.1em; }

.karte-fenster {
  width: min(620px, calc(100% - 24px));
  max-width: none;
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--linie-stark);
  border-radius: 18px;
  background: var(--nacht-2);
  color: var(--text);
  box-shadow: var(--schatten);
  overflow: hidden;
  font-size: 1.05rem;
  line-height: 1.65;
}
.karte-fenster[open] { display: flex; flex-direction: column; animation: karte-auf 0.3s ease-out; }
@keyframes karte-auf { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.karte-fenster::backdrop { background: rgba(6, 5, 9, 0.74); backdrop-filter: blur(3px); }
.karte-rahmen { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.karte-lupe {
  aspect-ratio: 16 / 7;
  background-color: #070609;
  background-repeat: no-repeat;
  background-size: var(--zoom, 260%) auto;
  box-shadow: inset 0 -50px 40px -24px var(--nacht-2);
}
.karte-lupe.faehrt { animation: lupe-fahrt 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes lupe-fahrt { from { background-size: 100% auto; } }
.karte-zu { position: absolute; z-index: 2; top: 10px; right: 10px; background: rgba(11, 9, 16, 0.75); }
.karte-inhalt { padding: 16px 24px 6px; }
.karte-ort { margin: 0 0 0.5em; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lila); font-weight: 600; }
.karte-fuss {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--linie);
  background: rgba(11, 9, 16, 0.55);
}
.karte-fuss .knopf.haupt { margin-left: auto; }

/* Zettel in Spiegelschrift zum Umdrehen */
.spiegel-zettel {
  margin: 1em 0 0.8em;
  padding: 20px 22px;
  background: var(--papier);
  color: var(--papier-tinte);
  border-radius: 4px;
  transform: rotate(-1deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.spiegel-zettel p {
  margin: 0 !important;
  font-family: 'Segoe Print', 'Ink Free', 'Bradley Hand', var(--serif);
  font-size: 1.1rem;
  line-height: 1.6;
  transform: scaleX(-1);
  transition: transform 0.8s cubic-bezier(0.5, 0, 0.2, 1);
}
.spiegel-zettel.gelesen p { transform: none; }

/* Inschrift: Latein oder Deutsch */
.stein-umschalt { margin: 1em 0 0.6em; }
.stein-deutsch {
  display: none;
  margin: 0 0 10px !important;
  padding: 22px 16px;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.5;
  color: #3a2e24;
  background: linear-gradient(160deg, #c9bfac, #9d927f);
  border-radius: 10px 10px 4px 4px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}
.stein-umschalt.deutsch .stein-latein { display: none; }
.stein-umschalt.deutsch .stein-deutsch { display: block; animation: einblenden 0.4s ease-out; }
@keyframes einblenden { from { opacity: 0; } }

/* „Was meinst du?“ */
.umfrage { width: min(760px, 100%); margin: 0 auto; padding: 56px 20px 0; scroll-margin-top: 112px; }
.umfrage h2 { font-size: clamp(1.75rem, 4.6vw, 2.5rem); margin: 0 0 0.3em; }
.umfrage-frage { font-size: 1.15rem; margin: 0 0 0.6em; }
.meinungen { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 18px; }
.meinung {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--linie-stark);
  background: var(--flaeche-hell);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}
.meinung i { font-size: 1.9rem; color: var(--bernstein); }
.meinung strong { font-size: 1.06rem; }
.meinung span { font-size: 0.9rem; color: var(--text-leise); }
.meinung:hover { border-color: var(--bernstein); }
.meinung:focus-visible { outline: 2px solid var(--bernstein); outline-offset: 2px; }
.meinung[aria-pressed='true'] { border-color: var(--bernstein); background: rgba(227, 168, 78, 0.15); }
.umfrage:not(.gewaehlt) .umfrage-aufloesung { display: none; }
.umfrage-aufloesung {
  padding: 18px 22px 6px;
  border-radius: 14px;
  background: rgba(169, 139, 232, 0.1);
  border: 1px solid rgba(169, 139, 232, 0.35);
  line-height: 1.65;
  animation: einblenden 0.5s ease-out;
}
.umfrage-aufloesung h3 { margin: 0.6em 0 0.35em; font-size: 1.25rem; }
.umfrage-aufloesung p { margin: 0 0 0.9em; }
.deine-wahl { font-weight: 600; }

@media (max-width: 640px) {
  .szene { width: 100%; border-radius: 0; }
  .fleck { width: 44px; height: 44px; margin: -22px 0 0 -22px; font-size: 1.2rem; border-width: 1.5px; }
  .fleck::before { display: none; }
  .fleck.gesehen::after { width: 15px; height: 15px; font-size: 10px; top: -4px; right: -4px; }
  .szene-zaehler { top: 8px; left: 8px; font-size: 0.78rem; }
  .karte-fenster { width: 100%; max-height: 90vh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .karte-inhalt { padding: 14px 18px 4px; }
  .karte-fuss { padding: 10px 12px; }
  .karte-fuss .knopf { font-size: 0.92rem; }
  .zeit-punkt { min-width: 66px; padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .szene-innen, .fleck, .karte-lupe.faehrt, .karte-fenster[open] { animation: none; }
  .spiegel-zettel p { transition: none; }
}

/* Knöpfe „Ganze Seite vorlesen“ und „Schrift“ nebeneinander */
.lese-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---------- Geschichtenseiten (aus geschichten/*.json gebaut) ---------- */
.geschichte-siegel {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 0 16px;
  border-radius: 50%;
  border: 1px solid rgba(227, 168, 78, 0.45);
  background: radial-gradient(circle at 35% 30%, rgba(227, 168, 78, 0.28), rgba(169, 139, 232, 0.1) 70%);
  box-shadow: 0 0 0 6px rgba(227, 168, 78, 0.06);
  color: var(--bernstein-hell);
  font-size: 2.4rem;
}
.geschichte-seite .text > section:first-child h2 { margin-top: 1em; }
.vorab a { color: var(--bernstein-hell); }

.gut-zu-wissen {
  margin: 2.2em 0 0;
  padding: 4px 22px 10px;
  border-radius: 14px;
  background: rgba(227, 168, 78, 0.08);
  border: 1px solid rgba(227, 168, 78, 0.3);
}
.gut-zu-wissen h2 { display: flex; align-items: center; gap: 0.4em; font-size: 1.4rem; margin: 0.9em 0 0.4em; }
.gut-zu-wissen h2 i { color: var(--bernstein); }
.gut-zu-wissen ul { padding-left: 1.1em; margin: 0 0 0.6em; }
.gut-zu-wissen li { margin-bottom: 0.45em; }
.gut-zu-wissen li::marker { color: var(--bernstein); }

.detektiv-frage {
  margin: 2.4em 0 0;
  padding: 4px 22px 14px;
  border-radius: 16px;
  background: rgba(169, 139, 232, 0.09);
  border: 1px solid rgba(169, 139, 232, 0.4);
  scroll-margin-top: 80px;
}
.detektiv-frage h2 { display: flex; align-items: center; gap: 0.4em; margin: 0.8em 0 0.35em; font-size: 1.6rem; }
.detektiv-frage h2 i { color: var(--lila); }
.df-frage { font-size: 1.15rem; font-weight: 600; }
.df-antworten { list-style: none; padding: 0; margin: 0 0 0.6em; display: grid; gap: 10px; }
.df-antwort {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--linie-stark);
  background: var(--flaeche-hell);
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.df-antwort:hover:not(:disabled) { border-color: var(--bernstein); }
.df-antwort:focus-visible { outline: 2px solid var(--bernstein); outline-offset: 2px; }
.df-buchstabe {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--linie-stark);
  font-weight: 700;
  color: var(--bernstein-hell);
}
.df-antwort:disabled { cursor: default; }
.df-antwort.falsch { opacity: 0.55; text-decoration: line-through; text-decoration-color: rgba(200, 96, 63, 0.8); }
.df-antwort.falsch .df-buchstabe { background: rgba(200, 96, 63, 0.25); border-color: var(--rot); color: #fff; }
.df-antwort.richtig { border-color: var(--gruen); background: rgba(127, 180, 137, 0.16); opacity: 1; }
.df-antwort.richtig .df-buchstabe { background: var(--gruen); border-color: var(--gruen); color: #10200f; }
.df-fertig .df-antwort:not(.richtig) { opacity: 0.45; }
.df-rueckmeldung { min-height: 1.2em; margin: 0 0 0.6em; color: var(--bernstein-hell); font-weight: 600; }
.df-rueckmeldung:empty { margin: 0; min-height: 0; }
.df-aufloesung {
  padding: 14px 18px 4px;
  border-radius: 12px;
  background: rgba(127, 180, 137, 0.12);
  border: 1px solid rgba(127, 180, 137, 0.45);
  animation: einblenden 0.5s ease-out;
}
.df-aufloesung strong { color: var(--gruen); }
.df-gespeichert { display: flex; gap: 0.45em; align-items: center; font-size: 0.92rem; color: var(--text-leise); }
.df-gespeichert i { color: var(--gruen); font-size: 1.2em; }

.links.weitere small { color: var(--text-leise); }
.geschichte-seite .weiter .knopf.haupt { margin: 0.4em 0 1em; }

@media (max-width: 640px) {
  .geschichte-siegel { width: 60px; height: 60px; font-size: 2rem; margin-bottom: 12px; }
  .gut-zu-wissen, .detektiv-frage { margin-left: -6px; margin-right: -6px; padding-left: 16px; padding-right: 16px; }
  .detektiv-frage h2 { font-size: 1.4rem; }
  .df-antwort { padding: 11px 12px; gap: 10px; font-size: 1rem; }
  .links a { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .df-aufloesung { animation: none; }
}
/* Lange deutsche Wörter in Überschriften notfalls trennen statt über den Rand laufen */
.geschichte-seite h1, .geschichte-seite h2, .df-antwort { hyphens: auto; overflow-wrap: break-word; }

/* ---------- Handy: Geschichte zum Durchblättern (js/blaettern.js) ---------- */
.bl-leiste, .bl-fuss { display: none; }
body.blaettern { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.blaettern .raetsel-kopf { position: relative; flex: none; padding-top: 8px; padding-bottom: 8px; }
body.blaettern main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.blaettern main > :not(.bl-an),
body.blaettern .text > section:not(.bl-an),
body.blaettern .bl-aus,
body.blaettern .lesen-knopf { display: none !important; }
body.blaettern main > .einleitung { margin-block: auto; padding: 20px 22px; }
body.blaettern main > .text { width: 100%; padding: 22px 22px 26px; font-size: 1.1rem; line-height: 1.68; }
body.blaettern .text > section { margin: 0; }
body.blaettern .text h2 { margin-top: 0; font-size: 1.6rem; }
body.blaettern .text h2 + p { margin-top: 0.2em; }
body.blaettern .text p:last-child { margin-bottom: 0; }
body.blaettern .gut-zu-wissen, body.blaettern .detektiv-frage { margin: 0 -6px; }
body.blaettern .gut-zu-wissen h2, body.blaettern .detektiv-frage h2 { margin-top: 0.8em; font-size: 1.4rem; }
body.blaettern .offen h2 { font-size: 1.45rem; }
body.blaettern .weiter { margin: 0 -6px; padding: 18px 18px 6px; }
body.blaettern .weiter > .knopf.haupt { display: none; }
body.blaettern .einleitung .vorab { margin-bottom: 1.1em; }

/* Bunte Leiste oben: Wie weit bin ich? */
body.blaettern .bl-leiste { display: flex; flex: none; gap: 3px; padding: 8px 14px 4px; }
.bl-leiste span { flex: 1 1 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.13); transition: background 0.3s; }
.bl-leiste span.gelesen { background: rgba(169, 139, 232, 0.75); }
.bl-leiste span.jetzt { background: var(--bernstein); }
.bl-leiste span.frage { background: rgba(169, 139, 232, 0.3); box-shadow: inset 0 0 0 1px var(--lila); }
.bl-leiste span.frage.gelesen { background: rgba(169, 139, 232, 0.75); }
.bl-leiste span.frage.jetzt { background: var(--bernstein); box-shadow: none; }
.bl-leiste span.geloest, .bl-leiste span.frage.geloest { background: var(--gruen); box-shadow: none; }

/* Knöpfe unten: zurück, vorlesen, Seitenzahl, weiter */
body.blaettern .bl-fuss {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie-stark);
  background: var(--nacht-2);
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.4);
}
.bl-fuss .rund { width: 46px; height: 46px; flex: none; }
.bl-fuss .rund:disabled { opacity: 0.3; cursor: default; }
.bl-zaehler { flex: 1 1 auto; text-align: center; font-size: 0.85rem; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.bl-weiter { flex: none; min-height: 48px; padding: 0.6em 1.25em; font-size: 1.05rem; }
.bl-weiter.bereit { background: var(--gruen); border-color: var(--gruen); color: #10200f; animation: bereit-puls 1.6s ease-in-out infinite; }
@keyframes bereit-puls { 50% { box-shadow: 0 0 0 7px rgba(127, 180, 137, 0.25); } }

/* Umblättern: Die neue Seite gleitet sanft herein */
body.blaettern main.bl-vor > .bl-an { animation: bl-von-rechts 0.32s ease-out; }
body.blaettern main.bl-zurueck > .bl-an { animation: bl-von-links 0.32s ease-out; }
@keyframes bl-von-rechts { from { opacity: 0; transform: translateX(28px); } }
@keyframes bl-von-links { from { opacity: 0; transform: translateX(-28px); } }


/* Handy-Blättern: Feinheiten */
body.blaettern .lese-knoepfe, body.blaettern #k-alles-lesen { display: none !important; }
.bl-schrift { display: none; }
body.blaettern .bl-schrift { display: inline-grid; margin-left: auto; }
body.blaettern .raetsel-kopf { gap: 8px; }
body.blaettern .einleitung h1 { font-size: 2.35rem; }
body.blaettern .einleitung .unterzeile { font-size: 1.2rem; }
/* Schlussseite: zuerst „Noch eine Geschichte?“ als große Kärtchen, danach die Quellen */
body.blaettern .weiter.bl-an { display: flex; flex-direction: column; }
body.blaettern .weiter h3 { order: -2; margin: 0 0 0.5em; font-size: 1.35rem; }
body.blaettern .weiter .links.weitere { order: -1; margin-bottom: 1.2em; }
body.blaettern .weiter h2 { font-size: 1.1rem; margin: 0 0 0.4em; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-leise); }
body.blaettern .links.weitere a {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
body.blaettern .links.weitere a:active { background: rgba(255, 255, 255, 0.09); }
body.blaettern .links.weitere a i { grid-row: 1 / span 2; font-size: 1.6rem; color: var(--lila); }
body.blaettern .links.weitere small { grid-column: 2; font-size: 0.82rem; }
body.blaettern .weiter .links:not(.weitere) { font-size: 0.95rem; margin-bottom: 0.6em; }

/* ---------- Bild oben in einer Geschichte (KI-Bild, nachgestellt) ---------- */
.geschichte-bild { position: relative; margin: 0 0 20px; border-radius: 16px; overflow: hidden; background: #07060a; box-shadow: var(--schatten); }
.geschichte-bild img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.geschichte-bild::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35); }
.bild-ki { position: absolute; z-index: 1; right: 10px; bottom: 8px; padding: 0.15em 0.65em; border-radius: 999px; background: rgba(11, 9, 16, 0.72); color: var(--text-leise); font-size: 0.72rem; }
@media (min-width: 980px) {
  .geschichte-seite .einleitung .geschichte-bild { margin-inline: -90px; }
}
@media (max-width: 640px) {
  .geschichte-seite .einleitung .geschichte-bild { margin: 0 -20px 16px; border-radius: 0; }
}
/* Am Handy beim Blättern: Bild ganz oben über die volle Breite, Text darunter */
body.blaettern main > .einleitung:has(.geschichte-bild) { margin-block: 0 auto; padding-top: 0; }
body.blaettern .einleitung .geschichte-bild { margin: 0 -22px 16px; border-radius: 0; box-shadow: none; }

/* ---------- Kurzer Hinweis auf einen Fall (js/raetsel.js), mit X zum Wegklicken ---------- */
.fall-hinweis {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 16px;
  width: min(370px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--nacht-2);
  border: 1px solid rgba(227, 168, 78, 0.55);
  box-shadow: var(--schatten);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: fh-rein 0.45s ease-out both;
}
.fall-hinweis img { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.fh-text { flex: 1 1 auto; min-width: 0; }
.fh-titel { margin: 0 0 3px; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-leise); }
.fh-titel i { color: var(--bernstein); }
.fh-link { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; line-height: 1.25; color: var(--bernstein-hell); text-decoration: none; }
.fh-link:hover, .fh-link:focus-visible { text-decoration: underline; }
.fall-hinweis .fh-zu { flex: none; align-self: flex-start; width: 36px; height: 36px; font-size: 1rem; }
.fall-hinweis.weg { opacity: 0; transform: translateY(14px); }
@keyframes fh-rein { from { opacity: 0; transform: translateY(14px); } }
/* Am Handy beim Blättern: über der Knopfleiste unten */
body.blaettern .fall-hinweis { left: 12px; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { .fall-hinweis { animation: none; transition: none; } }
@media print { .fall-hinweis { display: none; } }
