/* MUNKELBACH Web-Prototyp — „Illustriertes Fallakten-Dossier" (Eifelgold) */

:root {
  --creme: #f6efdf;
  --creme-tief: #efe6d0;
  --tusche: #2a211a;
  --siegel: #8c2f26;
  --gold: #e8b830;
  --moos: #3e5236;
  --moos-hell: #5c7048;
  --blass: #8a8270;
  --linie: #c9bd9c;
  --serif: "Baskerville", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --schreib: "American Typewriter", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  color: var(--tusche);
  background: var(--creme);
  line-height: 1.55;
  font-size: 17px;
}

/* Papierkorn + Vignette */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.13 0 0 0 0 0.10 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 130px rgba(90, 70, 50, .16);
}

#app { position: relative; z-index: 1; max-width: 620px; margin: 0 auto;
  padding: 0 16px calc(84px + env(safe-area-inset-bottom)); }

/* ---------- Kopf ---------- */
.kopf { text-align: center; padding: 26px 0 4px;
  border-bottom: double 3px var(--linie); margin-bottom: 18px; position: relative; }
.kraehe { width: 42px; height: 30px; fill: var(--tusche);
  position: absolute; right: 4px; bottom: -6px; }
.marke { font-family: var(--schreib); font-size: 11px; letter-spacing: .42em;
  color: var(--siegel); text-indent: .42em; }
.falltitel { font-size: clamp(30px, 8.5vw, 42px); line-height: 1.05;
  font-weight: 700; margin: 8px 0 4px; letter-spacing: -.01em; }
.untertitel { font-variant: small-caps; letter-spacing: .12em;
  color: var(--blass); font-size: 15px; padding-bottom: 14px; }

/* ---------- Panels ---------- */
.panel { animation: auftauchen .45s ease both; }
@keyframes auftauchen { from { opacity: 0; transform: translateY(10px); } }

.panel-intro { font-style: italic; color: var(--blass); font-size: 15px;
  margin: 4px 2px 14px; text-align: center; }

.aufmacher { width: 100%; border-radius: 6px; border: 1px solid var(--linie);
  box-shadow: 0 2px 14px rgba(42, 33, 26, .18); margin-bottom: 16px; }

.karte-box { background: rgba(255, 252, 243, .55);
  border: 1px solid var(--linie); border-radius: 6px;
  padding: 18px 18px 16px; margin-bottom: 16px; position: relative; }

.eyebrow { font-family: var(--schreib); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--tusche); margin-bottom: 10px; }
.eyebrow.rot, .rot { color: var(--siegel); }
.gold-eyebrow { color: #9a7714; }

#fallakte-text p { margin-bottom: .8em; text-align: justify; hyphens: auto; }
#fallakte-text p:last-child { margin-bottom: 0; }

.dossier { border-color: var(--siegel); }
.dossier dl { display: grid; grid-template-columns: 86px 1fr; gap: 7px 12px; font-size: 15px; }
.dossier dt { font-family: var(--schreib); font-size: 11px; letter-spacing: .06em;
  color: var(--siegel); padding-top: 3px; }

.regeln { padding-left: 0; list-style: none; counter-reset: regel; }
.regeln li { counter-increment: regel; position: relative;
  padding: 7px 0 7px 44px; font-size: 15.5px; }
.regeln li::before { content: counter(regel);
  position: absolute; left: 2px; top: 8px;
  width: 26px; height: 26px; border: 1.6px solid var(--siegel); border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; color: var(--siegel); font-size: 14px; }

.weiter { display: block; width: 100%; padding: 13px; margin: 4px 0 10px;
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  color: var(--creme); background: var(--tusche); border: 0; border-radius: 6px;
  cursor: pointer; }

/* ---------- Gerüchte ---------- */
.geruecht { margin-bottom: 22px; }
.geruecht .wer { display: grid; grid-template-columns: 74px 1fr; gap: 12px;
  align-items: start; margin-bottom: 10px; }
.geruecht img { width: 74px; height: 74px; object-fit: cover;
  border-radius: 5px; border: 1px solid var(--linie); }
.geruecht h2 { font-size: 19px; font-variant: small-caps; letter-spacing: .04em;
  line-height: 1.2; }
.geruecht .rolle { font-size: 13px; color: var(--blass); }
.geruecht .szene { font-size: 13.5px; font-style: italic; color: var(--blass);
  margin-top: 3px; line-height: 1.4; }

.saetze { border-left: 2.5px solid var(--gold); padding-left: 2px; }
.satz { display: block; width: 100%; text-align: left; cursor: pointer;
  font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--tusche);
  background: none; border: 0; border-radius: 5px;
  padding: 8px 10px 8px 34px; position: relative; transition: background .18s; }
.satz + .satz { margin-top: 2px; }
.satz::before { content: "○"; position: absolute; left: 10px; top: 9px;
  color: var(--blass); font-size: 14px; }
.satz.wahr { background: rgba(92, 112, 72, .13); }
.satz.wahr::before { content: "✓"; color: var(--moos); font-weight: 700; }
.satz.luege { background: rgba(140, 47, 38, .1); text-decoration: line-through;
  text-decoration-color: rgba(140, 47, 38, .55); text-decoration-thickness: 1.5px; }
.satz.luege::before { content: "✗"; color: var(--siegel); font-weight: 700; }
.satz.tipp { animation: pulsieren 1.1s ease 2; }
@keyframes pulsieren { 50% { background: rgba(232, 184, 48, .28); } }

.grundgesetz-tipp { font-family: var(--schreib); font-size: 12px;
  color: var(--siegel); margin: 6px 0 0 12px; min-height: 16px; }

.tag { font-size: 13px; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.tag.wahr { background: rgba(92, 112, 72, .18); color: var(--moos); }
.tag.luege { background: rgba(140, 47, 38, .14); color: var(--siegel); }

/* ---------- Karte ---------- */
.dorfkarte { position: relative; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--linie); box-shadow: 0 2px 14px rgba(42, 33, 26, .18); }
.dorfkarte img { width: 100%; display: block; }
#karten-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* --- Spielbrett: Orts-Hotspots + platzierte Porträts --- */
#brett-hotspots { position: absolute; inset: 0; z-index: 2; }
.hotspot { position: absolute; width: 40px; height: 40px; transform: translate(-50%, -50%);
  border: 0; background: transparent; cursor: pointer; padding: 0; border-radius: 50%; }
.hotspot::before { content: ""; position: absolute; inset: 11px; border-radius: 50%;
  border: 2px dashed rgba(42, 33, 26, .45); background: rgba(246, 239, 223, .35);
  transition: transform .15s, background .15s; }
.hotspot.tatort::before { border-color: var(--siegel); }
.waehlend .hotspot::before { transform: scale(1.25); background: rgba(232, 184, 48, .4);
  border-style: solid; border-color: var(--gold); }
.brett-marke { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
  transform: translate(calc(-50% + var(--i) * 13px), -50%);
  border-radius: 50%; border: 2px solid var(--creme); overflow: hidden;
  box-shadow: 0 1px 5px rgba(42, 33, 26, .4); animation: platzieren .25s cubic-bezier(.2,1.8,.5,1); }
.brett-marke img { width: 100%; height: 100%; object-fit: cover; }
@keyframes platzieren { from { transform: translate(-50%, -140%) scale(.4); opacity: 0; } }

.token-leiste { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px;
  -webkit-overflow-scrolling: touch; }
.token { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  gap: 3px; border: 0; background: none; cursor: pointer; padding: 2px; width: 58px; }
.token img { width: 50px; height: 50px; object-fit: cover; border-radius: 50%;
  border: 2.5px solid var(--linie); transition: border-color .15s, transform .15s; }
.token span { font-size: 11px; color: var(--blass); font-variant: small-caps; letter-spacing: .03em; }
.token.aktiv img { border-color: var(--gold); transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(232, 184, 48, .3); }
.token.aktiv span { color: var(--tusche); font-weight: 700; }
.token.platziert img { border-color: var(--moos); opacity: .55; }
.token.platziert::after { content: "✓"; position: absolute; margin: 2px 0 0 36px;
  color: var(--moos); font-size: 13px; font-weight: 700; }

.achse-probe { display: inline-block; width: 26px; height: 3px; vertical-align: middle;
  background-image: linear-gradient(90deg, var(--siegel) 62%, transparent 38%);
  background-size: 8px 3px; }

.orts-legende { list-style: none; padding: 12px 2px; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14px; }
.orts-legende b { display: inline-grid; place-items: center;
  width: 22px; height: 22px; border: 1.4px solid var(--tusche); border-radius: 50%;
  font-size: 12px; margin-right: 7px; background: var(--creme); }
.orts-legende li.tatort, .orts-legende li.tatort b { color: var(--siegel); border-color: var(--siegel); }

/* ---------- Matrix ---------- */
.matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--linie); border-radius: 6px; background: rgba(255,252,243,.55); }
.matrix { border-collapse: collapse; width: 100%; min-width: 470px; }
.matrix th, .matrix td { border: 1px solid var(--linie); text-align: center; }
.matrix th { font-family: var(--schreib); font-size: 11px; padding: 8px 2px;
  background: var(--creme-tief); font-weight: 400; }
.matrix th.tatort { color: var(--siegel); }
.matrix th[scope="row"] { font-family: var(--serif); font-variant: small-caps;
  font-size: 14.5px; text-align: left; padding: 0 10px; white-space: nowrap; }
.matrix td { min-width: 44px; height: 44px; cursor: pointer;
  font-size: 17px; user-select: none; -webkit-user-select: none; }
.matrix td[data-z="1"] { color: var(--siegel); }
.matrix td[data-z="2"] { color: var(--tusche); font-size: 20px; }

.geist { display: block; margin: 12px auto 0; background: none; cursor: pointer;
  border: 1px solid var(--linie); border-radius: 5px; color: var(--blass);
  font-family: var(--schreib); font-size: 12px; padding: 7px 14px; }

/* ---------- Lösung ---------- */
.lottoschein { border: 1.6px solid var(--gold); background: rgba(249, 243, 226, .8); }
.schein-hinweis { font-size: 15px; margin-bottom: 12px; }
.schein-felder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px; }
.schein-feld label { display: block; font-size: 13.5px; margin-bottom: 6px;
  line-height: 1.3; }
.schein-feld select { width: 100%; height: 52px; font-family: var(--serif);
  font-size: 22px; font-weight: 700; text-align: center; text-align-last: center;
  color: var(--tusche); background: var(--creme); border: 1.6px solid var(--tusche);
  border-radius: 5px; appearance: none; }
.pruefen { display: block; width: 100%; padding: 13px; border: 0; border-radius: 6px;
  font-family: var(--serif); font-size: 17px; font-weight: 700; cursor: pointer;
  color: var(--creme); background: var(--siegel); }
.pruefen:active { transform: translateY(1px); }
.schein-feedback { margin-top: 10px; font-style: italic; font-size: 15px;
  text-align: center; min-height: 22px; }
.schein-feedback.falsch { color: var(--siegel); animation: ruetteln .4s; }
@keyframes ruetteln { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.aufloesung { animation: auftauchen .6s ease both; }
.stempel { position: absolute; top: 10px; right: 12px; transform: rotate(9deg);
  font-family: var(--schreib); font-size: 15px; letter-spacing: .2em;
  color: var(--siegel); border: 2.5px solid var(--siegel); border-radius: 4px;
  padding: 3px 9px; opacity: .85; animation: stempeln .5s cubic-bezier(.2, 2.2, .4, 1) both .25s; }
@keyframes stempeln { from { transform: rotate(9deg) scale(2.4); opacity: 0; } }

.schritte { padding-left: 0; list-style: none; counter-reset: schritt; margin-bottom: 14px; }
.schritte li { counter-increment: schritt; padding: 7px 0 7px 34px;
  position: relative; font-size: 15px; }
.schritte li::before { content: counter(schritt) "."; position: absolute; left: 4px;
  font-weight: 700; color: var(--siegel); }
#epilog p { margin-bottom: .8em; font-size: 15.5px; }
.nachsatz { font-style: italic; color: var(--blass); font-size: 14.5px;
  border-top: 1px solid var(--linie); padding-top: 12px; }

/* ---------- Aktenreiter (Tab-Bar) ---------- */
.reiter { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--creme-tief);
  border-top: 1.6px solid var(--linie);
  box-shadow: 0 -4px 16px rgba(42, 33, 26, .1); }
.reiter button { flex: 1; max-width: 116px; padding: 9px 2px;
  font-family: var(--schreib); font-size: 12px; letter-spacing: .02em;
  color: var(--blass); background: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 6px 6px 0 0; }
.reiter button.aktiv { color: var(--tusche); background: var(--creme);
  border-color: var(--linie); border-bottom-color: var(--creme);
  font-weight: 700; position: relative; top: 1px; }

@media (min-width: 640px) {
  .orts-legende { grid-template-columns: 1fr 1fr 1fr; }
  body { font-size: 18px; }
}
