/* Emberwrath – Seite „Welt“: die Reise von Stufe 1 bis 40 (welt.html, welt.js).
   Alle Szenen sind echte Spielgrafik (site/tools/welt.mjs, 960 × 540), nur ganzzahlig vergrößert (site.js, img.shot);
   Bossfiguren im Feinraster 1:1 bzw. halb (site.js rundet auf ganze Gerätepixel).
   Kanten hart: Rahmen aus Linien, Glutkanten aus Farbbändern, kein Schein, keine Verläufe auf Grafik und Knöpfen. */

.reise-page main { background: var(--bg); }

/* ---------- Hart statt Schein (nur auf dieser Seite): Knöpfe, Titel */
.reise-page .btn.primary, .reise-page .btn.primary:hover { box-shadow: 0 0 0 2px #1a0604, inset 0 2px 0 #d8844a, inset 0 -3px 0 #5a1c08; }
.reise-page .btn.primary:hover { background: linear-gradient(180deg, #c05620 0 50%, #9a3a12 50% 100%); }
.reise-page h1, .reise-page h2 { text-shadow: none; }

/* Glutkante: drei harte Bänder wie die Kruste im Titelbild */
.glutkante, .auftakt-bild::after, .band::before, .band::after, .auftritt-bild::before, .auftritt-bild::after {
  content: ""; position: absolute; left: 0; right: 0; height: 6px; z-index: 1;
  background: linear-gradient(180deg, #ffd27a 0 2px, #ff8a2a 2px 4px, #8a2a0e 4px 6px);
}
.band::before, .auftritt-bild::before { top: 0; transform: scaleY(-1); }
.auftakt-bild::after, .band::after, .auftritt-bild::after { bottom: 0; }

/* ---------- Einstieg: Aufbruch in der Glutsenke, groß (×3), der Titel darunter auf festem Grund */
.auftakt-bild { position: relative; overflow: hidden; height: clamp(420px, calc(100svh - 250px), 760px); background: #05020a; --f: 2; }
@media (min-width: 1200px) { .auftakt-bild { --f: 3; } }
/* Gruppe in die Mitte des sichtbaren Teils unter der Kopfleiste, damit die Leiste nichts anschneidet */
.auftakt-bild .shot { --ay: 0.55; }
.auftakt-bild picture { display: contents; }
/* Mit JavaScript erst zeigen, wenn site.js das Bild ausgerichtet hat (.da), sonst springt es nach dem ersten Malen
   (Layout-Verschiebung); spätestens nach 2 s trotzdem, ohne JavaScript sofort (<noscript> in welt.html). */
.auftakt-bild .shot:not(.da) { animation: titel-warten 0s 2s backwards; }
/* Handy hoch (≤ 430 px): <picture> liefert nur die Mitte (reise-aufbruch-handy.webp = Bildpunkte 294–666 von 960,
   data-handy). Sichtbar sind dort höchstens 430 / 1,2 ≈ 358 Bildpunkte um die Mitte (kleinster Faktor von site.js bei
   krummer Bildschirmdichte), also immer innerhalb des Streifens. Lage wie beim ganzen Bild, nur um 294 Bildpunkte
   nach rechts versetzt (site.js; hier die Näherung ohne JavaScript). 294 = 2·3·7·7: der Versatz ist bei den üblichen
   Bildschirmdichten (2, 3, 1,75, 2,625, 3,5) ganze CSS-Pixel, sonst rastert Chrome das Bildpunktraster um einen
   Gerätepixel anders. Neues Einstiegsbild = Streifen neu schneiden (gleiche Bildpunkte). */
@media (max-width: 430px) {
  .auftakt-bild .shot { width: calc(372px * var(--f));
    left: calc(clamp(calc(100% - 960px * var(--f)), calc(var(--ax, 0.5) * 100% - var(--fx, 0.5) * 960px * var(--f)), 0px) + 294px * var(--f)); }
}
@media (min-width: 2200px) { .auftakt-bild { --f: 4; } }
.auftakt-text { padding-top: clamp(30px, 3.4vw, 48px); text-align: center; }
.kicker { margin: 0 0 12px; font: 700 13px/1 var(--font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ember); }
.auftakt h1 { margin: 0; font: 700 clamp(34px, 4.6vw, 64px)/1.05 var(--font-title); color: #fbe9c6; text-wrap: balance; }

/* ---------- Die Reise: links der Weg (Spur + Füllung, welt.js setzt --fill), rechts Etappen und Bänder */
.reise { padding: clamp(44px, 4.4vw, 70px) 0 0; }
.weg { --rail: 104px; --gap: clamp(18px, 2.4vw, 40px); position: relative; list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: 1440px; }
.weg::before, .weg::after { content: ""; position: absolute; top: 0; left: calc(var(--gutter) + var(--rail) / 2 - 4px); width: 8px; }
.weg::before { bottom: 0; background: linear-gradient(90deg, #0b0710 0 2px, #24161c 2px 6px, #0b0710 6px 8px); }
.weg::after { height: var(--fill, 0px); background: linear-gradient(90deg, #0b0710 0 2px, #ff8a2a 2px 4px, #c8501a 4px 6px, #0b0710 6px 8px); }
.no-js .weg::after { display: none; }
.weg > li { position: relative; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: var(--gap); padding-bottom: clamp(40px, 4vw, 60px); }

/* Stufenschild am Weg: wandert mit, bis die Etappe vorbei ist; erreicht = harte Glutbänder wie „Spielen“ */
.stufe { grid-column: 1; grid-row: 1 / span 3; align-self: start; justify-self: center; position: sticky; top: 92px; z-index: 2;
  min-width: 80px; padding: 12px 8px; text-align: center; white-space: nowrap;
  font: 700 24px/1 var(--font-title); color: #fbe9c6; background: #120a1a; border: 2px solid var(--edge); box-shadow: 0 0 0 2px #0b0710; }
.stufe.on, .stufe-ziel { color: #fff6e6; background: linear-gradient(180deg, #a8481a 0 50%, #86320f 50% 100%); border-color: #ffb050; }
.stufe-rast { min-width: 0; width: 28px; height: 28px; padding: 0; margin-top: 4px; display: grid; place-items: center; }
.stufe-rast::before { content: ""; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.stufe-rast.on::before { background: #fff6e6; }

/* ---------- Etappe: Szene groß, Text daneben, abwechselnd links und rechts */
.et-inhalt { grid-column: 2; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 3vw, 48px); align-items: center; }
@media (min-width: 1001px) {
  .etappe.r .et-inhalt { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .etappe.r .et-bild { order: 2; }
}
.et-bild { margin: 0; height: clamp(260px, 23vw, 380px); --f: 2; }
@media (min-width: 1921px) { .et-bild { --f: 3; } }
.et-art { margin: 0; font: 700 12px/1 var(--font); letter-spacing: 0.2em; text-transform: uppercase; color: rgb(var(--ton)); }
.weg h2 { margin: 10px 0 0; font: 700 clamp(30px, 3.2vw, 46px)/1.05 var(--font-title); color: #fbe9c6; text-wrap: balance; }
.stimme { margin: 20px 0 0; padding: 2px 0 2px 16px; border-left: 4px solid rgb(var(--ton)); }
.stimme p { margin: 0; font: 400 clamp(17px, 1.4vw, 20px)/1.4 var(--font); color: #f6e8c8; }
.stimme cite { display: block; margin-top: 6px; font: 600 13px/1.3 var(--font); font-style: normal; letter-spacing: 0.04em; color: var(--muted); }

/* Szene im gezeichneten Rahmen (Bronze, dunkle Außenlinie, goldene Eckbeschläge) */
.rahmen { position: relative; overflow: hidden; background: #05020a; border: 2px solid var(--edge); box-shadow: 0 0 0 2px #0b0710; }
.rahmen::before, .rahmen::after { content: ""; position: absolute; z-index: 1; width: 8px; height: 8px; background: var(--edge-hi); box-shadow: 0 0 0 2px #0b0710; }
.rahmen::before { top: 0; left: 0; }
.rahmen::after { bottom: 0; right: 0; }

/* Dungeon-Marke: Boss halb so groß (bei 1 Bildpunkt je CSS-Pixel 1:1); Gebiet und Stufe bilden eine Zeile, die vor der Stufe umbricht
   (der Punkt bleibt am Gebiet, die Stufe bleibt ganz),
   darunter der Name. Der Text bleibt in seiner Spalte und bricht dort um, statt ins Bild zu laufen. */
.marke { display: flex; align-items: flex-end; gap: 14px; margin: 26px 0 0; padding-top: 16px; border-top: 2px solid #24161c; }
.marke img { flex: none; width: calc(var(--w) / 2); height: calc(var(--h) / 2); }
.marke > span { flex: 1 1 auto; min-width: 0; padding-bottom: 4px; font-size: 12px; line-height: 1.3; }
.marke b { font: 700 12px/1.3 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); }
.marke b:first-child::after { content: "\a0·"; }   /* Punkt fest am Gebiet */
.marke b + b { white-space: nowrap; }
.marke .boss { display: block; margin-top: 5px; font: 700 17px/1.2 var(--font-title); color: #fbe9c6; text-wrap: balance; }

/* ---------- Bänder (Glutarena, Reittiere, Mitspieler): Kopf am Weg, Bild randlos, der Weg läuft darunter durch */
.band-kopf { grid-column: 2; align-self: center; }
.band-kopf h2 { margin-top: 0; }
.band-kopf > p:not(.et-art) { margin: 8px 0 0; font-size: clamp(16px, 1.4vw, 19px); color: var(--soft); }
.vorspann .band-kopf h2 { margin-top: 10px; }
.voll { grid-column: 1 / -1; position: relative; z-index: 3; margin: 26px calc(50% - 50vw) 0; }
.band { overflow: hidden; height: clamp(260px, 24vw, 400px); background: #05020a; --f: 3; }
@media (max-width: 1199px) { .band { --f: 2; } }
/* Glutarena: enger geschnitten (×2), damit Kämpfer, Schmelztiegel und Kohlebecken das Band füllen */
@media (min-width: 1200px) and (min-height: 501px) { .band.nah { --f: 2; } }
.ritt { background: #0a0510; }
.ritt .parade { margin: 0; }
.ritt .parade canvas { -webkit-mask-image: none; mask-image: none; }
/* Unter der Parade kein Name: bei mehreren Tieren im Bild bliebe unklar, welches gemeint ist (Liste bleibt für Screenreader) */
.ritt .parade-names { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Großer Auftritt (Ignaroth, Aschethron): Szene über die volle Breite, Schild und Name darunter */
.auftritt { padding-bottom: clamp(40px, 4vw, 60px); }
.weg > .auftritt { display: block; }
.auftritt-bild { position: relative; overflow: hidden; height: clamp(340px, 34vw, 580px); background: #05020a; --f: 2; }
.weg .auftritt-bild { margin-top: 0; }
@media (min-width: 1700px) { .auftritt-bild { --f: 3; } }
.auftritt-text { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; margin-top: -26px; text-align: center; }
.stufe-ziel { position: static; align-self: center; min-width: 96px; font-size: 28px; padding: 12px 14px; }
.auftritt h2 { margin: 22px 0 6px; font: 700 clamp(36px, 4.6vw, 64px)/1.05 var(--font-title); color: #fbe9c6; }
.auftritt-name { margin: 0; font: 600 clamp(16px, 1.4vw, 19px)/1.3 var(--font); color: var(--soft); }
.thron { padding-bottom: clamp(72px, 7vw, 100px); }
.thron .btn { margin-top: clamp(28px, 3vw, 40px); }

/* ---------- Schmal: Etappen untereinander (Text, Szene, Marke) */
@media (max-width: 1000px) {
  .et-inhalt { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .et-text { display: contents; }
  .et-text .et-art { order: -3; }
  .et-text h2 { order: -2; }
  .et-text .stimme { order: -1; margin-bottom: 18px; }
  .et-bild { height: clamp(260px, 56vw, 460px); }
}
@media (max-width: 820px) {
  .auftakt-bild { height: 62svh; min-height: 320px; --f: 1.5; }
  .auftakt-text { text-align: left; }
  .weg { --rail: 56px; --gap: 12px; }
  .weg > li, .auftritt { padding-bottom: 64px; }
  .stufe { top: 70px; min-width: 52px; padding: 8px 4px; font-size: 14px; }
  .stufe-rast { width: 22px; height: 22px; min-width: 0; padding: 0; }
  .weg h2 { margin-top: 8px; font-size: 27px; }
  .et-art { font-size: 11px; }
  .stimme p { font-size: 17px; }
  .et-bild { height: 76vw; --f: 0.5; }
  .marke { margin-top: 16px; padding-top: 0; border-top: 0; gap: 10px; }
  .marke b { font-size: 10.5px; letter-spacing: 0.06em; }
  .marke .boss { font-size: 15px; }
  .band { height: 70vw; --f: 0.5; }
  .auftritt-bild { height: 86vw; --f: 0.5; }
  .stufe-ziel { min-width: 72px; font-size: 22px; padding: 10px; }
  .auftritt h2 { font-size: 34px; }
}
/* Handy quer: jedes Bild passt unter die Kopfleiste */
@media (min-width: 821px) and (max-height: 500px) {
  .et-bild, .band, .auftritt-bild { height: calc(100svh - 110px); min-height: 0; --f: 1; }
  .stufe { top: 76px; }
}
/* Einstieg auf dem Handy quer (auch unter 821 px Breite, z. B. 740 × 360): Bild so hoch wie das Fenster, Gruppe und Truhe
   (Bildpunkte x 380–590, y 167–347) mittig im Teil unter der Kopfleiste. Faktor 5/3 (dpr 3: 5 Gerätepunkte je Bildpunkt,
   dpr 2: 3), bei sehr flachen Fenstern 4/3, damit die Gruppe ganz hineinpasst. Die Überschrift beginnt unter dem Bild. */
@media (orientation: landscape) and (max-height: 500px) {
  .auftakt-bild { height: 100svh; min-height: 0; --f: 1.667; }
  .auftakt-bild .shot { --ay: 0.583; }
}
@media (orientation: landscape) and (max-height: 379px) { .auftakt-bild { --f: 1.334; } }

/* ---------- Die Karte (atlas.js, site/tools/atlas.mjs): echte Gebietskarten als Blätter, ganzzahlig vergrößert.
   atlas.js setzt die Breite auf ganze Gerätepixel je Bildpunkt; ohne JavaScript gilt die Näherung unten. Leinwand
   .atlas-live liegt im selben Raster darüber (Glutpfad, Rahmen, Sternenfunkeln). */
.atlas { padding: clamp(56px, 7vw, 96px) var(--gutter) clamp(64px, 8vw, 110px); background: #07040a; }
.atlas-kopf { padding: 0; margin-bottom: 64px; text-align: center; }
.atlas-kopf h2 { margin: 0; font: 700 clamp(28px, 3.4vw, 44px)/1.1 var(--font-title); color: #fff1d6; }
.atlas-satz { margin: 14px auto 0; max-width: 34em; color: var(--soft); }
.atlas-karte { position: relative; width: min(1000px, 100%); margin: 0 auto; aspect-ratio: 1000 / 2590; }
.atlas-bild, .atlas-live { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.atlas-karte.weich .atlas-bild, .atlas-karte.weich .atlas-live { image-rendering: auto; }
.atlas-karte.zeigt { cursor: pointer; }
.atlas-orte { position: absolute; inset: 0; pointer-events: none; }
/* Beschriftung über der linken oberen Ecke des Blatts: Name auf festem Grund, Stufen als Schild wie am Weg */
.ort { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 8px; transform: translate(-4px, calc(-100% - 10px));
  padding: 5px 6px 5px 10px; background: #0b0610; border: 1px solid #5a200c; color: #fff1d6; text-decoration: none; white-space: nowrap; }
/* rechte Spalte: rechte Kante bündig mit dem Blatt */
.ort.rechts { transform: translate(4px, calc(-100% - 10px)); }
.ort b { font: 700 15px/1.2 var(--font-title); letter-spacing: 0.02em; }
.ort .schild { font: 700 12px/1 var(--font); padding: 4px 6px; color: #fff6e6; background: linear-gradient(180deg, #a8481a 0 50%, #86320f 50% 100%); border: 1px solid #ffb050; }
a.ort:hover, a.ort:focus-visible, .ort.an { border-color: #ffb050; outline: none; }
a.ort:hover b, a.ort:focus-visible b, .ort.an b { color: #ffd27a; }
.ort.sterne { border-color: #3a2460; }
.ort.sterne .schild { background: linear-gradient(180deg, #5a36a0 0 50%, #43277e 50% 100%); border-color: #b088f8; }
@media (max-width: 600px) {
  .atlas-kopf { margin-bottom: 40px; text-align: left; }
  .ort { gap: 5px; padding: 3px 4px 3px 6px; transform: translate(-2px, calc(-100% - 5px)); }
  .ort.rechts { transform: translate(2px, calc(-100% - 5px)); }
  .ort b { font-size: 11px; }
  .ort .schild { font-size: 9px; padding: 2px 4px; }
}
