/* Fortschritt und Ziele (docs/04 Abschnitt 12): Fenster „Erfolge“ und der Hinweis oben in
   der Leitstelle. Farben aus app.css, die Stufenfarben kommen aus dem Content. */

.erf-fenster { width: min(960px, 96vw); min-height: min(520px, 80dvh); max-height: 88dvh; }
.erf-fenster .modal-body { gap: .75rem; }

.erf-kopfzeile {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-size: .85rem; color: var(--muted);
}
.erf-kopfzeile b { color: var(--text); }
.erf-kopfzeile .erf-balken { flex: 1 1 160px; max-width: 320px; }

.erf-balken {
  display: inline-block; height: 6px; border-radius: 3px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden; vertical-align: middle; min-width: 60px;
}
.erf-balken > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.erf-zahl { font-family: var(--mono); font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ── Medaille ─────────────────────────────────────────────────────────────── */
.erf-medaille { position: relative; display: inline-block; flex: none; }
.erf-medaille svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.erf-medaille img {
  position: absolute; left: 21.9%; top: 13.75%; width: 56.25%; height: 56.25%;
  object-fit: contain;
}
.erf-medaille.offen img { opacity: .28; }

/* ── Abzeichen ────────────────────────────────────────────────────────────── */
/* Jede Karte eine Zeile hoch stretchen (Grid-Standard), damit Balken und Stufen
   trotz unterschiedlich langer Beschreibung in gleicher Höhe stehen: die
   Beschreibung wächst (flex: 1), der Rest bleibt unten. */
.erf-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .6rem; align-items: stretch; }
.erf-karte {
  display: flex; gap: .7rem; align-items: stretch; padding: .65rem .7rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.erf-karte .erf-medaille { align-self: flex-start; }
.erf-karte-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.erf-name { font-weight: 700; }
.erf-desc { flex: 1; font-size: .78rem; color: var(--muted); }
.erf-karte.offen .erf-name { color: #c3c7cd; }
.erf-stand { display: flex; align-items: center; gap: .5rem; }
.erf-stand .erf-balken { flex: 1; }
.erf-stand.fertig { font-size: .75rem; color: var(--ok); }
.erf-stufen { display: flex; gap: .3rem; flex-wrap: wrap; }
.erf-stufe {
  font-size: .66rem; padding: .05rem .4rem; border-radius: 8px;
  border: 1px solid var(--line); color: var(--muted);
}
.erf-stufe.an { border-color: var(--stufe); color: var(--text); background: color-mix(in srgb, var(--stufe) 22%, transparent); }

/* ── Sammelalbum ──────────────────────────────────────────────────────────── */
.erf-org { margin-bottom: 0; }
.erf-org .reiter-knopf { border-left: 3px solid var(--org, var(--line)); }
.erf-kategorie { display: flex; flex-direction: column; gap: .4rem; }
.erf-kategorie-kopf { display: flex; align-items: center; gap: .6rem; }
.erf-kategorie-name { font-weight: 700; font-size: .85rem; min-width: 0; }
.erf-kategorie-kopf .erf-balken { flex: 1 1 80px; max-width: 220px; }
.erf-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .4rem; }
.erf-eintrag {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
  padding: .45rem .35rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 92px;
}
.erf-eintrag img { width: 40px; height: 40px; object-fit: contain; }
.erf-eintrag-name { font-size: .72rem; line-height: 1.25; overflow-wrap: anywhere; }
.erf-eintrag-info { font-size: .66rem; color: var(--muted); }
.erf-eintrag.unbekannt { border-style: dashed; background: transparent; }
.erf-eintrag.unbekannt img { filter: brightness(0) invert(1); opacity: .13; }
.erf-eintrag.unbekannt .erf-eintrag-name { color: var(--muted); font-style: italic; }

/* ── Wochenaufträge ───────────────────────────────────────────────────────── */
.erf-wochen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.erf-auftrag {
  display: flex; flex-direction: column; gap: .45rem; padding: .7rem .8rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.erf-auftrag.fertig { border-color: var(--ok); }
.erf-auftrag.fertig .erf-balken > span { background: var(--ok); }
.erf-auftrag-kopf { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.erf-auftrag-text { font-weight: 600; }
.erf-belohnung { display: flex; gap: .5rem; font-size: .78rem; color: var(--accent); }
.erf-haken { color: var(--ok); font-weight: 800; }

/* ── Hinweis beim Erreichen ───────────────────────────────────────────────── */
.erf-hinweise {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none;
}
.erf-hinweis {
  pointer-events: auto; display: flex; align-items: center; gap: .65rem; text-align: left;
  padding: .45rem .9rem .45rem .5rem; border-radius: 26px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
  animation: erf-rein .35s ease-out;
}
.erf-hinweis-bild { display: inline-flex; }
.erf-hinweis-bild.erf-haken {
  width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center;
  border: 2px solid var(--ok); font-size: 1.2rem;
}
.erf-hinweis-text { display: flex; flex-direction: column; font-size: .85rem; }
.erf-hinweis-marke { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
@keyframes erf-rein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  .erf-fenster { width: 100vw; height: 100dvh; min-height: 0; max-height: 100dvh; border-radius: 0; }
  .erf-raster, .erf-wochen { grid-template-columns: 1fr; }
  .erf-album { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .erf-hinweise { top: 56px; width: calc(100vw - 24px); }
  .erf-hinweis { width: 100%; }
}
