:root {
    --blau-tief:   #0c2740;
    --blau:        #123a5c;
    --orange:      #f5821f;
    --orange-dun:  #d96d0c;
    --grund:       #ffffff;
    --grund-2:     #f4f6f8;
    --karte:       #ffffff;
    --rand:        #dde3e9;
    --text:        #1b2733;
    --leise:       #5a6875;
    --link:        #0b5fa5;
    --gut:         #1a7f37;
    --schlecht:    #c0392b;
    --breite:      44rem;
}
@media (prefers-color-scheme: dark) {
    :root {
        --grund:   #0f1720;
        --grund-2: #16212c;
        --karte:   #1e2b3a;
        --rand:    #263441;
        --text:    #e6edf3;
        --leise:   #9aa9b7;
        --link:    #6cb6ff;
        --gut:     #56d364;
        --schlecht:#ff7b72;
    }
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    /* Platz fuer die Reiterleiste am unteren Rand, plus die Home-Leiste des iPhones. */
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kopf ---------- */
header.kopf {
    background: linear-gradient(160deg, var(--blau-tief) 0%, var(--blau) 100%);
    color: #fff;
    position: sticky; top: 0; z-index: 10;
    padding-top: env(safe-area-inset-top, 0px);
}
.kopf-innen {
    max-width: var(--breite); margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap;
}
.marke { color: #fff; font-weight: 700; letter-spacing: 0.01em;
         display: inline-flex; align-items: center; gap: 0.5rem; }
.marke:hover { text-decoration: none; }
.marke-bild { width: 28px; height: 28px; border-radius: 7px; display: block; }
/* Der Vereinsname darf schrumpfen (Ellipse), damit Marke, Name und Abmelden auf einem
   iPhone in EINER Zeile bleiben; erst ein sehr langer Name bricht um. */
.kopf-innen .wo { color: #cfe0ee; font-size: 0.92rem; flex: 1 1 0; min-width: 4rem;
                  display: inline-flex; align-items: center; gap: 0.4rem; }
.kopf-innen .wo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abmelden { flex-shrink: 0; }
.kopf-innen .wappen { width: 26px; height: 26px; border-radius: 6px; object-fit: cover;
                      background: #fff; flex-shrink: 0; }
.abmelden { margin-left: auto; }
.abmelden button {
    background: transparent; color: #cfe0ee;
    border: 1px solid rgba(255,255,255,0.35);
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.7rem;
    min-height: 40px;
}
.abmelden button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.abmelden .symbol { display: inline-flex; }
.abmelden .symbol svg { width: 18px; height: 18px; }
/* Am schmalen Telefon nur das Symbol -- das Wort steht im title. */
@media (max-width: 480px) { .abmelden .wort { display: none; } }

/* ---------- Rumpf ---------- */
main.huelle { max-width: var(--breite); margin: 0 auto; padding: 1rem 1rem 2rem; }
.abschnitt { margin-bottom: 1.8rem; }
.abschnitt > h1 { font-size: 1.45rem; margin: 0 0 0.7rem; }
.abschnitt > h2 { font-size: 1.1rem; margin: 0 0 0.6rem; color: var(--leise);
                  text-transform: uppercase; letter-spacing: 0.05em; }
p { margin: 0 0 0.7rem; }
.leise { color: var(--leise); }
.klein { font-size: 0.9rem; }

/* ---------- Karten und Zeilen ---------- */
.karte {
    background: var(--karte); border: 1px solid var(--rand);
    border-radius: 10px; padding: 0.9rem 1rem; margin-bottom: 0.7rem;
}

/* Eine antippbare Zeile. `min-height` ist kein Zierrat: unter 44 px trifft ein Daumen
   auf dem Telefon danebeen -- das ist Apples eigene Mindestgroesse, und sie stimmt. */
.zeile {
    display: flex; align-items: center; gap: 0.7rem;
    min-height: 44px; padding: 0.45rem 0;
    border-bottom: 1px solid var(--rand); color: inherit;
}
.zeile:last-child { border-bottom: none; }
a.zeile:hover { text-decoration: none; background: var(--grund-2); }
.zeile .weit { margin-left: auto; }
.zeile .pfeil { color: var(--leise); }

.name { font-weight: 600; }
.wert { font-variant-numeric: tabular-nums; }

/* Rundes Profilbild. `object-fit: cover` verhindert, dass ein nicht-quadratisches
   Bild zur Ellipse gequetscht wird. */
.bildchen {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0; background: var(--grund-2);
}
.platzhalter {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: var(--blau); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
}
/* `inline-block` ist hier kein Feinschliff: ein LEERES `span` ist `inline`, und ein
   inline-Element ignoriert width und height -- der Punkt war unsichtbar, obwohl die
   Zeile darunter ihn erklaerte. */
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.punkt.an { background: var(--gut); }
.punkt.aus { background: var(--rand); }
.merkmal {
    font-size: 0.78rem; padding: 0.1rem 0.45rem; border-radius: 999px;
    background: var(--grund-2); color: var(--leise); border: 1px solid var(--rand);
}

/* ---------- Knoepfe und Felder ---------- */
button, .knopf {
    font: inherit; cursor: pointer;
    background: var(--orange); color: #14232f; font-weight: 600;
    border: none; border-radius: 8px; padding: 0.55rem 1.1rem;
    min-height: 44px;
}
button:hover, .knopf:hover { background: var(--orange-dun); color: #fff; text-decoration: none; }
button.leiser {
    background: transparent; color: var(--link);
    border: 1px solid var(--rand); font-weight: 500;
}
button.leiser:hover { background: var(--grund-2); color: var(--link); }
form.inline { display: inline; }

input[type="text"], textarea, select {
    font: inherit; width: 100%;
    background: var(--grund); color: var(--text);
    border: 1px solid var(--rand); border-radius: 8px;
    padding: 0.6rem 0.7rem; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--link); outline-offset: -1px; }

/* ---------- Chat ---------- */
.nachricht { display: flex; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rand); }
.nachricht:last-of-type { border-bottom: none; }
.nachricht .rumpf { min-width: 0; flex: 1; }
.nachricht .kopfzeile { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.nachricht .zeit { color: var(--leise); font-size: 0.82rem; }
/* Ein Chattext ist fremder Text und kann eine 200 Zeichen lange Wortkette sein.
   Ohne das bricht er die Seite auf und alles rollt waagrecht. */
.nachricht .text { overflow-wrap: anywhere; }
.nachricht .geloescht { color: var(--leise); font-style: italic; }
.antwort {
    border-left: 3px solid var(--rand); padding-left: 0.6rem;
    color: var(--leise); font-size: 0.88rem; margin-bottom: 0.2rem;
    overflow-wrap: anywhere;
}
.schreibfeld { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }

/* Geteilte Bilder und Stellungen im Chat (05.09.2026). Ein Bild fuellt hoechstens
   die Breite der Nachricht und bleibt in seinem Seitenverhaeltnis. */
.chatbild { display: block; max-width: min(100%, 22rem); max-height: 20rem; border-radius: 8px;
            border: 1px solid var(--rand); margin: 0.3rem 0; background: var(--grund-2); }
.stellung { margin: 0.3rem 0; }
.stellung svg.brett { display: block; width: min(100%, 240px); height: auto; border-radius: 4px;
                      box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.stellung .klein { margin-top: 0.3rem; }
.werkzeuge { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.werkzeuge .weit { margin-left: auto; }
a.knopf.leiser, .knopf.leiser { background: transparent; color: var(--link);
    border: 1px solid var(--rand); font-weight: 500; }
a.knopf.leiser:hover, .knopf.leiser:hover { background: var(--grund-2); color: var(--link); }
.knopf.mit-symbol { display: inline-flex; align-items: center; gap: 0.4rem; }
.knopf.mit-symbol svg { width: 18px; height: 18px; }
.zeile .wann { white-space: nowrap; }
.zeile .kalenderlink { color: var(--leise); display: inline-flex; padding: 0.4rem; border-radius: 6px; }
.zeile .kalenderlink:hover { background: var(--grund-2); color: var(--link); }
.zeile .kalenderlink svg { width: 20px; height: 20px; }
.wappen-gross { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
                background: #fff; border: 1px solid var(--rand); }

/* ---------- Reiterleiste unten ---------- */
nav.reiter {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; background: var(--karte); border-top: 1px solid var(--rand);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.reiter-knopf {
    flex: 1; text-align: center; padding: 0.45rem 0.2rem 0.4rem;
    font-size: 0.7rem; color: var(--leise); min-height: 52px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.15rem; line-height: 1.15;
}
.reiter-knopf .symbol { display: inline-flex; }
.reiter-knopf .symbol svg { width: 22px; height: 22px; }
.reiter-knopf .wort { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reiter-knopf:hover { text-decoration: none; background: var(--grund-2); }
.reiter-knopf.hier { color: var(--orange); font-weight: 700; }
.reiter-knopf.hier .symbol svg { stroke-width: 2.3; }

/* ---------- Hinweise ---------- */
.hinweis { border-left: 4px solid var(--rand); padding: 0.6rem 0.9rem;
           margin-bottom: 0.9rem; background: var(--grund-2); border-radius: 6px; }
.hinweis p { margin: 0; }
.hinweis.fehler { border-left-color: var(--schlecht); }
.hinweis.gut { border-left-color: var(--gut); }
.hinweis.warn { border-left-color: var(--orange); }

/* ---------- Formular scannen ---------- */
.scanform label { display: block; margin-bottom: 0.5rem; }
.scanform label .name { display: block; font-weight: 600; margin-bottom: 0.5rem; }
/* Das Dateifeld ist auf dem iPhone die Kamera-Taste -- es muss gross genug sein, um es
   mit dem Daumen zu treffen, waehrend die andere Hand das Formular haelt. */
.scanform input[type="file"] {
    width: 100%; padding: 0.9rem; min-height: 56px;
    background: var(--grund-2); border: 1px dashed var(--rand); border-radius: 8px;
}
/* Die Vorschau steht in einem QUADRAT: so passt das Bild in jeder der vier Drehlagen
   hinein, ohne dass sich die Seite beim Drehen verschiebt oder etwas abgeschnitten wird. */
.scanform .vorschau { margin: 0.9rem 0; }
.scanform .vorschaurahmen {
    width: min(100%, 320px); aspect-ratio: 1 / 1; margin: 0 auto 0.6rem;
    display: grid; place-items: center; overflow: hidden;
    background: var(--grund-2); border: 1px solid var(--rand); border-radius: 8px;
}
.scanform .vorschaurahmen img {
    max-width: 100%; max-height: 100%; display: block;
    transition: transform 0.25s ease;
}
.scanform .vorschau p { text-align: center; }
.scanform .vorschau button { margin-left: 0.3rem; }
.hinweis .nochmal-drehen { margin-top: 0.4rem; }
#scan-ergebnis .laeuft { color: var(--leise); padding: 0.6rem 0; }
.tipps { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--leise); }
.tipps li { margin-bottom: 0.3rem; }

/* Die Zugliste. Feste Spaltenbreiten statt einer Tabelle: eine Tabelle rollt am Telefon
   waagrecht, und genau das soll auf dieser Seite nie passieren. */
.zugliste {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.2rem 0.8rem; margin-top: 0.8rem;
    font-variant-numeric: tabular-nums;
}
.zugzeile { display: grid; grid-template-columns: 2.4rem 1fr 1fr; align-items: baseline; }
.zugzeile .nr { color: var(--leise); }
.zugzeile .zug { padding: 0.15rem 0.3rem; border-radius: 4px; }
/* Unsichere Zuege werden NICHT nur eingefaerbt: wer rot-gruen-blind ist, saehe sonst gar
   nichts. Die Unterstreichung traegt dieselbe Aussage ohne Farbe. */
.zugzeile .zug.unsicher {
    background: rgba(245, 130, 31, 0.18);
    text-decoration: underline wavy var(--orange);
    text-underline-offset: 3px;
}
textarea.pgn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }

/* ---------- Vereinskarte (05.09.2026) ---------- */
/* Die Karte fuellt den Bildschirm fast, aber nicht ganz: darunter muss der Hinweis
   „Zum Beitreten anmelden" noch ohne Rollen sichtbar sein. */
#karte {
    height: 62vh; min-height: 320px; max-height: 640px;
    border: 1px solid var(--rand); border-radius: 10px; background: var(--grund-2);
    /* Leaflet setzt seine eigene Schrift; die Popups sollen aussehen wie die Seite. */
    font-family: inherit;
}
/* Wappen als Marker: rund abgeschnitten wie in der App, mit einem hellen Rand, der es
   vom Kartenhintergrund abhebt. Leaflet gibt dem divIcon selbst keinen Stil. */
.marker-wappen {
    background: var(--karte); border: 2px solid #fff; border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35); overflow: hidden;
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 0.95rem;
    background: var(--blau);
}
.marker-wappen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.marker-wappen.eigen { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,130,31,0.35), 0 2px 6px rgba(0,0,0,0.4); }
.marker-wappen.vorlage { opacity: 0.55; filter: grayscale(1); }
/* Ein Verein, der die App noch nicht nutzt: ein kleiner blasser Punkt -- lesbar, aber
   nie mit einem echten Wappen zu verwechseln (wie `unclaimedDot` in der App). */
.marker-punkt {
    border-radius: 50%; background: var(--leise); opacity: 0.6;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.marker-popup { min-width: 12rem; line-height: 1.4; }
.marker-popup strong { display: block; margin-bottom: 0.2rem; }
.marker-popup .knopf { display: inline-block; margin-top: 0.6rem; }
.knopf.klein { padding: 0.4rem 0.8rem; min-height: 36px; font-size: 0.9rem; }
.leaflet-popup-content { margin: 0.8rem 1rem; font-size: 0.95rem; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.merkmal.eigen { background: rgba(245,130,31,0.15); color: var(--orange-dun); border-color: rgba(245,130,31,0.4); }
.name .merkmal { margin-left: 0.4rem; vertical-align: middle; }

/* ---------- Vereine suchen und beitreten ---------- */
form.suche { display: flex; gap: 0.5rem; align-items: flex-end; }
form.suche label { flex: 1; display: block; }
form.suche label .name { display: block; font-weight: 600; margin-bottom: 0.3rem; }
form.codeform { display: flex; gap: 0.5rem; }
form.codeform input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                      letter-spacing: 0.12em; text-transform: uppercase; }
/* Ein Formular, das untereinander steht: Notizfeld, dann der Knopf -- am Telefon ist
   nebeneinander zu eng fuer beides. */
form.stapel { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
form.stapel label .name { display: block; font-weight: 600; margin-bottom: 0.3rem; }
form.stapel button { align-self: flex-start; }
.vereinkarte .zeile { border-bottom: none; padding-bottom: 0.2rem; }
.zeile form.inline.weit { margin-left: auto; }

/* ---------- Anmeldung ---------- */
.anmeldung { max-width: 26rem; margin: 2.5rem auto; text-align: center; }
.anmeldung h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.anmeldung .knopfplatz { display: flex; justify-content: center; margin: 1.6rem 0; min-height: 44px; }

/* Der Hinweis „Zum Home-Bildschirm hinzufuegen". Er steht NICHT im Kleingedruckten:
   auf dem iPhone entscheidet genau dieser Schritt darueber, ob spaeter
   Benachrichtigungen ankommen und ob die Daten laenger als sieben Tage bleiben. */
.installhinweis {
    background: var(--grund-2); border: 1px dashed var(--rand);
    border-radius: 10px; padding: 0.8rem 1rem; margin: 1rem 0;
}
.installhinweis strong { color: var(--text); }

/* ---------- Fuss ---------- */
footer.fuss { border-top: 1px solid var(--rand); padding: 1.2rem 1rem 1.5rem; margin-top: 1rem; }
.fuss-innen {
    max-width: var(--breite); margin: 0 auto;
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-size: 0.88rem;
}
.fuss-innen a { color: var(--leise); }