/* nfmemes – Farbschema dunkel, Akzent Gelb. Grundidee aus nfsubs. */
:root {
  --bg: #18141b; --flaeche: #221d27; --flaeche-2: #2d2733; --text: #eeeaf2; --leise: #a39cab;
  --rand: #362f3d; --akzent: #facc15; --akzent-text: #18141b; --gefahr: #f87171;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; min-height: calc(100% + env(safe-area-inset-top)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.kopf {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .5rem;
  padding: calc(.5rem + env(safe-area-inset-top)) .75rem .5rem;
  background: var(--flaeche); border-bottom: 1px solid var(--rand);
}
.marke { font-weight: 700; white-space: nowrap; }
#suche { flex: 1; min-width: 0; }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--flaeche-2);
  border: 1px solid var(--rand); border-radius: 10px; padding: .55rem .7rem;
}
input:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
.knopf {
  font: inherit; font-weight: 600; color: var(--text); background: var(--flaeche-2);
  border: 1px solid var(--rand); border-radius: 10px; padding: .5rem .9rem; cursor: pointer;
}
.knopf.akzent { background: var(--akzent); color: var(--akzent-text); border-color: transparent; }
.knopf.gefahr { color: var(--gefahr); }
.knopf:disabled { opacity: .5; }
#neu { font-size: 1.3rem; line-height: 1; padding: .45rem .75rem; }
.filter { display: flex; gap: .4rem; padding: .6rem .75rem 0; }
.filter button {
  font: inherit; font-size: .9rem; color: var(--leise); background: none;
  border: 1px solid var(--rand); border-radius: 99px; padding: .2rem .8rem;
}
.filter button.aktiv { color: var(--akzent-text); background: var(--akzent); border-color: transparent; }
.raster {
  display: grid; gap: 6px; padding: .6rem .75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.kachel {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px;
  overflow: hidden; background: var(--flaeche-2); cursor: pointer;
}
.kachel img, .kachel video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.abzeichen {
  position: absolute; top: 6px; right: 6px; font-size: .75rem; color: #fff;
  background: rgb(0 0 0 / .55); border-radius: 99px; padding: .1rem .45rem;
}
.unterschrift {
  position: absolute; inset: auto 0 0 0; padding: 1.2rem .5rem .35rem; text-align: left;
  font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .75));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.mitte { text-align: center; padding: 2rem 1rem; }
.mitte-knopf { display: block; margin: .5rem auto; }
.vor { white-space: pre-wrap; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
dialog {
  color: var(--text); background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
}
dialog::backdrop { background: rgb(0 0 0 / .7); }
.ansicht-medium { background: #000; display: flex; justify-content: center; }
.ansicht-medium img, .ansicht-medium video { max-width: 100%; max-height: 65dvh; display: block; }
.ansicht-info { padding: .8rem 1rem 1rem; }
.ansicht-info h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.formular form { padding: 1rem; display: grid; gap: .7rem; }
.formular h2 { margin: 0; font-size: 1.15rem; }
label { display: grid; gap: .25rem; font-size: .9rem; color: var(--leise); }
.vorschau img, .vorschau video { max-width: 100%; max-height: 30dvh; border-radius: 8px; display: block; }
progress { width: 100%; accent-color: var(--akzent); }
.fehler { color: var(--gefahr); margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--akzent); color: var(--akzent-text); padding: .5rem 1rem; border-radius: 99px;
  font-weight: 600; z-index: 100; margin: 0;
}

/* --- Anmeldung und Konto --- */
.anmeldung {
  max-width: 380px; margin: 0 auto;
  padding: calc(2.5rem + env(safe-area-inset-top)) 1rem 1rem;
}
.anmeldung form { display: grid; gap: .7rem; }
.anmeldung h1 { margin: 0 0 .5rem; font-size: 1.5rem; }
.konto-inhalt { padding: 1rem; display: grid; gap: .7rem; }
.konto-inhalt h2, .konto-inhalt h3 { margin: 0; }
.konto-inhalt h3 { margin-top: .8rem; font-size: 1rem; }
.konto-inhalt .zeile { margin-top: 0; }
#k-einladen input { flex: 1; min-width: 10rem; }
.link-box { display: flex; gap: .5rem; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.liste li {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .5rem .6rem; background: var(--flaeche-2); border-radius: 10px;
}
.liste li > span { flex: 1; min-width: 8rem; }
.liste .knopf { font-size: .8rem; padding: .25rem .6rem; }
