/* Jerry Auftrags-Wiki
   Dunkle Apple-Oberfläche (System-Farben aus dem Dark-Mode-Human-Interface-
   Guidelines-Palette: #000/#1c1c1e-Flächenhierarchie, Systemblau #0a84ff). */

:root {
  color-scheme: dark;

  --text:        #f5f5f7;
  --text-zweit:  #98989d;
  --flaeche:     #1c1c1e;
  --sektion:     #000000;
  --linie:       #38383a;
  --blau:        #0a84ff;
  --blau-hover:  #409cff;
  --gruen:       #30d158;
  --rot:         #ff453a;
  --gelb:        #ffd60a;
  --karte-bg:    #050506;

  --radius-gross: 18px;
  --radius-klein: 10px;
  --breite: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Segoe UI, Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  color: var(--text);
  background: var(--sektion);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  letter-spacing: -0.022em;
  line-height: 1.14;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: 40px; letter-spacing: -0.03em; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

p { margin: 0 0 1em; max-width: 72ch; }

a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--blau);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------- Kopfzeile */
.kopf {
  background: rgba(28,28,30,.78);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 500;
}
.kopf-inhalt {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 12px 22px;
  display: flex; align-items: center; gap: 18px;
}
.marke {
  color: var(--text);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.marke:hover { text-decoration: none; }
.kopf-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.wer { color: var(--text-zweit); font-size: 14px; }

/* ---------------------------------------------------------------- Layout */
.huelle {
  flex: 1;
  max-width: var(--breite);
  width: 100%;
  margin: 0 auto;
  padding: 40px 22px 64px;
}

.tafel {
  position: relative;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  padding: 32px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
/* Haarfeiner Lichtsaum an der Oberkante - gibt der Flaeche Tiefe, ohne
   dass ein schwerer Schatten noetig waere (auf Schwarz wirkt Licht, nicht
   Schatten). */
.tafel::before {
  content: '';
  position: absolute; inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius-gross) var(--radius-gross) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09) 22%, rgba(255,255,255,.09) 78%, transparent);
  pointer-events: none;
}
.tafel > h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.tafel > h2:not(:first-child) { margin-top: 34px; }

.kopfzeile-seite {
  display: flex; align-items: flex-end; gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.kopfzeile-seite h1 { margin: 0; }
.kopfzeile-seite .rechts { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.seiten-untertitel { color: var(--text-zweit); font-size: 16px; margin: 8px 0 0; }

/* --------------------------------------------------------------- Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 15px;
  border: 0; cursor: pointer;
  border-radius: 980px;
  padding: 9px 20px;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}
.knopf:hover { text-decoration: none; }
.knopf-primaer { background: var(--blau); color: #fff; }
.knopf-primaer:hover { background: var(--blau-hover); }
.knopf-zweit {
  background: transparent; color: var(--blau);
  border: 1px solid var(--blau);
}
.knopf-zweit:hover { background: rgba(10,132,255,.14); }
.knopf-text { background: transparent; color: var(--blau); padding: 9px 6px; }
.knopf-gefahr { background: transparent; color: var(--rot); border: 1px solid var(--rot); }
.knopf-gefahr:hover { background: rgba(255,69,58,.14); }
.knopf-klein { font-size: 14px; padding: 6px 14px; }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }
.knopf-block { width: 100%; }

/* ------------------------------------------------------------- Formulare */
label { display: block; margin-bottom: 18px; font-size: 15px; color: var(--text-zweit); }
label > span.pflicht { color: var(--rot); }

input[type=text], input[type=password], input[type=search], textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: 11px 13px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blau);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10,132,255,.25);
}
textarea { min-height: 190px; resize: vertical; line-height: 1.5; }
input[type=file] { font-size: 14px; margin-top: 6px; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-size: 15px; color: var(--text-zweit); padding: 0; margin-bottom: 8px; }

/* Segmentierte Auswahl (Abschluss-Modus) */
.segment { display: flex; gap: 0; border: 1px solid var(--linie); border-radius: var(--radius-klein); overflow: hidden; max-width: 520px; }
.segment label {
  flex: 1; margin: 0; text-align: center; cursor: pointer;
  padding: 11px 12px; font-size: 15px; color: var(--text);
  background: var(--flaeche);
  border-left: 1px solid var(--linie);
}
.segment label:first-child { border-left: 0; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment input:checked + span { color: #fff; }
.segment label:has(input:checked) { background: var(--blau); color: #fff; }

.schalter { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 16px; color: var(--text); }
.schalter input { width: 18px; height: 18px; accent-color: var(--blau); }

/* -------------------------------------------------------------- Hinweise */
.hinweis {
  border-radius: var(--radius-klein);
  padding: 13px 16px 13px 15px;
  font-size: 15px;
  margin: 0 0 18px;
  max-width: none;
  border-left: 3px solid currentColor;
}
.hinweis-info    { background: rgba(10,132,255,.13); color: #7cc0ff; }
.hinweis-erfolg  { background: rgba(48,209,88,.13);  color: #6fe092; }
.hinweis-fehler  { background: rgba(255,69,58,.13);  color: #ff8078; }
.hinweis-warnung { background: rgba(255,159,10,.13); color: #ffbd4a; }

/* -------------------------------------------------------------- Statleiste */
.statleiste { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.statkachel {
  flex: 1; min-width: 140px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  padding: 18px 22px;
}
.statzahl {
  display: block;
  font-size: 34px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.statlabel { display: block; font-size: 13px; color: var(--text-zweit); margin-top: 4px; }

/* ----------------------------------------------------------- Auftragsliste */
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.eintrag {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius-gross);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.eintrag:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(10,132,255,.45);
  box-shadow: 0 10px 28px rgba(10,132,255,.14), 0 2px 10px rgba(0,0,0,.35);
}
.eintrag-bild {
  width: 124px; height: 84px; flex: none;
  border-radius: 12px;
  border: 1px solid var(--linie);
  object-fit: cover; background: var(--sektion);
}
.eintrag-bild-leer {
  width: 124px; height: 84px; flex: none;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: var(--sektion);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; opacity: .35;
}
.eintrag-bild-leer::before { content: '🧭'; }
.eintrag-haupt { min-width: 0; flex: 1; }
.eintrag-titel { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; }
.eintrag-datum { color: var(--text-zweit); font-size: 13px; margin: 8px 0 0; }
.eintrag-belohnung { color: var(--text); font-size: 14px; margin: 8px 0 0; }

.chip-reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-zweit);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--linie);
  border-radius: 980px;
  padding: 3px 11px;
}

.marke-status {
  display: inline-block;
  font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: 980px;
  vertical-align: 2px;
}
.status-entwurf { background: rgba(255,159,10,.18); color: #ffbd4a; }
.status-fertig  { background: rgba(48,209,88,.18);  color: #6fe092; }

/* -------------------------------------------------------------- Stationen */
.stationen { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.station {
  display: flex; gap: 16px;
  padding: 16px 18px;
  background: var(--sektion);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
}
.station-nr {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blau); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.station-haupt { flex: 1; min-width: 0; }
.station-name { font-weight: 600; margin: 2px 0 4px; }
.station-text { color: var(--text-zweit); font-size: 15px; margin: 0 0 8px; }
.station-bild { max-width: 260px; border-radius: var(--radius-klein); display: block; }

/* Formular-Stationen */
.st-zeile {
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
  padding: 16px;
  margin-bottom: 14px;
  background: var(--flaeche);
}
.st-zeile.aktiv { border-color: var(--blau); box-shadow: 0 0 0 3px rgba(10,132,255,.22); }
.st-zeile-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.st-zeile-kopf .station-nr { width: 26px; height: 26px; font-size: 14px; }
.st-zeile-kopf .titel { font-weight: 600; font-size: 16px; }
.st-werkzeuge { margin-left: auto; display: flex; gap: 6px; }
/* Screenshot-Dropzone (Klick / Ziehen / Strg+V) */
.feldtitel { font-size: 15px; color: var(--text-zweit); margin-bottom: 6px; }
.datei-versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px dashed var(--linie);
  border-radius: var(--radius-klein);
  background: rgba(255,255,255,.02);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover { border-color: var(--blau); background: rgba(10,132,255,.06); }
.dropzone-drueber {
  border-color: var(--blau);
  border-style: solid;
  background: rgba(10,132,255,.14);
}
.dropzone-bild {
  width: 92px; height: 62px; flex: none;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--linie);
}
.dropzone-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dropzone-info strong { font-size: 15px; font-weight: 600; }
.dropzone-info span { font-size: 13px; color: var(--text-zweit); }

.st-koord { font-size: 13px; color: var(--text-zweit); }
.st-koord.gesetzt { color: #6fe092; }

/* ------------------------------------------------------------------ Karte */
.karte {
  height: 560px;
  border-radius: var(--radius-gross);
  background: var(--karte-bg);
  border: 1px solid var(--linie);
  overflow: hidden;
}
.karte-leer {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #98989d; font-size: 15px; text-align: center; padding: 30px;
}
.leaflet-container { background: var(--karte-bg); font: inherit; }

/* Leaflet-Bedienelemente an das dunkle Chrome anpassen */
.leaflet-bar, .leaflet-bar a {
  background: rgba(28,28,30,.92);
  border-color: var(--linie) !important;
  color: var(--text);
}
.leaflet-bar a:hover { background: rgba(56,56,58,.95); color: var(--text); }
.leaflet-bar a.leaflet-disabled { background: rgba(28,28,30,.5); color: var(--text-zweit); }
.leaflet-control-attribution { background: rgba(28,28,30,.7) !important; color: var(--text-zweit) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--flaeche); color: var(--text); }

.stift {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blau);
  color: #fff;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 5px rgba(0,0,0,.6);
}
.stift-jerry { background: var(--gelb); color: #1d1d1f; }

.blip-stift {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(28,28,30,.85);
  border: 1px solid var(--linie);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ---------------------------------------------------------- Belohnungen */
.belohnungen { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.belohnungen li {
  display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--sektion);
  border: 1px solid var(--linie);
  border-radius: var(--radius-klein);
}
/* Die Belohnung selbst ist die interessante Information - entsprechend
   staerker gesetzt als die Randdaten. */
.bel-text { font-weight: 600; font-size: 17px; flex: 1; min-width: 0; }
.bel-meta { color: var(--text-zweit); font-size: 13px; flex: none; }

.leer {
  color: var(--text-zweit);
  padding: 26px 0;
  font-size: 16px;
}

/* -------------------------------------------------------------- Tabellen */
table.tab { width: 100%; border-collapse: collapse; font-size: 15px; }
table.tab th, table.tab td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linie); }
table.tab th { color: var(--text-zweit); font-weight: 500; font-size: 14px; }

/* --------------------------------------------------------------- Filter */
.filter { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.filter label { margin: 0; }
.filter input[type=search] { min-width: 260px; }

.blaettern { display: flex; gap: 14px; align-items: center; margin-top: 22px; }

/* ---------------------------------------------------------------- Anmeldung */
.anmelden-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 13vh 22px 9vh;
}
.anmelden-glut {
  position: absolute;
  top: 50%; left: 50%;
  width: 1000px; height: 1000px;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(10,132,255,.28), rgba(10,132,255,.08) 42%, transparent 70%);
  pointer-events: none;
}
.anmelden-titel {
  position: relative;
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 10px;
}
.anmelden-byline {
  position: relative;
  font-size: 19px;
  color: var(--text-zweit);
  margin: 0 0 46px;
}
.anmelden {
  position: relative;
  max-width: 380px; margin: 0 auto;
  text-align: left;
  background: rgba(28,28,30,.72);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  padding: 32px;
}
.anmelden h2 { font-size: 20px; margin-bottom: 20px; }

/* ------------------------------------------------------------------ Fuß */
.fuss { border-top: 1px solid var(--linie); background: var(--sektion); }
.fuss-inhalt { max-width: var(--breite); margin: 0 auto; padding: 22px; }
.fuss p { font-size: 12px; line-height: 1.5; color: var(--text-zweit); margin: 0; max-width: 90ch; }

/* --------------------------------------------------------------- Details */
/* Jerrys Originaltext ist der inhaltliche Kern der Seite - entsprechend
   praesent, wie ein Zitat gesetzt. */
.jerry-text {
  white-space: pre-wrap;
  background: var(--sektion);
  border-left: 3px solid var(--gelb);
  border-radius: 4px var(--radius-klein) var(--radius-klein) 4px;
  padding: 22px 24px;
  margin: 0;
  max-width: none;
  font-size: 18px;
  line-height: 1.62;
}
.daten { display: flex; gap: 26px; flex-wrap: wrap; color: var(--text-zweit); font-size: 14px; margin-bottom: 4px; }

/* Loeschen sitzt bewusst abgesetzt und ruhig am Seitenende - sichtbar,
   aber nicht auf einer Stufe mit den normalen Aktionen. */
.gefahrenzone {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 22px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,69,58,.3);
  border-radius: var(--radius-gross);
  background: rgba(255,69,58,.05);
}
.gefahrenzone > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 220px; }
.gefahrenzone strong { font-size: 15px; font-weight: 600; }
.gefahrenzone span { font-size: 13px; color: var(--text-zweit); }
.gefahrenzone form { margin-left: auto; }

/* --------------------------------------------------------------- Mobil */
@media (max-width: 720px) {
  h1 { font-size: 30px; }
  .huelle { padding: 26px 16px 48px; }
  .tafel { padding: 20px; border-radius: 14px; }
  .karte { height: 420px; }
  .eintrag-bild, .eintrag-bild-leer { width: 76px; height: 54px; }
  .kopf-inhalt { padding: 10px 16px; }
  .filter input[type=search] { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------- Screenshot auslesen */
.vorlesen {
  background: var(--sektion);
  border-radius: var(--radius-klein);
  padding: 16px;
  margin-bottom: 22px;
}
.vorlesen .hinweis { margin: 0; }
