/* Must-Read-Regal – Gestaltung nach dem BKM-Design-Kit (Creme, Aubergine, Rot als einziger Akzent, flache Rechtecke) */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-display: swap; src: url('/fonts/inter-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bebas Neue'; font-weight: 400; font-display: swap; src: url('/fonts/bebas-neue-latin-400-normal.woff2') format('woff2'); }

:root {
  --aubergine: #4c2147;
  --rot: #c3023b;
  --sand: #ddd3bc;
  --tuerkis: #1eab9e;
  --maigruen: #ccd500;
  --bis: #00414c;
  --creme: #f1eadc;
  --creme2: #f6f2eb;

  --flaeche: var(--creme);
  --flaeche-karte: #ffffff;
  --flaeche-zone: var(--sand);
  --flaeche-leise: var(--creme2);
  --flaeche-vollton: var(--aubergine);
  --text: #000000;
  --text-headline: var(--aubergine);
  --text-neben: rgba(0, 0, 0, 0.62);
  --linie: rgba(0, 0, 0, 0.14);
  --linie-betont: var(--aubergine);
  --link: var(--bis);
  --fokus: var(--aubergine);
  --balken: var(--aubergine);
  --auf-vollton-text: #ffffff;
  --auf-vollton-neben: rgba(255, 255, 255, 0.75);
  --auf-vollton-akzent: var(--maigruen);
  --schatten: 0 12px 32px rgba(0, 0, 0, 0.18);

  --font: 'Inter', Arial, sans-serif;
  --font-zahl: 'Bebas Neue', 'Inter', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --flaeche: #231823;
    --flaeche-karte: #2c1f2b;
    --flaeche-zone: #1a1118;
    --flaeche-leise: #362736;
    --flaeche-vollton: #1a1118;
    --text: rgba(255, 255, 255, 0.86);
    --text-headline: #ffffff;
    --text-neben: rgba(255, 255, 255, 0.6);
    --linie: rgba(255, 255, 255, 0.14);
    --linie-betont: rgba(255, 255, 255, 0.4);
    --link: var(--tuerkis);
    --fokus: var(--tuerkis);
    --balken: var(--tuerkis);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--flaeche);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--link); font-weight: 700; }
a:hover { color: var(--text-headline); }

:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }

[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }

/* Kopfband */
.kopf { border-bottom: 1px solid var(--linie); }
.kopf .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.marke { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.marke b { font-family: var(--font-zahl); font-weight: 400; font-size: 30px; letter-spacing: 0.02em; color: var(--text-headline); }
.marke span { font-size: 13px; font-weight: 500; color: var(--text-neben); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 15px; }
.nav a { color: var(--text-headline); text-decoration: none; font-weight: 500; padding: 10px 0; }
.nav a[aria-current="page"] { font-weight: 700; border-bottom: 2px solid var(--text-headline); }

/* Vollton-Bühne */
.buehne { background: var(--flaeche-vollton); color: var(--auf-vollton-text); }
.buehne .wrap { display: flex; flex-wrap: wrap; gap: 32px 48px; padding-top: 56px; padding-bottom: 48px; }
.buehne .text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.buehne h1 { margin: 0; font-size: clamp(32px, 5vw, 44px); line-height: 1.15; font-weight: 800; }
.buehne p { margin: 0; font-size: 18px; color: var(--auf-vollton-neben); max-width: 660px; }
.buehne .kicker { color: var(--auf-vollton-akzent); }
.schritte { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; align-self: flex-end; margin: 0; padding: 0; list-style: none; }
.schritte li { display: flex; gap: 12px; align-items: baseline; }
.schritte b { font-family: var(--font-zahl); font-weight: 400; font-size: 32px; color: var(--auf-vollton-akzent); line-height: 1; }

.kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-headline); }

main.wrap { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }

h2 { margin: 0; font-size: 26px; line-height: 1.2; color: var(--text-headline); font-weight: 700; }
h3 { margin: 0; font-size: 18px; line-height: 1.3; color: var(--text-headline); font-weight: 700; }
.zeile { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.neben { color: var(--text-neben); font-size: 14px; }
.klein { font-size: 13px; }

/* Karten */
.karte { background: var(--flaeche-karte); border: 1px solid var(--linie); border-top: 4px solid var(--aubergine); padding: 20px; }
.karte.tuerkis { border-top-color: var(--tuerkis); }
.karte.leer { border: 1px dashed var(--linie-betont); border-top-width: 1px; background: transparent; }
@media (min-width: 640px) { .karte { padding: 24px; } }

.buch { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.buch .info { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.buch .titel { font-size: 19px; font-weight: 700; color: var(--text-headline); line-height: 1.3; }

.cover { width: 72px; height: 108px; background: var(--sand); flex-shrink: 0; object-fit: cover; display: block; }
.cover.klein { width: 40px; height: 60px; }

/* Formular */
label { font-size: 14px; font-weight: 600; color: var(--text-headline); }
input[type="text"], input[type="search"], input[type="password"], textarea, select {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--flaeche-karte);
  border: 1px solid var(--linie-betont);
  border-radius: 0;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
textarea { background: var(--flaeche-leise); border-color: var(--linie); resize: vertical; min-height: 72px; }
.suchzeile { display: flex; gap: 8px; flex-wrap: wrap; }
.suchzeile input { flex: 1 1 260px; width: auto; border-width: 2px; }
.feld { display: flex; flex-direction: column; gap: 6px; }

/* Buttons */
button, .button {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 0;
  min-height: 44px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 180ms, color 180ms;
}
.primaer { background: var(--rot); color: #ffffff; border: 0; padding: 12px 28px; font-size: 16px; }
.primaer:hover { background: var(--aubergine); }
.voll { background: var(--aubergine); color: #ffffff; border: 0; }
.voll:hover { background: var(--bis); }
.sekundaer { background: transparent; color: var(--text-headline); border: 1px solid var(--linie-betont); font-weight: 600; font-size: 14px; padding: 8px 16px; }
.sekundaer:hover { background: var(--flaeche-leise); }
.textlink { background: transparent; border: 0; color: var(--link); text-decoration: underline; padding: 8px 4px; font-size: 14px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Suchergebnisse */
.treffer { background: var(--flaeche-karte); border: 1px solid var(--linie); box-shadow: var(--schatten); }
.treffer .kopfzeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--linie); }
.treffer .gruppe { padding: 10px 16px 4px; }
.eintrag { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--linie); }
.eintrag .info { flex: 1 1 auto; min-width: 0; }
.eintrag .titel { font-weight: 700; color: var(--text-headline); line-height: 1.3; }
.eintrag.regal { background: var(--flaeche-leise); }
.treffer .fuss { padding: 12px 16px; font-size: 14px; color: var(--text-neben); display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }

.tag { display: inline-block; background: var(--flaeche); border: 1px solid var(--linie); color: var(--text-headline); font-size: 13px; font-weight: 600; padding: 2px 10px; }

.hinweis { background: var(--flaeche-zone); border: 1px solid var(--linie-betont); padding: 16px 20px; color: var(--text-headline); }
.fehler { border-left: 4px solid var(--rot); background: var(--flaeche-karte); padding: 12px 16px; }
.erfolg { border-top: 4px solid var(--tuerkis); background: var(--flaeche-karte); padding: 20px 24px; }

/* Regal-Schnellauswahl */
.regalliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 8px; }
.regalliste .eintrag { background: var(--flaeche-karte); border: 1px solid var(--linie); }

/* Ergebnisse */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kennzahl { background: var(--flaeche-karte); border: 1px solid var(--linie); padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.kennzahl b { font-family: var(--font-zahl); font-weight: 400; font-size: 52px; line-height: 1; color: var(--text-headline); }
.kennzahl span { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-neben); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: var(--flaeche-karte); color: var(--text-headline); border: 1px solid var(--linie-betont); font-size: 14px; font-weight: 600; padding: 8px 16px; }
.chips button[aria-pressed="true"] { background: var(--aubergine); color: #ffffff; border-color: var(--aubergine); }

.rangliste { background: var(--flaeche-karte); border: 1px solid var(--linie); }
.platz { border-bottom: 1px solid var(--linie); }
.platz:last-child { border-bottom: 0; }
.platz .haupt { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 14px 20px; }
.platz .rang { font-family: var(--font-zahl); font-size: 40px; line-height: 1; color: var(--text-headline); width: 44px; text-align: right; flex-shrink: 0; }
.platz .info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.platz .titel { font-size: 17px; font-weight: 700; color: var(--text-headline); line-height: 1.3; }
.balkenzeile { display: flex; align-items: center; gap: 12px; }
.balken { flex: 1 1 auto; height: 12px; background: var(--flaeche); }
.balken i { display: block; height: 12px; background: var(--balken); }
.platz.erster .balken i { background: var(--rot); }
.anzahl { font-weight: 700; color: var(--text-headline); font-size: 15px; white-space: nowrap; min-width: 110px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.stimmen { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) { .stimmen { padding-left: 140px; } }
.stimmen p { margin: 0; padding: 10px 14px; background: var(--flaeche-leise); font-size: 15px; }

/* Präsentationsmodus */
body.praesentation .kopf, body.praesentation .nur-normal { display: none; }
body.praesentation main.wrap { max-width: 1400px; padding-top: 24px; }
body.praesentation .platz .titel { font-size: 24px; }
body.praesentation .platz .rang { font-size: 56px; width: 64px; }
body.praesentation .balken, body.praesentation .balken i { height: 18px; }
body.praesentation .anzahl { font-size: 20px; }
body.praesentation h1 { font-size: 48px; }

/* Admin */
.admin-kopf { background: var(--flaeche-vollton); color: #ffffff; }
.admin-kopf .marke b { color: #ffffff; }
.admin-kopf .kicker { color: var(--auf-vollton-akzent); }
.admin-kopf .sekundaer { color: #ffffff; border-color: rgba(255, 255, 255, 0.4); }
.admin-kopf .sekundaer:hover { background: rgba(255, 255, 255, 0.08); }
.tabelle { background: var(--flaeche-karte); border: 1px solid var(--linie); overflow-x: auto; }
.tabelle table { width: 100%; border-collapse: collapse; min-width: 720px; }
.tabelle th { background: var(--aubergine); color: #ffffff; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; padding: 10px 14px; }
.tabelle td { border-top: 1px solid var(--linie); padding: 10px 14px; vertical-align: middle; font-size: 15px; }
.tabelle td.titel { font-weight: 700; color: var(--text-headline); }
.tabelle select { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.leer-hinweis { padding: 16px; color: var(--text-neben); }

.code-box { max-width: 420px; }

/* Hilfsklassen (keine Inline-Styles wegen Content-Security-Policy) */
.stapel { display: flex; flex-direction: column; gap: 16px; }
.stapel.eng { gap: 12px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.abschluss { padding-top: 8px; align-items: center; }
.schmal { margin: 0; max-width: 560px; }
.code-box { margin: 40px 0; }
.fuellen { flex: 1 1 auto; }

.seitentitel { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; color: var(--text-headline); font-weight: 800; }
.text-seite { max-width: 760px; }
.text-seite h2 { font-size: 20px; margin-top: 8px; }
.text-seite p, .text-seite ul { margin: 0; }
.nav a.sekundaer { padding: 8px 16px; font-weight: 600; }
