/* collector - Bestandsseite.
 *
 * Dieselben Randbedingungen wie bei crybot, aus demselben Grund: das hier
 * wird auf einem iPhone vom Homescreen gestartet.
 *
 * 1. Kein Adressleistenbereich im Standalone-Modus -- ueberall
 *    env(safe-area-inset-*), sonst laeuft der Inhalt unter die Dynamic Island.
 * 2. Kein Zurueck-Knopf. Die Seite muss auf einen Blick verstaendlich sein.
 * 3. Daumen, nicht Maus. Nichts Antippbares unter 44 px.
 * 4. Mobilfunknetz. Keine Web-Fonts, keine Bibliotheken, drei Dateien.
 *
 * Und die Regel aus crybot: **Zahlen und Marken, keine Erklaerungen.**
 * Erklaertext wiederholt sich pro Zeile und frisst den Platz. Was begruendet
 * werden muss, steht in den .md-Dateien im Projekt.
 */

:root {
  --grund: #0E1621;
  --karte: #16212E;
  --karte-rand: #223141;
  --tinte: #E8EDF2;
  --leise: #8A9AAB;
  --linie: #33455A;
  --auf: #2FBF71;
  --ab: #E5654F;
  --warn: #E8B23A;
  --radius: 16px;
}

* { box-sizing: border-box; }

html {
  background: var(--grund);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 400 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.huelle {
  max-width: 640px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 14px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + 28px)
    calc(env(safe-area-inset-left, 0px) + 16px);
}

/* --- Pull-to-refresh ---------------------------------------------------- */
/* **Diese beiden Regeln standen bis zum 06.09.2026 in pull-refresh.js** und
   wurden dort per document.createElement('style') eingehaengt. Das blockt
   die CSP: `style-src 'self'` verbietet auch ein vom Skript erzeugtes
   <style>-Element, nicht nur eines im Markup. Gemessen auf der Live-Seite --
   securitypolicyviolation meldet `style-src-elem / inline`, und
   `element.sheet` bleibt null.

   Wirkung des Fehlers: der Ladekreis erschien und folgte dem Finger (das
   laeuft ueber `style.cssText`, also CSSOM, und das erlaubt die CSP), aber
   **er drehte sich beim Nachladen nicht**. Genau das Detail, gegen das der
   Kommentar im Skript argumentiert: ein stillstehender Ring sieht aus wie
   ein haengender Ladevorgang. Nichts davon war als Fehler zu sehen -- die
   Seite laedt, nur die Animation fehlt. */
@keyframes pr-dreht { to { transform: rotate(360deg); } }
.pr-dreht { animation: pr-dreht 0.7s linear infinite; }

/* --- Kopf --------------------------------------------------------------- */
.kopf {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.kopf h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.2px; }
/* Das Icon ist 180 px gross und wird auf 34 gezeichnet -- absichtlich, damit
   es auf einem Retina-Schirm scharf bleibt. Breite und Hoehe stehen im
   Markup, sonst springt die Zeile beim Laden. */
.marke { display: flex; align-items: center; gap: 11px; }
.marke-icon { border-radius: 8px; display: block; }
.unter { margin: 1px 0 0; font-size: 12.5px; color: var(--leise); }
.puls {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--leise); white-space: nowrap;
}
.punkt {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--auf); flex: none;
}
.puls--alt { color: var(--warn); }
.puls--alt .punkt { background: var(--warn); }
/* Puls und Abmelden stehen untereinander rechts. Nebeneinander waeren es
   auf 393 px zwei Zeilen, die den Titel umbrechen. */
.kopf-rechts {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
.abmelden {
  font-size: 12px; color: var(--leise); text-decoration: none;
  border-bottom: 1px dotted currentColor; line-height: 1.4;
}

/* --- Karten ------------------------------------------------------------- */
.karte {
  background: var(--karte);
  border: 1px solid var(--karte-rand);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.karte h2 {
  margin: 0 0 10px; font-size: 13px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase; color: var(--leise);
}

.dickzahl {
  font-size: 40px; font-weight: 600; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.waehrung { font-size: 16px; font-weight: 400; color: var(--leise); }
.auf { color: var(--auf); }
.ab { color: var(--ab); }
.leise { color: var(--leise); }

/* Zahlenzeile unter der grossen Zahl. */
.zeilen { margin-top: 12px; border-top: 1px solid var(--karte-rand); }
.zeile {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--karte-rand);
  font-size: 15px;
}
.zeile:last-child { border-bottom: 0; }
.zeile .l { color: var(--leise); }
.z { font-variant-numeric: tabular-nums; text-align: right; }

/* --- Wertkurve ---------------------------------------------------------- */
/* preserveAspectRatio="none" zieht die Kurve auf die volle Breite. Das
   verzerrt sie bewusst: es geht um den Verlauf, nicht um Steigungswinkel. */
.kurve {
  display: block; width: 100%; height: 90px; margin: 14px 0 6px;
  overflow: visible;
}
.kurve polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke;
                  stroke-linejoin: round; stroke-linecap: round; }
.kurve polygon  { stroke: none; }
.kl-auf { stroke: var(--auf); }
.kl-ab  { stroke: var(--ab); }
.kf-auf { fill: rgba(47, 191, 113, .14); }
.kf-ab  { fill: rgba(229, 101, 79, .14); }
.kurve-fuss {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--leise); margin-bottom: 4px;
}
.kurve-leer { margin: 12px 0 2px; font-size: 13px; color: var(--leise); }

/* --- Marken ------------------------------------------------------------- */
.marken { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.marke {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.marke-ebay { background: rgba(47, 191, 113, .16); color: var(--auf); }
.marke-cm   { background: rgba(232, 178, 58, .16); color: var(--warn); }
.marke-pc   { background: rgba(138, 154, 171, .16); color: var(--leise); }
.marke-lauf { background: rgba(138, 154, 171, .16); color: var(--leise); }

/* --- Filter ------------------------------------------------------------- */
.filter { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.fbtn {
  display: inline-flex; align-items: center;
  border: 1px solid var(--karte-rand); background: var(--karte);
  color: var(--leise); text-decoration: none;
  border-radius: 999px; padding: 0 14px; height: 34px; font-size: 14px;
}
.fbtn--an { background: var(--linie); color: var(--tinte); border-color: var(--linie); }
.fbtn--warn { color: var(--warn); border-color: rgba(232, 178, 58, .35); }
/* Marke fuer einen Wert, der gemessen, aber nicht mehr frisch ist. */
.warn-marke {
  margin-left: 6px; font-size: 11px; font-weight: 600; letter-spacing: .2px;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  background: rgba(232, 178, 58, .16); color: var(--warn);
}
/* Fuenf Filter statt drei: gemessen 372 px, auf dem iPhone 15 Pro stehen
   361 px zur Verfuegung. Ohne das faellt "Displays" allein in eine zweite
   Zeile -- kein Fehler, sieht aber nach einem aus. */
@media (max-width: 420px) {
  .filter { gap: 6px; }
  .filter .fbtn { padding: 0 10px; }
}
.fform { margin: 0; }
.filter select {
  appearance: none; border: 1px solid var(--karte-rand);
  background: var(--karte); color: var(--tinte);
  border-radius: 999px; padding: 0 30px 0 14px; height: 34px;
  font: inherit; font-size: 14px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--leise) 50%),
    linear-gradient(135deg, var(--leise) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* --- Bestandsliste ------------------------------------------------------ */
/* Kopfzeile und Zeile teilen sich EIN Rastermass. Zwei Angaben derselben
   Spaltenbreiten laufen beim naechsten Aendern auseinander, und zwar
   unauffaellig -- das ist bei crybot schon passiert. */
.liste { --raster: minmax(0, 1fr) 44px 30px 74px; }

.listkopf {
  display: grid; grid-template-columns: var(--raster);
  gap: 8px; align-items: end; padding: 0 2px 6px;
  font-size: 11px; letter-spacing: .3px; text-transform: uppercase;
  color: var(--leise); border-bottom: 1px solid var(--linie);
}

.rechts { text-align: right; }

.st { border-bottom: 1px solid var(--linie); }
.st > summary {
  display: grid; grid-template-columns: var(--raster);
  gap: 8px; align-items: center; padding: 11px 2px;
  cursor: pointer; list-style: none; min-height: 44px;
}
.st > summary::-webkit-details-marker { display: none; }
.st > summary::before {
  content: "▸"; position: absolute; margin-left: -13px;
  color: var(--leise); font-size: 11px;
}
.st[open] > summary::before { content: "▾"; }

/* Der Name bricht um, statt abgeschnitten zu werden. Mit Auslassungspunkten
   wurde bei crybot aus zwei Strategien dieselbe Zeile -- hier waeren
   "Zelda Oracle of Ages" und "Zelda Oracle of Seasons" nicht mehr zu
   unterscheiden. Die Zeile saehe aufgeraeumt aus und waere unlesbar. */
.st-name {
  display: block; font-size: 15px; line-height: 1.25;
  overflow-wrap: anywhere;
}
/* display:block ist noetig, nicht Kosmetik: als Inline-Span klebte die
   Plattform hinter dem Namen -- "Super Mario Control Deck NES" las sich
   wie ein Titel. Bei Namen, die ohnehin umbrechen, fiel es nicht auf. */
.st-gruppe {
  display: block; font-size: 11px; color: var(--leise); margin-top: 1px;
}
.st-zst {
  font-size: 11px; padding: 2px 6px; border-radius: 6px; text-align: center;
  background: rgba(138, 154, 171, .16); color: var(--leise);
}
.st-zst--cib { background: rgba(47, 191, 113, .16); color: var(--auf); }
.st-zst--neu { background: rgba(232, 178, 58, .16); color: var(--warn); }
.st-menge { font-size: 12px; color: var(--leise); text-align: right; }
.st-wert {
  font-size: 15px; font-variant-numeric: tabular-nums; text-align: right;
  white-space: nowrap;
}

.st-mehr {
  padding: 2px 2px 14px; font-size: 13.5px; color: var(--leise);
}
.st-mehr .zeile { font-size: 13.5px; padding: 6px 0; }
.st-mehr .zeile:last-child { border-bottom: 0; }

/* Die Differenz ist eine Zeile wie die anderen — nur die Zahl traegt Farbe.
   Der erste Entwurf hatte einen farbig hinterlegten Block ueber die ganze
   Breite: er brach den Zeilenrhythmus und sah nach Fehlermeldung aus statt
   nach Zahl. Farbe an der Stelle, wo die Information steht, reicht. */
.diff-pz { font-weight: 400; opacity: .7; margin-left: 2px; }

.mehr-knopf {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 10px; min-height: 44px;
  border: 1px solid var(--karte-rand); background: none;
  color: var(--leise); text-decoration: none;
  border-radius: 12px; font-size: 14px;
}
.listfuss { margin: 12px 0 0; font-size: 12px; color: var(--leise); text-align: center; }

/* --- Fussnote ----------------------------------------------------------- */
.fuss {
  margin-top: 18px; font-size: 12px; color: var(--leise);
  line-height: 1.5;
}

/* --- Fehlzustand -------------------------------------------------------- */
/* Ein ausbleibender Stand ist selbst die Information und bekommt deshalb
   eine eigene Anzeige, keine leere Seite. */
.leer { text-align: center; padding: 40px 16px; color: var(--leise); }
.leer .gross { font-size: 19px; color: var(--tinte); margin-bottom: 6px; }

/* --- Anmeldung ---------------------------------------------------------- */
/* Diese Klassen gehoeren zu anmeldung.php. Sie kamen mit der Datei aus
   crybot mit, das CSS dazu nicht -- die Seite stand deshalb unformatiert da.
   Beim Uebernehmen einer Datei mitpruefen, welche Stile an ihr hingen. */
.anmeldung { max-width: 340px; text-align: center; padding-top: 12vh; }
.anmeldung-icon { border-radius: 16px; margin-bottom: 14px; }
.anmeldung h1 { font-size: 26px; }
.anmeldeformular { display: grid; gap: 6px; margin-top: 26px; text-align: left; }
.anmeldeformular label { font-size: 12.5px; color: var(--leise); }
.anmeldeformular input {
  /* 17 px ist die Untergrenze, ab der iOS beim Antippen NICHT hineinzoomt.
     Mit 16 px springt das Layout bei jedem Feld. */
  font: inherit; font-size: 17px;
  background: var(--karte); color: var(--tinte);
  border: 1px solid var(--karte-rand); border-radius: 11px;
  padding: 12px 13px; margin-bottom: 8px; width: 100%;
}
.anmeldeformular input:focus { outline: none; border-color: var(--auf); }
.anmeldeformular button {
  font: inherit; font-weight: 600; font-size: 17px;
  background: var(--auf); color: #08130C;
  border: 0; border-radius: 11px; padding: 13px; margin-top: 6px;
  min-height: 48px; cursor: pointer;
}
.anmeldefehler {
  min-height: 20px; margin-top: 12px; font-size: 13.5px; color: var(--ab);
}

/* --- Kopfzahl mit Rendite ------------------------------------------------ */
.kopfzahl {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.rendite { text-align: right; line-height: 1.2; }
.rendite-pz { display: block; font-size: 21px; font-weight: 600;
              font-variant-numeric: tabular-nums; }
.rendite-eur { display: block; font-size: 12.5px; opacity: .8;
               font-variant-numeric: tabular-nums; }

/* Die Rendite je Art steht neben ihrer Zahl, nicht darunter -- eine eigene
   Zeile je Art waere die doppelte Hoehe fuer eine Zahl, die man nebenbei
   liest. Tabellenziffern, damit die Prozentwerte untereinander stehen. */
.teil-pz {
  margin-left: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums;
}

.fehlt {
  margin-left: 6px; font-size: 12px; color: var(--warn);
  text-decoration: none; border-bottom: 1px dotted currentColor;
}

.hinweis {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 11px;
  background: rgba(47, 191, 113, .14); color: var(--auf); font-size: 14px;
}

/* --- Sortierung ---------------------------------------------------------- */
.filter--sort { align-items: center; margin-top: -4px; }
.sortlabel { font-size: 12px; color: var(--leise); }
.sbtn {
  font-size: 13px; color: var(--leise); text-decoration: none;
  padding: 4px 2px; border-bottom: 2px solid transparent;
}
.sbtn--an { color: var(--tinte); border-bottom-color: var(--auf); }

/* --- Formulare ----------------------------------------------------------- */
/* 17 px ist die Untergrenze, ab der iOS beim Antippen NICHT hineinzoomt.
   Mit 16 px springt das Layout bei jedem Feld. */
/* Bearbeiten ist eine kleine Klappe, kein Formular, das immer offen steht.
   Die Seite ist zum Ansehen da; das Aendern ist der seltenere Fall und soll
   nicht bei jedem Aufklappen zwei Knoepfe danebenstellen. */
.bearbeiten { margin-top: 10px; }
.bearbeiten > summary {
  list-style: none; cursor: pointer; display: inline-block;
  font-size: 12.5px; color: var(--leise);
  border-bottom: 1px dotted currentColor; padding-bottom: 1px;
}
.bearbeiten > summary::-webkit-details-marker { display: none; }
.bearbeiten[open] > summary { color: var(--tinte); }

.st-form, .neu-form { margin-top: 12px; display: grid; gap: 10px; }
.st-form label, .neu-form label {
  display: grid; gap: 4px; font-size: 12px; color: var(--leise);
}
.st-form input, .neu-form input, .neu-form select {
  font: inherit; font-size: 17px; width: 100%;
  background: var(--grund); color: var(--tinte);
  border: 1px solid var(--karte-rand); border-radius: 10px; padding: 9px 11px;
}
.st-form input:focus, .neu-form input:focus, .neu-form select:focus {
  outline: none; border-color: var(--auf);
}
.neu-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.st-knoepfe { display: flex; gap: 10px; }
.knopf {
  font: inherit; font-size: 15px; font-weight: 600; min-height: 44px;
  flex: 1; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--auf); color: #08130C;
}
.knopf--weg { background: rgba(229, 101, 79, .16); color: var(--ab); }
.knopf--gross { width: 100%; }
.neu-kopf {
  cursor: pointer; list-style: none; font-size: 13px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase; color: var(--leise);
}
.neu-kopf::-webkit-details-marker { display: none; }
.neu-kopf::after { content: " +"; color: var(--auf); }
