/* Posen-Katalog — Neumorphismus in warmem Weiß mit Erdtönen.
   Regel für dieses Stylesheet: Flächen sind weich und plastisch, Text ist es nie.
   Schrift bleibt dunkel auf hellem Grund, damit der Stil die Lesbarkeit am Set
   nicht kostet — dort wird bei Sonne aufs Display geschaut. */

:root {
  --grund: #EFE8DA;          /* warmes Weiß, leicht ins Gelb */
  --grund-hoch: #F5F0E5;
  --licht: #FFFDF6;          /* helle Schattenkante oben links */
  --schatten: #CFC4AE;       /* dunkle Schattenkante unten rechts */

  --gruen: #6E8059;          /* grüner Erdton */
  --gruen-tief: #3F4C33;
  --gruen-blass: #DCE1CF;
  --braun: #8F7052;          /* brauner Erdton, auf das Grün abgestimmt */
  --braun-tief: #5B4630;
  --braun-blass: #E7DCCB;

  --text: #2F3529;
  --text-leise: #6C7061;
  --text-still: #9A9683;

  --r-gross: 26px;
  --r: 20px;
  --r-klein: 14px;
  --rand: 18px;

  --erhoben: 6px 6px 14px var(--schatten), -6px -6px 14px var(--licht);
  --erhoben-klein: 3px 3px 7px var(--schatten), -3px -3px 7px var(--licht);
  --erhoben-gross: 10px 10px 26px var(--schatten), -10px -10px 24px var(--licht);
  --vertieft: inset 4px 4px 9px var(--schatten), inset -4px -4px 9px var(--licht);
  --vertieft-tief: inset 6px 6px 12px var(--schatten), inset -5px -5px 11px var(--licht);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* muss stehen, bevor display gesetzt wird: sonst schlaegt display:flex das hidden-Attribut */
[hidden] { display: none !important; }

html { background: var(--grund); }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 400 16px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; font-weight: 800; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 12px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: var(--gruen-tief); }
img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid var(--gruen); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------ Grundbausteine */

.ansicht { padding: 0 var(--rand) 24px; max-width: 620px; margin: 0 auto; }
.ansicht:focus { outline: none; }

.kopf {
  position: sticky; top: 0; z-index: 30;
  max-width: 620px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) var(--rand) 12px;
  background: linear-gradient(var(--grund) 72%, rgba(239, 232, 218, 0));
}
.kopf-reihe { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.kopf-reihe h1, .kopf-reihe h2 { flex: 1; min-width: 0; }
.kopf-titel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf-unter { color: var(--text-leise); font-size: 13px; margin-top: 2px; }

.flaeche {
  background: var(--grund);
  border-radius: var(--r);
  box-shadow: var(--erhoben);
}
.flaeche-gross { border-radius: var(--r-gross); box-shadow: var(--erhoben-gross); }

/* Runde Taste, plastisch — Grundelement des Screenshots */
.taste {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 48px; min-height: 48px; padding: 0 18px;
  border-radius: var(--r-klein);
  background: var(--grund);
  box-shadow: var(--erhoben-klein);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  transition: box-shadow .12s ease, transform .12s ease, color .12s ease;
}
.taste:active { box-shadow: var(--vertieft); transform: translateY(1px); }
.taste[aria-pressed="true"], .taste.aktiv { box-shadow: var(--vertieft); color: var(--gruen-tief); }
.taste-rund { width: 48px; height: 48px; padding: 0; border-radius: 50%; }
.taste-voll {
  width: 100%; min-height: 54px;
  background: linear-gradient(145deg, var(--gruen), var(--gruen-tief));
  color: #FBF8F0; box-shadow: var(--erhoben);
  font-weight: 700;
}
.taste-voll:active { box-shadow: var(--vertieft); }
.taste-still { box-shadow: none; color: var(--text-leise); }
.taste-warn { color: #8A4A3A; }
.taste svg { flex: none; }

.reihe { display: flex; gap: 10px; align-items: center; }
.reihe-umbruch { flex-wrap: wrap; }
.abstand { margin-top: 18px; }
.leise { color: var(--text-leise); font-size: 14px; }
.still { color: var(--text-still); font-size: 13px; }
.zentriert { text-align: center; }

/* --------------------------------------------------------------- Navigation */

.navleiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 8px;
  padding: 10px var(--rand) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(239, 232, 218, 0), var(--grund) 42%);
}
.navleiste-innen {
  display: flex; gap: 6px; padding: 8px;
  border-radius: 999px; background: var(--grund); box-shadow: var(--erhoben);
}
.navtaste {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 62px; height: 54px; border-radius: 999px;
  color: var(--text-leise); font-size: 10px; font-weight: 600; letter-spacing: .01em;
}
.navtaste[aria-current="page"] { box-shadow: var(--vertieft); color: var(--gruen-tief); }

/* -------------------------------------------------------------- Startseite */

.start-kachel {
  position: relative; overflow: hidden;
  padding: 22px; border-radius: var(--r-gross);
  background: var(--grund); box-shadow: var(--erhoben-gross);
}
.start-kachel h1 { font-size: 34px; }
.start-kachel .schleife {
  position: absolute; right: -30px; top: -30px; width: 150px; height: 150px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gruen-blass), var(--braun-blass));
  box-shadow: var(--erhoben); opacity: .75;
}
.start-zahl { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

.kategorien { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.kategorie {
  display: block; text-align: left; padding: 16px;
  border-radius: var(--r); background: var(--grund); box-shadow: var(--erhoben);
  transition: box-shadow .12s ease;
}
.kategorie:active { box-shadow: var(--vertieft); }
.kategorie .name { display: block; font-weight: 700; font-size: 16px; }
.kategorie .anzahl { display: block; color: var(--text-still); font-size: 13px; margin-top: 2px; }
.kategorie .ring {
  width: 42px; height: 42px; border-radius: 50%; margin-bottom: 12px;
  background: var(--grund); box-shadow: var(--erhoben-klein);
  display: grid; place-items: center; color: var(--gruen);
}

/* ------------------------------------------------------------- Posenraster */

/* minmax(0,1fr) statt 1fr: sonst sprengen lange Titelwoerter die Spalte */
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.posenkarte {
  display: block; text-align: left; padding: 8px;
  border-radius: var(--r); background: var(--grund); box-shadow: var(--erhoben);
  transition: box-shadow .12s ease, transform .12s ease;
  content-visibility: auto; contain-intrinsic-size: 260px;
}
.posenkarte:active { box-shadow: var(--vertieft); transform: translateY(1px); }
.posenkarte .bild {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: var(--r-klein); background: var(--grund-hoch);
  box-shadow: var(--vertieft);
}
.posenkarte .bild img { width: 100%; height: 100%; object-fit: cover; }
.posenkarte .titel {
  /* zwei Zeilen fest, damit die Karten einer Reihe gleich hoch bleiben */
  font-size: 13px; font-weight: 600; line-height: 1.3; margin: 9px 4px 2px; min-height: 34px;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.posenkarte .unter { font-size: 11px; color: var(--text-still); margin: 0 4px 6px; }
.posenkarte .herz {
  position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--braun-tief);
  background: rgba(245, 240, 229, .85); box-shadow: var(--erhoben-klein);
}
.gesperrt .bild img { filter: blur(9px) saturate(.55); transform: scale(1.1); }
.gesperrt .schloss {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--braun-tief); background: rgba(239, 232, 218, .45);
}

/* --------------------------------------------------------------- Detailseite */

.detail-bild {
  position: relative; border-radius: var(--r-gross); overflow: hidden;
  box-shadow: var(--erhoben-gross); background: var(--grund-hoch);
}
/* Kein festes Seitenverhaeltnis: die Liegend-Bilder sind quer (1024x768),
   ein 3:4-Beschnitt wuerde ihnen die Pose abschneiden. */
.detail-bild img { width: 100%; height: auto; }
.varianten {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px;
  display: flex; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(245, 240, 229, .88); box-shadow: var(--erhoben-klein);
  backdrop-filter: blur(6px);
}
.variante { width: 34px; height: 26px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text-leise); }
.variante[aria-pressed="true"] { box-shadow: var(--vertieft); color: var(--gruen-tief); }

.marken { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.marke {
  padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--grund); box-shadow: var(--erhoben-klein); color: var(--text-leise);
}
.marke-gruen { color: var(--gruen-tief); }
.marke-braun { color: var(--braun-tief); }

.block { padding: 18px; border-radius: var(--r); background: var(--grund); box-shadow: var(--erhoben); margin-top: 14px; }
.block h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--braun-tief); }
.block h3 .ziffer {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: var(--grund); box-shadow: var(--erhoben-klein); color: var(--gruen);
}
.block ol { margin: 0; padding-left: 20px; }
.block ol li { margin-bottom: 10px; }
.block ol li:last-child { margin-bottom: 0; }
.block ol li strong { color: var(--text); }

.ansage {
  padding: 20px; border-radius: var(--r); margin-top: 14px;
  background: linear-gradient(145deg, var(--gruen-blass), var(--grund));
  box-shadow: var(--erhoben);
  font-size: 19px; line-height: 1.5; font-weight: 600; color: var(--gruen-tief);
}
.ansage .etikett {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-still); margin-bottom: 8px;
}

.aktionsleiste { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.aktionsleiste .taste { flex-direction: column; gap: 4px; min-height: 66px; font-size: 11px; padding: 0 6px; }

/* ------------------------------------------------------------------ Listen */

.liste { display: flex; flex-direction: column; gap: 12px; }
.listenzeile {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--r); background: var(--grund); box-shadow: var(--erhoben);
}
.listenzeile:active { box-shadow: var(--vertieft); }
a.listenzeile { color: inherit; text-decoration: none; box-sizing: border-box; }
.listenzeile .inhalt { flex: 1; min-width: 0; }
.listenzeile .name { font-weight: 700; font-size: 16px; }
.listenzeile .unter { font-size: 13px; color: var(--text-still); margin-top: 1px; }
.listenzeile .vorschau {
  width: 54px; height: 54px; border-radius: var(--r-klein); overflow: hidden;
  box-shadow: var(--vertieft); background: var(--grund-hoch); flex: none;
}
.listenzeile .vorschau img { width: 100%; height: 100%; object-fit: cover; }

.leerzustand { text-align: center; padding: 46px 22px; }
.leerzustand .ring {
  width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; color: var(--gruen);
  background: var(--grund); box-shadow: var(--erhoben);
}

/* ------------------------------------------------------- Felder und Schieber */

.feld { display: block; margin-bottom: 14px; }
.feld span { display: block; font-size: 13px; font-weight: 600; color: var(--text-leise); margin-bottom: 7px; }
.feld input, .feld textarea, .feld select {
  width: 100%; padding: 14px 16px; border: 0; border-radius: var(--r-klein);
  background: var(--grund); box-shadow: var(--vertieft); color: var(--text);
  font: inherit; font-size: 16px;
}
.feld textarea { min-height: 92px; resize: vertical; }
.feld input:focus, .feld textarea:focus { outline: none; box-shadow: var(--vertieft-tief); }

.suchfeld { position: relative; }
.suchfeld input { padding-left: 46px; }
.suchfeld svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-still); }

/* ------------------------------------------------------ Schublade (Filter) */

.blende {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(47, 53, 41, .32); backdrop-filter: blur(2px);
}
.schublade {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 620px; margin: 0 auto;
  max-height: 86vh; overflow-y: auto;
  padding: 10px var(--rand) calc(24px + env(safe-area-inset-bottom));
  border-radius: var(--r-gross) var(--r-gross) 0 0;
  background: var(--grund); box-shadow: 0 -12px 34px rgba(90, 78, 56, .26);
  animation: hoch .22s ease;
}
@keyframes hoch { from { transform: translateY(100%); } }
.griff { width: 46px; height: 5px; border-radius: 999px; background: var(--schatten); margin: 0 auto 16px; }
.schublade h2 { margin-bottom: 14px; }
.gruppe { margin-bottom: 20px; }
.gruppe > .etikett {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-still); margin-bottom: 10px;
}
.marken-wahl { display: flex; flex-wrap: wrap; gap: 9px; }
.wahl {
  padding: 10px 15px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--grund); box-shadow: var(--erhoben-klein); color: var(--text-leise);
  min-height: 42px;
}
.wahl[aria-pressed="true"] { box-shadow: var(--vertieft); color: var(--gruen-tief); }

/* --------------------------------------------------------- Shooting-Modus */

body.modus-set { padding-bottom: 0; background: var(--grund); }
.set { min-height: 100svh; display: flex; flex-direction: column; padding: 0 var(--rand) calc(16px + env(safe-area-inset-bottom)); max-width: 620px; margin: 0 auto; }
.set-kopf { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 0 10px; }
.set-fortschritt { flex: 1; }
.set-balken { height: 10px; border-radius: 999px; box-shadow: var(--vertieft); overflow: hidden; margin-top: 6px; }
.set-balken i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gruen), var(--braun)); transition: width .25s ease; }
.set-bild { position: relative; border-radius: var(--r-gross); overflow: hidden; box-shadow: var(--erhoben-gross); background: var(--grund-hoch); }
.set-bild img { width: 100%; max-height: 46svh; object-fit: contain; background: var(--grund-hoch); }
.set-ansage {
  margin-top: 14px; padding: 18px; border-radius: var(--r);
  background: linear-gradient(145deg, var(--gruen-blass), var(--grund)); box-shadow: var(--erhoben);
  font-size: 21px; line-height: 1.45; font-weight: 600; color: var(--gruen-tief);
}
/* Klebt am unteren Rand: Abhaken und Weiter muessen am Set immer erreichbar sein,
   ohne dass jemand mit der Kamera in der Hand erst scrollt. */
.set-fuss {
  position: sticky; bottom: 0; margin-top: auto; z-index: 10;
  padding: 14px 0 calc(6px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 56px 1fr 56px; gap: 12px; align-items: center;
  background: linear-gradient(rgba(239, 232, 218, 0), var(--grund) 26%);
}
.set-erledigt { min-height: 60px; border-radius: var(--r); font-size: 16px; font-weight: 700; }
.set-erledigt[aria-pressed="true"] { box-shadow: var(--vertieft); color: var(--gruen-tief); }

/* ------------------------------------------------------------------ Hinweis */

.hinweis {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 70;
  padding: 13px 20px; border-radius: 999px; max-width: calc(100% - 36px);
  background: var(--grund); box-shadow: var(--erhoben); font-size: 14px; font-weight: 600;
  animation: hoch .18s ease;
}

/* ------------------------------------------------------------------ Schloss */

.hinweis-sperre {
  margin-top: 16px; padding: 20px; border-radius: var(--r-gross);
  background: linear-gradient(145deg, var(--braun-blass), var(--grund));
  box-shadow: var(--erhoben-gross);
}
.hinweis-sperre h2 { color: var(--braun-tief); margin-bottom: 8px; }

.fortschrittsring { display: flex; gap: 10px; align-items: center; }

@media (min-width: 560px) {
  .raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kategorien { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Marken auf der Detailseite sind antippbar (Filter im Katalog setzen). */
button.marke { cursor: pointer; }
button.marke:active { box-shadow: var(--vertieft); }
