/* =========================================================================
   AKTE NR. 70 — Stil: warme Schweizer Ermittlungsakte
   Papier, Tinte, Bordeaux, ein Hauch Gold. Mobile first.
   ========================================================================= */

:root {
  --paper: #f6f0e4;
  --paper-deep: #efe6d3;
  --card: #fbf7ee;
  --ink: #2b2620;
  --ink-soft: #5c5347;
  --line: #d8cdb8;
  --accent: #8c2f39;      /* Bordeaux */
  --accent-deep: #6f232c;
  --moss: #4a5d4a;
  --gold: #a8853c;
  --shadow: 0 2px 10px rgba(43, 38, 32, .10), 0 1px 3px rgba(43, 38, 32, .08);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Nova", Palatino, "Palatino Linotype", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(rgba(168, 133, 60, .05) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100dvh;
}

#app { max-width: 700px; margin: 0 auto; padding: 14px 16px 96px; }

/* ---------- Header ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 240, 228, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
}
.brand {
  font-family: var(--serif); font-weight: 700; letter-spacing: .14em;
  font-size: 15px; color: var(--ink);
  background: none; border: none; cursor: pointer; padding: 4px 0;
}
.brand .brand-no { color: var(--accent); }
#btn-fallbuch {
  border: 1.5px solid var(--accent); background: var(--card); color: var(--accent);
  border-radius: 999px; padding: 6px 14px; font-family: var(--serif); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
#btn-fallbuch .badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 12px; min-width: 20px; height: 20px; line-height: 20px; text-align: center;
  padding: 0 4px;
}

/* ---------- Bottom bar ---------- */
#bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: none; justify-content: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 240, 228, .94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
#bottombar button {
  flex: 1; max-width: 220px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 12px; font-family: var(--serif); font-size: 15px; cursor: pointer;
}

/* ---------- Views ---------- */
.view { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view, .toast { animation: none !important; transition: none !important; }
}

/* ---------- Titel ---------- */
.view-title { text-align: center; padding-top: 8vh; }
.title-stamp {
  display: inline-block; margin-bottom: 26px;
  border: 2.5px solid var(--accent); color: var(--accent);
  padding: 5px 16px; border-radius: 4px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .28em;
  transform: rotate(-3.5deg); opacity: .85;
}
.title-main {
  font-size: clamp(42px, 11vw, 64px); margin: 0; letter-spacing: .06em;
  font-weight: 700; line-height: 1.05;
}
.title-sub { margin: 10px 0 0; font-style: italic; color: var(--ink-soft); font-size: 19px; }
.title-paws { margin: 22px 0; font-size: 15px; letter-spacing: .4em; opacity: .5; }
.title-dedication {
  font-size: 17px; color: var(--accent-deep); margin: 0 0 34px;
  font-variant: small-caps; letter-spacing: .12em;
}
.title-note { margin-top: 34px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.7; }

/* ---------- Buttons ---------- */
.btn {
  display: block; width: 100%;
  font-family: var(--serif); font-size: 17px; line-height: 1.4;
  border-radius: var(--radius); padding: 13px 18px; cursor: pointer;
  text-align: left; transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: var(--accent); color: #fff; border: 1.5px solid var(--accent-deep);
  box-shadow: var(--shadow); text-align: center; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-choice {
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}
.btn-choice:hover { border-color: var(--accent); }
.btn-choice::before { content: '▸ '; color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--ink-soft); border: 1.5px dashed var(--line);
  text-align: center;
}
.btn-col { display: flex; flex-direction: column; gap: 12px; max-width: 340px; margin: 0 auto; }
.choices { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.link-quiet {
  background: none; border: none; color: var(--ink-soft); text-decoration: underline;
  font-family: var(--serif); font-size: 14.5px; cursor: pointer; opacity: .8;
}

/* ---------- Szene ---------- */
.scene-kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .18em;
  color: var(--moss); text-transform: uppercase; margin: 14px 0 6px;
}
.scene-title { font-size: 27px; line-height: 1.2; margin: 2px 0 14px; }
.scene-body .para { margin: 0 0 14px; }
.para { margin: 0 0 12px; }

.photo {
  margin: 0 0 18px; padding: 10px 10px 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 6px;
  transform: rotate(-.6deg);
}
.photo img {
  display: block; width: 100%; height: auto; border-radius: 3px;
  aspect-ratio: 4 / 3;            /* Platz wird vor dem Laden reserviert: kein Layoutsprung */
  max-height: 340px; object-fit: cover; object-position: center;
  background: var(--paper-deep);
}

.say {
  margin: 0 0 13px; padding: 10px 14px;
  background: var(--card); border-left: 3.5px solid var(--gold);
  border-radius: 0 10px 10px 0;
}
.say-who {
  display: block; font-family: var(--mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 2px;
}
.sp-pandi { border-left-color: #3d6b35; }
.sp-baeri { border-left-color: #a8853c; }
.sp-maira { border-left-color: #7b5ea7; }
.sp-beni  { border-left-color: #b0602f; }
.sp-nana, .sp-nani { border-left-color: var(--accent); }

.note {
  margin: 0 0 14px; padding: 14px 16px 14px 40px; position: relative;
  background: #fdf9ec; border: 1px solid #e5d9b8; border-radius: 4px;
  font-family: var(--mono); font-size: 14.5px; line-height: 1.65;
  box-shadow: var(--shadow); transform: rotate(.4deg);
}
.note-pin { position: absolute; left: 12px; top: 12px; }

.hintbox {
  margin: 0 0 13px; padding: 12px 14px;
  background: rgba(74, 93, 74, .08); border: 1px dashed var(--moss);
  border-radius: 10px; font-style: italic;
}

.result-card {
  margin: 20px 0 4px; padding: 14px 16px;
  background: var(--card); border: 1.5px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.result-head {
  font-family: var(--mono); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.ded-ok { border-color: var(--moss); }
.ded-ok .result-head { color: var(--moss); }
.ded-bad { border-color: var(--accent); }
.ded-bad .result-head { color: var(--accent); }

/* ---------- Hub ---------- */
.hub-head { margin: 16px 0 14px; }
.hub-kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.hub-title { font-size: 26px; margin: 0 0 8px; }
.hub-lede { color: var(--ink-soft); margin: 0; }
.hub-section {
  font-family: var(--mono); font-size: 13px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-soft); margin: 26px 0 10px;
}
.card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.loc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.loc-card {
  padding: 13px 13px 11px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--serif); transition: border-color .15s ease, transform .06s ease;
}
.loc-card:active { transform: scale(.98); }
.loc-card:hover { border-color: var(--accent); }
.loc-icon { font-size: 26px; line-height: 1.2; }
.loc-name { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.loc-sub { font-size: 13.5px; color: var(--ink-soft); }
.loc-status { margin-top: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.st-locked { color: var(--ink-soft); opacity: .75; }
.st-unknown { color: var(--moss); }
.st-new { color: var(--accent); font-weight: 700; }
.st-open { color: var(--gold); }
.st-done { color: var(--moss); }
.loc-locked { opacity: .62; }
.loc-locked .loc-icon { filter: grayscale(1); }

.person-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.person-card {
  padding: 13px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: var(--serif); text-align: left;
}
.person-card:hover { border-color: var(--accent); }
.p-icon { font-size: 24px; }
.p-name { font-weight: 700; font-size: 16.5px; flex: 1; }

.card-cta {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; margin: 14px 0 2px; cursor: pointer;
  border-color: var(--accent); background: linear-gradient(135deg, #fbf7ee 0%, #f7ecdc 100%);
  font-family: var(--serif); font-size: 16.5px; text-align: left;
}
.cta-icon { font-size: 26px; }
.cta-body { flex: 1; line-height: 1.45; }
.cta-go { color: var(--accent); font-size: 22px; font-weight: 700; }
.cta-final { border-color: var(--gold); }

.hub-foot { margin-top: 30px; text-align: center; }

/* ---------- Lead-Wahl ---------- */
.lead-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 18px; }
.lead-card { padding: 16px; }
.lead-photo { transform: rotate(.8deg); margin-bottom: 12px; }
.lead-photo img { max-height: 260px; }
.lead-name { margin: 0; font-size: 24px; }
.lead-role {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin: 3px 0 10px;
}
.lead-desc { margin: 0 0 14px; color: var(--ink-soft); }

/* ---------- Deduktion ---------- */
.ded-progress {
  font-family: var(--mono); font-size: 13px; color: var(--ink-soft);
  margin-bottom: 6px; letter-spacing: .08em;
}
.ded-intro { color: var(--ink-soft); font-style: italic; }

/* ---------- Medien ---------- */
.media-wrap { margin: 20px 0; }
.media-video, .media-audio { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
/* Hochformat-Video: nicht seitenfüllend hoch, sondern gedeckelt und zentriert */
.media-video {
  display: block; width: auto; max-width: 100%; height: auto;
  max-height: min(72vh, 640px); margin: 0 auto;
  background: #1d1a16; aspect-ratio: 9 / 16;
}
.media-poster { width: auto; max-width: 100%; max-height: min(60vh, 520px); border-radius: var(--radius); margin: 0 auto 10px; display: block; }

/* ---------- Geburtstagsgruss ---------- */
.greeting-card {
  margin: 26px 0 8px; padding: 18px 16px 20px;
  background: var(--card); border: 1.5px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
}
.greeting-photo {
  margin: 0 auto 16px; padding: 10px 10px 14px; max-width: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); transform: rotate(-1.2deg);
}
.greeting-photo img {
  display: block; width: 100%; height: auto; border-radius: 3px;
  aspect-ratio: 2 / 3; object-fit: contain; background: var(--paper-deep);
}
.greeting-text { max-width: 520px; margin: 0 auto; }
.greeting-salutation { font-size: 24px; font-weight: 700; margin: 6px 0 12px; }
.greeting-line { margin: 0 0 12px; font-size: 17.5px; line-height: 1.6; }
.greeting-closing { font-weight: 700; color: var(--accent-deep); font-size: 18px; margin-top: 16px; letter-spacing: .02em; }
.greeting-signature { font-family: var(--serif); font-style: italic; font-size: 20px; margin-top: 8px; color: var(--ink); }

/* ---------- Abschlussmeldung ---------- */
.closing-card {
  margin: 22px 0 6px; padding: 16px 18px; text-align: center;
  background: rgba(74, 93, 74, .08); border: 1px dashed var(--moss); border-radius: var(--radius);
}
.closing-title { font-family: var(--mono); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--moss); margin-bottom: 6px; }
.closing-text { margin: 0; color: var(--ink-soft); }
.media-placeholder {
  padding: 30px 20px; text-align: center;
  background: var(--card); border: 2px dashed var(--gold); border-radius: var(--radius);
}
.ph-icon { font-size: 40px; margin-bottom: 8px; }
.ph-title {
  font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); font-size: 14px; margin-bottom: 10px;
}

.stats-card {
  margin: 20px 0; padding: 14px 16px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.stats-list { margin: 0; padding-left: 20px; }
.stats-list li { margin-bottom: 4px; }

/* ---------- Fallbuch / Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(43, 38, 32, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .2s ease;
}
.fb-panel {
  background: var(--paper); width: 100%; max-width: 700px;
  max-height: 88dvh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .25);
}
.modal-panel { border-radius: 18px; max-width: 420px; margin: auto; }
.fb-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.fb-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.fb-tab {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 13px; font-family: var(--serif); font-size: 14px; cursor: pointer;
}
.fb-tab.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.fb-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.fb-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 15.5px;
}
.fb-item p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.fb-item-head { line-height: 1.4; }
.fb-discarded { opacity: .75; }
.fb-discarded .fb-item-head strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.fb-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; padding: 1px 6px; margin-left: 6px;
}
.fb-q { font-size: 15.5px; }
.fb-done { opacity: .6; text-decoration: line-through; text-decoration-thickness: 1px; }
.fb-empty { color: var(--ink-soft); font-style: italic; }
.fb-close { margin-top: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 76px; z-index: 70;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 9px 18px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 15px;
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
  max-width: 90vw; box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon { font-size: 17px; }

/* ---------- Grössere Screens ---------- */
@media (min-width: 620px) {
  body { font-size: 18px; }
  .loc-grid { grid-template-columns: 1fr 1fr 1fr; }
  .lead-grid { grid-template-columns: 1fr 1fr; }
  .overlay { align-items: center; }
  .fb-panel { border-radius: 18px; }
  .scene-title { font-size: 30px; }
}
