/* =============================================================
   MOBILE FOLDER MODAL
   -------------------------------------------------------------
   Vollbild-Sheet das auf Mobile (<=720px) statt der Desktop-
   Mappe-Animation aufgeht. Slidet von unten hoch, scrollbar
   untereinander, behält Detective-Atmosphäre durch Tab-Look,
   Stempel, Polaroid und Schreibmaschinen-Schrift.

   Wird per JS getoggled (.is-open Klasse). Auf Desktop nie
   sichtbar (display: none ohne is-open).
   ============================================================= */
.mobile-folder-overlay {
  /* visibility statt display:none — display ist nicht animierbar.
     Mit visibility funktionieren Transitions sauber. */
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  /* Explizite Viewport-Units statt inset:0, weil body's overflow-x:hidden
     + position:relative den Body zum Containing-Block für position:fixed-
     Children machen kann. Mit 100vw/100vh ist die Größe unabhängig vom
     Containing-Block immer Viewport-Größe. */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  z-index: 250;
  background: rgba(0, 0, 0, 0);
  /* Beim Schließen wartet visibility 380ms (= transform-Dauer der Mappe),
     damit die Slide-Down-Animation noch komplett abgespielt wird, bevor
     das Element wirklich versteckt wird. Beim Öffnen sofort sichtbar
     (siehe is-open-Regel mit visibility 0s 0s). */
  transition: background 320ms ease, visibility 0s linear 380ms;
  overflow: hidden;
  box-sizing: border-box;
}
.mobile-folder-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.55);
  /* Beim Öffnen visibility sofort umschalten, damit der Sheet
     gleich animieren kann. */
  transition: background 320ms ease, visibility 0s linear 0s;
}

.mobile-folder {
  position: absolute;
  /* width/height: 100% relativ zum Overlay (das nun definitiv viewport-
     sized ist). Kein inset:0, damit nicht über Containing-Block-Sprünge
     unsicher wird. */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f0e0a8;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(180, 150, 80, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(220, 180, 100, 0.12), transparent 50%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.4, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono, 'Cutive Mono', monospace);
}
.mobile-folder-overlay.is-open .mobile-folder {
  transform: translateY(0);
}

.mobile-folder-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(247, 237, 210, 0.95);
  border: 1px solid rgba(95, 70, 30, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: var(--font-mono, monospace);
  font-size: 22px;
  line-height: 1;
  color: var(--ink, #2a1f15);
  font-weight: 600;
  padding: 0;
}
.mobile-folder-handle {
  width: 44px;
  height: 4px;
  background: rgba(95, 70, 30, 0.35);
  border-radius: 999px;
  margin: 0.7rem auto 0;
}

/* Akten-Tab (Header) */
.mf-tab-strip {
  position: relative;
  margin: 1rem 1.2rem 1.4rem;
  background: linear-gradient(180deg, #f7edd2 0%, #e8d896 100%);
  border: 1px solid rgba(95, 70, 30, 0.3);
  padding: 1.2rem 1.2rem 1rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transform: rotate(-0.6deg);
}
.mf-tab-strip::before {
  /* Klebeband oben */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 90px;
  height: 22px;
  background: rgba(255, 230, 130, 0.85);
  border: 1px solid rgba(150, 110, 60, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.mf-tab-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft, #5f4620);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.4rem;
}
.mf-tab-title {
  font-family: var(--font-display, 'Special Elite', monospace);
  font-size: 1.5rem;
  color: var(--ink, #2a1f15);
  text-align: center;
  margin: 0 0 0.3rem;
  font-weight: 400;
}
.mf-tab-loc {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(60, 40, 20, 0.6);
  text-transform: uppercase;
  text-align: center;
}

/* Status-Stempel */
.mf-status {
  text-align: center;
  margin: 0 1.2rem 1.5rem;
}
.mf-status-stamp {
  display: inline-block;
  border: 2.5px solid var(--stamp-red, #b82727);
  color: var(--stamp-red, #b82727);
  padding: 6px 18px;
  font-family: var(--font-display, 'Special Elite', monospace);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  font-weight: 600;
  background: rgba(255, 250, 230, 0.5);
}

/* Reward-Badges */
.mf-rewards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 1.2rem 1.8rem;
}
.mf-reward {
  background: rgba(247, 237, 210, 0.85);
  border: 1px solid rgba(95, 70, 30, 0.3);
  padding: 0.6rem 0.3rem 0.5rem;
  text-align: center;
}
.mf-reward.active {
  background: linear-gradient(180deg, #f7d96a 0%, #e8c245 100%);
  border-color: rgba(95, 70, 30, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}
.mf-reward-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  color: rgba(60, 40, 20, 0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mf-reward-num {
  font-family: var(--font-display, 'Special Elite', monospace);
  font-size: 1.3rem;
  color: var(--ink, #2a1f15);
  font-weight: 400;
}

/* Section-Divider */
.mf-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 1.2rem 1rem;
  padding-top: 0.5rem;
}
.mf-divider::before,
.mf-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(95, 70, 30, 0.25);
}
.mf-divider-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: rgba(60, 40, 20, 0.6);
  text-transform: uppercase;
}

/* Hinweis-Polaroid-Stack — wegwischbar wie auf Desktop */
.mf-photo-stack-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 1.2rem 1.8rem;
}
.mf-photo-stack {
  position: relative;
  width: 220px;
  height: 280px;
  margin-bottom: 0.8rem;
}
.mf-stack-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  transform: rotate(var(--tilt, 0deg));
}
.mf-stack-card.flying-left,
.mf-stack-card.flying-right {
  transition: transform 480ms cubic-bezier(0.4, 0.0, 0.2, 1),
              opacity 480ms ease;
}
.mf-stack-card.flying-left  { transform: translateX(-150%) rotate(-22deg) !important; opacity: 0 !important; pointer-events: none; }
.mf-stack-card.flying-right { transform: translateX(150%)  rotate(22deg)  !important; opacity: 0 !important; pointer-events: none; }
.mf-stack-polaroid {
  width: 100%;
  height: 100%;
  background: #fffaee;
  padding: 10px 10px 36px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(150, 110, 60, 0.25);
}
.mf-stack-photo {
  width: 100%;
  flex: 1;
  background: #1a1410;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mf-stack-photo img {
  width: 100%;
  height: 100%;
  /* contain statt cover: das GANZE Hinweisbild ist sichtbar, nichts wird
     abgeschnitten und nichts steht über. Ränder füllt der dunkle
     Polaroid-Fotogrund. */
  object-fit: contain;
  display: block;
}
/* Sealed/ungeöffnete Hinweise — verzerrt sodass das Bild nicht erkannt wird.
   Kein "Versiegelt"-Stempel-Text — der Streifen-Hintergrund + die Tatsache
   dass sich die Karte nicht wegwischen lässt sind Hinweis genug. */
.mf-stack-card.sealed .mf-stack-photo {
  background:
    repeating-linear-gradient(45deg, rgba(80, 60, 30, 0.08) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, #c0a878 0%, #8a7050 100%);
  position: relative;
}
.mf-stack-caption {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 17px;
  color: var(--ink-soft, #5f4620);
}
.mf-stack-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  color: var(--ink-soft, #5f4620);
  border: 1px dashed rgba(95, 70, 30, 0.3);
  background: rgba(247, 237, 210, 0.4);
  text-align: center;
  padding: 1rem;
}

.mf-stack-counter {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft, #5f4620);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.mf-stack-hint {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  color: rgba(60, 40, 20, 0.5);
  font-style: italic;
  text-align: center;
  transition: opacity 300ms ease;
}
.mf-stack-hint.is-faded { opacity: 0; }

/* Detective-Notizen */
.mf-notes {
  background: rgba(255, 250, 230, 0.55);
  border-left: 3px solid var(--stamp-red, #b82727);
  padding: 0.9rem 1.1rem;
  margin: 0 1.2rem 1.8rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #3a2818;
  font-style: italic;
}
.mf-notes-prefix {
  display: block;
  font-style: normal;
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(184, 39, 39, 0.85);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Akten-Stand-Tabelle */
.mf-stats {
  margin: 0 1.2rem 1.8rem;
  padding: 0.9rem 1rem;
  background: rgba(247, 237, 210, 0.5);
  border: 1px solid rgba(95, 70, 30, 0.18);
}
.mf-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(95, 70, 30, 0.18);
  gap: 1rem;
}
.mf-stat-row:last-child { border-bottom: none; }
.mf-stat-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(60, 40, 20, 0.65);
  text-transform: uppercase;
  flex-shrink: 0;
}
.mf-stat-value {
  font-family: var(--font-display, 'Special Elite', monospace);
  font-size: 0.9rem;
  color: var(--ink, #2a1f15);
  font-weight: 400;
  text-align: right;
}

/* Finder-Sektion */
.mf-finder {
  margin: 0 1.2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.mf-finder-polaroid {
  width: 200px;
  background: #fffaee;
  padding: 12px 12px 36px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: rotate(-1deg);
}
.mf-finder-polaroid::before {
  /* Klebeband */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 70px;
  height: 18px;
  background: rgba(180, 200, 240, 0.55);
  border: 1px dashed rgba(80, 100, 140, 0.3);
}
.mf-finder-photo {
  width: 100%;
  aspect-ratio: 1;
  background: #1a1410;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(244, 236, 216, 0.5);
}
.mf-finder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mf-finder-photo svg {
  width: 60%;
  height: auto;
}
.mf-finder-caption {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 17px;
  color: var(--ink-soft, #5f4620);
}
.mf-finder-note {
  background: rgba(255, 250, 230, 0.6);
  border: 1px solid rgba(95, 70, 30, 0.18);
  padding: 0.9rem 1.1rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #3a2818;
  font-style: italic;
  margin: 0;
}
.mf-finder-note.empty {
  opacity: 0.55;
  font-style: italic;
}

.mf-bottom-pad { height: 2.5rem; }

