/* Walk of Mystery – Website-Prototyp. Keine externen Schriften/Skripte (Datenschutz-Versprechen). */
:root {
  --night: #0d1216;
  --ink: #2b1d10;
  --parch: #f4e7c5;
  --parch-2: #e9d7aa;
  --edge: #6b4a22;
  --gold: #d9a441;
  --green: #3f9a3c;
  --red: #a3241c;
  --blue: #3c6edc;
  --gray: #8f8f8f;
  --text: #f6efe0;
  --muted: #c9bda3;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 17px/1.5 var(--serif);
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }

/* ---------- Welt ---------- */
#world {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100lvh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  z-index: 0;
}
#track { position: relative; z-index: 1; pointer-events: none; }

/* Hände */
.hand {
  position: fixed; bottom: 0; z-index: 2; pointer-events: none;
  height: min(46vh, 62vw);
  will-change: transform;
  filter: drop-shadow(0 0 6px rgba(0,0,0,.35));
}
.hand.left { left: max(-2vw, calc(50vw - 46vh)); transform-origin: bottom left; }
.hand.right { right: max(2vw, calc(50vw - 46vh)); transform-origin: bottom right; }
.hand.shield {
  height: min(30vh, 44vw); left: max(-10vw, calc(50vw - 50vh)); bottom: -6vh; transform-origin: bottom left;
  opacity: 0; transition: opacity .35s;
}
.hand.left { transition: opacity .35s; }
body.noTorch .hand.left { opacity: 0; }
body.noTorch .hand.shield { opacity: 1; }
#torchglow { transition: opacity .3s; }
body.atFaq .hand, body.atFaq #torchglow, body.atFaq .stage, body.atFaq .scrollhint { opacity: 0 !important; pointer-events: none; }
body.atFaq .hand { transition: opacity .3s; }
#torchglow {
  position: fixed; z-index: 1; pointer-events: none;
  width: 70vh; height: 70vh; left: calc(max(-2vw, calc(50vw - 46vh)) - 22vh); bottom: 8vh;
  background: radial-gradient(closest-side, rgba(255,170,60,.28), rgba(255,140,40,.10) 55%, transparent);
  mix-blend-mode: screen;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
.hud .logo { font-size: 15px; letter-spacing: .06em; color: var(--gold); white-space: nowrap; }
.hud .meters { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 15px; }
.lang { display: flex; border: 2px solid var(--edge); border-radius: 8px; overflow: hidden; }
.lang button {
  font: 700 13px var(--serif); padding: 5px 8px; border: 0; cursor: pointer;
  background: rgba(30,20,10,.7); color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* Biom-Leiste wie die Fortschrittsleiste im Spiel */
.route {
  position: fixed; z-index: 5; left: 14px; right: 14px; top: calc(max(10px, env(safe-area-inset-top)) + 40px);
  display: flex; gap: 4px; align-items: center;
}
.route i {
  flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); position: relative; overflow: hidden;
}
.route i b { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #6fcf5a, var(--gold)); }
.route i.locked::after { content: ""; }

/* Biom-Banner wie "Der alte Wald" im Spiel */
.banner {
  position: fixed; z-index: 4; left: 0; right: 0; top: 22vh; text-align: center; pointer-events: none;
  font-size: clamp(30px, 8vw, 54px); font-weight: 700; color: #fff;
  text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,.7);
  opacity: 0; transition: opacity .8s;
}
.banner small { display: block; font-size: .42em; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.banner.show { opacity: 1; }

/* ---------- Karten (Stil der Spielkarten) ---------- */
.stage {
  position: fixed; z-index: 6; left: 0; right: 0; top: 0; bottom: 0;
  display: grid; place-items: center; pointer-events: none; padding: 92px 16px 30vh;
}
.card {
  width: min(380px, 100%);
  background: linear-gradient(var(--parch), var(--parch-2));
  color: var(--ink);
  border: 4px solid var(--green);
  outline: 3px solid #1d3b17;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.35);
  padding: 0 18px 16px;
  opacity: 0; transform: translateY(40px) scale(.96);
  transition: opacity .45s, transform .45s cubic-bezier(.2,.9,.3,1.2);
  pointer-events: none;
  position: absolute;
}
.card.show { opacity: 1; transform: none; pointer-events: auto; }
.card.gold { border-color: var(--gold); outline-color: #4d3410; }
.card.dark { background: linear-gradient(#2a2420, #15110e); color: var(--text); border-color: #5b1712; outline-color: #000; }
.card .ribbon {
  margin: -4px -18px 12px; padding: 10px 14px; text-align: center;
  background: linear-gradient(#b52c22, #861a13); color: #fff; font-weight: 700; font-size: 19px;
  border-radius: 10px 10px 0 0; text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.card.gold .ribbon { background: linear-gradient(#e2b24c, #a8741f); color: #2b1a05; text-shadow: none; }
.card.dark .ribbon { background: linear-gradient(#3a0f0b, #1d0605); }
.card h2 { font-size: 22px; margin: 4px 0 6px; line-height: 1.2; }
.card p { margin: 0 0 10px; }
.card .facts { display: flex; gap: 8px; margin: 12px 0 0; }
.card .facts div {
  flex: 1; text-align: center; background: rgba(107,74,34,.12); border: 2px solid rgba(107,74,34,.35);
  border-radius: 8px; padding: 6px 2px; font-size: 12px; line-height: 1.2;
}
.card .facts b { display: block; font-size: 22px; }
.enc { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.enc li { display: flex; gap: 10px; align-items: center; background: rgba(107,74,34,.10); border-radius: 8px; padding: 6px 10px; }
.enc .ic { font-size: 22px; width: 28px; text-align: center; }
.enc b { display: block; line-height: 1.2; }
.enc span { font-size: 14px; color: #5c4630; }

/* Item-Karte (Wisch-Teaser) */
.item {
  display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center;
  background: #fffaf0; border: 3px solid var(--blue); border-radius: 10px; padding: 10px; margin: 8px 0;
  touch-action: pan-y; user-select: none; cursor: grab; position: relative;
  transition: transform .25s;
}
.item.common { border-color: var(--gray); }
.item.unc { border-color: var(--green); }
.item.unc .rar { color: #2f7d2a; }
.item img { width: 74px; height: 74px; object-fit: contain; image-rendering: pixelated; background: #e9e1cf; border-radius: 8px; }
.item .rar { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); }
.item.common .rar { color: #6c6c6c; }
.item .nm { font-weight: 700; font-size: 18px; line-height: 1.15; }
.item .st { font-size: 14px; }
.item .st .up { color: #237a1f; font-weight: 700; }
.item .st .dn { color: #a3241c; font-weight: 700; }
.vs { text-align: center; font-size: 12px; color: #7a6145; margin: -2px 0; }
.swipehint { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-top: 4px; }
.swipehint .l { color: #a3241c; } .swipehint .r { color: #237a1f; }
.verdict { min-height: 1.5em; font-size: 15px; font-style: italic; margin: 6px 0 0; }

/* Boss-Silhouette */
.boss { display: grid; place-items: center; margin: 4px 0 10px; }
.boss img {
  height: 210px; filter: brightness(0) drop-shadow(0 0 14px rgba(160,255,140,.35));
  animation: breathe 3.2s ease-in-out infinite;
}
.boss .q { font-size: 30px; font-weight: 700; letter-spacing: .3em; color: #9ad18d; margin-top: 4px; }
@keyframes breathe { 50% { transform: scale(1.025) translateY(-3px); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 16px var(--serif); padding: 12px 16px; border-radius: 10px; cursor: pointer;
  border: 3px solid #1d3b17; background: linear-gradient(#57b44f, #2f7d2a); color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.35); text-decoration: none; min-height: 48px;
}
.btn.alt { border-color: #4d3410; background: linear-gradient(#e2b24c, #a8741f); color: #2b1a05; text-shadow: none; }

/* ---------- Weggabelung (Start) ---------- */
.fork {
  position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 30%, rgba(0,0,0,.55));
  transition: opacity .6s;
}
.fork.gone { opacity: 0; pointer-events: none; }
.fork .title { text-align: center; margin-bottom: 16px; text-shadow: 0 3px 0 #000, 0 0 20px rgba(0,0,0,.8); }
.fork .title h1 { margin: 0; font-size: clamp(36px, 10vw, 64px); line-height: 1; color: #fff; }
.fork .title p { margin: 8px 0 0; color: var(--gold); font-weight: 700; letter-spacing: .08em; }
.fork .card { position: relative; opacity: 1; transform: none; pointer-events: auto; touch-action: none; cursor: grab; }
.fork .sign { display: block; margin: 0 auto 6px; height: 92px; image-rendering: pixelated; }
.fork .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.fork .choices .btn { font-size: 15px; padding: 10px 8px; }
.fork .hint { text-align: center; font-size: 13px; color: #6c5338; margin-top: 10px; }

.scrollhint {
  position: fixed; z-index: 6; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-weight: 700; font-size: 14px; text-shadow: 0 2px 0 #000; animation: bob 1.6s ease-in-out infinite;
  transition: opacity .5s; pointer-events: none;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

.proto-tag {
  position: fixed; z-index: 9; right: 8px; bottom: 8px; font: 700 11px ui-monospace, Consolas, monospace;
  background: rgba(0,0,0,.6); color: #ffd36a; padding: 4px 8px; border-radius: 6px; pointer-events: auto;
}
.proto-tag a { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .card, .banner, .fork { transition: none; }
  .boss img, .scrollhint { animation: none; }
}

/* ---------- Ergänzungen: alle Biome, FAQ ---------- */
.ph { background: #ffe9a8; color: #5a3d00; border-radius: 4px; padding: 0 4px; font-size: .82em; font-weight: 700; }
.card .small, .card p.small { font-size: 14px; color: #5c4630; margin-top: 10px; }
.card.dark .small { color: var(--muted); }
.hud .faqlink { color: var(--text); font-size: 13px; text-decoration: none; border: 2px solid var(--edge); border-radius: 8px; padding: 3px 7px; background: rgba(30,20,10,.6); }
.hud .meters { margin-left: auto; }
@media (max-width: 400px) { .hud .logo { font-size: 12px; letter-spacing: .03em; } }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle button {
  font: 700 16px var(--serif); padding: 10px; border-radius: 10px; cursor: pointer; min-height: 48px;
  border: 3px solid #6b4a22; background: #fffaf0; color: var(--ink);
}
.toggle button[aria-pressed="true"] { background: linear-gradient(#e2b24c, #a8741f); border-color: #4d3410; }

.attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.attrs div { background: rgba(107,74,34,.10); border-radius: 8px; padding: 6px 8px; display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; align-items: center; }
.attrs span { grid-row: 1 / 3; font-size: 20px; text-align: center; }
.attrs b { font-size: 15px; line-height: 1.2; }
.attrs small { font-size: 12px; line-height: 1.25; color: #5c4630; }

.foes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.foes figure { margin: 0; text-align: center; background: radial-gradient(#3b4466, #1c2036); border-radius: 8px; padding: 6px 4px 4px; }
.foes img { width: 100%; height: 74px; object-fit: contain; image-rendering: pixelated; }
.foes figcaption { font-size: 11px; line-height: 1.2; color: #f3ead5; margin-top: 2px; }

.item.relic { border-color: #9a46d2; cursor: default; grid-template-columns: 52px 1fr; padding: 8px; margin: 6px 0; }
.item.relic img { width: 52px; height: 52px; }
.item.relic .nm { font-size: 16px; }
.setrow { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.setrow img { width: 54px; height: 54px; image-rendering: pixelated; background: #e9e1cf; border-radius: 8px; border: 2px solid #d9a441; }

.card .store { font-weight: 700; text-align: center; }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.btnrow .btn { font-size: 15px; padding: 10px 8px; }
.linkbtn { background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 0; color: inherit; }
.linkbtn.back { display: block; margin: 10px auto 0; text-decoration: underline; font-size: 14px; }
.fork .forkfaq { text-align: center; margin: 14px 0 0; }
.fork .forkfaq a { color: #fff; font-weight: 700; text-shadow: 0 2px 0 #000; }

/* FAQ unter dem Spaziergang */
.faq {
  position: relative; z-index: 7; padding: 60px 16px 80px;
  background: linear-gradient(rgba(10,8,6,0), rgba(10,8,6,.92) 120px);
}
.faqwrap { max-width: 720px; margin: 0 auto; }
.faq h2 { font-size: clamp(28px, 7vw, 40px); text-align: center; margin: 40px 0 20px; text-shadow: 0 3px 0 #000; }
.faq details {
  background: linear-gradient(var(--parch), var(--parch-2)); color: var(--ink);
  border: 3px solid var(--edge); border-radius: 12px; margin: 0 0 10px; padding: 0 16px;
}
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; padding: 14px 0; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 22px; color: var(--edge); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 14px; }
.faq details a { color: #7a4a10; }
.faq .legal { text-align: center; margin-top: 28px; font-size: 14px; }
.faq .legal a { color: var(--muted); }
.stage .card[data-id="end"] { align-self: start; }

/* Ausgeblendete Weggabelung darf nichts mehr abfangen (sonst trifft man unsichtbare Buttons) */
.fork.gone { visibility: hidden; transition: opacity .6s, visibility 0s linear .6s; }
.fork.gone, .fork.gone * { pointer-events: none !important; }

/* Auto-Laufen */
.autobtn {
  position: fixed; z-index: 7; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  font: 700 15px var(--serif); padding: 10px 16px; min-height: 44px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--edge); background: rgba(30,20,10,.78); color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: opacity .4s;
}
.autobtn[hidden] { display: none; }
.autobtn.off { background: linear-gradient(#57b44f, #2f7d2a); border-color: #1d3b17; color: #fff; }
.autohint { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px); }
body.atFaq .autobtn { opacity: 0; pointer-events: none; }

/* Hinweis unten links (Website ≠ Spielgrafik) */
.webnote {
  position: fixed; z-index: 7; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom));
  max-width: min(250px, calc(50vw - 110px)); padding: 6px 10px; border-radius: 8px;
  font: italic 12.5px/1.35 var(--serif); color: var(--muted);
  background: rgba(20,13,8,.62); border: 1px solid rgba(217,164,65,.35);
  pointer-events: none; transition: opacity .4s;
}
@media (max-width: 640px) {
  .webnote { max-width: 58vw; font-size: 11.5px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 100px); }
}
body.atFaq .webnote { opacity: 0; }
.card a:not(.btn) { color: #7a4a10; }
