:root {
  --hg: #1b1714;
  --flaeche: #262019;
  --flaeche2: #322a21;
  --linie: #43392d;
  --text: #f3ece2;
  --leise: #b5a794;
  --akzent: #e7a85b;
  --akzent-text: #241a0e;
  --gut: #8fc79a;
  --rot: #e58a7b;
  --radius: 14px;
  --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--hg); color: var(--text); }
body {
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(88px + var(--unten));
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
img { display: block; }
[hidden] { display: none !important; }

main { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.kopf h1 { font-size: 28px; margin: 0; letter-spacing: -0.01em; }
.kopf .zurueck { font-size: 26px; width: 44px; height: 44px; border-radius: 50%; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--leise); margin: 26px 0 10px; font-weight: 600; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--akzent); color: var(--akzent-text); font-weight: 650;
}
.knopf.zweit { background: var(--flaeche2); color: var(--text); }
.knopf.klein { min-height: 38px; padding: 0 14px; font-size: 15px; }
.knopf:disabled { opacity: 0.5; }
.rund { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }

/* Anmeldung */
.login { max-width: 360px; margin: 18vh auto 0; text-align: center; }
.login h1 { font-size: 34px; margin: 12px 0 4px; }
.login p { color: var(--leise); margin: 0 0 24px; }
.feld {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); margin-bottom: 12px;
}
.feld:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.fehler { color: var(--rot); min-height: 1.4em; }

/* Weiterhören */
.weiter {
  display: flex; gap: 16px; align-items: center; width: 100%; text-align: left;
  background: var(--flaeche); border-radius: 20px; padding: 14px;
}
.weiter img, .weiter .platzhalter { width: 86px; height: 128px; border-radius: 10px; flex: none; }
.weiter b { display: block; font-size: 19px; line-height: 1.25; }
.weiter small { color: var(--leise); display: block; margin-top: 4px; }
.weiter .play { margin-left: auto; background: var(--akzent); color: var(--akzent-text); flex: none; }

/* Bücherregal */
.regal { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.buch { text-align: left; }
.buch .bild { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--flaeche2); }
.buch img { width: 100%; height: 100%; object-fit: cover; }
.buch b { display: block; font-size: 15px; line-height: 1.25; margin-top: 8px; }
.buch small { color: var(--leise); font-size: 13px; }
.balken { height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--akzent); }
.buch .balken { position: absolute; left: 8px; right: 8px; bottom: 8px; }
.marke {
  position: absolute; top: 8px; left: 8px; font-size: 12px; font-weight: 650;
  padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.65);
}
.platzhalter {
  display: grid; place-items: center; text-align: center; padding: 10px; font-weight: 650;
  background: linear-gradient(160deg, #5b4430, #2d241b); color: #f3dcc0; font-size: 15px; line-height: 1.2;
  width: 100%; height: 100%;
}

/* Aufträge */
.auftrag { display: flex; gap: 12px; align-items: center; background: var(--flaeche); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.auftrag img { width: 44px; height: 66px; border-radius: 6px; object-fit: cover; flex: none; }
.auftrag .mitte { flex: 1; min-width: 0; }
.auftrag b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auftrag small { color: var(--leise); display: block; margin: 2px 0 6px; }
.auftrag.fehler small { color: var(--rot); }

/* Kindle-Liste */
.suche { position: sticky; top: 0; background: var(--hg); padding: 6px 0 10px; z-index: 2; }
.eintrag { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.eintrag img, .eintrag .platzhalter { width: 48px; height: 72px; border-radius: 6px; object-fit: cover; flex: none; }
.eintrag .mitte { flex: 1; min-width: 0; }
.eintrag b { display: block; line-height: 1.25; }
.eintrag small { color: var(--leise); }
.status { font-size: 14px; color: var(--leise); text-align: right; }
.status.ok { color: var(--gut); }

/* Player */
.player { text-align: center; }
.player .cover { width: min(68vw, 300px); aspect-ratio: 2 / 3; margin: 6px auto 18px; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.player .cover img { width: 100%; height: 100%; object-fit: cover; }
.player h1 { font-size: 22px; margin: 0; line-height: 1.25; }
.player .autor { color: var(--leise); margin: 2px 0 0; }
.player .kapitel { margin: 12px 0 4px; font-weight: 600; min-height: 1.4em; }
.zeitleiste { margin: 10px 0 0; }
.zeitleiste input { width: 100%; accent-color: var(--akzent); height: 28px; }
.zeiten { display: flex; justify-content: space-between; font-size: 14px; color: var(--leise); font-variant-numeric: tabular-nums; }
.steuerung { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 8px; }
.steuerung .gross { width: 78px; height: 78px; background: var(--akzent); color: var(--akzent-text); }
.steuerung .sprung { width: 58px; height: 58px; font-size: 15px; font-weight: 700; position: relative; }
.steuerung svg { width: 30px; height: 30px; }
.steuerung .gross svg { width: 36px; height: 36px; }
.leiste { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 0; }
.leiste button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: var(--radius); background: var(--flaeche); font-size: 13px; color: var(--leise);
}
.leiste button b { color: var(--text); font-size: 16px; }
.leiste button.an { background: var(--flaeche2); }
.leiste button.an b { color: var(--akzent); }
.zusatz { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hinweis { color: var(--leise); font-size: 14px; margin-top: 10px; }

/* Mini-Player */
.mini {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--unten)); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px;
  background: var(--flaeche2); border-radius: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.45);
  max-width: 704px; margin: 0 auto;
}
.mini img { width: 44px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--flaeche); }
.mini-info { flex: 1; min-width: 0; text-align: left; }
.mini-info span, .mini-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info small { color: var(--leise); font-size: 13px; }
.mini .rund { background: var(--akzent); color: var(--akzent-text); }
.mini svg { width: 24px; height: 24px; }

/* Blatt */
.blatt-hg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10; }
.blatt {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 82dvh; overflow: auto;
  background: var(--flaeche); border-radius: 22px 22px 0 0; padding: 10px 18px calc(22px + var(--unten));
  max-width: 720px; margin: 0 auto;
}
.blatt::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--linie); margin: 0 auto 12px; }
.blatt h3 { margin: 4px 0 12px; font-size: 19px; }
.wahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wahl button { min-height: 54px; border-radius: var(--radius); background: var(--flaeche2); font-weight: 600; }
.wahl button.an { background: var(--akzent); color: var(--akzent-text); }
.wahl .breit { grid-column: 1 / -1; }
.liste button {
  display: flex; width: 100%; text-align: left; gap: 12px; align-items: center;
  padding: 13px 4px; border-bottom: 1px solid var(--linie);
}
.liste button.an { color: var(--akzent); font-weight: 650; }
.liste .rechts { margin-left: auto; color: var(--leise); font-size: 14px; font-variant-numeric: tabular-nums; flex: none; }
.lz { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--linie); }
.lz > button:first-child { flex: 1; text-align: left; padding: 12px 4px; }
.lz small { display: block; color: var(--leise); }
.lz .weg { color: var(--rot); padding: 10px; }

.meldung {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--unten)); z-index: 20;
  background: #f3ece2; color: #1b1714; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.leer { color: var(--leise); text-align: center; padding: 30px 10px; }
.menue { display: flex; gap: 6px; }
@media (min-width: 600px) { .regal { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* Korrekturen nach Handy-Test */
a { color: inherit; text-decoration: none; }
.knopf { white-space: nowrap; text-decoration: none; }
.kopf h1 { font-size: 25px; line-height: 1.15; }
.kopf .zurueck { display: grid; place-items: center; background: var(--flaeche); flex: none; }
.player .cover { width: auto; height: min(36dvh, 330px); max-width: 70vw; margin: 0 auto 16px; }
.player .kopf { margin-bottom: 8px; }
