/* BrickData – ruhig, hell und dunkel, Desktop zuerst, auf dem Handy einspaltig. */

:root {
  --grund: #f6f5f2;
  --flaeche: #ffffff;
  --flaeche-2: #efede8;
  --linie: #dedad2;
  --text: #1d1f24;
  --text-2: #5c606a;
  --akzent: #1f2a44;
  --akzent-text: #ffffff;
  --rot: #e5483f;
  --gruen: #2f7d4f;
  --gefahr: #b3261e;
  --schatten: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --rund: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14161b;
    --flaeche: #1d2027;
    --flaeche-2: #262a33;
    --linie: #333845;
    --text: #eceef2;
    --text-2: #a3a8b4;
    --akzent: #dfe6ff;
    --akzent-text: #14161b;
    --gruen: #6fcf97;
    --gefahr: #ff8a80;
    --schatten: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
h1, h2 { line-height: 1.2; }
[hidden] { display: none !important; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.klein { font-size: 13px; color: var(--text-2); }

/* Kopf */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; text-decoration: none; }
.logo img { width: 26px; height: 26px; }
.aktionen { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--linie); border-radius: 8px;
  background: var(--flaeche); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  list-style: none;
}
.knopf::-webkit-details-marker { display: none; }
.knopf:hover { background: var(--flaeche-2); }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf.haupt:hover { filter: brightness(1.1); }
.knopf.gefahr { color: var(--gefahr); }
.knopf:disabled { opacity: .55; cursor: progress; }

.menue { position: relative; }
.menue-liste {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund);
  box-shadow: var(--schatten);
}
.menue-liste a, .menue-liste button {
  padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menue-liste a:hover, .menue-liste button:hover { background: var(--flaeche-2); }
#benutzer { color: var(--text-2); }

/* Anmelden */
.anmelden { display: grid; place-items: center; padding: 48px 16px; }
.karte-anmelden {
  width: min(420px, 100%); padding: 28px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten);
}
.karte-anmelden h1 { margin: 0 0 8px; font-size: 24px; }
.karte-anmelden form { display: grid; gap: 12px; margin-top: 20px; }

/* Formularfelder */
label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
input, select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px;
  border: 1px solid var(--linie); border-radius: 8px;
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 15px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .knopf:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 1px;
}
.meldung { margin: 0; min-height: 1.2em; color: var(--gefahr); font-size: 14px; }
.meldung.gut { color: var(--gruen); }

/* Sammlung: links Filter, rechts Raster */
.sammlung {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px;
  max-width: 1600px; margin: 0 auto; padding: 20px 24px 48px;
}
.filter {
  position: sticky; top: 76px; align-self: start;
  display: grid; gap: 20px;
  max-height: calc(100vh - 96px); overflow: auto;
}
.filter h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.umschalter { display: flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.umschalter button {
  flex: 1; min-height: 34px; border: 0; background: var(--flaeche);
  color: var(--text); font: inherit; cursor: pointer;
}
.umschalter button + button { border-left: 1px solid var(--linie); }
.umschalter button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); }

.marken { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.marken button {
  display: flex; width: 100%; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border: 0; border-radius: 6px; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.marken button:hover { background: var(--flaeche-2); }
.marken button[aria-pressed="true"] { background: var(--flaeche-2); font-weight: 600; }
.marken .anzahl { color: var(--text-2); font-variant-numeric: tabular-nums; }

.zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.zahlen div { padding: 10px 12px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; }
.zahlen dt { font-size: 12px; color: var(--text-2); }
.zahlen dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Raster der Sets */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.karte {
  display: flex; flex-direction: column; overflow: hidden;
  padding: 0; border: 1px solid var(--linie); border-radius: var(--rund);
  background: var(--flaeche); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.karte:hover { transform: translateY(-2px); box-shadow: var(--schatten); }
.karte .bild {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: #fff; border-bottom: 1px solid var(--linie);
}
.karte .bild img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.karte .bild .ohne { color: #9aa0aa; font-size: 13px; }
.karte .text { display: grid; gap: 2px; padding: 10px 12px 12px; }
.karte .marke { font-size: 12px; color: var(--text-2); }
.karte .name { font-weight: 600; line-height: 1.25; }
.karte .angaben { font-size: 13px; color: var(--text-2); }
.marken-band {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--akzent); color: var(--akzent-text);
}
.marken-band.lego { background: var(--rot); color: #fff; }
.zaehler {
  position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--flaeche-2); color: var(--text);
}
.zaehler.wunsch { background: #fde7b0; color: #5a4300; }

.leer { padding: 64px 16px; text-align: center; color: var(--text-2); }

/* Dialog */
.dialog {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--linie); border-radius: 14px;
  background: var(--flaeche); color: var(--text); box-shadow: var(--schatten);
}
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dialog-kopf { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--linie); }
.dialog-kopf h2 { margin: 0; font-size: 18px; }
.schliessen { margin-left: auto; border: 0; background: none; color: inherit; font-size: 26px; cursor: pointer; }
.dialog-inhalt { overflow: auto; padding: 16px 20px; display: grid; gap: 16px; }
.dialog-fuss { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--linie); }
.platz { flex: 1; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
legend { margin-bottom: 8px; font-weight: 600; }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mit-knopf { display: flex; gap: 6px; }
.haken { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 38px; color: var(--text); font-size: 15px; }
.haken input { width: auto; min-height: 0; }
.vorschau:empty { display: none; }
.vorschau { display: flex; gap: 14px; align-items: center; }
.vorschau img { width: 120px; height: 90px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--linie); }
.vorschau a { font-size: 13px; }
fieldset:disabled input, fieldset:disabled select { background: var(--flaeche-2); color: var(--text-2); }

/* Handy */
@media (max-width: 820px) {
  .kopf { padding: 8px 16px; gap: 8px; }
  .logo span { display: none; }
  #knopf-import { display: none; }
  .sammlung { grid-template-columns: 1fr; padding: 12px 16px 40px; gap: 12px; }
  .filter { position: static; max-height: none; gap: 12px; }
  .filter .gruppe:has(#filter-marken) ul { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .marken button { white-space: nowrap; border: 1px solid var(--linie); border-radius: 999px; padding: 4px 12px; }
  .filter h2 { display: none; }
  .zahlen, #letzter-import { display: none; }
  .raster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .karte .text { padding: 8px 10px 10px; }
  .reihe { grid-template-columns: 1fr; }
  .dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dialog form { max-height: 100dvh; height: 100%; }
}

/* Im Menü auf dem Handy: Import dort anbieten */
.nur-handy { display: none; }
@media (max-width: 820px) { .nur-handy { display: block; } }
fieldset:disabled .nur-eigen { display: none; }
