/* MITBRINGEN - schlicht, hell, Handy zuerst. Eigenes Aussehen, nichts aus
 * der Spieleseite (deshalb kein lobbyCss in spiele.json). */

:root {
  --grund: #f6f5f1;
  --flaeche: #ffffff;
  --linie: #e4e2da;
  --schrift: #1c1f1a;
  --leise: #6b6f66;
  --akzent: #1f7a4d;
  --akzent-dunkel: #17603c;
  --akzent-hell: #e5f2ea;
  --gefahr: #b42318;
  --blase: #e5f2ea;
  --radius: 14px;
  --schatten: 0 1px 2px rgb(0 0 0 / 0.05), 0 2px 8px rgb(0 0 0 / 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #151714;
    --flaeche: #1e211d;
    --linie: #2f332d;
    --schrift: #ecede8;
    --leise: #9da397;
    --akzent: #3fae74;
    --akzent-dunkel: #5cc08a;
    --akzent-hell: #1d3326;
    --gefahr: #f97066;
    --blase: #1d3326;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--schrift);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}
h1 { font-size: 1.35rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.6rem; }
a { color: var(--akzent); }
[hidden] { display: none !important; }
.leise { color: var(--leise); }
.klein { font-size: 0.875rem; }

/* ── Kopf ── */
.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 1rem; padding-top: calc(0.6rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--grund) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 700; font-size: 1.1rem; color: var(--schrift); text-decoration: none; display: flex; gap: 0.35rem; align-items: center; }
.kopf-rechts { display: flex; align-items: center; gap: 0.5rem; }
.glocke { position: relative; text-decoration: none; font-size: 1.2rem; padding: 0.25rem; }
.zahl {
  display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem;
  border-radius: 1rem; background: var(--gefahr); color: #fff; font: 700 0.7rem/1 system-ui, sans-serif; font-style: normal;
}
.glocke .zahl { position: absolute; top: -0.15rem; right: -0.35rem; }
.sprachwahl { display: flex; gap: 2px; }
.sprachwahl:empty { display: none; }
.sprachknopf {
  border: 0; background: none; color: var(--leise); font: 600 0.72rem system-ui, sans-serif; padding: 0.3rem 0.35rem; border-radius: 6px; cursor: pointer;
}
.sprachknopf.sel { color: var(--akzent); background: var(--akzent-hell); }

main { max-width: 40rem; margin: 0 auto; padding: 1rem; }

/* ── Knoepfe ── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1.5px solid var(--akzent); background: var(--akzent); color: #fff;
  font: 600 1rem system-ui, sans-serif; padding: 0.65rem 1.1rem; border-radius: 999px;
  cursor: pointer; text-decoration: none; min-height: 2.75rem;
}
.knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
.knopf:disabled { opacity: 0.55; cursor: wait; }
.knopf.leer { background: transparent; color: var(--akzent); }
.knopf.leer:hover { background: var(--akzent-hell); }
.knopf.gefahr { color: var(--gefahr); border-color: var(--gefahr); }
.knopf.klein { font-size: 0.875rem; padding: 0.35rem 0.85rem; min-height: 2.1rem; }
.knopf.gross { width: 100%; font-size: 1.05rem; padding: 0.85rem; }
.knopf.rund { width: 2.75rem; height: 2.75rem; padding: 0; flex: none; }
.link { background: none; border: 0; color: var(--akzent); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Reiter, Suche, Chips ── */
.reiter { display: flex; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 0.9rem; }
.reiter button {
  flex: 1; border: 0; background: none; padding: 0.55rem; border-radius: 999px; font: 600 0.95rem system-ui, sans-serif; color: var(--leise); cursor: pointer;
}
.reiter button.sel { background: var(--akzent); color: #fff; }
.suche {
  display: flex; align-items: center; gap: 0.5rem; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 999px; padding: 0 1rem; margin-bottom: 0.6rem;
}
.suche input { flex: 1; border: 0; background: none; padding: 0.7rem 0; font: inherit; color: inherit; outline: none; }
.erklaer { font-size: 0.9rem; margin: 0 0.25rem 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chips button {
  border: 1.5px solid var(--linie); background: var(--flaeche); color: var(--schrift); border-radius: 999px;
  padding: 0.45rem 0.75rem; font: 600 0.95rem system-ui, sans-serif; cursor: pointer;
}
.chips button.sel { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); }
.chips .eigen { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; }
.chips .eigen input { width: 3.6rem; text-align: right; padding: 0.45rem 0.5rem; }

/* ── Formulare ── */
.formular { display: grid; gap: 1.1rem; }
.feld { display: grid; gap: 0.35rem; }
.feld > span { font-weight: 600; }
input, textarea {
  font: inherit; color: inherit; background: var(--flaeche); border: 1.5px solid var(--linie); border-radius: 10px; padding: 0.65rem 0.75rem; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--akzent); }
textarea { resize: vertical; }
.haken { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.haken input { width: 1.25rem; height: 1.25rem; flex: none; margin-top: 0.1rem; accent-color: var(--akzent); }
.fehler { color: var(--gefahr); margin: 0; font-size: 0.95rem; }
.block { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
.block h2 { margin-top: 0; }

/* ── Karten ── */
.karten { display: grid; gap: 0.8rem; }
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem; box-shadow: var(--schatten);
  display: grid; gap: 0.55rem; position: relative;
}
.karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.betrag b { font-size: 1.35rem; color: var(--akzent); }
.betrag small { color: var(--leise); }
.wer { font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.sachen { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.1rem; }
.beschreibung { margin: 0; white-space: pre-line; }
.notiz { margin: 0; font-style: italic; color: var(--leise); white-space: pre-line; }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.875rem; }
.karte-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.2rem; }
.karte-knoepfe > .knopf:only-child { width: 100%; }
.melden { position: absolute; right: 1rem; bottom: 0.4rem; font-size: 0.75rem; color: var(--leise); }
.karte:has(.melden) { padding-bottom: 1.6rem; }
.status { font-weight: 600; font-size: 0.875rem; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--grund); }

.status[data-status="entfernt"] { color: var(--gefahr); }
.test-marke {
  font: 700 0.65rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em;
  background: #fff1c2; color: #7a5b00; border-radius: 4px; padding: 0.1rem 0.3rem;
}
.test-schild { background: #fff1c2; color: #7a5b00; padding: 0.6rem 0.8rem; border-radius: 10px; }
.leerstand { text-align: center; padding: 2rem 1rem; display: grid; gap: 0.8rem; justify-items: center; color: var(--leise); }
.leerstand p { margin: 0; }

/* ── Chats ── */
.chatliste { display: grid; gap: 0.25rem; }
.chatzeile {
  display: flex; gap: 0.8rem; align-items: center; padding: 0.75rem; border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--flaeche);
  border: 1px solid var(--linie);
}
.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--akzent-hell); color: var(--akzent); font-weight: 700; font-size: 1.1rem;
}
.chatzeile-text { flex: 1; min-width: 0; display: grid; }
.chatzeile-text strong { display: flex; gap: 0.35rem; align-items: center; }
.chatzeile-text .leise { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.chatzeile-rechts { display: grid; justify-items: end; gap: 0.2rem; }

.chat-kopf {
  position: sticky; top: calc(3.2rem + env(safe-area-inset-top)); z-index: 4; display: flex; align-items: center; gap: 0.7rem;
  background: var(--grund); padding: 0.4rem 0 0.6rem; border-bottom: 1px solid var(--linie); margin-bottom: 0.6rem;
}
.chat-kopf strong { flex: 1; display: flex; gap: 0.4rem; align-items: center; font-size: 1.1rem; }
.zurueck { text-decoration: none; font-size: 1.4rem; padding: 0 0.3rem; color: var(--schrift); }
.laufend {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0.6rem 0.8rem; margin-bottom: 0.6rem; font-size: 0.95rem;
}
.laufend b { color: var(--akzent); }
.verlauf { display: flex; flex-direction: column; gap: 0.4rem; padding-bottom: 5rem; }
.blase {
  max-width: 82%; align-self: flex-start; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 16px 16px 16px 4px; padding: 0.5rem 0.75rem 0.3rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.blase.eigen { align-self: flex-end; background: var(--blase); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.zeit { display: block; text-align: right; font-size: 0.7rem; color: var(--leise); margin-top: 0.1rem; }
.blase.eigen.gelesen .zeit::after { content: " ✓✓"; color: var(--akzent); }
.tel { font-weight: 700; font-size: 1.05rem; }
.sys { align-self: center; text-align: center; font-size: 0.85rem; color: var(--leise); background: var(--flaeche); border-radius: 999px; padding: 0.3rem 0.9rem; margin: 0.4rem 0; max-width: 92%; }
.chat-eingabe {
  position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 6;
  display: flex; gap: 0.5rem; align-items: flex-end; padding: 0.5rem max(1rem, calc(50% - 19rem));
  background: var(--grund); border-top: 1px solid var(--linie);
}
.chat-eingabe textarea { resize: none; overflow-y: hidden; line-height: 1.4; border-radius: 22px; min-height: 2.75rem; max-height: 140px; padding: 0.6rem 1rem; }
body[data-ansicht="chat"] .fuss { display: none; }

/* ── Hinweise ── */
.hinweisliste { display: grid; gap: 0.4rem; }
.hinweis {
  display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); text-decoration: none; color: inherit;
}
.hinweis.neu { border-left: 4px solid var(--akzent); }

/* ── Leiste unten ── */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; justify-content: center;
  background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom);
}
.leiste a {
  flex: 1; max-width: 8rem; display: grid; justify-items: center; gap: 0.05rem; padding: 0.45rem 0 0.4rem; position: relative;
  text-decoration: none; color: var(--leise); font-size: 0.72rem;
}
.leiste a span { font-size: 1.25rem; line-height: 1.3; }
.leiste a b { font-weight: 600; }
.leiste a.sel { color: var(--akzent); }
.leiste a.plus span {
  background: var(--akzent); color: #fff; width: 1.75rem; height: 1.75rem; margin: -0.06rem 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem;
}
.leiste .zahl { position: absolute; top: 0.25rem; left: calc(50% + 0.4rem); }

/* ── Fuss ── */
.fuss { display: flex; justify-content: center; gap: 1.2rem; padding: 1.5rem 1rem 1rem; font-size: 0.85rem; }
.fuss a { color: var(--leise); }

/* ── Blaetter (Dialoge) ── */
.blatt {
  border: 0; border-radius: 20px; padding: 1.4rem 1.2rem 1.2rem; width: min(26rem, calc(100vw - 1.5rem));
  background: var(--flaeche); color: var(--schrift); box-shadow: 0 10px 40px rgb(0 0 0 / 0.25);
}
.blatt::backdrop { background: rgb(0 0 0 / 0.45); }
.blatt h2 { margin: 0 2rem 1rem 0; font-size: 1.2rem; }
.blatt .schliessen { position: absolute; top: 0.6rem; right: 0.6rem; }
.blatt .schliessen button { border: 0; background: none; font-size: 1.1rem; color: var(--leise); cursor: pointer; padding: 0.4rem; }
.umschalten { text-align: center; margin: 1rem 0 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--schrift); color: var(--grund); padding: 0.7rem 1.1rem; border-radius: 12px; max-width: calc(100vw - 2rem);
  font-size: 0.95rem; box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
}
.hinweis-box { max-width: 40rem; margin: 1rem auto; padding: 1rem; background: #fff1c2; border-radius: 10px; }

@media (min-width: 48rem) {
  .karten { grid-template-columns: 1fr 1fr; }
  .karten > h2 { grid-column: 1 / -1; }
}

/* ── Regeln ── */
body.text-seite { padding-bottom: 0; }
.rechtstext { line-height: 1.6; }
.rechtstext h2 { margin-top: 1.8rem; }
.rechtstext ul { padding-left: 1.2rem; display: grid; gap: 0.35rem; }

/* Reserviert / pausiert: bleibt sichtbar, tritt aber zurueck. */
.karte.reserviert { opacity: 0.72; }
.status[data-status="reserviert"] { background: #fff1c2; color: #7a5b00; }
.status[data-status="offen"] { background: var(--akzent-hell); color: var(--akzent); }
.karte-knoepfe > .knopf:not(.klein) { flex: 1 1 12rem; white-space: nowrap; }

/* ── Suche leeren, Sortierung ── */
.suche-weg { border: 0; background: none; color: var(--leise); font-size: 1rem; padding: 0.4rem; cursor: pointer; }
.sortierung { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0 0.25rem 0.6rem; font-size: 0.9rem; }
.sortier-wahl, .von-feld { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--leise); }
.sortierung select {
  font: inherit; color: var(--schrift); background: var(--flaeche); border: 1.5px solid var(--linie);
  border-radius: 999px; padding: 0.35rem 0.7rem;
}
.von-feld input { width: 6.5rem; padding: 0.35rem 0.7rem; border-radius: 999px; }
.von-hinweis { margin: -0.2rem 0.25rem 0.6rem; }

/* ── Datum ── */
.chips input[type="date"] { width: auto; padding: 0.4rem 0.6rem; border-radius: 999px; font-size: 0.95rem; }
.ablauf { flex-basis: 100%; }

/* ── Hinweis-Leiste ── */
.banner-liste { display: grid; gap: 0.5rem; }
.banner-liste:not(:empty) { margin-bottom: 0.9rem; }
.banner {
  display: flex; align-items: flex-start; gap: 0.6rem; background: #fff1c2; color: #5c4400;
  border-radius: 12px; padding: 0.6rem 0.4rem 0.6rem 0.9rem; font-size: 0.92rem;
}
.banner a { color: inherit; flex: 1; text-decoration: none; }
.banner button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0.4rem; font-size: 0.95rem; }
.quelle { max-width: 40rem; margin: 0 auto; padding: 0 1rem; }
.chat-schutz { margin: -0.2rem 0 0.8rem; text-align: center; }
.chat-schutz .link { color: var(--leise); margin-left: 0.3rem; font-size: inherit; }
