/* Feenwelt: Papier, Weinrot und Gold über der 3D-Fläche. Alle Überlagerungen sind normales HTML. */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("../schriften/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("../schriften/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("../schriften/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 500; font-style: normal; font-display: swap; src: url("../schriften/cinzel-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-style: normal; font-display: swap; src: url("../schriften/cinzel-latin-700-normal.woff2") format("woff2"); }

@font-face { font-family: "Marcellus"; font-weight: 400; font-style: normal; font-display: swap; src: url("../schriften/marcellus-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap; src: url("../schriften/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-style: normal; font-display: swap; src: url("../schriften/figtree-latin-700-normal.woff2") format("woff2"); }

@font-face { font-family: "Abril Fatface"; font-weight: 400; font-style: normal; font-display: swap; src: url("../schriften/abril-fatface-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../schriften/josefin-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --papier: #fbf3dc; --tinte: #3d1424; --wein: #5a1f30; --gold: #c2912e; --rose: #b0356a; --leise: #7a5a52; --linie: #e2d3ae;
  --gross: "Cormorant Garamond", Georgia, serif; --klein: "Cinzel", Georgia, serif;
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px); --links: env(safe-area-inset-left, 0px); --rechts: env(safe-area-inset-right, 0px);
}
/* Papierwelt: Papierweiß, Petrol, Zinnober und Gold */
:root[data-welt="papier"] { --papier: #fffaf0; --tinte: #17414f; --wein: #1f6f7c; --gold: #f2b63c; --rose: #d8452f; --leise: #5f7f86; --linie: #eadfc6; --gross: "Abril Fatface", Georgia, serif; --klein: "Josefin Sans", system-ui, sans-serif; }
/* Bergwelt: Sinterweiß, Enzianblau und Alpenrosenrot */
:root[data-welt="berg"] { --papier: #fbf6ea; --tinte: #2a3340; --wein: #24427a; --gold: #f2b63c; --rose: #2f5fd0; --leise: #6a7280; --linie: #e0d8c6; --gross: "Marcellus", Georgia, serif; --klein: "Figtree", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c2a22; color: var(--tinte); font: 500 18px/1.5 var(--gross); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#buehne { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.klein, small { font: 500 12px/1.3 var(--klein); letter-spacing: .14em; text-transform: uppercase; }

/* Kopfzeile */
#kopf { position: fixed; inset: 0 0 auto 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--oben) + 12px) calc(var(--rechts) + 14px) 12px calc(var(--links) + 14px); pointer-events: none; }
#kopf > * { pointer-events: auto; }
#marke { border: 0; background: none; padding: 6px 4px; font: 700 clamp(15px, 4.4vw, 21px)/1 var(--klein); letter-spacing: .12em; text-transform: uppercase; color: #fffaf0; text-shadow: 0 1px 10px rgba(40, 20, 10, .75), 0 0 2px rgba(40, 20, 10, .6); white-space: nowrap; }
.pille { display: flex; background: rgba(251, 243, 220, .92); border: 1px solid var(--linie); border-radius: 99px; padding: 3px; box-shadow: 0 6px 20px -10px rgba(40, 20, 10, .6); }
.pille button { border: 0; background: none; border-radius: 99px; padding: 6px 14px; font: 500 12px/1.2 var(--klein); letter-spacing: .12em; text-transform: uppercase; }
.pille button[aria-pressed="true"] { background: var(--wein); color: var(--papier); }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.knopf { border: 1px solid var(--wein); background: var(--wein); color: var(--papier); border-radius: 99px; padding: 12px 26px; font: 700 14px/1.2 var(--klein); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 10px 26px -12px rgba(40, 20, 10, .8); }
.knopf.leer { background: var(--papier); color: var(--wein); }
.knopf:disabled { opacity: .5; cursor: default; }

@media (max-width: 350px) { #marke { font-size: 13px; letter-spacing: .06em; } .pille button { padding: 6px 9px; letter-spacing: .08em; } }

/* Kleine Auswahl der Welten, rechts unter der Kopfzeile */
#welten { position: fixed; z-index: 6; right: calc(var(--rechts) + 14px); top: calc(var(--oben) + 58px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#weltwechsel, #weltliste button { border: 1px solid var(--linie); background: rgba(251, 243, 220, .96); border-radius: 99px; padding: 8px 14px; font: 500 12px/1.2 var(--klein); letter-spacing: .1em; text-transform: uppercase; }
#weltwechsel { box-shadow: 0 6px 20px -10px rgba(40, 20, 10, .6); }
#weltwechsel::after { content: " ▾"; }
#weltliste { display: flex; flex-direction: column; gap: 4px; background: var(--papier); border: 1px solid var(--linie); border-radius: 16px; padding: 6px; box-shadow: 0 14px 30px -14px rgba(40, 20, 10, .7); }
#weltliste button { border-color: transparent; background: none; text-align: left; }
#weltliste button[aria-current="true"] { background: var(--wein); color: var(--papier); }
.ort-laden #welten, .oeffnet #welten { display: none; }

/* Vor dem Buch */
#startfuss { position: fixed; inset: auto 0 0 0; z-index: 4; display: none; flex-direction: column; align-items: center; gap: 10px; padding: 16px calc(var(--rechts) + 16px) calc(var(--unten) + 22px) calc(var(--links) + 16px); text-align: center; pointer-events: none; }
#startfuss > * { pointer-events: auto; }
#startfuss .klein { color: #fffaf0; text-shadow: 0 1px 8px rgba(40, 20, 10, .9); }
.ort-start #startfuss { display: flex; }
.ort-start.oeffnet #startfuss, .ort-start.oeffnet #kopf { opacity: 0; transition: opacity .4s; }

/* Im Flur und im Buchraum */
#hud { position: fixed; inset: auto 0 0 0; z-index: 4; display: none; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 12px calc(var(--rechts) + 12px) calc(var(--unten) + 14px) calc(var(--links) + 12px); pointer-events: none; }
.ort-flur #hud, .ort-raum #hud { display: flex; }
#hud > * { pointer-events: auto; }
#zurueck { position: fixed; left: calc(var(--links) + 12px); top: calc(var(--oben) + 58px); border: 1px solid var(--linie); background: rgba(251, 243, 220, .94); border-radius: 99px; padding: 8px 14px; font: 500 12px/1.2 var(--klein); letter-spacing: .1em; text-transform: uppercase; }
#mitte { flex: 1 1 auto; min-width: 0; max-width: 460px; margin: 0 auto; background: rgba(251, 243, 220, .94); border: 1px solid var(--linie); border-radius: 16px; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; box-shadow: 0 12px 30px -16px rgba(40, 20, 10, .7); }
#mklein { color: var(--leise); }
#mtitel { font: 600 clamp(19px, 5vw, 24px)/1.15 var(--gross); text-wrap: balance; }
#maktion { margin-top: 6px; border: 0; background: var(--wein); color: var(--papier); border-radius: 99px; padding: 8px 16px; font: 700 12px/1.2 var(--klein); letter-spacing: .12em; text-transform: uppercase; }
#gehen { display: flex; flex-direction: column; gap: 8px; flex: none; }
#gehen button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--linie); background: rgba(251, 243, 220, .94); font-size: 15px; color: var(--wein); touch-action: none; user-select: none; -webkit-user-select: none; }
#gehen button:active { background: var(--wein); color: var(--papier); }
.liste-an #hud, .liste-an #startfuss { display: none; }

/* Leseprobe: am Rechner rechts, am Handy von unten */
#lesen { position: fixed; z-index: 8; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--papier); border-left: 1px solid var(--linie); box-shadow: -20px 0 50px -30px rgba(40, 20, 10, .8); padding: calc(var(--oben) + 26px) calc(var(--rechts) + 26px) calc(var(--unten) + 24px) 26px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; }
#lesen small { color: var(--rose); }
#lesen h2 { margin: 0; font: 600 clamp(28px, 7vw, 38px)/1.08 var(--gross); text-wrap: balance; padding-right: 36px; }
.autorin { margin: 0; font: 500 13px/1.3 var(--klein); letter-spacing: .14em; text-transform: uppercase; color: var(--leise); }
#lesentext { margin-top: 14px; font: 500 20px/1.6 var(--gross); max-width: 34em; flex: 1 0 auto; }
#lesentext p { margin: 0 0 .8em; }
.hinweis { color: var(--leise); font: italic 500 16px/1.4 var(--gross); margin: 0; }
.lesenfuss { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-top: 1px solid var(--linie); padding-top: 16px; }
#lesenzu { position: absolute; top: calc(var(--oben) + 14px); right: calc(var(--rechts) + 14px); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: #fffaf0; font-size: 22px; line-height: 1; }
@media (max-width: 699px) {
  #lesen { top: auto; left: 0; width: 100%; max-height: 82%; border-left: 0; border-top: 1px solid var(--linie); border-radius: 20px 20px 0 0; padding: 22px calc(var(--rechts) + 20px) calc(var(--unten) + 20px) calc(var(--links) + 20px); box-shadow: 0 -20px 50px -30px rgba(40, 20, 10, .8); }
  #lesenzu { top: 12px; }
  .nurbreit { display: none; }
}

/* Liste */
#liste { position: fixed; inset: 0; z-index: 3; overflow-y: auto; background: var(--papier); padding: calc(var(--oben) + 74px) calc(var(--rechts) + 18px) calc(var(--unten) + 40px) calc(var(--links) + 18px); }
#liste h1 { margin: 0 auto 6px; max-width: 760px; font: 600 clamp(30px, 8vw, 46px)/1.05 var(--gross); }
#liste > p { margin: 0 auto 22px; max-width: 760px; color: var(--leise); }
#liste ol { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; border-top: 1px solid var(--linie); }
#liste li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--linie); padding: 12px 0; }
#liste li b { font: 600 21px/1.2 var(--gross); min-width: 0; }
#liste li span { display: flex; gap: 8px; flex: none; }
#liste li button { border: 1px solid var(--wein); background: none; color: var(--wein); border-radius: 99px; padding: 7px 13px; font: 500 11px/1.2 var(--klein); letter-spacing: .1em; text-transform: uppercase; }
#liste li button.voll { background: var(--wein); color: var(--papier); }
.liste-an #marke { color: var(--wein); text-shadow: none; }
@media (max-width: 460px) { #liste li { flex-direction: column; align-items: flex-start; } }

/* Überblendung zwischen den Räumen, hell wie das Licht aus dem Buch */
#blende { position: fixed; inset: 0; z-index: 9; background: #fff8dc; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
#blende.an { opacity: 1; pointer-events: auto; }
#blendetext { font: 500 13px/1.3 var(--klein); letter-spacing: .16em; text-transform: uppercase; color: var(--wein); }
@media (prefers-reduced-motion: reduce) { #blende { transition: none; } }

:root[data-welt="papier"] #mtitel, :root[data-welt="papier"] #lesen h2, :root[data-welt="papier"] #liste h1, :root[data-welt="papier"] #liste li b { font-weight: 400; }
:root[data-welt="papier"] #lesentext { font-family: Georgia, serif; font-weight: 400; font-size: 18px; }
:root[data-welt="papier"] .hinweis { font: italic 400 15px/1.4 Georgia, serif; }
