:root {
  --grund: #05070d;
  --schrift: #ece7dc;
  --gedaempft: #8d8577;
  --linie: rgba(236, 231, 220, 0.14);
  --ton: #e8b95c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--grund);
  color: var(--schrift);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ------------------------------------------------------------- Hintergrund */
#himmel, #schleier { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#himmel {
  background: #05070d url("bilder/milchstrasse.jpg") center / cover no-repeat;
  opacity: .66;
  transform: scale(1.06);
  filter: saturate(.85);
}
#schleier {
  background:
    radial-gradient(ellipse 56% 60% at 50% 50%, rgba(5,7,13,.70) 0%, rgba(5,7,13,.30) 48%, rgba(5,7,13,0) 74%),
    radial-gradient(ellipse at 22% 18%, rgba(5,7,13,.35), transparent 60%),
    linear-gradient(to bottom, rgba(5,7,13,.55), rgba(5,7,13,.15) 30%, rgba(5,7,13,.75));
}

main { position: relative; z-index: 1; height: 100%; }
#buehne { position: absolute; inset: 0; }
#buehne canvas { display: block; cursor: grab; touch-action: none; }
#buehne canvas.greift { cursor: grabbing; }

/* ------------------------------------------------------------------- Kopf */
#kopf {
  position: absolute; top: clamp(1.1rem, 3vw, 2.4rem); left: clamp(1.1rem, 3vw, 2.6rem);
  max-width: 24rem; pointer-events: none;
}
#kopf h1 {
  margin: 0; font-weight: 400; letter-spacing: .1em; text-transform: uppercase;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  color: #f2e7cf;
  text-shadow: 0 2px 24px rgba(0,0,0,.9);
}
#kopf p {
  margin: .5rem 0 0; font-size: .82rem; line-height: 1.5;
  color: var(--gedaempft); font-style: italic;
  text-shadow: 0 2px 16px rgba(0,0,0,.9);
}

/* -------------------------------------------------------------- Infotafel */
/* Links stehen Chronik und Infotafel untereinander in einer Spalte und teilen
   sich die Höhe: die Chronik so hoch wie nötig, die Tafel nimmt den Rest. */
#linkeSpalte {
  position: absolute; left: clamp(1.1rem, 3vw, 2.6rem);
  top: clamp(8rem, 16vh, 9.5rem); bottom: clamp(2.6rem, 6vh, 4rem);
  width: min(24rem, 34vw);
  display: flex; flex-direction: column; gap: .7rem;
  pointer-events: none;
}
#linkeSpalte > * { pointer-events: auto; }

#tafel {
  flex: 1 1 auto; min-height: 9rem;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1.2rem 1.4rem 1.3rem;
  background: linear-gradient(155deg, rgba(10,13,22,.80), rgba(6,8,14,.68));
  border: 1px solid var(--linie);
  border-left: 2px solid var(--ton);
  border-radius: 3px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
  scrollbar-width: thin; scrollbar-color: var(--ton) transparent;
}
#tafel.ein { opacity: 1; transform: none; }
#tafel::-webkit-scrollbar { width: 4px; }
#tafel::-webkit-scrollbar-thumb { background: var(--ton); opacity: .5; }

#tafel .stufeNr {
  margin: 0 0 .55rem; font-size: .64rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ton); opacity: .8; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
#tafel h2 {
  margin: 0; font-weight: 400; font-size: 1.55rem; line-height: 1.15; color: #f4ecdd;
}
#tafel .dauer {
  margin: .25rem 0 0; font-size: 1.02rem; color: var(--ton); letter-spacing: .03em;
}
#tafel .unter {
  margin: .15rem 0 .95rem; font-size: .8rem; font-style: italic; color: var(--gedaempft);
}
#tafel .fliess {
  margin: 0 0 .95rem; font-size: .87rem; line-height: 1.62; color: #ddd6c8;
  hyphens: auto;
}
#tafel .jetztZeile {
  display: flex; align-items: flex-start; gap: .5rem;
  margin: 0 0 1rem; padding: .55rem .7rem;
  font-size: .8rem; line-height: 1.45; color: #f0e6d2;
  background: rgba(255,242,208,.055);
  border: 1px solid rgba(255,242,208,.14); border-radius: 2px;
}
#tafel .jetztPunkt {
  flex: none; width: 7px; height: 7px; margin-top: .38rem; border-radius: 50%;
  background: #fff2d0; box-shadow: 0 0 8px #fff2d0;
  animation: pochen 2.4s ease-in-out infinite;
}
@keyframes pochen { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

#tafel .fakten { margin: 0; padding: 0; list-style: none; }
#tafel .fakten li {
  position: relative; padding-left: .95rem; margin-bottom: .42rem;
  font-size: .78rem; line-height: 1.5; color: #c3bcae;
}
#tafel .fakten li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ton); opacity: .75;
}
#tafel .hinweis {
  margin: 1rem 0 0; padding: .6rem .75rem;
  font-size: .74rem; line-height: 1.5; font-style: italic; color: #a89f90;
  border-left: 1px solid var(--linie); background: rgba(255,255,255,.025);
}
#tafel .quelle {
  margin: .9rem 0 0; font-size: .68rem; letter-spacing: .06em;
  color: #6f695d;
}

/* ---------------------------------------------------------- Tiefenleiste */
/* Die Zeilenhöhe wächst mit dem Fenster, bleibt aber so bemessen, dass alle
   fünfzehn Schichten ohne Scrollen untereinander stehen. */
#leiste {
  --zeile: min(5.05vh, 54px);
  position: absolute; right: clamp(1.2rem, 4vw, 4.5rem); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1px;
  max-height: 94vh; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
}
#leiste::-webkit-scrollbar { width: 0; }
.stufe {
  --ton: #e8b95c;
  display: flex; align-items: center; gap: calc(var(--zeile) * .21);
  padding: calc(var(--zeile) * .12) calc(var(--zeile) * .26);
  border: 0; border-radius: 3px;
  background: transparent; color: #c2b8a7;
  font: inherit; font-size: calc(var(--zeile) * .40); text-align: left; cursor: pointer;
  transition: background .25s, color .25s, opacity .25s;
}
.stufe:hover { background: rgba(255,255,255,.05); color: #ded6c7; }
.stufe .punktFeld {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: calc(var(--zeile) * .40);
}
.stufe .punkt {
  flex: none; border-radius: 50%;
  width: calc(var(--zeile) * .27 * var(--punktMass, 1));
  height: calc(var(--zeile) * .27 * var(--punktMass, 1));
  /* Auch die nicht gewaehlten Punkte sollen gut zu sehen sein: heller Rand,
     dazu ein Hauch Fuellung, damit der Ring nicht im Himmel verschwindet. */
  border: 1.5px solid var(--ton);
  background: color-mix(in srgb, var(--ton) 26%, transparent);
  box-shadow: 0 0 6px -1px var(--ton);
  transition: background .3s, box-shadow .3s, transform .3s;
}
.stufe .stufeText { display: flex; flex-direction: column; line-height: 1.2; }
.stufe em { font-style: normal; }
.stufe small { font-size: calc(var(--zeile) * .31); opacity: .74; }
.stufe.aktiv { color: #f4ecdd; background: rgba(255,255,255,.06); }
.stufe.aktiv .punkt { background: var(--ton); box-shadow: 0 0 10px var(--ton); transform: scale(1.25); }
.stufe.durch { opacity: .82; }
.stufe.durch .punkt { opacity: .78; }

/* ----------------------------------------------------------------- Pult */
#pult {
  position: absolute; right: clamp(.8rem, 2.4vw, 2rem); bottom: clamp(1.1rem, 3vh, 2.2rem);
  display: flex; gap: .5rem;
}
#pult button {
  padding: .5rem .9rem; border-radius: 2px;
  border: 1px solid var(--linie); background: rgba(10,13,22,.6);
  color: #ddd5c6; font: inherit; font-size: .76rem; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .25s, color .25s, background .25s;
}
#pult button:hover { border-color: rgba(236,231,220,.4); color: #f4ecdd; background: rgba(20,25,38,.7); }

#hinweisZeile {
  position: absolute; left: 50%; bottom: clamp(.8rem, 2.2vh, 1.5rem); transform: translateX(-50%);
  margin: 0; font-size: .68rem; letter-spacing: .05em; color: #625c51;
  white-space: nowrap; pointer-events: none;
}

/* ------------------------------------------------------------ Schmal */
@media (max-width: 900px) {
  #kopf { max-width: 60vw; }
  #kopf p { display: none; }

  /* Chronik, Schicht-Tafel und Spendenknopf werden zum Pop-up, damit die
     Kugel den Bildschirm behält. */
  #linkeSpalte {
    display: none;
    left: .5rem; right: .5rem; top: 6.3rem; width: auto;
    bottom: calc(var(--zeitHoehe, 175px) + 1.6rem + .8rem);
    gap: .5rem; z-index: 6; overflow-y: auto;
  }
  #linkeSpalte.auf { display: flex; }
  #tafel {
    border-left: 2px solid var(--ton); border-radius: 3px;
    padding: 1rem 1.1rem 1.1rem;
  }
  #chronik, .spende {
    border-left: 2px solid var(--ton); border-top: 1px solid var(--linie);
    border-radius: 3px;
  }
  /* Die Punkte stehen ganz oben, gleich unter dem Titel */
  #leiste {
    top: 3.5rem; bottom: auto; left: .5rem; right: .5rem; transform: none;
    flex-direction: row; justify-content: space-between; align-items: center;
    gap: 0; max-height: none; overflow: visible;
    padding: .35rem .5rem;
    background: linear-gradient(160deg, rgba(10,13,22,.72), rgba(6,8,14,.58));
    border: 1px solid var(--linie); border-radius: 3px;
    backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  }
  .stufe .stufeText { display: none; }
  /* Sechzehn Punkte müssen nebeneinander in die Breite passen */
  .stufe { padding: .28rem .1rem; }
  .stufe .punktFeld {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 1.05rem;
  }
  .stufe .punkt { width: 11px; height: 11px; }
  #leiste { --zeile: 40px; }
  .stufe.durch { opacity: .8; }
  /* Am Handy wird mit zwei Fingern gezoomt — die Knoepfe entfallen */
  #pult { display: none; }
  #hinweisZeile { display: none; }
}

/* ------------------------------------------------------------ Zeitschieber */
#zeitleiste {
  position: absolute; top: clamp(.9rem, 2.4vw, 1.6rem); left: 50%; transform: translateX(-50%);
  width: min(30rem, 44vw); min-width: 19rem;
  padding: .7rem .95rem .6rem;
  background: linear-gradient(160deg, rgba(10,13,22,.78), rgba(6,8,14,.66));
  border: 1px solid var(--linie); border-radius: 3px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  transition: border-color .3s;
}
#zeitleiste.verschoben { border-color: rgba(255,242,208,.34); }
/* Die ganze Leiste laesst sich mit dem Finger durch die Zeit ziehen */
#zeitleiste { touch-action: none; cursor: ew-resize; }
#zeitleiste button, #zeitleiste input { cursor: pointer; }
#zeitleiste.zieht { border-color: rgba(255,242,208,.5); }

#zeitKopf { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
#zeitAnzeige {
  font-size: 1.02rem; letter-spacing: .02em; color: #f2e7cf;
  font-variant-numeric: tabular-nums;
}
#zeitleiste.verschoben #zeitAnzeige { color: #fff2d0; }

#jetztKnopf {
  flex: none; padding: .2rem .6rem; border-radius: 2px;
  border: 1px solid var(--linie); background: transparent;
  color: var(--gedaempft); font: inherit; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer; transition: color .25s, border-color .25s;
}
#jetztKnopf:hover { color: #f4ecdd; border-color: rgba(236,231,220,.4); }
#zeitleiste.verschoben #jetztKnopf { color: #fff2d0; border-color: rgba(255,242,208,.4); }

#schieber {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin: .35rem 0 .1rem;
  background: transparent; cursor: ew-resize;
}
#schieber::-webkit-slider-runnable-track {
  height: 2px; border-radius: 1px;
  background: linear-gradient(to right, #9b5fd0, #4a87ce, #4aa8d8, #4cae7a, #f0c431, #ee8d2e, #e0423a);
  opacity: .55;
}
#schieber::-moz-range-track {
  height: 2px; border-radius: 1px;
  background: linear-gradient(to right, #9b5fd0, #4a87ce, #4aa8d8, #4cae7a, #f0c431, #ee8d2e, #e0423a);
  opacity: .55;
}
#schieber::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%;
  background: #fff2d0; box-shadow: 0 0 9px rgba(255,242,208,.85); border: 0;
}
#schieber::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; border: 0;
  background: #fff2d0; box-shadow: 0 0 9px rgba(255,242,208,.85);
}
#schieber:focus-visible { outline: 1px solid rgba(255,242,208,.5); outline-offset: 3px; }

/* Der Jetzt-Knopf steht unter der Zeitleiste, nicht mehr in der Kopfzeile */
#zeitFuss { display: flex; margin-top: .4rem; }
#zeitFuss #jetztKnopf { flex: 1 1 auto; text-align: center; }

#zeitSchritte { display: flex; gap: 2px; justify-content: space-between; }
#zeitSchritte button {
  flex: 1; padding: .18rem 0; border: 0; border-radius: 2px;
  background: rgba(255,255,255,.035); color: #7d7568;
  font: inherit; font-size: .62rem; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .2s, color .2s;
}
#zeitSchritte button:hover { background: rgba(255,255,255,.1); color: #ded6c7; }

/* Termine in der Infotafel */
#tafel .terminKopf {
  margin: 0 0 .35rem; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ton); opacity: .75;
}
#tafel .termine { margin: 0 0 1rem; padding: 0; list-style: none; }
#tafel .termine li {
  display: flex; gap: .5rem; margin-bottom: .3rem;
  font-size: .76rem; line-height: 1.4; color: #c3bcae;
}
#tafel .termine b {
  flex: none; min-width: 7.4rem; font-weight: 400; color: #e6dccb;
  font-variant-numeric: tabular-nums;
}
#tafel .jetztZeile em { font-style: normal; color: var(--gedaempft); }
#tafel .jetztZeile i { color: #cfc6b6; }
#tafel .jetztZeile b { font-weight: 600; color: #fff2d0; }

@media (max-width: 900px) {
  /* Die Zeitachse steht jetzt oben in der Leiste, dort wo vorher die Punkte waren */
  #zeitleiste {
    top: auto; bottom: 1.6rem; left: .5rem; right: .5rem;
    width: auto; min-width: 0; transform: none;
    padding: .5rem .6rem .45rem;
    display: flex; flex-direction: column;
  }
  #zeitleiste #schieber { order: 1; margin: 0 0 .45rem; }
  #zeitleiste #zeitKopf { order: 2; }
  #zeitleiste #zeitSchritte { order: 3; }
  #zeitleiste #zeitFuss { order: 4; }
  /* Datum oben über die volle Breite, die Knöpfe in eine eigene Zeile darunter */
  #zeitKopf { flex-wrap: wrap; gap: .3rem; align-items: center; }
  #zeitAnzeige { flex: 1 1 100%; font-size: .82rem; }
  /* Deutung und Jetzt sind die beiden Knöpfe, die man wirklich trifft */
  #zeitKopf button { flex: 1 1 0; padding: .5rem .2rem; font-size: .76rem;
    letter-spacing: .08em; }
  #zeitFuss #jetztKnopf { padding: .5rem .2rem; font-size: .76rem; letter-spacing: .08em; }
  #schieber { height: 18px; margin: .25rem 0 .1rem; }
  #zeitSchritte button { font-size: .55rem; padding: .14rem 0; }
  #kopf p { display: none; }
}

#tafel .schiefeZeile {
  margin: -.2rem 0 1rem; padding: .55rem .7rem;
  font-size: .78rem; line-height: 1.5; color: #d8cfbd;
  background: rgba(255,255,255,.035);
  border-left: 1px solid var(--ton); border-radius: 0 2px 2px 0;
}
#tafel .schiefeZeile b { font-weight: 400; color: #fff2d0; }
#tafel .schiefeZeile em { font-style: normal; color: var(--gedaempft); }

#tafel .menschZeile {
  margin: -.4rem 0 1rem; padding: .55rem .7rem;
  font-size: .78rem; line-height: 1.5; color: #d8cfbd;
  background: rgba(255,242,208,.04);
  border-left: 1px solid var(--ton); border-radius: 0 2px 2px 0;
}
#tafel .menschZeile b { font-weight: 400; color: #fff2d0; }

/* Auf flachen Bildschirmen rückt die Zyklenleiste wieder etwas enger zusammen,
   damit alle fünfzehn Schichten ohne Scrollen nebeneinander stehen. */


/* ------------------------------------------------------------------ Chronik */
#chronik {
  flex: none;
  padding: .7rem .9rem .75rem;
  background: linear-gradient(155deg, rgba(10,13,22,.76), rgba(6,8,14,.62));
  border: 1px solid var(--linie); border-left: 2px solid rgba(255,242,208,.4);
  border-radius: 3px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  transition: border-left-color .5s ease, box-shadow .5s ease;
}
#chronik.regt {
  border-left-color: #fff2d0;
  box-shadow: -6px 0 22px -14px rgba(255,242,208,.9);
}

.chronikKopf {
  margin: 0 0 .5rem; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  color: #a2937a;
}
#chronikListe { margin: 0; padding: 0; list-style: none; }
#chronikListe li {
  display: flex; gap: .55rem; align-items: baseline;
  margin-bottom: .4rem; font-size: .74rem; line-height: 1.42;
  color: #8d8577; opacity: .78;
}
#chronikListe li:last-child { margin-bottom: 0; }
#chronikListe li b {
  flex: none; min-width: 5.4rem; font-weight: 400;
  font-variant-numeric: tabular-nums; color: #9b9080;
}
#chronikListe li em { display: block; font-style: normal; color: #9b9080; }
#chronikListe li.laufend { color: #ddd6c8; opacity: 1; font-size: .79rem; }
#chronikListe li.laufend b { color: #fff2d0; }
#chronikListe li.laufend em { color: var(--ton); }

@media (max-width: 900px) {
  #chronik {
    border-left: 0; border-top: 1px solid var(--linie);
    border-radius: 0; padding: .5rem 1.1rem .55rem;
  }
  #chronikListe li:not(.laufend) { display: none; }
  #chronikListe li { font-size: .72rem; }
}

/* Art des Ereignisses: Himmel, Natur, Menschenwerk */
#chronikListe li b { display: flex; align-items: baseline; gap: .38rem; }
#chronikListe li .art {
  flex: none; width: 5px; height: 5px; border-radius: 50%;
  background: #8d8577; opacity: .8;
}
#chronikListe li.himmel .art { background: #8fb6f0; }
#chronikListe li.natur  .art { background: #e0724f; }
#chronikListe li.kultur .art { background: #d9b46a; }
#chronikListe li.laufend .art { box-shadow: 0 0 7px currentColor; opacity: 1; }
#chronikListe li.laufend.himmel .art { box-shadow: 0 0 7px #8fb6f0; }
#chronikListe li.laufend.natur  .art { box-shadow: 0 0 7px #e0724f; }
#chronikListe li.laufend.kultur .art { box-shadow: 0 0 7px #d9b46a; }

#halley {
  margin: .6rem 0 0; padding-top: .5rem;
  border-top: 1px solid rgba(236,231,220,.09);
  font-size: .7rem; line-height: 1.4; color: #8fa3bd;
  font-variant-numeric: tabular-nums;
}
#halley::before { content: "☄ "; opacity: .7; }

/* ------------------------------------------------------- Ovids Weltalter */
#tafel .ovidZeile {
  margin: -.4rem 0 1rem; padding: .6rem .75rem;
  background: rgba(255,242,208,.045);
  border-left: 1px solid var(--ton); border-radius: 0 2px 2px 0;
  font-size: .78rem; line-height: 1.5;
}
#tafel .ovidKopf {
  display: block; margin-bottom: .2rem;
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ton); opacity: .8;
}
#tafel .ovidZeile b { font-weight: 400; color: #f2e7cf; }
#tafel .ovidZeile > i { color: var(--gedaempft); }
#tafel .ovidStelle {
  display: block; margin: .05rem 0 .3rem;
  font-size: .66rem; color: #6f695d; font-variant-numeric: tabular-nums;
}
#tafel .ovidText { display: block; color: #cdc5b6; }

#tafel .fliess.klein { font-size: .8rem; margin-bottom: .6rem; }
#tafel table.vergleich {
  width: 100%; border-collapse: collapse; margin: 0 0 .8rem;
  font-size: .76rem;
}
#tafel table.vergleich td {
  padding: .22rem .4rem .22rem 0; vertical-align: top;
  border-bottom: 1px solid rgba(236,231,220,.07);
}
#tafel table.vergleich td:first-child { color: var(--ton); white-space: nowrap; }
#tafel table.vergleich td:nth-child(2) { color: #ddd6c8; }
#tafel table.vergleich td:last-child {
  color: #7d7568; text-align: right; white-space: nowrap; font-size: .7rem;
}
#tafel .quelle.quelleKlein { margin: -.4rem 0 1rem; }

/* Aufklappbare Vergleichstafeln */
#tafel details.vergleichsBlock {
  margin: 0 0 .5rem; padding: 0 0 .3rem;
  border-bottom: 1px solid rgba(236,231,220,.07);
}
#tafel details.vergleichsBlock > summary {
  list-style: none; cursor: pointer;
  padding: .35rem 0; font-size: .82rem; color: #c9c0b0;
  transition: color .2s;
}
#tafel details.vergleichsBlock > summary::-webkit-details-marker { display: none; }
#tafel details.vergleichsBlock > summary::before {
  content: "▸"; display: inline-block; width: 1em;
  color: var(--ton); opacity: .7; transition: transform .2s;
}
#tafel details[open].vergleichsBlock > summary::before { transform: rotate(90deg); }
#tafel details.vergleichsBlock > summary:hover { color: #f2e7cf; }
#tafel details.vergleichsBlock > *:not(summary) { margin-left: 1em; }

/* ------------------------------------------------------------- Spendenknopf */
.spende {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem;
  padding: .45rem .9rem .5rem;
  background: linear-gradient(155deg, rgba(10,13,22,.72), rgba(6,8,14,.58));
  border: 1px solid var(--linie); border-left: 2px solid var(--ton);
  border-radius: 3px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
}
.spendeTitel {
  margin: 0; font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ton); opacity: .85;
}
.spendeReihe { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.spendeKnopf {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--ton); border-radius: 2px;
  color: #f2e7cf; font-size: .82rem; letter-spacing: .05em;
  padding: .28rem .85rem;
  transition: background .18s, color .18s;
}
.spendeKnopf:hover { background: var(--ton); color: var(--grund); }
/* Der freie Betrag ist die Nebentür — kein eigener Kasten, nur ein Hinweis. */
.spendeKnopf.frei {
  border: none; padding: .2rem .2rem;
  color: var(--gedaempft); font-size: .74rem;
  text-decoration: underline; text-decoration-color: var(--linie);
  text-underline-offset: .3em;
}
.spendeKnopf.frei:hover { background: transparent; color: #ded6c7; }
.spendeNot {
  flex-basis: 100%;
  margin: .4rem 0 0; font-size: .68rem; line-height: 1.45; color: #7d7568;
}
/* Auf flachen Bildschirmen soll die Infotafel den Platz behalten. */
@media (max-height: 820px) {
  .spendeNot { display: none; }
}

@media (max-width: 900px) {
  .spende {
    border-left: 0; border-top: 1px solid var(--linie);
    border-radius: 0; padding: .5rem 1.1rem .55rem;
  }
  .spendeNot { display: none; }
}

/* ------------------------------------------------------------------ Deutung */
#tafelKnopf { display: none; }
#deutungKnopf, #weltalterKnopf, #tafelKnopf {
  flex: none; padding: .2rem .6rem; border-radius: 2px;
  border: 1px solid var(--linie); background: transparent;
  color: var(--gedaempft); font: inherit; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}
#deutungKnopf:hover, #weltalterKnopf:hover, #tafelKnopf:hover { color: #f4ecdd; border-color: rgba(236,231,220,.4); }
#deutungKnopf.an, #weltalterKnopf.an, #tafelKnopf.an { color: var(--grund); background: #e8d9b4; border-color: #e8d9b4; }

.ueberlagerung {
  position: absolute; z-index: 5;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(34rem, 72vw); max-height: 78vh; overflow-y: auto;
  padding: 1.6rem 1.8rem 1.5rem;
  background: linear-gradient(155deg, rgba(10,13,22,.93), rgba(6,8,14,.88));
  border: 1px solid rgba(236,231,220,.18); border-radius: 4px;
  box-shadow: 0 24px 70px -30px #000;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  scrollbar-width: thin; scrollbar-color: rgba(236,231,220,.3) transparent;
}
.ueberlagerung[hidden] { display: none; }
.ueberlagerungZu {
  position: absolute; top: .5rem; right: .7rem;
  border: 0; background: transparent; color: var(--gedaempft);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: .2rem .4rem;
}
.ueberlagerungZu:hover { color: #f4ecdd; }

.deutungEpoche {
  margin: 0 0 .4rem; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  color: #a2937a;
}
.ueberlagerung h2 {
  margin: 0 0 1.1rem; font-weight: 400; font-size: 1.6rem; line-height: 1.15;
  color: #f4ecdd;
}
.messwerte { margin: 0 0 1.3rem; display: flex; flex-direction: column; gap: .35rem; }
.messwert { display: flex; align-items: center; gap: .7rem; font-size: .72rem; }
.messName { flex: none; width: 9.5rem; color: #9b9080; }
.messBalken {
  flex: 1 1 auto; height: 3px; border-radius: 2px;
  background: rgba(236,231,220,.1); overflow: hidden;
}
.messBalken i { display: block; height: 100%; border-radius: 2px; }
.messZahl {
  flex: none; width: 1.8rem; text-align: right;
  color: #7d7568; font-variant-numeric: tabular-nums;
}

.deutungKopf {
  margin: 0 0 .3rem; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ton); opacity: .85;
}
.deutungText {
  margin: 0 0 1.15rem; font-size: .9rem; line-height: 1.62; color: #ddd6c8;
  hyphens: auto;
}
.ueberlagerung .hinweis { margin-top: .4rem; }

@media (max-width: 900px) {
  /* Am Handy liegen die Pop-ups unter der Kugel und nie ueber ihr. Die obere
     Haelfte des Bildschirms gehoert allein der Grafik — sie rueckt dorthin
     hoch, sobald eine Tafel aufgeht. */
  .ueberlagerung {
    width: auto; left: .5rem; right: .5rem;
    top: 6.3rem; transform: none; max-height: none;
    bottom: calc(var(--zeitHoehe, 175px) + 1.6rem + .8rem);
    padding: .9rem .9rem .85rem;
  }
  .ueberlagerung h2 { margin-bottom: .7rem; font-size: 1.25rem; }
  .ueberlagerung .fliess { font-size: .8rem; line-height: 1.55; margin-bottom: .6rem; }
  .deutungText { font-size: .82rem; line-height: 1.55; margin-bottom: .8rem; }
  .messwerte { margin-bottom: .8rem; gap: .25rem; }
  .messName { width: 7.5rem; font-size: .68rem; }
}

/* Das Größenverhältnis zur nächsten Schale — die Zahl, die das Modell erklärt */
#tafel .masstab {
  margin: .1rem 0 .95rem; padding: .45rem .65rem;
  font-size: .76rem; line-height: 1.5; color: #c2b8a7;
  background: rgba(255,255,255,.035);
  border-left: 1px solid var(--ton); border-radius: 0 2px 2px 0;
}

/* Die Vergleichstafeln leben jetzt in der Weltalter-Ansicht */
.ueberlagerung .vergleichsBlock { margin: 0 0 .5rem; padding: 0 0 .3rem;
  border-bottom: 1px solid rgba(236,231,220,.07); }
.ueberlagerung .vergleichsBlock > summary {
  list-style: none; cursor: pointer; padding: .4rem 0;
  font-size: .88rem; color: #c9c0b0; transition: color .2s; }
.ueberlagerung .vergleichsBlock > summary::-webkit-details-marker { display: none; }
.ueberlagerung .vergleichsBlock > summary::before {
  content: "▸"; display: inline-block; width: 1em; color: var(--ton);
  opacity: .7; transition: transform .2s; }
.ueberlagerung details[open].vergleichsBlock > summary::before { transform: rotate(90deg); }
.ueberlagerung .vergleichsBlock > summary:hover { color: #f2e7cf; }
.ueberlagerung .vergleichsBlock > *:not(summary) { margin-left: 1em; }
.ueberlagerung .fliess { margin: 0 0 .9rem; font-size: .87rem; line-height: 1.62;
  color: #ddd6c8; hyphens: auto; }
.ueberlagerung .fliess.klein { font-size: .8rem; }
.ueberlagerung table.vergleich { width: 100%; border-collapse: collapse;
  margin: 0 0 .8rem; font-size: .76rem; }
.ueberlagerung table.vergleich td { padding: .22rem .4rem .22rem 0; vertical-align: top;
  border-bottom: 1px solid rgba(236,231,220,.07); }
.ueberlagerung table.vergleich td:first-child { color: var(--ton); white-space: nowrap; }
.ueberlagerung table.vergleich td:nth-child(2) { color: #ddd6c8; }
.ueberlagerung table.vergleich td:last-child { color: #7d7568; text-align: right;
  white-space: nowrap; font-size: .7rem; }
.ueberlagerung .hinweis { margin: 0 0 .6rem; padding: .6rem .75rem;
  font-size: .74rem; line-height: 1.5; font-style: italic; color: #a89f90;
  border-left: 1px solid var(--linie); background: rgba(255,255,255,.025); }
.ueberlagerung .quelle { margin: 0 0 .8rem; font-size: .68rem; letter-spacing: .06em;
  color: #6f695d; }
.ueberlagerung .terminKopf { margin: 1.2rem 0 .5rem; font-size: .64rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ton); opacity: .8; }
.ueberlagerung a { color: var(--ton); }

#tafel .zuWeltalter { margin: 0 0 1rem; font-size: .78rem; line-height: 1.5;
  color: #a89f90; }
.alsLink { border: 0; background: none; padding: 0; font: inherit;
  color: var(--ton); text-decoration: underline; text-underline-offset: .25em;
  cursor: pointer; }
.alsLink:hover { color: #f4ecdd; }

/* ------------------------------------------------------------------ Einstieg */
#einstiegKnopf {
  margin-left: .45rem; vertical-align: .12em;
  width: 1.25rem; height: 1.25rem; padding: 0;
  border: 1px solid var(--linie); border-radius: 50%;
  background: transparent; color: var(--gedaempft);
  font: inherit; font-size: .72rem; line-height: 1; cursor: pointer;
  pointer-events: auto; transition: color .25s, border-color .25s;
}
#einstiegKnopf:hover { color: #f4ecdd; border-color: rgba(236,231,220,.45); }
#kopf { pointer-events: none; }

.einstiegListe { margin: 0 0 1.4rem; padding: 0; list-style: none; }
.einstiegListe li {
  position: relative; padding-left: 1rem; margin-bottom: .55rem;
  font-size: .84rem; line-height: 1.55; color: #c9c0b0;
}
.einstiegListe li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ton); opacity: .8;
}
.einstiegListe b { font-weight: 400; color: #f2e7cf; }
#losKnopf {
  padding: .5rem 1.6rem; border-radius: 2px;
  border: 1px solid var(--ton); background: transparent;
  color: #f2e7cf; font: inherit; font-size: .88rem; letter-spacing: .06em;
  cursor: pointer; transition: background .2s, color .2s;
}
#losKnopf:hover { background: var(--ton); color: var(--grund); }

/* ------------------------------------------------------------------- Lineal */
/* Sitzt zwischen der linken Spalte und dem Pult, damit es nichts verdeckt. */
#lineal {
  position: absolute; bottom: clamp(2.4rem, 5.5vh, 3.6rem);
  left: calc(min(24rem, 34vw) + clamp(1.1rem, 3vw, 2.6rem) + 1.6rem);
  right: 13.5rem;
  pointer-events: none;
}
#linealAchse {
  position: relative; height: 34px;
  border-bottom: 1px solid rgba(236,231,220,.26);
}
.linealMarke {
  position: absolute; bottom: 0; transform: translateX(-50%);
  width: 4px; height: 17px; padding: 0; border: 0; border-radius: 1px;
  background: var(--ton); opacity: .8; cursor: pointer;
  pointer-events: auto; transition: height .2s, opacity .2s, box-shadow .2s;
}
.linealMarke::after {                 /* größere Trefferfläche als der Strich */
  content: ""; position: absolute; inset: -6px -5px;
}
.linealMarke:hover { opacity: 1; height: 26px; box-shadow: 0 0 10px var(--ton); }
.linealMarke.aktiv {
  opacity: 1; height: 34px; width: 5px;
  box-shadow: 0 0 14px var(--ton);
}
#linealTexte { position: relative; height: 1.4rem; }
#linealTexte span {
  position: absolute; top: .3rem; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .1em; color: #8d8577; white-space: nowrap;
}
/* Ein feiner Strich führt vom Rand der Achse zur Beschriftung hinunter */
#linealTexte span::before {
  content: ""; position: absolute; left: 50%; top: -.3rem;
  width: 1px; height: .26rem; background: rgba(236,231,220,.26);
}

@media (max-width: 1100px) { #lineal { right: 11rem; } }
@media (max-width: 900px) { #lineal { display: none; } }


/* Der Schicht-Knopf gehört ans Ende: Die Regel oben setzt ihn auf none, und
   nur eine spätere Media Query darf ihn am Handy wieder einblenden. */
@media (max-width: 900px) {
  #tafelKnopf { display: inline-block; }
}

/* Das Kreuz gehört nur zum Handy-Pop-up der linken Spalte */
#spalteZuKnopf { display: none; }
@media (max-width: 900px) {
  #spalteZuKnopf {
    display: block; position: absolute; top: .2rem; right: .4rem; z-index: 2;
    pointer-events: auto;
  }
}


/* Wo die eingestellte Zeit in den anderen Überlieferungen liegt */
.weltalterTafel { margin: 0 0 1.2rem; }
.weltalterZeile {
  display: grid; grid-template-columns: 1fr; gap: .05rem;
  padding: .4rem 0; border-bottom: 1px solid rgba(236,231,220,.07);
}
.weltalterZeile .waName {
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: #9b9080;
}
.weltalterZeile .waLage { font-size: .86rem; color: #f2e7cf; }
.weltalterZeile .waNote { font-size: .74rem; color: #7d7568; }
.weltalterZeile .waNote b { font-weight: 400; color: #a99d88; }
.weltalterZeile:first-child { border-left: 2px solid var(--ton); padding-left: .6rem; }
.weltalterZeile:first-child .waLage { color: #fff2d0; font-size: .95rem; }
.weltalterKopfZeile { margin-top: 1.4rem; }

/* Der Streifen unter der Kugel — am Handy läuft hier die Schicht immer mit */
#streifen { display: none; }
@media (max-width: 900px) {
  #streifen {
    --ton: #e8b95c;
    display: flex; flex-direction: column; gap: .1rem; text-align: left;
    position: absolute; left: .5rem; right: .5rem; z-index: 4;
    bottom: calc(var(--zeitHoehe, 157px) + 1.6rem + .5rem);
    padding: .4rem .7rem .45rem;
    background: linear-gradient(160deg, rgba(10,13,22,.78), rgba(6,8,14,.62));
    border: 1px solid var(--linie); border-left: 2px solid var(--ton);
    border-radius: 3px; color: #c2b8a7; font: inherit; cursor: pointer;
    backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
    transition: border-color .25s;
  }
  #streifen.an { border-color: rgba(236,231,220,.34); border-left-color: var(--ton); }
  /* Steht eine Tafel offen, sagt sie dasselbe ausführlicher — der Streifen tritt ab */
  #linkeSpalte.auf ~ #streifen,
  #deutung:not([hidden]) ~ #streifen,
  #einstieg:not([hidden]) ~ #streifen { display: none; }
  #streifenSchicht {
    font-size: .58rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--ton); opacity: .85;
  }
  #streifenStand {
    font-size: .88rem; color: #f2e7cf; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #streifenChronik {
    font-size: .68rem; color: #7d7568; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}

/* ------------------------------------------------------------- Der Anflug */
#anflug {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 1.2rem clamp(3rem, 12vh, 7rem);
  text-align: center;
}
#anflug[hidden] { display: none; }
#anflugTitel {
  margin: 0 0 .35rem; font-size: clamp(1.5rem, 5vw, 2.6rem); font-weight: 400;
  letter-spacing: .04em; color: #f4ecdd; line-height: 1.1;
  text-shadow: 0 0 30px rgba(0,0,0,.9);
  transition: opacity .5s;
}
#anflugUnten {
  margin: 0; font-size: clamp(.74rem, 2.4vw, .92rem); line-height: 1.5;
  letter-spacing: .04em; color: #a99d88; max-width: 28rem;
  text-shadow: 0 0 20px rgba(0,0,0,.9);
  transition: opacity .5s;
}
#anflugMarke {
  position: absolute; margin: 0; font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: #cfc6b6; white-space: nowrap;
  text-shadow: 0 0 14px rgba(0,0,0,.95); opacity: 0;
  transition: opacity .35s;
}
#anflugZu {
  position: absolute; top: clamp(.9rem, 3vh, 1.6rem); right: clamp(.8rem, 3vw, 1.8rem);
  pointer-events: auto;
  padding: .5rem .9rem; border-radius: 2px;
  border: 1px solid var(--linie); background: rgba(10,13,22,.6);
  color: #ddd5c6; font: inherit; font-size: .72rem; letter-spacing: .08em;
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#anflugZu:hover { border-color: rgba(236,231,220,.4); color: #f4ecdd; }

/* Während des Anflugs tritt alle Bedienung ab */
body.fliegt #kopf, body.fliegt #leiste, body.fliegt #streifen,
body.fliegt #zeitleiste, body.fliegt #linkeSpalte, body.fliegt #pult,
body.fliegt #lineal, body.fliegt #hinweisZeile { opacity: 0; pointer-events: none; }
#kopf, #leiste, #streifen, #zeitleiste, #linkeSpalte, #pult, #lineal {
  transition: opacity .8s;
}

/* Die Aufschrift über dem Schieber — sagt, was man da in der Hand hat */
#zeitMarke {
  margin: 0 0 .3rem; font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ton, #e8b95c); opacity: .78;
}
@media (max-width: 900px) {
  #zeitleiste #zeitMarke { order: 0; margin: 0 0 .35rem; }
}

/* Loslegen und der Anflug noch einmal stehen nebeneinander */
.einstiegKnoepfe { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0 0; }
#anflugNochmal {
  padding: .6rem 1.1rem; border-radius: 2px;
  border: 1px solid var(--linie); background: transparent;
  color: var(--gedaempft); font: inherit; font-size: .78rem; letter-spacing: .06em;
  cursor: pointer; transition: color .25s, border-color .25s;
}
#anflugNochmal:hover { color: #f4ecdd; border-color: rgba(236,231,220,.4); }

/* Der Schalter am Ende der Punktleiste: elf oder alle sechzehn */
.stufe.mehrSchalen { --ton: #8d8577; }
.stufe.mehrSchalen .mehrZeichen {
  display: flex; align-items: center; justify-content: center;
  width: 100%; font-size: calc(var(--zeile) * .30);
  color: var(--ton); letter-spacing: 0;
}
@media (max-width: 900px) {
  .stufe.mehrSchalen .mehrZeichen { font-size: .62rem; }
}
.stufe.mehrSchalen:hover .mehrZeichen { color: #ded6c7; }
/* Stillgelegte Schalen bleiben im Lineal stehen, aber blass */
.linealMarke.still { opacity: .2; pointer-events: none; }
