/* Schriften liegen lokal, es wird nichts von fremden Servern geladen. */
@font-face {
  font-family: "Cinzel Decorative";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/cinzel-decorative-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blood: #8e1830;
  --blood-deep: #4a0d18;
  --gold: #e8c872;
  --gold-dim: #a6843e;
  --bone: #f3e6c8;
  --ink: #07040c;
  --panel: rgba(10, 5, 12, 0.94);
  --line: rgba(232, 200, 114, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: "Cormorant Garamond", Palatino, "Palatino Linotype", Georgia, serif;
  overflow: hidden;
}

body {
  user-select: none;
  touch-action: none;
}

@media (pointer: fine) {
  body.ready, body.ready button, body.ready canvas, body.ready a { cursor: none; }
}

button, a { font: inherit; color: inherit; }

button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone);
  padding: 0.7rem 1.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

button:hover,
button:focus-visible {
  background: var(--gold);
  color: #1a0c10;
  border-color: var(--gold);
  outline: none;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button:disabled:hover {
  background: transparent;
  color: var(--bone);
}

h1, h2, h3, .brand, .eyebrow, button, .sign-font {
  font-family: "Cinzel Decorative", Palatino, Georgia, serif;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  background: #07040c;
}

.reticle {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(243, 230, 200, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.25s ease, background 0.25s ease, opacity 0.6s ease;
}

body.walking .reticle { opacity: 1; }
body.walking.hot .reticle { transform: scale(2.6); background: rgba(232, 200, 114, 0.9); }

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent);
}

body.walking .hud {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold);
}

.where {
  font-style: italic;
  letter-spacing: 0.04em;
  opacity: 0.85;
  text-align: center;
  flex: 1;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#guest {
  font-style: italic;
  opacity: 0.8;
  max-width: 28vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mute {
  padding: 0.4rem 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.quests {
  position: fixed;
  z-index: 4;
  top: 3.9rem;
  left: 1.25rem;
  width: min(300px, calc(100% - 2.5rem));
  pointer-events: none;
}

.quests[hidden], body:not(.walking) .quests { display: none; }

#quests-toggle {
  pointer-events: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  background: rgba(8, 4, 10, 0.6);
  border-color: rgba(232, 200, 114, 0.35);
}

#quest-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.1rem 0 0.1rem 0.75rem;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.25;
  text-shadow: 0 1px 8px #000, 0 0 3px #000;
}

#quest-list b {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

#quest-list li.done { opacity: 0.5; text-decoration: line-through; text-decoration-color: var(--gold-dim); }
#quest-list li.done b { text-decoration: none; display: block; }
.quests.shut #quest-list { display: none; }
.quests.fresh #quests-toggle { animation: questPing 1.6s ease; }

@keyframes questPing {
  0%, 40% { background: var(--gold); color: #1a0c10; }
  100% { background: rgba(8, 4, 10, 0.6); color: var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  .quests.fresh #quests-toggle { animation: none; }
}

@media (max-width: 1180px) {
  body.has-quests .toast { top: 6.4rem; }
}

.prompt {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: calc(50% + 3.2rem);
  transform: translateX(-50%);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: rgba(8, 4, 10, 0.72);
  font-family: "Cormorant Garamond", Palatino, Georgia, serif;
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.prompt[hidden], .caption[hidden] { display: none; }

body.riding .prompt { top: auto; bottom: 2.2rem; opacity: 0.75; }

.caption {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 5.4rem;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 2rem));
  margin: 0;
  text-align: center;
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.35;
  text-shadow: 0 2px 14px #000, 0 0 3px #000;
  pointer-events: none;
}

body:not(.walking) .caption { display: none; }

.lookhint {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 3rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.3rem 0.8rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  background: rgba(8, 4, 10, 0.6);
  border: 1px solid rgba(232, 200, 114, 0.3);
  pointer-events: none;
  display: none;
}

body.walking.ready:not(.locked) .lookhint { display: block; }
body.locked .cursor { display: none !important; }

body:not(.walking) .prompt { display: none; }

.prompt kbd {
  font-family: "Cinzel Decorative", Palatino, serif;
  border: 1px solid var(--gold-dim);
  padding: 0 0.35rem;
  margin-right: 0.4rem;
  color: var(--gold);
}

.keys {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 1.4s ease;
  text-align: center;
  width: min(640px, calc(100% - 8rem));
  pointer-events: none;
}

body.walking .keys { opacity: 0.72; }
body.walking .keys.fade { opacity: 0; }

.walk-btn {
  position: fixed;
  z-index: 4;
  top: 50%;
  width: 3.4rem;
  height: 5.2rem;
  transform: translateY(-50%);
  font-size: 1.8rem;
  line-height: 1;
  padding: 0;
  background: rgba(8, 4, 10, 0.35);
  border-color: rgba(232, 200, 114, 0.35);
}

body:not(.walking) .walk-btn, body:not(.touch) .walk-btn { display: none; }

#left { left: 0.8rem; }
#right { right: 0.8rem; }

.walk-btn.depth {
  top: auto;
  bottom: 1.15rem;
  width: 3.4rem;
  height: 3.1rem;
  transform: none;
  font-size: 1.15rem;
}

body.touch .keys { bottom: 4.9rem; }
body.touch .caption { bottom: 8rem; }

#forward { left: calc(50% - 4.4rem); }
#back { left: calc(50% + 1rem); }

.toast {
  position: fixed;
  z-index: 5;
  top: 4.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 2rem));
  text-align: center;
  padding: 0.7rem 1rem;
  background: rgba(10, 4, 12, 0.8);
  border: 1px solid rgba(142, 24, 48, 0.7);
  font-style: italic;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

#blackout {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

#blackout.on { opacity: 1; }

#gate {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  transition: opacity 1.15s ease;
}

#gate.leave {
  opacity: 0;
  pointer-events: none;
}

#gate[hidden] { display: none; }

.gate-card {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  text-align: center;
  padding: 3.2rem 2rem 2rem;
  background: rgba(8, 4, 12, 0.62);
  border: 1px solid var(--line);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 80px rgba(90, 10, 30, 0.25);
  backdrop-filter: blur(5px);
  user-select: text;
}

.gate-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #6e1228 0 16px,
    #12060c 16px 32px
  );
}

.eyebrow {
  margin: 0 0 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(3.4rem, 10vw, 6.4rem);
  line-height: 0.82;
  color: var(--bone);
  text-shadow: 0 0 28px rgba(142, 24, 48, 0.55);
}

h1 span { display: block; }

h1 span:last-child {
  color: #f7d7dc;
  animation: flicker 5.5s infinite;
}

@keyframes flicker {
  0%, 19%, 21%, 52%, 54%, 100% { opacity: 1; }
  20%, 53% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  h1 span:last-child { animation: none; }
}

.lede {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-style: italic;
  margin: 1.2rem auto 1.6rem;
  max-width: 28rem;
  line-height: 1.35;
}

#enter {
  font-size: 0.95rem;
  padding: 0.9rem 1.8rem;
}

.fine, .remember {
  margin: 1.1rem auto 0;
  max-width: 30rem;
  opacity: 0.72;
  font-size: 1.02rem;
  line-height: 1.35;
}

.remember { color: var(--gold); font-style: italic; opacity: 0.9; }

.dialog {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 10.4rem;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem));
  display: grid;
  gap: 0.4rem;
}

.dialog[hidden] { display: none; }

.dialog button {
  text-align: left;
  font-family: "Cormorant Garamond", Palatino, Georgia, serif;
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.9rem;
  background: rgba(8, 4, 10, 0.78);
}

.dialog kbd { margin-right: 0.5rem; opacity: 0.7; }
body.touch .dialog kbd { display: none; }
body.touch .dialog { bottom: 13rem; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #07040c;
  text-align: center;
  font-size: 1.4rem;
}

.cursor {
  position: fixed;
  z-index: 30;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: difference;
  display: none;
}

body.ready .cursor { display: block; }
body.ready.touch .cursor { display: none; }

@media (pointer: coarse) {
  .cursor { display: none !important; }
  .keys { width: calc(100% - 2rem); }
}

@media (max-width: 720px) {
  .where { display: none; }
  .hud { padding-inline: 0.7rem; }
  #guest { display: none; }
  .walk-btn { width: 3rem; height: 4.4rem; }
}

/* Die Tasche: Fundstücke, die noch nirgends stecken. */
.bag {
  position: fixed;
  z-index: 4;
  right: 1.25rem;
  bottom: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: min(22rem, 46%);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  pointer-events: none;
}

.bag[hidden], body:not(.walking) .bag { display: none; }

.bag span, .bag button {
  padding: 0.3rem 0.65rem;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: rgba(8, 4, 10, 0.6);
  border: 1px solid rgba(232, 200, 114, 0.35);
}

.bag button { pointer-events: auto; }
.bag button[aria-pressed="true"] { background: var(--gold); color: #1a0c10; }
.bag kbd { font: inherit; opacity: 0.7; margin-right: 0.2rem; }

body.touch .bag { bottom: 4.9rem; right: 0.8rem; }

/* Das Opernglas: ein runder Ausschnitt, der Rest bleibt Nacht. */
body.glass::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0, transparent 36vmin, rgba(0, 0, 0, 0.94) 41vmin);
}

body.glass .reticle { opacity: 0.35; }

/* Unter Wasser durch das Fenster des Taucherhelms: Messingrand, beschlagenes Glas. */
.helmview {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s;
  background:
    radial-gradient(ellipse 46vmin 42vmin at 50% 48%, transparent 0, transparent 78%, rgba(120, 160, 140, 0.12) 90%, rgba(70, 52, 22, 0.96) 93%, rgba(150, 112, 50, 0.95) 95%, rgba(40, 28, 12, 0.98) 98%, #050403 100%),
    radial-gradient(circle at 50% 48%, transparent 30vmin, rgba(160, 210, 190, 0.08) 44vmin);
}
body.diving .helmview { opacity: 1; }


/* Das Inventar: Fächer mit Bildern, mit der Maus zu bedienen. */
.inv {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(36rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 1rem 1.2rem 1.1rem;
  background: rgba(8, 4, 10, 0.9);
  border: 1px solid rgba(232, 200, 114, 0.4);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.inv[hidden], body:not(.walking) .inv { display: none; }
body.inv-open .lookhint, body.inv-open .prompt, body.inv-open .reticle { display: none !important; }

.inv h2 {
  margin: 0 0 0.8rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

#inv-close {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  padding: 0.1rem 0.55rem;
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--gold);
  background: none;
  border: 0;
}

.inv-grid {
  display: grid;
  /* minmax(0, …): lange Namen dürfen die Fächer nicht breiter machen als den Kasten. */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.inv .slot {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem;
  font: inherit;
  color: var(--gold);
  background: rgba(232, 200, 114, 0.05);
  border: 1px solid rgba(232, 200, 114, 0.22);
  transition: background 0.15s, border-color 0.15s;
}

.inv .slot.empty { border-style: dashed; border-color: rgba(232, 200, 114, 0.12); background: none; }
.inv .slot.on { background: rgba(232, 200, 114, 0.16); border-color: var(--gold); }
.inv .slot.away { color: var(--gold-dim); }
.inv .slot.away svg { opacity: 0.45; }

.inv .slot svg {
  width: 58%;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inv .slot svg .fill { fill: currentColor; stroke: none; }

.inv .slot i {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
}

.inv-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(232, 200, 114, 0.2);
}

.inv-detail p { margin: 0; font-style: italic; font-size: 1.05rem; line-height: 1.25; }

.inv-detail b {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

#inv-use {
  flex: none;
  padding: 0.45rem 0.8rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a0c10;
  background: var(--gold);
  border: 0;
}

#inv-use[hidden] { display: none; }
