/* Geisterarchiv – Wirkraum. Pergament und Kerzenlicht. */
:root {
  --nacht: #0a0604;
  --wand: #1d130b;
  --pergament: #e4cf9f;
  --tinte: #2b1a0e;
  --tinte-blass: rgba(43, 26, 14, .16);
  --rubrik: #9a2c1b;
  --gold: #c9a352;
  --gold-hell: #ecd28f;
  --ui: #ead9b3;
  --ui-leise: rgba(234, 217, 179, .62);

  --kopf-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nacht); }
body {
  color: var(--ui);
  font-family: "Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

/* ---------- Raum ---------- */
.raum {
  position: relative;
  height: 100vh; height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #070403;
}
.szene, .szene img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.szene { z-index: 0; }
.szene img { inset: auto; } /* Größe und Lage setzt das Skript (unten verankert, der Altar ist immer zu sehen) */
.szene::after { /* oberer Bildrand läuft weich ins Dunkel aus */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--szene-oben, 0px) + 22vh);
  background: linear-gradient(#070403 0, #070403 var(--szene-oben, 0px), rgba(7, 4, 3, 0) 100%);
}

/* ---------- Kopf ---------- */
.kopf {
  position: absolute; z-index: 30; left: 0; right: 0; top: 0; height: var(--kopf-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.marke {
  font-family: "Fraktur", serif; font-size: 25px; letter-spacing: .02em;
  color: var(--gold); text-decoration: none; opacity: .82;
  text-shadow: 0 0 18px rgba(255, 180, 80, .25);
}
.kopf-rechts { display: flex; gap: 10px; align-items: center; }
.knopf-klein {
  background: none; border: 0; cursor: pointer; padding: 6px 4px;
  font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 17px;
  color: var(--ui-leise);
}
.knopf-klein:hover { color: var(--ui); }
.klang-schalter {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; padding: 8px;
  background: rgba(20, 12, 6, .45); border: 1px solid rgba(201, 163, 82, .3); color: var(--gold);
}
.klang-schalter svg { width: 100%; height: 100%; display: block; }
.klang-schalter .aus { display: none; }
.klang-schalter[aria-pressed="false"] .welle { display: none; }
.klang-schalter[aria-pressed="false"] .aus { display: inline; }

/* ---------- Bühne & Pergament ---------- */
.buehne {
  position: absolute; z-index: 2; left: 0; right: 0;
  top: var(--kopf-h); bottom: var(--perg-unten, 30%);
  display: flex; justify-content: center; align-items: stretch;
  padding: 4px 16px 0;
}
.pergament {
  position: relative;
  width: min(100%, var(--perg-breite, 600px));
  max-height: 100%;
  margin-bottom: 6px;
  color: var(--tinte);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .6)) drop-shadow(0 2px 3px rgba(0, 0, 0, .5)) sepia(.14) brightness(.9);
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity 3.2s ease, transform 3.2s cubic-bezier(.2, .7, .2, 1);
}
.phase-raum .pergament, body:not(.phase-schwelle) .pergament { opacity: 1; transform: none; }
.pergament, .karte { background: url("bild/pergament.webp") center / 100% 100% no-repeat; }
.pergament-haut { display: none; } /* gezeichnetes Pergament nur noch als Rückfall im Code */
.pergament-inhalt {
  position: relative;
  height: 100%;
  padding: clamp(26px, 5.5vh, 52px) clamp(26px, 7%, 54px) clamp(34px, 6vh, 56px);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.rubrik {
  margin: 0 0 .35em;
  font-family: "Garamond", serif; font-weight: 500;
  font-variant: small-caps; letter-spacing: .09em; font-size: clamp(12px, 1.6vh + 4px, 15px);
  color: var(--rubrik); opacity: .9; text-align: center;
}
.spruch-titel {
  margin: 0; text-align: center;
  font-family: "Fraktur", serif; font-weight: 400;
  font-size: clamp(38px, 6.4vh + 10px, 68px); line-height: 1.02;
  color: var(--tinte);
  text-shadow: 0 0 1px rgba(43, 26, 14, .4);
}
.anliegen {
  margin: .5em auto 0; max-width: 30em; text-align: center;
  font-style: italic; font-size: clamp(14px, 1.4vh + 7px, 18px); line-height: 1.35;
  color: rgba(43, 26, 14, .78);
}
.verse {
  margin: clamp(14px, 3.2vh, 34px) 0 0;
  border-top: 1px solid rgba(154, 44, 27, .28);
  padding-top: clamp(10px, 2.4vh, 24px);
}
.vers { margin: 0 0 clamp(6px, 1.5vh, 14px); }
.orig {
  display: block;
  font-family: "Alegreya", Georgia, serif; font-weight: 500;   /* 11.10.: statt Unziale, für junge Leute lesbar */
  font-size: clamp(17px, 2.3vh + 4px, 26px); line-height: 1.24;
  color: var(--tinte);
  transition: color 2.4s ease, text-shadow 2.4s ease, filter 2.4s ease, opacity 2.4s ease;
}
.glosse {
  display: block; margin-top: .1em;
  font-style: italic; font-size: clamp(14.5px, 1.4vh + 7px, 19px); line-height: 1.25;   /* 11.10.: größer (Olaf: „sehr klein“) */
  color: rgba(43, 26, 14, .74);
  transition: opacity 2.4s ease;
}
.vers.erster .orig::first-letter {
  float: left;
  font-family: "Fraktur", serif; font-size: 3.05em; line-height: .78;
  margin: .06em .12em 0 -.04em;
  color: var(--rubrik);
  text-shadow: .02em .02em 0 rgba(201, 163, 82, .55);
}
.vers.formel .orig { color: var(--rubrik); }
.widmung {
  margin: 14px 0 0; padding-top: 6px; min-height: 1.4em;
  font-family: "Cormorant", serif; font-style: italic; font-weight: 500;
  font-size: clamp(17px, 1.6vh + 8px, 22px); color: var(--rubrik);
  opacity: 0; transition: opacity 2.6s ease;
}
.widmung.sichtbar { opacity: 1; }

/* Ungewirkte Verse: blass vorgezeichnet, wie mit Silberstift */
.wirken-bereit .vers .orig { color: var(--tinte-blass); text-shadow: none; }
.wirken-bereit .vers.formel .orig { color: rgba(154, 44, 27, .2); }
.wirken-bereit .vers.erster .orig::first-letter { color: rgba(154, 44, 27, .22); text-shadow: none; }
.wirken-bereit .glosse { opacity: .18; }
.wirken-bereit .vers.geschrieben .orig { color: var(--tinte); animation: tinte 2.6s ease both; }
.wirken-bereit .vers.formel.geschrieben .orig { color: var(--rubrik); }
.wirken-bereit .vers.erster.geschrieben .orig::first-letter { color: var(--rubrik); text-shadow: .02em .02em 0 rgba(201, 163, 82, .55); }
.wirken-bereit .vers.geschrieben .glosse { opacity: 1; transition-delay: 1.4s; }
@keyframes tinte {
  0% { filter: blur(2.5px); opacity: .3; letter-spacing: .03em; }
  60% { filter: blur(.3px); opacity: .95; }
  100% { filter: none; opacity: 1; letter-spacing: 0; }
}
.formel-aktiv .verse, .formel-aktiv .anliegen { opacity: .2; transition: opacity 1.6s ease; }
.verse, .anliegen { transition: opacity 1.6s ease; }

/* Formel-Bühne: die Lösung, dreimal gesprochen */
.formel-buehne {
  position: absolute; left: 8%; right: 8%; top: 46%; transform: translateY(-50%);
  text-align: center; pointer-events: none;
  isolation: isolate;
}
.formel-buehne::before { /* heller Pergamentschleier, der die Verse dahinter zurücknimmt */
  content: ""; position: absolute; left: -9%; right: -9%; top: -55%; bottom: -55%; z-index: -1;
  background: radial-gradient(closest-side, rgba(233, 213, 168, .96), rgba(233, 213, 168, .8) 55%, rgba(233, 213, 168, 0));
  opacity: 0; transition: opacity 1.8s ease;
}
.formel-aktiv .formel-buehne::before { opacity: 1; }
.formel-zeile {
  margin: 0;
  font-family: "Alegreya", Georgia, serif; font-weight: 500; font-size: clamp(25px, 3.8vh + 8px, 44px); line-height: 1.2;
  color: var(--rubrik);
  opacity: 0; filter: blur(6px); transform: scale(.97);
  transition: opacity 2.2s ease, filter 2.2s ease, transform 6s ease;
}
.formel-zeile.an { opacity: 1; filter: none; transform: scale(1.02); }
.formel-zaehler {
  margin: .6em 0 0; font-family: "Garamond", serif; font-variant: small-caps; letter-spacing: .3em;
  font-size: 14px; color: rgba(154, 44, 27, .7); opacity: 0; transition: opacity 1.2s;
}
.formel-zaehler.an { opacity: 1; }
/* Siegel aus dem 6. und 7. Buch Mosis: groß und blass hinter der Formel, dreht sich kaum merklich */
.formel-siegel {
  position: absolute; left: 50%; top: 50%; z-index: -1; width: 112%; max-width: none; height: auto;
  transform: translate(-50%, -50%) rotate(-1.5deg) scale(.94);
  opacity: 0; filter: blur(1.5px);
  transition: opacity 2.6s ease, filter 2.6s ease, transform 14s ease-out;
}
.formel-aktiv .formel-siegel { opacity: .24; filter: none; transform: translate(-50%, -50%) rotate(.8deg) scale(1.02); }
.formel-aktiv .formel-siegel.glimmt { opacity: .34; transition: opacity .5s ease, transform 14s ease-out; }

/* Siegel */
.siegel-platz {
  position: absolute; right: 9%; bottom: -14px;
  width: clamp(62px, 9vh, 88px); aspect-ratio: 1; pointer-events: none;
}
.siegel-platz svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(1px 3px 3px rgba(40, 10, 4, .55)); }
.siegel-platz.gesetzt svg { animation: siegel 1.1s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes siegel {
  0% { transform: scale(1.8) rotate(-14deg); opacity: 0; }
  55% { transform: scale(.94) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---------- Hinweis & Wahl ---------- */
.hinweis { /* Lage per JS: unter der Schale (quer) oder zwischen den Kerzen über der Schale (hoch) */
  position: absolute; z-index: 30; left: 50%; transform: translateX(-50%);
  top: var(--hinweis-oben, auto); bottom: var(--hinweis-unten, auto);
  width: min(100% - 32px, 620px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  pointer-events: none;
}
.hinweis::before { /* weicher Schatten, damit der Text auch über dem Pergament lesbar bleibt */
  content: ""; position: absolute; inset: -14px -10%; z-index: -1;
  background: radial-gradient(closest-side, rgba(8, 5, 3, .62), rgba(8, 5, 3, 0));
  opacity: 0; transition: opacity 1s;
}
.hinweis:has(.hinweis-text.an)::before, .hinweis:has(.wahl:not(:empty))::before { opacity: 1; }
.hinweis-text {
  margin: 0; max-width: 34em;
  font-family: "Cormorant", serif; font-style: italic; font-weight: 500;
  font-size: clamp(18px, 1.5vh + 9px, 23px); line-height: 1.25;
  color: var(--ui);
  text-shadow: 0 0 14px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .9);
  opacity: 0; transition: opacity 1.1s ease;
}
.hinweis-text.an { opacity: 1; }
.wahl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: auto; }
.wahl:empty { display: none; }
.marke-wahl, .knopf {
  cursor: pointer;
  padding: 7px 15px 8px;
  background: rgba(18, 11, 6, .72);
  border: 1px solid rgba(201, 163, 82, .42);
  border-radius: 2px;
  font-family: "Cormorant", serif; font-weight: 600; font-size: 17px; letter-spacing: .02em;
  color: var(--ui);
  box-shadow: inset 0 0 0 3px rgba(18, 11, 6, .72), inset 0 0 0 4px rgba(201, 163, 82, .14);
  transition: border-color .3s, color .3s, box-shadow .3s, background .3s;
}
.marke-wahl small { display: block; font-family: "Garamond", serif; font-style: italic; font-weight: 400; font-size: 12.5px; color: var(--ui-leise); letter-spacing: 0; }
.marke-wahl:hover, .knopf:hover, .marke-wahl:focus-visible, .knopf:focus-visible {
  border-color: var(--gold); color: var(--gold-hell); outline: none;
  box-shadow: inset 0 0 0 3px rgba(18, 11, 6, .72), inset 0 0 0 4px rgba(201, 163, 82, .35), 0 0 18px rgba(255, 180, 80, .18);
}
.name-feld { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.name-feld input {
  width: 11em; padding: 4px 2px; background: transparent;
  border: 0; border-bottom: 1px solid rgba(201, 163, 82, .55); border-radius: 0;
  font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 22px; color: var(--gold-hell);
  text-align: center; outline: none;
}
.name-feld input::placeholder { color: rgba(234, 217, 179, .35); }

/* ---------- Altar: Kerzen und Schale stehen im Bild, hier liegen nur Flammen und Tippflächen ---------- */
.altar { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.kerze { position: absolute; width: 0; height: 0; } /* Nullpunkt = Dochtspitze im Bild, per JS gesetzt */
.kerze-tippen {
  position: absolute; left: 0; top: 0; width: var(--tipp-b, 80px); height: var(--tipp-h, 160px);
  transform: translate(-50%, -38%);
  background: none; border: 0; cursor: pointer; border-radius: 40px; pointer-events: auto;
}
.kerze-tippen:focus-visible { outline: 1px dashed rgba(201, 163, 82, .6); }
.kerze.brennt .kerze-tippen { pointer-events: none; }
body.phase-schwelle .kerze-tippen { pointer-events: none; }
.flamme {
  position: absolute; left: 50%; bottom: 6px;
  width: 20px; height: 50px; margin-left: -10px;
  transform-origin: 50% 92%;
  pointer-events: none;
}
.kerze .flamme {
  bottom: 0; width: var(--fl-b); height: var(--fl-h); margin-left: calc(var(--fl-b) / -2);
  opacity: 0; transform: scale(.2, .1); transition: opacity .35s ease;
}
.kerze.brennt .flamme { opacity: 1; }
.flamme i { position: absolute; display: block; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; }
.flamme-mantel {
  inset: 0;
  background: radial-gradient(ellipse 50% 60% at 50% 70%, rgba(255, 200, 110, .95) 0%, rgba(255, 140, 40, .75) 45%, rgba(220, 70, 10, 0) 75%);
  filter: blur(1.6px);
}
.flamme-kern {
  left: 26%; right: 26%; top: 34%; bottom: 8%;
  background: radial-gradient(ellipse 50% 60% at 50% 66%, #fffbea 0%, #fff0b8 45%, rgba(255, 220, 140, 0) 100%);
  filter: blur(.8px);
}
.flamme-blau {
  left: 32%; right: 32%; bottom: 3%; height: 18%;
  background: radial-gradient(ellipse at 50% 70%, rgba(110, 140, 255, .75), rgba(60, 90, 220, 0) 70%);
  filter: blur(.6px);
}

/* Schale */
.schale { position: absolute; width: 0; height: 0; pointer-events: none; }
.kohle-glut { /* glühende Kohle in der Schale aus dem Bild */
  position: absolute; left: 0; top: 0; width: var(--sb, 90px); height: calc(var(--sb, 90px) * .26);
  transform: translate(-50%, -62%); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 196, 110, .95) 0%, rgba(240, 92, 30, .8) 38%, rgba(140, 26, 6, .35) 70%, rgba(80, 10, 0, 0) 100%);
  mix-blend-mode: screen; opacity: var(--kohle, 0);
  filter: blur(calc(var(--sb, 90px) * .02));
}

/* ---------- Licht-Ebenen ---------- */
.lichtkarte, .rauch, .glut { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
.lichtkarte { z-index: 4; }
.rauch { z-index: 5; }
.glut { z-index: 8; mix-blend-mode: screen; }
/* Flammen und Kerzen liegen über der Lichtkarte (z 6), der Rauch zieht davor und dahinter */

/* ---------- Schwelle ---------- */
.schwelle {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; text-align: center;
  background: radial-gradient(ellipse 40% 35% at 50% 40%, rgba(60, 34, 14, .55) 0%, rgba(10, 6, 4, 0) 70%), var(--nacht);
  transition: opacity 2.4s ease, visibility 0s linear 2.4s;
}
.schwelle.weg { opacity: 0; visibility: hidden; }
.schwelle-licht { position: relative; width: 60px; height: 78px; margin-bottom: 18px; }
.schwelle-licht::before {
  content: ""; position: absolute; left: 50%; top: 52%; width: 340px; height: 340px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 170, 80, .22) 0%, rgba(255, 140, 50, .06) 35%, rgba(0, 0, 0, 0) 65%);
  animation: atmen 5s ease-in-out infinite;
}
.schwelle-licht .flamme { opacity: 1; transform: none; bottom: 10px; animation: flackern 3.1s ease-in-out infinite; }
.schwelle-licht::after { /* Lichtstumpf */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 22px; height: 12px; margin-left: -11px; border-radius: 2px 2px 4px 4px;
  background: linear-gradient(90deg, #3f2709, #c9973f 40%, #f0d08a 50%, #8a5c22 80%, #2d1b07);
}
@keyframes atmen { 50% { opacity: .65; transform: translate(-50%, -50%) scale(.93); } }
@keyframes flackern {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  20% { transform: scale(.96, 1.06) skewX(2deg); }
  45% { transform: scale(1.03, .95) skewX(-1.5deg); }
  70% { transform: scale(.98, 1.04) skewX(1deg); }
}
.schwelle-marke {
  margin: 0; font-family: "Fraktur", serif; font-size: clamp(46px, 11vw, 92px); line-height: 1;
  color: var(--gold); letter-spacing: .01em;
  text-shadow: 0 0 30px rgba(255, 170, 70, .28), 0 2px 0 rgba(0, 0, 0, .6);
  background: linear-gradient(180deg, #f3dc9e 0%, #c9a352 55%, #8e6a2c 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.schwelle-unter {
  margin: .5em 0 2.2em; font-family: "Cormorant", serif; font-style: italic; font-weight: 500;
  font-size: clamp(18px, 4.4vw, 25px); color: var(--ui-leise);
}
.eintreten {
  position: relative; cursor: pointer;
  padding: 12px 34px; background: transparent;
  border: 1px solid rgba(201, 163, 82, .55);
  font-family: "Garamond", serif; font-weight: 500; font-variant: small-caps; letter-spacing: .28em;
  font-size: 18px; color: var(--gold-hell);
  transition: box-shadow .5s, border-color .5s, color .5s;
}
.eintreten::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid rgba(201, 163, 82, .22); pointer-events: none;
}
.eintreten:hover, .eintreten:focus-visible {
  outline: none; border-color: var(--gold); color: #fff3d0;
  box-shadow: 0 0 28px rgba(255, 170, 70, .22), inset 0 0 18px rgba(255, 170, 70, .1);
}
.mit-klang {
  margin-top: 16px; font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 16px;
  color: var(--ui-leise); cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.mit-klang input { accent-color: #b48a52; }

/* ---------- Karte ---------- */
.karte-dialog {
  position: absolute; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 16px;
  background: rgba(6, 4, 2, .78);
  backdrop-filter: blur(3px);
  animation: einblenden 1.4s ease both;
}
.karte-dialog[hidden] { display: none; }
@keyframes einblenden { from { opacity: 0; } }
.karte {
  position: relative; width: min(92vw, 380px, calc((100svh - 120px) * .8)); aspect-ratio: 4 / 5;
  color: var(--tinte);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7));
  container-type: inline-size;
}
.karte-inhalt {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  padding: 10cqi 11cqi 8cqi;
}
.karte-oben, .karte-mitte, .karte-unten { display: flex; flex-direction: column; align-items: center; width: 100%; }
.karte .rubrik { font-size: 3.3cqi; margin: 0; }
.karte-titel { margin: .12em 0 0; font-family: "Fraktur", serif; font-size: 15.5cqi; line-height: 1; }
.karte-quelle { margin: .35em 0 0; font-style: italic; font-size: 3.5cqi; color: rgba(43, 26, 14, .62); }
.zier { position: relative; width: 46%; height: 2cqi; margin: 1.2cqi 0; }
.zier::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(154, 44, 27, .45); }
.zier::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.6cqi; height: 1.6cqi; transform: translate(-50%, -50%) rotate(45deg); background: var(--rubrik); box-shadow: 0 0 0 1.2cqi #e2c993; }
.karte-formel { margin: .55em 0 0; font-family: "Alegreya", Georgia, serif; font-weight: 500; font-size: 7cqi; line-height: 1.22; color: var(--rubrik); }
.karte-glosse { margin: .5em 0 .6em; font-style: italic; font-size: 4.3cqi; line-height: 1.3; color: rgba(43, 26, 14, .74); }
.karte-widmung { margin: 0 0 1.5cqi; font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 6.4cqi; color: var(--rubrik); }
.karte-siegelzeile { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3cqi; width: 100%; }
.karte-zutat { display: flex; flex-direction: column; align-items: center; gap: .6cqi; }
.karte-zutat svg { width: 12cqi; height: auto; display: block; }
.karte-zutat span { font-size: 3.2cqi; font-variant: small-caps; letter-spacing: .08em; color: rgba(43, 26, 14, .7); }
.karte-siegel { width: 17cqi; aspect-ratio: 1; }
.karte-siegel svg { width: 100%; height: 100%; display: block; filter: drop-shadow(.4cqi .8cqi .7cqi rgba(40, 10, 4, .5)); }
.karte-marke { margin: 2.2cqi 0 0; font-family: "Fraktur", serif; font-size: 4.6cqi; color: rgba(43, 26, 14, .66); }
.karte-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .schwelle-licht .flamme, .schwelle-licht::before { animation: none; }
  .pergament { transition-duration: .6s; }
}
@media (max-height: 640px) {
  .anliegen { display: none; }
}

/* ---------- Handy: dichter setzen, damit alle vier Verse auf das Pergament passen ---------- */
@media (max-width: 600px) {
  :root { --kopf-h: 46px; }
  .marke { font-size: 22px; }
  .pergament-inhalt { padding: 22px 20px 30px; }
  .rubrik { font-size: 11px; letter-spacing: .06em; }
  .spruch-titel { font-size: clamp(36px, 11.5vw, 50px); }
  .anliegen { font-size: 14.5px; margin-top: .35em; }
  .pergament-inhalt { justify-content: center; }
  .orig { font-size: clamp(16px, 4.9vw, 20px); line-height: 1.18; }
  .glosse { font-size: 14.5px; line-height: 1.22; }
  .vers.erster .orig::first-letter { font-size: 2.7em; }
  .widmung { font-size: 18px; padding-top: 6px; margin-top: 10px; }
  .verse { margin-top: 18px; padding-top: 14px; }
  .vers { margin-bottom: 10px; }
  .formel-zeile { font-size: clamp(22px, 7vw, 30px); }
  .hinweis-text { font-size: 18px; }
  .marke-wahl { padding: 6px 12px 7px; font-size: 16px; }
}
@media (max-width: 600px) {
  .marke-wahl small { display: none; }  /* auf dem Handy nur der Name des Krauts, damit die Wahl in eine schmale Zeile passt */
  .wahl { gap: 6px; }
}

/* ---------- Hochformat: Hinweise als rote Randnotiz unten auf dem Pergament ---------- */
.hinweis-pergament .anliegen { font-size: 14px; }
.hinweis-pergament .rubrik-zusatz { display: none; }
.hinweis-pergament .pergament-inhalt { padding-top: 18px; padding-bottom: 44px; }
.hinweis-pergament .spruch-titel { font-size: clamp(34px, 10.5vw, 46px); }
.hinweis-pergament .verse { margin-top: 10px; padding-top: 10px; }
.hinweis-pergament .vers { margin-bottom: 7px; }
.hinweis-pergament .orig { font-size: clamp(15px, 4.5vw, 18.5px); }
.hinweis-pergament .glosse { font-size: 14px; }
.hinweis-pergament .widmung { margin-top: 6px; padding-top: 2px; font-size: 17px; }
.hinweis-pergament .hinweis::before { display: none; }
.hinweis-pergament .hinweis-text { color: var(--rubrik); text-shadow: none; font-size: 18px; }
.hinweis-pergament .siegel-platz { bottom: -20px; right: 3%; width: 62px; }
.hinweis-pergament .name-feld input { color: var(--tinte); border-bottom-color: rgba(154, 44, 27, .5); }
.hinweis-pergament .name-feld input::placeholder { color: rgba(43, 26, 14, .4); }

/* ---------- Sonderformen: Abracadabra-Dreieck und Sator-Quadrat ---------- */
.form-dreieck .verse, .form-quadrat .verse { text-align: center; }
.vers.zeile { margin: 0; }
.vers.zeile .orig { font-weight: 600; letter-spacing: .22em; line-height: 1.32; }
.form-dreieck .vers.zeile .orig { font-size: clamp(15px, 1.9vh + 4px, 22px); }
.form-quadrat .vers.zeile .orig { font-size: clamp(20px, 2.6vh + 6px, 30px); letter-spacing: .38em; line-height: 1.4; }
.vers.zeile .glosse { margin-top: .8em; }
.form-dreieck .vers.zeile:first-child .orig, .form-quadrat .vers.zeile .orig { color: var(--tinte); }
.wirken-bereit .vers.zeile.geschrieben .orig { color: var(--rubrik); }

/* ---------- Kartenbild-Dialog: Formatwahl, echtes Bild als Vorschau ---------- */
.karte-format { display: flex; gap: 6px; }
.format-knopf { cursor: pointer; padding: 5px 12px; background: rgba(18, 11, 6, .6); border: 1px solid rgba(201, 163, 82, .3); border-radius: 2px;
  font-family: "Cormorant", serif; font-weight: 600; font-size: 15px; color: var(--ui-leise); }
.format-knopf[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hell); box-shadow: 0 0 12px rgba(255, 180, 80, .15); }
.karte-bild { display: block; width: auto; height: auto; max-width: min(92vw, 440px); max-height: calc(100svh - 200px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7); animation: einblenden .8s ease both; }
.karte-bild.story { max-width: min(80vw, 330px); }
.karte-bild[hidden] { display: none; }
.knopf.haupt { border-color: var(--gold); color: var(--gold-hell); }

/* ---------- Pause, Abbrechen, Karte schließen ---------- */
.karte-schliessen { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: rgba(18, 11, 6, .75); border: 1px solid rgba(201, 163, 82, .45); color: var(--gold-hell); font-size: 20px; line-height: 1; }
.karte-schliessen:hover, .karte-schliessen:focus-visible { border-color: var(--gold); outline: none; box-shadow: 0 0 14px rgba(255, 180, 80, .2); }
body.pausiert .vers.geschrieben .orig, body.pausiert .formel-zeile { animation-play-state: paused; }
body.pausiert .hinweis-text { opacity: .35; }
#pause[aria-pressed="true"] { color: var(--gold-hell); }
@media (max-width: 420px) { .kopf-rechts { gap: 4px; } .knopf-klein { font-size: 15px; padding: 6px 2px; } .marke { font-size: 20px; } }

/* Impressum/Datenschutz von jeder Seite erreichbar: dezent unten links, über dem Altar */
.rechtliches {
  position: absolute; z-index: 55; left: 12px; bottom: max(6px, env(safe-area-inset-bottom)); margin: 0;
  font-family: "Garamond", serif; font-size: 12.5px; color: rgba(234, 217, 179, .45);
}
.rechtliches a { color: inherit; text-decoration: none; }
.rechtliches a:hover, .rechtliches a:focus-visible { color: var(--gold-hell); text-decoration: underline; }

/* Widmung („Für … gewirkt.“) mittig unter den Versen (Olaf 11.10.) */
.widmung { text-align: center; }

/* Logo oben links: Signet (Nische mit Kerze) + Fraktur-Wortmarke */
.marke { display: inline-flex; align-items: center; gap: 8px; }
.marke .signet { width: 38px; height: 38px; display: block; filter: drop-shadow(0 0 8px rgba(255, 170, 70, .3)); }
@media (max-width: 420px) { .marke .signet { width: 32px; height: 32px; } .marke { gap: 6px; } }

/* Link zur Bibliothek oben rechts; während des Wirkens stehen dort Pause/Abbrechen/Überspringen */
#zur-bibliothek { text-decoration: none; }
.phase-wirken #zur-bibliothek { display: none; }

/* Handy: während des Wirkens nur das Signet zeigen, damit Pause/Abbrechen/Überspringen Platz haben */
@media (max-width: 480px) { .phase-wirken .marke-text { display: none; } }

/* Einstellungen: Zahnrad oben rechts (nicht während des Wirkens), Textlink auf der Schwelle */
.phase-wirken #einstellungen-knopf { display: none; }
.einst-link { margin-top: 10px; background: none; border: 0; cursor: pointer; font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 16px; color: var(--ui-leise); text-decoration: underline; text-underline-offset: 3px; }
.einst-link:hover, .einst-link:focus-visible { color: var(--gold-hell); outline: none; }
/* Textausschnitt statt Siegel (Engelsegen: General-Citation): blasser, damit die Formel lesbar bleibt */
.formel-aktiv .formel-siegel.text { opacity: .13; }
.formel-aktiv .formel-siegel.text.glimmt { opacity: .19; }
/* Viele Optionen (8 Räucherwerke, 12.10.): kompakt in Viererreihen */
.wahl.viele { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 6px; }
.wahl.viele .marke-wahl { padding: 5px 11px 6px; font-size: 16px; }
.wahl.viele .marke-wahl small { font-size: 12px; }
.hinweis { transition: margin-top .4s ease; }
@media (max-width: 420px) { .wahl.viele { gap: 5px; } .wahl.viele .marke-wahl { padding: 5px 7px 6px; font-size: 15px; } }

/* Siegel zum Mitnehmen (13.10.): eigenes Fenster, gleiche Gestalt wie das Kartenfenster */
.siegel-format { cursor: pointer; padding: 5px 12px; background: rgba(18, 11, 6, .6); border: 1px solid rgba(201, 163, 82, .3); border-radius: 2px;
  font-family: "Cormorant", serif; font-weight: 600; font-size: 15px; color: var(--ui-leise); }
.siegel-format[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hell); box-shadow: 0 0 12px rgba(255, 180, 80, .15); }
.siegel-dialog-titel { margin: 0; font-family: "Fraktur", serif; font-size: clamp(26px, 4vh, 34px); color: var(--gold-hell); text-align: center; }
.siegel-hinweis { margin: -6px 0 0; max-width: 26em; text-align: center; font-family: "Cormorant", serif; font-style: italic; font-size: 17px; color: var(--ui-leise); }
#siegel-bild { max-height: calc(100svh - 270px); }
#siegel-bild.druck { max-width: min(86vw, 380px); }

/* Dein eigenes Siegel (13.10.): brennt sich beim Wirken in das Pergament ein (vorher leer) */
.vers.siegel-zeile { margin: clamp(4px, 1vh, 10px) 0; text-align: center; }
.vers.siegel-zeile canvas { width: clamp(120px, 26vh, 240px); height: auto; aspect-ratio: 1; display: inline-block; filter: drop-shadow(0 0 0 rgba(255, 140, 40, 0)); transition: filter 2.5s ease; }
.vers.siegel-zeile.brennt canvas { filter: drop-shadow(0 0 14px rgba(255, 140, 40, .45)); transition-duration: 1.5s; }   /* warmer Schein, solange es glüht */

