@charset "utf-8";
/* Fallakte Nr. 8 - gemeinsames Design-System fuer Kinder-App und Admin.
   Regeln: 3px Rahmen, harter Schatten, Radius max 4px, keine Verlaeufe. */

:root {
  --cream: #FFFBEF;
  --ink: #1A1A1A;
  --yellow: #FFD23F;
  --blue: #1F5FBF;
  --lightblue: #E6F0FF;
  --red: #D7263D;

  --font-display: "Special Elite", "Courier New", monospace;
  --font-body: "Courier Prime", "Courier New", monospace;

  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 3px;

  --gap: 1rem;
  --btn-h: 64px;
}

/* 1rem = Fliesstext: 22px Handy, 26px ab iPad */
html { font-size: 22px; -webkit-text-size-adjust: 100%; }
@media (min-width: 768px) { html { font-size: 26px; } }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1, .h1 { font-size: 2.2rem; }
h2, .h2 { font-size: 1.6rem; }
h3, .h3 { font-size: 1.2rem; }
p { margin: 0 0 0.8em; }
img, svg { max-width: 100%; }
.small { font-size: 0.8rem; }
.center { text-align: center; }

:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

/* ---------- Kasten ---------- */
.box {
  background: var(--cream);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1rem;
}
.box-yellow { background: var(--yellow); }
.box-blue { background: var(--lightblue); }
.box-flat { box-shadow: none; }

/* ---------- Label ---------- */
.label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--blue);
}
.label-solid {
  background: var(--blue);
  color: var(--cream);
  padding: 0.25em 0.6em 0.1em;
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: var(--btn-h);
  padding: 0.35em 1.2em 0.2em;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.1;
  color: var(--ink);
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 60ms, box-shadow 60ms;
}
.btn-primary { background: var(--yellow); }
.btn-secondary { background: var(--cream); }
.btn-danger { background: var(--red); color: var(--cream); }
.btn-block { display: flex; width: 100%; }
.btn:active, .btn.is-pressed {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--ink);
}
.btn:disabled, .btn.is-disabled {
  cursor: not-allowed;
  color: rgba(26, 26, 26, 0.45);
  border-style: dashed;
  box-shadow: none;
  background: var(--cream);
  transform: none;
}

/* ---------- Stempel ---------- */
.stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--red);
  border: 4px solid var(--red);
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: var(--radius);
  padding: 0.45em 0.5em 0.25em 0.64em;
  transform: rotate(var(--stamp-rot, -6deg));
  transform-origin: center;
}
.stamp-geheim { --stamp-rot: -5deg; }
.stamp-geloest { --stamp-rot: -9deg; }
.stamp-verdaechtig { --stamp-rot: 4deg; }
.stamp-entlastet { --stamp-rot: -4deg; }
.stamp-lg { font-size: 2rem; border-width: 6px; outline-width: 3px; outline-offset: 5px; }
.stamp-sm { font-size: 0.7rem; border-width: 3px; outline: none; }
.stamp-animate { animation: stamp-slam 480ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes stamp-slam {
  0% { opacity: 0; transform: rotate(calc(var(--stamp-rot, -6deg) - 14deg)) scale(3.2); }
  55% { opacity: 1; transform: rotate(var(--stamp-rot, -6deg)) scale(0.92); }
  75% { transform: rotate(var(--stamp-rot, -6deg)) scale(1.06); }
  100% { opacity: 1; transform: rotate(var(--stamp-rot, -6deg)) scale(1); }
}

/* ---------- Absperrband ----------
   <div class="tape-zone"><div class="tape tape-animate"></div></div>
   Text kommt aus CSS, kein Markup noetig. */
.tape-zone { overflow: hidden; padding: 0.9rem 0; }
.tape {
  position: relative;
  width: 112%;
  margin-left: -6%;
  overflow: hidden;
  background: var(--yellow);
  border-top: var(--border);
  border-bottom: var(--border);
  transform: rotate(var(--tape-rot, -2deg));
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
  padding: 0.55em 0 0.3em;
}
.tape::before {
  display: inline-block;
  /* zwei identische Haelften, damit -50% nahtlos laeuft */
  content: "TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  TATORT \00B7  NICHT BETRETEN \00B7  ";
  white-space: pre;
}
.tape-reverse { --tape-rot: 2deg; }
.tape-animate::before { animation: tape-scroll 60s linear infinite; }
@keyframes tape-scroll { to { transform: translateX(-50%); } }
/* reines Streifenband ohne Text */
.tape-stripes {
  height: 0.9rem;
  border: var(--border);
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--ink) 14px 28px);
}

/* ---------- Felder ---------- */
.field {
  display: block;
  width: 100%;
  min-height: var(--btn-h);
  padding: 0.3em 0.6em 0.15em;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lightblue);
  border: var(--border);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}
.field::placeholder { color: rgba(26, 26, 26, 0.35); }
.field:focus, .digit-field:focus { outline: 4px solid var(--blue); outline-offset: 2px; }
.field.is-wrong, .digit-row.is-wrong .digit-field { border-color: var(--red); animation: shake 320ms; }

.digit-row { display: flex; gap: 0.4rem; justify-content: center; }
.digit-field {
  width: 1.65em;
  height: 2.1em;
  padding: 0.18em 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
  background: var(--lightblue);
  border: var(--border);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
/* Anzeige gefundener Code-Ziffern (div statt input) */
.digit-field.is-found, .digit-field.is-open {
  display: inline-flex; align-items: center; justify-content: center;
}
.digit-field.is-found { background: var(--yellow); box-shadow: var(--shadow-sm); }
.digit-field.is-open { background: var(--cream); border-style: dashed; color: rgba(26, 26, 26, 0.35); }
.digit-row-sm .digit-field { font-size: 1.1rem; }

@keyframes shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- Verdaechtigen-Karte ---------- */
.suspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.suspect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
button.suspect-card { cursor: pointer; touch-action: manipulation; transition: transform 60ms, box-shadow 60ms; }
button.suspect-card:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.suspect-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--lightblue);
  border-bottom: var(--border);
  overflow: hidden;
}
.suspect-photo > img, .suspect-photo > svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.suspect-time {
  position: absolute; left: 0; bottom: 0;
  background: var(--ink); color: var(--cream);
  font-size: 0.65rem; padding: 0.2em 0.5em 0.05em;
}
.suspect-info { padding: 0.5rem 0.6rem 0.45rem; }
.suspect-name { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.1; }
.suspect-traits { margin: 0.2rem 0 0; padding: 0; list-style: none; font-size: 0.62rem; line-height: 1.3; }
.suspect-traits li { padding-left: 1.2em; text-indent: -1.2em; }
.suspect-traits li::before { content: "- "; color: var(--blue); }
.suspect-card.is-selected { background: var(--yellow); outline: 4px solid var(--blue); outline-offset: 2px; }
.suspect-card.is-eliminated { box-shadow: none; color: rgba(26, 26, 26, 0.5); }
.suspect-card.is-eliminated .suspect-photo > img,
.suspect-card.is-eliminated .suspect-photo > svg { filter: grayscale(1); opacity: 0.45; }
.suspect-card.is-eliminated .suspect-photo::after {
  content: "";
  position: absolute; inset: 6%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M4 4L96 96M96 4L4 96' stroke='%23D7263D' stroke-width='9' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.suspect-card .stamp { position: absolute; top: 0.5rem; right: 0.3rem; background: rgba(255, 251, 239, 0.85); }

/* ---------- Audio-Play-Button ----------
   <button class="play-btn [is-playing|is-done]">
     <span class="play-btn-icon"></span><span class="play-btn-label">Anhören</span>
     <span class="play-btn-progress"><span class="play-btn-bar" style="width:40%"></span></span>
   </button> */
.play-btn {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.6rem;
  width: 100%;
  min-height: 60px;
  padding: 0.4rem 0.7rem 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  text-align: left;
  color: var(--ink);
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 60ms, box-shadow 60ms;
}
.play-btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.play-btn-icon {
  width: 36px; height: 36px;
  background: var(--ink);
  border-radius: var(--radius);
  position: relative;
}
.play-btn-icon::before {
  content: "";
  position: absolute; inset: 9px 8px 9px 12px;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.play-btn.is-playing .play-btn-icon::before {
  inset: 10px 10px;
  clip-path: polygon(0 0, 36% 0, 36% 100%, 0 100%, 0 0, 64% 0, 100% 0, 100% 100%, 64% 100%, 64% 0);
}
.play-btn-label { padding-top: 0.2em; }
.play-btn-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 8px;
  background: var(--cream);
  border-top: var(--border);
}
.play-btn-bar { display: block; height: 100%; width: 0; background: var(--blue); }
.play-btn.is-done .play-btn-bar { width: 100%; }

/* ---------- Screen-Geruest und untere Leiste ---------- */
.screen { display: flex; flex-direction: column; min-height: 100dvh; }
.screen-body { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.bottom-bar {
  display: flex;
  border-top: var(--border);
  background: var(--ink);
  gap: 3px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-bar > button, .bottom-bar > a {
  flex: 1;
  min-height: 56px;
  padding: 0.3em 0.5em 0.1em;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--cream);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
}
.bottom-bar > button:active, .bottom-bar > .is-open { background: var(--yellow); }
.bottom-bar .badge {
  display: inline-block; min-width: 1.5em; margin-left: 0.4em; padding: 0.15em 0.3em 0;
  background: var(--red); color: var(--cream); font-size: 0.7rem; border-radius: var(--radius);
}

/* ---------- Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center;
  padding: 1rem 0.8rem;
  background: rgba(26, 26, 26, 0.72);
  overflow-y: auto;
}
/* margin:auto zentriert und bleibt scrollbar, wenn der Inhalt hoeher ist als der Screen */
.overlay > * { margin: auto; flex: none; }
.overlay-panel {
  width: 100%; max-width: 34rem;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--yellow);
  padding: 1rem;
}
.overlay-panel-wide { max-width: 60rem; }
.overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.overlay-head > h2 { margin: 0; }

/* ---------- Eingehende Nachricht ---------- */
.msg-incoming {
  width: 100%; max-width: 30rem;
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--red);
}
.msg-incoming-head {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--red); color: var(--cream);
  border-bottom: var(--border);
  padding: 0.6rem 0.8rem 0.4rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}
.msg-incoming-head::before {
  content: ""; width: 0.7em; height: 0.7em; background: var(--cream); flex: none;
  animation: blink 0.9s steps(2, jump-none) infinite;
}
.msg-incoming-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.msg-sender { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.1; }
.msg-text { margin: 0; }
.msg-ring { animation: ring 0.7s 3; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ring {
  10%, 50% { transform: rotate(-1.6deg) translateX(-4px); }
  30%, 70% { transform: rotate(1.6deg) translateX(4px); }
  90% { transform: none; }
}

/* ---------- Fingerabdruck ---------- */
.fingerprint { display: inline-block; width: 3rem; height: auto; aspect-ratio: 4 / 5; }

/* ---------- Admin: kompakt, ohne Deko ---------- */
.admin { font-size: 16px; line-height: 1.35; }
.admin h1 { font-size: 24px; }
.admin h2 { font-size: 19px; margin-bottom: 8px; }
.admin h3 { font-size: 16px; }
.admin .box { padding: 10px; box-shadow: var(--shadow-sm); border-width: 2px; }
.admin .btn {
  min-height: 48px; font-size: 15px; padding: 6px 12px 3px;
  border-width: 2px; box-shadow: var(--shadow-sm);
}
.admin .btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.admin .btn-lg { min-height: 64px; font-size: 18px; }
.admin .field { min-height: 44px; font-size: 16px; border-width: 2px; letter-spacing: 0; text-transform: none; font-family: var(--font-body); }
.admin .label { font-size: 13px; }
.admin .digit-field { font-size: 22px; border-width: 2px; }
.admin-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-left-width: 12px;
  border-radius: var(--radius);
  background: var(--cream);
}
.admin-row + .admin-row { margin-top: 6px; }
.admin-row-nr { font-family: var(--font-display); font-size: 22px; line-height: 1; padding-top: 4px; }
.admin-row-title { font-family: var(--font-display); font-size: 16px; line-height: 1.15; }
.admin-row-meta { font-size: 13px; opacity: 0.7; }
.admin-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.admin-row-actions .btn { flex: 1 1 auto; }
.admin-row.is-locked { border-left-color: rgba(26, 26, 26, 0.3); }
.admin-row.is-unlocked { border-left-color: var(--blue); background: var(--lightblue); }
.admin-row.is-active { border-left-color: var(--yellow); background: #FFF3C2; }
.admin-row.is-solved { border-left-color: var(--ink); }
.status {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: 0.06em; line-height: 1;
  padding: 5px 7px 2px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  white-space: nowrap;
}
.status-locked { background: var(--cream); color: rgba(26, 26, 26, 0.55); border-style: dashed; }
.status-unlocked { background: var(--blue); color: var(--cream); }
.status-active { background: var(--yellow); }
.status-solved { background: var(--ink); color: var(--cream); }
.status-ok { background: var(--cream); }
.status-off { background: var(--red); color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .tape-animate::before, .msg-ring, .msg-incoming-head::before, .stamp-animate,
  .field.is-wrong, .digit-row.is-wrong .digit-field { animation: none; }
  .btn, .play-btn, button.suspect-card { transition: none; }
}
