/* Der Nibelungenhort — Gestaltung.
   Herausgelöst aus index.html; Aufbau und Begründungen siehe docs/DESIGN.md. */

/* ─────────────────────────────────────────────────────────────
   DER NIBELUNGENHORT — Welt & Tokens
   ───────────────────────────────────────────────────────────── */
:root{
  /* Grund: Höhlendunkel mit Purpurstich, aus dem Drachen des Logos */
  --cave-900:#0C0712;
  --cave-800:#140D1E;
  --cave-700:#1D1329;
  --cave-600:#2A1B3B;

  /* Drache */
  --dragon-700:#4A2263;
  --dragon-500:#7A3E9D;
  --dragon-300:#A96FCB;

  /* Rune (Lettering des Logos) */
  --rune-700:#1F6B33;
  --rune-500:#2F8F46;
  --rune-300:#5FCB77;

  /* Hort */
  --gold-700:#8E6316;
  --gold-500:#C9942A;
  --gold-400:#E9B83A;
  --gold-200:#F6DD9C;
  --ember:#FF9A3C;

  /* Truhe */
  --chest-wood:#4A2F1C;
  --chest-wood-dark:#2E1B0E;
  --chest-iron:#3A3340;
  --chest-lining:#8E1F2A;

  /* Schrift auf Dunkel */
  --ink-100:#F3EADA;
  --ink-70:#CBBBA4;
  --ink-45:#9C8B78;

  --parchment:#EADBB8;
  --parchment-ink:#2D2013;

  /* Bewegung */
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-out-soft:cubic-bezier(.23,1,.32,1);
  --ease-in-out:cubic-bezier(.77,0,.175,1);
  --ease-lid:cubic-bezier(.32,.72,0,1);

  --shadow-deep:0 24px 60px -18px rgba(0,0,0,.85), 0 4px 14px -4px rgba(0,0,0,.6);
  --lamp-gold:0 10px 34px -12px rgba(233,184,58,.5), 0 2px 6px -2px rgba(0,0,0,.6);
}

*,*::before,*::after{box-sizing:border-box}
button,a{touch-action:manipulation}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  min-height:100svh;
  background:var(--cave-900);
  color:var(--ink-100);
  font-family:"Cormorant Garamond",Georgia,"Times New Roman",serif;
  font-size:clamp(1.15rem,1.02rem + .6vw,1.35rem);
  line-height:1.6;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

/* Browser-Oberflächen gehören zur Welt */
::selection{background:var(--rune-700);color:var(--gold-200)}
:focus-visible{outline:2px solid var(--gold-400);outline-offset:4px;border-radius:3px}
/* Kein sichtbarer Scrollbalken: Eine dunkel eingefärbte Bahn hinterließe am
   rechten Rand weiterhin einen feinen Streifen, weil die Spur eine feste
   Farbe trägt, der Höhlengrund dahinter aber einen Verlauf. Also ganz weg.
   Gescrollt wird weiter mit Rad, Trackpad, Pfeiltasten und Leertaste. */
html{scrollbar-width:none}
::-webkit-scrollbar{width:0;height:0}

/* ── Höhle ───────────────────────────────────────────────── */
.cave{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.cave__floor{
  position:absolute;inset:0;
  background:
    radial-gradient(120% 80% at 50% 118%, rgba(122,62,157,.22), transparent 62%),
    radial-gradient(90% 60% at 50% -10%, rgba(47,143,70,.10), transparent 60%),
    linear-gradient(180deg,var(--cave-900) 0%,var(--cave-800) 45%,var(--cave-700) 100%);
}
/* Liegt über dem Licht: die Höhle bleibt an den Rändern eine Höhle. */
.cave__vignette{
  position:absolute;inset:0;
  background:radial-gradient(115% 88% at 50% 46%, transparent 32%, rgba(8,4,14,.42) 72%, rgba(6,3,11,.72) 100%);
}
/* Fels: zwei sehr weiche Konturen, keine Textur-Tapete */
.cave__rock{position:absolute;top:-5%;left:-10%;width:120%;height:70%;opacity:.5}
.cave__rock--low{top:auto;bottom:-8%;height:55%;opacity:.7}

/* Hortschein: wächst, wenn die Truhe aufgeht */
.cave__glow{
  position:absolute;left:50%;top:44%;
  width:min(132vw,1800px);height:min(96vh,820px);
  translate:-50% -50%;
  background:radial-gradient(circle, rgba(233,184,58,.34), rgba(255,154,60,.14) 38%, transparent 68%);
  opacity:0;transform:scale(.6);
  transition:opacity 1400ms var(--ease-out), transform 1600ms var(--ease-out);
}
body[data-act="open"] .cave__glow,
body[data-act="hoard"] .cave__glow,
body[data-act="sealed"] .cave__glow{opacity:1;transform:scale(1)}

/* Der Lichtstoß beim Aufschließen */
.cave__flash{
  position:absolute;left:50%;top:44%;
  width:min(126vw,1700px);height:min(92vh,780px);translate:-50% -50%;
  background:radial-gradient(circle, rgba(255,232,170,.6), rgba(255,154,60,.2) 34%, transparent 62%);
  opacity:0;
}
body.is-flash .cave__flash{animation:flash 780ms var(--ease-out) forwards}
@keyframes flash{
  0%{opacity:0;scale:.35}
  16%{opacity:1}
  100%{opacity:0;scale:1.3}
}

/* Staub im Goldlicht */
.mote{
  position:absolute;bottom:-8px;width:7px;height:7px;opacity:0;
  background:radial-gradient(circle, var(--gold-200) 0%, rgba(233,184,58,.55) 26%, rgba(233,184,58,0) 68%);
  animation:drift linear infinite;
}
@keyframes drift{
  0%{opacity:0;transform:translateY(0) translateX(0) scale(.6)}
  12%{opacity:.85}
  80%{opacity:.5}
  100%{opacity:0;transform:translateY(-92svh) translateX(var(--dx,20px)) scale(1)}
}
body:not([data-act="open"]):not([data-act="hoard"]):not([data-act="sealed"]) .mote{animation-play-state:paused;opacity:0}

/* Der Hofmagier: er sitzt über dem Hort und sieht zu */
.magus{
  position:absolute;left:50%;bottom:76%;
  width:132%;translate:-50%;
  z-index:0;pointer-events:none;
  opacity:.45;
  transition:opacity 900ms var(--ease-out);
}
body[data-act="turning"] .magus{opacity:1}
body[data-act="open"] .magus,
body[data-act="hoard"] .magus,
body[data-act="sealed"] .magus{opacity:.85}

/* Sobald site/hofmagier.webp existiert, tritt das Bild an die Stelle der
   Zeichnung. Kein Codeeingriff nötig: das Skript prüft die Datei beim Laden. */
.magus-art{
  /* Hergeleitet, nicht geraten: die Augen liegen bei 42 % der Bildhöhe, die
     Deckelkante bei 65,5 % der Truhenbreite. bottom:25 % setzt die Augen damit
     bei jeder Größe rund 13 % der Truhenbreite über den Deckel. */
  position:absolute;left:50%;bottom:29%;
  width:142%;aspect-ratio:1536/1024;translate:-50%;
  z-index:0;pointer-events:none;
  /* Das ganze Bild, exakt eingepasst: jeder Ausschnitt hinterließe eine
     harte Schnittkante, sobald die Truhe schmaler wird als die Gestalt. */
  background:center / 100% 100% no-repeat;
  /* Die weiche Kante steckt als Alphakanal im Bild selbst, nicht in einer
     CSS-Maske: die verhielt sich je nach Fenstergröße unterschiedlich und
     hat die Gestalt zeitweise ganz verschluckt. */
  /* Kein Einblenden aus Deckkraft 0: die Ebene existiert schlicht nicht,
     solange kein Bild vorliegt. Sichtbarkeit an eine Übergangsanimation zu
     hängen ist eine Fehlerquelle ohne Gegenwert. */
  display:none;
  opacity:.45;transition:opacity 700ms var(--ease-out);
}
.magus-art__eyes{position:absolute;inset:0;width:100%;height:100%}
.vault.has-magus-art .magus-art{display:block;background-image:url("hofmagier.webp")}
.vault.has-magus-art .magus{display:none}
body[data-act="turning"] .vault.has-magus-art .magus-art{opacity:.85}
/* Ist die Truhe offen, tritt er zurück: der Schatz hat jetzt die Bühne,
   und die offene Truhe ist schmaler, sodass sonst seine Schultern
   seitlich hervorstehen. */
body[data-act="open"] .vault.has-magus-art .magus-art,
body[data-act="hoard"] .vault.has-magus-art .magus-art,
body[data-act="sealed"] .vault.has-magus-art .magus-art{opacity:.4}

.magus__cloak{stroke:#3E1F57;stroke-width:2.5;fill:none;stroke-linecap:round}

.magus__eye{fill:var(--ember);transform-box:fill-box;transform-origin:center}
.magus__pupil{fill:#3A0E00;transform-box:fill-box;transform-origin:center}
/* Die Gruppe ist so groß wie das Auge, also schließt alles um dessen Mitte. */
.magus__blink{
  transform-box:fill-box;transform-origin:center;
  animation:blink 4s var(--ease-in-out) infinite;
}
.magus__blink--r{animation-delay:.09s}
body[data-act="turning"] .magus__blink{animation-duration:2.2s}
@keyframes blink{0%,92%,100%{transform:scaleY(1)}96%{transform:scaleY(.07)}}

/* ── Auftakt ─────────────────────────────────────────────── */
@keyframes emerge{
  from{opacity:0;translate:0 16px;filter:blur(7px)}
  to{opacity:1;translate:0 0;filter:blur(0)}
}
.hail__name        {animation:emerge 900ms  var(--ease-out)  60ms backwards}
.hail__swap + .hail__swap{animation:emerge 900ms var(--ease-out) 200ms backwards}
.vault             {animation:emerge 1000ms var(--ease-out) 340ms backwards}
.keyring           {animation:emerge 800ms  var(--ease-out) 560ms backwards}

/* ── Bühne ───────────────────────────────────────────────── */
.stage > *{max-width:100%;min-width:0}
.stage{
  position:relative;z-index:1;
  min-height:100svh;
  display:flex;flex-direction:column;align-items:center;
  gap:clamp(1.25rem,3.2vw,2.25rem);
  padding:clamp(1.5rem,4.5svh,2.75rem) clamp(1.15rem,5vw,2rem)
          calc(clamp(3.5rem,10svh,6rem) + env(safe-area-inset-bottom));
  text-align:center;
}

@media (max-height:820px){
  .stage{gap:clamp(.7rem,2vw,1.2rem);padding-top:clamp(.85rem,2.5svh,1.5rem)}
  .vault{width:min(66vw,290px);margin-top:1rem}
  .hail__line{font-size:clamp(1.15rem,1rem + .7vw,1.4rem);margin-top:.6rem}
  .hail__name{font-size:clamp(2.5rem,9.5vw,4.25rem)}
  .key{width:clamp(112px,30vw,132px);height:clamp(112px,30vw,132px)}
}

/* ── Typografie ──────────────────────────────────────────── */
.rune{
  font-family:"Uncial Antiqua","Cinzel",Georgia,serif;
  font-weight:400;letter-spacing:.01em;line-height:.98;
}
/* Über allem: die Gestalt darf den Text nie überlagern oder abdunkeln.
   .vault erzeugt durch `perspective` einen eigenen Stapelkontext und läge
   sonst als späteres Geschwister davor. */
.hail{position:relative;z-index:2;max-width:46ch;margin:0 auto}
.hail__name{
  display:block;
  font-size:clamp(2.95rem,11.5vw,5.5rem);
  max-width:100%;overflow-wrap:break-word;
  color:var(--gold-200);
  text-shadow:0 3px 0 var(--gold-700), 0 12px 30px rgba(0,0,0,.75);
}
.hail__line{
  margin:1rem auto 0;max-width:32ch;
  color:#E7DCC8;font-size:clamp(1.35rem,1.12rem + 1vw,1.7rem);
  line-height:1.5;font-style:italic;text-wrap:pretty;
}
.hail__line strong{font-style:normal;color:var(--rune-300);font-weight:600}
.hail__line em{font-style:normal;color:var(--gold-200);font-weight:600}

/* Wechsel der Überschrift ohne Sprung */
.hail__swap{display:grid}
.hail__swap > *{grid-area:1/1;transition:opacity 420ms var(--ease-out), filter 420ms var(--ease-out), transform 420ms var(--ease-out)}
.hail__swap > [hidden]{display:block;opacity:0;filter:blur(6px);transform:translateY(-6px) scale(.985);pointer-events:none}

/* ── Truhe ───────────────────────────────────────────────── */
.vault{
  position:relative;
  margin-top:clamp(1.4rem,6vh,3.6rem);
  width:min(84vw,380px);
  perspective:1100px;
  transition:transform 900ms var(--ease-out);
}
body[data-act="hoard"] .vault,
body[data-act="sealed"] .vault{transform:scale(.82) translateY(-4px)}

/* Druckwelle aus dem Schloss */
.shock{
  position:absolute;left:50%;top:62.5%;
  width:clamp(52px,14vw,68px);aspect-ratio:1;
  translate:-50% -50%;
  border:2px solid var(--gold-200);border-radius:50%;
  opacity:0;pointer-events:none;z-index:2;
}
body.is-flash .shock{animation:shock 820ms var(--ease-out) forwards}
body.is-flash .shock--late{animation-delay:120ms;border-color:var(--ember)}
@keyframes shock{
  0%{opacity:.95;scale:.3}
  65%{opacity:.3}
  100%{opacity:0;scale:4.2}
}

/* ── Die Truhe ───────────────────────────────────────────── */
.chestpic{
  position:relative;z-index:1;
  width:100%;aspect-ratio:880/748;
  animation:breathe 6.5s cubic-bezier(.45,0,.55,1) infinite;
  filter:drop-shadow(0 26px 30px rgba(0,0,0,.7));
}
@keyframes breathe{0%,100%{translate:0 0}50%{translate:0 -5px}}
body[data-act="turning"] .chestpic{animation-play-state:paused}

/* Das Rütteln liegt auf einer eigenen Ebene, damit es das Atmen
   nicht überschreibt: beide würden sonst dieselbe Eigenschaft belegen. */
body[data-act="turning"] .chestpic__img{animation:strain 280ms ease-in-out infinite}
body.is-straining .chestpic__img{animation-duration:150ms}
body.is-yielding  .chestpic__img{animation-duration:90ms}
@keyframes strain{0%,100%{transform:translateX(0)}25%{transform:translateX(-1.6px)}75%{transform:translateX(1.6px)}}

/* Die Grafiken sind Kulisse, kein Inhalt zum Mitnehmen: nicht ziehbar,
   nicht markierbar, und auf dem Handy ohne „Bild sichern"-Menü. Letzteres
   ist kein Kopierschutz — die Dateien liegen offen auf dem Server —, sondern
   verhindert, dass das Menü mitten im zehn Sekunden langen Gedrückthalten
   aufspringt und die Interaktion abbricht. */
.chestpic__img,
.key__svg{
  -webkit-user-drag:none;
  -webkit-touch-callout:none;
  user-select:none;-webkit-user-select:none;
  pointer-events:none;
}

.chestpic__img{
  position:absolute;inset:0;
  width:100%;height:100%;object-fit:contain;
  /* Kurz und mit Verzögerung: der Wechsel passiert, während der schwarze
     Blitz darüber liegt. So fällt nicht auf, dass beide Truhen nicht
     pixelgenau dieselbe Silhouette haben. */
  transition:opacity 90ms linear 130ms;
}

/* Der schwarze Blitz deckt den Wechsel ab */
.chestpic__blackout{
  /* Die Ebene ist deutlich größer als die Truhe, damit der weiche Rand des
     Verlaufs noch hineinpasst. Sonst schneidet der Kasten ihn ab und es
     bleibt ein hartes schwarzes Rechteck. */
  position:absolute;inset:-38%;
  background:radial-gradient(ellipse 50% 50% at 50% 50%,
    #000 0%, #000 84%, rgba(0,0,0,.45) 94%, rgba(0,0,0,0) 100%);
  opacity:0;pointer-events:none;z-index:3;
}
body.is-swap .chestpic__blackout{animation:blackout 460ms var(--ease-out) forwards}
@keyframes blackout{
  0%{opacity:0}
  26%{opacity:1}
  46%{opacity:1}
  100%{opacity:0}
}
.chestpic__img--open{opacity:0}
body[data-act="open"]   .chestpic__img--shut,
body[data-act="hoard"]  .chestpic__img--shut,
body[data-act="sealed"] .chestpic__img--shut{opacity:0}
body[data-act="open"]   .chestpic__img--open,
body[data-act="hoard"]  .chestpic__img--open,
body[data-act="sealed"] .chestpic__img--open{opacity:1}

/* Die Glut im Schlüsselloch, während der Schlüssel sich dreht */
.chestpic__spark{
  position:absolute;left:50%;top:62.5%;
  width:20%;aspect-ratio:1;translate:-50% -50%;
  background:radial-gradient(circle,
    rgba(255,231,168,.95) 0%, rgba(255,154,60,.5) 42%, rgba(255,154,60,0) 72%);
  opacity:0;pointer-events:none;z-index:2;
}

/* ── Schlüssel: gedrückt halten ──────────────────────────── */
.keyring{
  display:flex;flex-direction:column;align-items:center;gap:1rem;
  transition:opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}
body[data-act="open"] .keyring,
body[data-act="hoard"] .keyring,
body[data-act="sealed"] .keyring{
  opacity:0;transform:translateY(-10px) scale(.94);pointer-events:none;
  transition-duration:340ms;
}
.keyring[hidden]{display:none}

.key{
  --turn:0deg;
  position:relative;
  display:grid;place-items:center;
  width:clamp(124px,34vw,148px);height:clamp(124px,34vw,148px);
  padding:0;border:2px solid rgba(233,184,58,.3);border-radius:50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(233,184,58,.20), transparent 62%),
    var(--cave-700);
  box-shadow:var(--shadow-deep);
  color:var(--gold-200);
  cursor:pointer;touch-action:none;-webkit-tap-highlight-color:transparent;
  /* Langes Drücken darf auf dem Handy kein Kontextmenü und keine Textauswahl auslösen */
  -webkit-touch-callout:none;user-select:none;-webkit-user-select:none;
  transition:transform 160ms var(--ease-out), box-shadow 240ms var(--ease-out);
}
.key:active{transform:scale(.97)}
@media (hover:hover) and (pointer:fine){
  .key:hover{border-color:rgba(233,184,58,.7);box-shadow:var(--shadow-deep), var(--lamp-gold)}
}
.key__count{
  position:absolute;left:0;right:0;bottom:11%;
  font-family:"Cinzel",Georgia,serif;font-size:.92rem;font-weight:500;
  font-variant-numeric:tabular-nums;letter-spacing:.04em;
  color:var(--gold-400);
  opacity:0;transition:opacity 200ms var(--ease-out);
}
body[data-act="turning"] .key__count{opacity:1}

.key__svg{
  width:72%;height:auto;margin-bottom:13%;
  transform:rotate(var(--turn));
  transition:transform 90ms linear;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
.key.is-releasing .key__svg{transition:transform 320ms var(--ease-out)}
/* Fortschrittsring */
.key__ring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg);pointer-events:none}
.key__track{fill:none;stroke:rgba(233,184,58,.16);stroke-width:3}
.key__fill{
  fill:none;stroke:var(--gold-400);stroke-width:3;stroke-linecap:round;
  stroke-dasharray:var(--circ) var(--circ);
  stroke-dashoffset:calc(var(--circ) - var(--circ) * var(--p,0));
  transition:stroke-dashoffset 90ms linear;
  filter:drop-shadow(0 1px 3px rgba(142,99,22,.9));
}
.key.is-releasing .key__fill{transition:stroke-dashoffset 320ms var(--ease-out)}

.keyring__hint{
  margin:0;color:var(--ink-70);
  font-family:"Cinzel",Georgia,serif;font-size:1.02rem;
  letter-spacing:.02em;line-height:1.5;
}
.keyring__hint b{color:var(--gold-400);font-weight:500}
.keyring__hint{
  min-height:3em;max-width:20ch;
  transition:opacity 200ms var(--ease-out), filter 200ms var(--ease-out);
}
.keyring__hint.is-changing{opacity:0;filter:blur(3px)}
/* Wie weit ist es noch: der Ring allein reicht bei zehn Sekunden nicht */
.keyring__count{
  display:block;margin-top:.15rem;
  font-variant-numeric:tabular-nums;
  color:var(--gold-400);font-size:1.05em;letter-spacing:.05em;
}

/* ── Hort: die drei Münzen ───────────────────────────────── */
.hoard{
  display:grid;gap:clamp(1.4rem,4vw,2rem);
  width:min(100%,940px);
  grid-template-columns:1fr;
  justify-items:center;
}
/* Bündige Oberkanten: die Boxen folgen direkt auf die Münze, unterschiedlich
   lange Texte wachsen nach unten statt die Box nach oben zu schieben. */
@media (min-width:720px){.hoard{grid-template-columns:repeat(3,1fr);align-items:start}}
.hoard[hidden]{display:none}

.minted{
  display:flex;flex-direction:column;align-items:center;gap:.9rem;
  width:100%;max-width:300px;
  opacity:0;translate:0 52px;filter:blur(9px);
  animation:hoardRise 780ms var(--ease-out) forwards;
}
.minted:nth-child(1){animation-delay:0ms}
.minted:nth-child(2){animation-delay:110ms}
.minted:nth-child(3){animation-delay:220ms}
@keyframes hoardRise{to{opacity:1;translate:0 0;filter:blur(0)}}

/* ── Die Münze ───────────────────────────────────────────── */
.coin{
  --flip:0deg;--lift:1;
  position:relative;
  width:clamp(150px,42vw,186px);aspect-ratio:1;
  padding:0;border:0;background:none;border-radius:50%;
  perspective:900px;
  cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:transform 160ms var(--ease-out);
}
.coin:active{transform:scale(.97)}
@media (hover:hover) and (pointer:fine){
  .coin:hover .coin__body{--lift:1.035}
  .coin:hover .coin__face{box-shadow:var(--coin-relief), 0 16px 30px -12px rgba(0,0,0,.85), var(--lamp-gold)}
}

.coin__body{
  /* Ein Span ist inline: ohne display:block greifen width und height nicht,
     und die absolut gesetzten Münzflächen bekommen keine Größe. */
  display:block;
  position:relative;width:100%;height:100%;
  transform-style:preserve-3d;
  transform:rotateY(var(--flip)) scale(var(--lift));
  transition:transform 700ms var(--ease-lid);
}
.coin[aria-expanded="true"] .coin__body{--flip:180deg}
.coin.is-flipping .coin__body{--lift:1.06;transition-duration:320ms}

/* Relief: Licht von oben links, Schatten unten rechts */
:root{
  --coin-relief:
    inset 0 3px 5px rgba(255,244,214,.55),
    inset 0 -5px 10px rgba(92,60,8,.55),
    inset 3px 0 8px rgba(255,238,196,.22),
    inset -3px 0 8px rgba(92,60,8,.3);
}

.coin__face{
  position:absolute;inset:0;border-radius:50%;
  backface-visibility:hidden;-webkit-backface-visibility:hidden;
  display:grid;place-items:center;
  /* Geriffelter Rand, wie bei einer geprägten Münze */
  background:repeating-conic-gradient(from 0deg,
    #8A5F14 0deg 2.2deg, #D8A63A 2.2deg 4.4deg);
  box-shadow:var(--coin-relief), 0 14px 26px -12px rgba(0,0,0,.85);
  transition:box-shadow 240ms var(--ease-out);
}
.coin__face--back{transform:rotateY(180deg)}

/* Die Prägefläche liegt innerhalb des Randes */
.coin__field{
  position:absolute;inset:7%;border-radius:50%;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.35rem;padding:14% 13%;
  background:
    radial-gradient(circle at 36% 28%, #FFF3CE 0%, #F0C859 26%, #D9A437 56%, #B0821F 82%, #8E6316 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255,243,206,.4),
    inset 0 0 0 3px rgba(122,86,16,.35),
    inset 0 -7px 14px rgba(110,74,12,.4),
    inset 0 7px 12px rgba(255,243,206,.3);
}
/* Innerer Perlkreis */
.coin__field::before{
  content:"";position:absolute;inset:7%;border-radius:50%;
  border:1.5px dotted rgba(122,86,16,.42);
}

.coin__icon{
  width:clamp(30px,8.5vw,38px);height:auto;
  stroke:#7A5610;fill:none;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 1px 0 rgba(255,243,206,.65));
}
.coin__word{
  font-family:"Uncial Antiqua",Georgia,serif;
  font-size:clamp(.98rem,.86rem + .55vw,1.22rem);line-height:1.1;
  color:#6B4A0C;text-wrap:balance;
  text-shadow:0 1px 0 rgba(255,243,206,.7), 0 -1px 0 rgba(92,60,8,.35);
}
.coin__word--big{
  font-size:clamp(1.15rem,.95rem + .95vw,1.55rem);
}
/* Längere Prägungen eine Stufe kleiner, sonst stoßen sie an den Perlkreis. */
.coin__word--long{
  font-size:clamp(.92rem,.78rem + .68vw,1.18rem);
}

/* ── Die Aufschrift darunter ─────────────────────────────── */
.plate{
  width:100%;
  display:grid;grid-template-rows:0fr;
  opacity:0;
  transition:grid-template-rows 420ms var(--ease-out), opacity 300ms var(--ease-out);
}
.coin[aria-expanded="true"] + .plate{grid-template-rows:1fr;opacity:1}
.plate__clip{overflow:hidden}
.plate__inner{
  border:1px solid rgba(233,184,58,.2);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(42,27,59,.5), rgba(20,13,30,.5));
  padding:.95rem 1.1rem;
  text-align:center;
}
.plate__label{
  display:block;margin-bottom:.3rem;
  font-family:"Cinzel",Georgia,serif;font-size:.9rem;font-weight:500;
  letter-spacing:.16em;text-transform:uppercase;color:var(--gold-400);
}
.plate__text{
  margin:0;color:var(--ink-100);
  font-size:clamp(1.05rem,.98rem + .3vw,1.2rem);line-height:1.5;
  text-wrap:pretty;
}

/* ── Siegel & Schluss ────────────────────────────────────── */
.seal{
  position:relative;
  width:min(100%,560px);
  display:flex;flex-direction:column;align-items:center;gap:1.05rem;
  opacity:0;transform:translateY(16px);
  transition:opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.seal[hidden]{display:none}
/* Abstand zum oberen Rand beim automatischen Nachführen */
.seal{scroll-margin-top:clamp(.75rem,5vh,2.5rem)}
.plate{scroll-margin-block:clamp(.75rem,4vh,2rem)}
.seal > *{max-width:100%;min-width:0}
.seal.is-in{opacity:1;transform:translateY(0)}

.seal__puff{
  position:absolute;top:0;left:50%;translate:-50% 0;
  width:clamp(98px,26vw,118px);aspect-ratio:1;
  border:2px solid var(--gold-400);border-radius:50%;
  opacity:0;pointer-events:none;
}
.seal.is-in .seal__puff{animation:shock 900ms var(--ease-out) 300ms forwards}

/* Dieselbe Prägung wie die Münzen im Hort, nur kleiner und ohne Funktion. */
.sigil{
  position:relative;display:block;
  width:clamp(98px,26vw,118px);aspect-ratio:1;border-radius:50%;
  background:repeating-conic-gradient(from 0deg,
    #8A5F14 0deg 2.2deg, #D8A63A 2.2deg 4.4deg);
  box-shadow:var(--coin-relief), 0 12px 24px -10px rgba(0,0,0,.85);
}
.seal.is-in .sigil{animation:stamp 760ms var(--ease-out) both}
.sigil__field{
  position:absolute;inset:7%;border-radius:50%;
  display:grid;place-items:center;
  background:
    radial-gradient(circle at 36% 28%, #FFF3CE 0%, #F0C859 26%, #D9A437 56%, #B0821F 82%, #8E6316 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255,243,206,.4),
    inset 0 0 0 3px rgba(122,86,16,.35),
    inset 0 -7px 14px rgba(110,74,12,.4),
    inset 0 7px 12px rgba(255,243,206,.3);
}
.sigil__field::before{
  content:"";position:absolute;inset:8%;border-radius:50%;
  border:1.5px dotted rgba(122,86,16,.42);
}
.sigil__letter{
  font-family:"Uncial Antiqua",Georgia,serif;
  font-size:clamp(2.6rem,7vw,3.1rem);line-height:1;
  color:#6B4A0C;
  text-shadow:0 1px 0 rgba(255,243,206,.7), 0 -1px 0 rgba(92,60,8,.35);
}
@keyframes stamp{
  0%{opacity:0;transform:scale(1.5) rotate(-14deg)}
  55%{opacity:1;transform:scale(.94) rotate(2deg)}
  100%{opacity:1;transform:scale(1) rotate(0deg)}
}
.seal__word{
  margin:0;font-size:clamp(1.85rem,1.2rem + 2.2vw,2.6rem);
  max-width:16ch;text-wrap:balance;overflow-wrap:break-word;
  color:var(--rune-300);
  text-shadow:0 2px 0 var(--rune-700), 0 10px 24px rgba(0,0,0,.6);
}
.seal__hail{margin:.1rem 0 -.1rem}
.seal__name{
  display:block;
  font-size:clamp(1.55rem,1.2rem + 1.5vw,2.2rem);line-height:1.15;
  color:var(--gold-200);
  text-shadow:0 2px 0 var(--gold-700), 0 8px 20px rgba(0,0,0,.65);
}
/* Ein Schriftschnitt und eine Größe für alle Sätze im Siegel.
   Cinzel setzt Kleinbuchstaben als Kapitälchen — das ist der Satz, der hier
   am besten liest. Ein echtes text-transform:uppercase wäre das Gegenteil:
   reine Versalien nehmen den Wörtern ihre Umrissform. */
.seal__note,
.seal__gear,
.seal .footnote{
  margin:0;max-width:38ch;
  font-family:"Cinzel",Georgia,serif;
  font-size:clamp(1.08rem,.98rem + .35vw,1.22rem);
  font-style:normal;
  letter-spacing:.015em;line-height:1.62;
  color:var(--ink-100);
  text-wrap:pretty;
}
/* Einzige Abstufung: die Fußnote ist leiser, aber gleich groß. */
.seal .footnote{color:var(--ink-45)}

.scribe{
  display:inline-flex;align-items:center;gap:.6rem;
  padding:1rem 1.6rem;min-height:52px;
  border:2px solid rgba(233,184,58,.38);border-radius:99px;
  background:linear-gradient(180deg, rgba(233,184,58,.14), rgba(233,184,58,.04));
  color:var(--gold-200);
  font-family:"Cinzel",Georgia,serif;font-size:.95rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;text-decoration:none;
  cursor:pointer;
  transition:transform 160ms var(--ease-out), box-shadow 240ms var(--ease-out), border-color 240ms var(--ease-out);
}
.scribe:active{transform:scale(.97)}
@media (hover:hover) and (pointer:fine){
  .scribe:hover{border-color:rgba(233,184,58,.85);box-shadow:var(--lamp-gold)}
}
.scribe svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ── Für Eltern: die Fakten ohne Spiel ───────────────────── */
.plainly{width:min(100%,560px);margin-top:.5rem;text-align:center;
  padding-top:1.1rem;border-top:1px solid rgba(233,184,58,.16)}
/* Gleiche Form wie der Kalenderknopf darüber, nur eine Stufe leiser:
   als reiner Text war nicht erkennbar, dass man darauf drücken kann. */
.plainly__toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:.6rem;
  margin:0 auto;padding:.95rem 1.5rem;min-height:52px;
  background:rgba(233,184,58,.05);
  border:2px solid rgba(233,184,58,.26);border-radius:99px;
  color:var(--ink-70);cursor:pointer;
  font-family:"Cinzel",Georgia,serif;
  font-size:clamp(1.08rem,.98rem + .35vw,1.22rem);
  letter-spacing:.015em;text-align:center;
  transition:color 200ms var(--ease-out), border-color 200ms var(--ease-out),
             transform 160ms var(--ease-out);
}
.plainly__toggle:active{transform:scale(.97)}
@media (hover:hover) and (pointer:fine){
  .plainly__toggle:hover{color:var(--gold-200);border-color:rgba(233,184,58,.6)}
}
.plainly__chevron{
  width:16px;height:16px;flex:none;
  stroke:currentColor;fill:none;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
  transition:transform 260ms var(--ease-out);
}
.plainly[data-open="true"] .plainly__chevron{transform:rotate(180deg)}
.plainly__body{
  display:grid;grid-template-rows:0fr;
  transition:grid-template-rows 320ms var(--ease-out), opacity 260ms var(--ease-out);
  opacity:0;
}
.plainly[data-open="true"] .plainly__body{grid-template-rows:1fr;opacity:1}
.plainly__clip{overflow:hidden}
.plainly dl{margin:0;padding:.35rem 0 1.25rem;display:grid;gap:.2rem .9rem;
  grid-template-columns:1fr;text-align:left}
@media (min-width:430px){.plainly dl{gap:.6rem .9rem;grid-template-columns:auto 1fr}}
.plainly dt{
  font-family:"Cinzel",Georgia,serif;font-size:.95rem;font-weight:500;
  letter-spacing:.12em;text-transform:uppercase;color:var(--ink-70);
  padding-top:.32em;white-space:nowrap;
}
.mapped{
  display:inline-block;padding:.5rem .15rem;margin:-.5rem -.15rem;
  color:var(--gold-400);text-decoration:underline;
  text-underline-offset:3px;text-decoration-thickness:1px;
  text-decoration-color:rgba(233,184,58,.45);
  transition:text-decoration-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
@media (hover:hover) and (pointer:fine){
  .mapped:hover{color:var(--gold-200);text-decoration-color:var(--gold-200)}
}
.plainly dd{margin:0 0 .75rem;color:var(--ink-100);min-width:0;overflow-wrap:break-word}
@media (min-width:430px){.plainly dd{margin-bottom:0}}

.footnote{
  margin:0;color:var(--ink-70);font-size:1.1rem;font-style:italic;
  max-width:36ch;
}

.outro{
  display:flex;flex-direction:column;align-items:center;gap:.9rem;
  margin-top:clamp(1.75rem,5vh,3rem);
}
.outro__rule{width:min(60%,220px);height:auto;color:var(--gold-500);opacity:.7}
.outro__word{
  margin:0;
  font-family:"Uncial Antiqua",Georgia,serif;
  font-size:clamp(1.2rem,1.02rem + .6vw,1.45rem);
  line-height:1.5;color:var(--gold-500);text-wrap:balance;
}

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

/* ── Weniger Bewegung ────────────────────────────────────── */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:120ms!important;
  }
  /* Die Regel oben kürzt jede Animation auf .01ms; Animationen mit
     `forwards`/`backwards` landen dadurch sofort auf ihrem Endzustand.
     Sie hier zusätzlich auf `none` zu setzen wäre ein Fehler: die Münzen
     blieben dann auf ihrem deklarierten opacity:0 stehen. */
  .mote,.chestpic,.cave__flash,.shock,.seal__puff{animation:none!important}
  .minted{opacity:1;translate:none;filter:none}
  .coin__icon{stroke-dashoffset:0}
  .mote{opacity:0!important}
  .coin__body{transition:none}
  /* Ausnahme: Das Rütteln ist Rückmeldung auf das eigene Gedrückthalten,
     keine Deko. Es bleibt deshalb, aber schwächer, langsamer und ohne
     Steigerung bis zum Aufspringen. */
  body[data-act="turning"] .chestpic__img{animation:strain-soft 320ms ease-in-out infinite!important}
  /* Auch das Blinzeln bleibt: ein Lidschlag alle paar Sekunden ist kaum Bewegung,
     und ohne ihn wirkt der Hofmagier wie ausgestopft. */
  .magus__blink{animation:blink 4s var(--ease-in-out) infinite!important}
  .magus__blink--r{animation-delay:.09s!important}
}
@keyframes strain-soft{0%,100%{transform:translateX(0)}25%{transform:translateX(-.8px)}75%{transform:translateX(.8px)}}
