@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bg-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bg-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bg-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --blau: #2418B8;
  --blau-hell: #4438EA;
  --rosa: #FFF1F3;
  --rosa-stark: #FFDDE4;
  --himbeere: #E11D48;
  --himbeere-dunkel: #A80F35;
  --minze: #2EE6B0;
  --tinte: #17104F;
  --leise: #5A5380;
  --weiss: #fff;
  --spalte: 680px;
  --rand: 16px;
  --zacke: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--rosa); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--rosa);
  color: var(--tinte);
  font: 500 17px/1.25 "Bricolage Grotesque", system-ui, sans-serif;
  overflow-anchor: none;
}
main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--himbeere); outline-offset: -3px; }

/* Oben: der Korb, unter einer Markise, die über das Regal hängt. */
.kaufen {
  position: relative; z-index: 1;
  background: var(--blau); color: var(--weiss);
  padding: calc(env(safe-area-inset-top) + 20px) max(var(--rand), calc((100vw - var(--spalte)) / 2)) 14px;
}
.kaufen::after {
  content: ""; position: absolute; inset: 100% 0 auto 0; height: var(--zacke);
  background:
    radial-gradient(circle at 50% 0, var(--blau) 13.5px, transparent 14px) 0 0 / 56px var(--zacke) repeat-x,
    radial-gradient(circle at 50% 0, var(--blau-hell) 13.5px, transparent 14px) 28px 0 / 56px var(--zacke) repeat-x;
}
.kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
h1 { margin: 0; font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
#anzahl-kaufen { display: inline-block; font-size: 46px; font-weight: 800; line-height: 1; color: var(--minze); }
.kaufen .leer { padding: 10px 0 8px; font-size: 19px; font-weight: 600; }

.kaufen .zeile { min-height: 64px; padding: 6px 0; font-size: 21px; font-weight: 600; line-height: 1.15; }
.kaufen .zeile:active .bild { transform: scale(.9); }
.kaufen .bild { flex: none; width: 48px; height: 48px; display: grid; place-items: center; transition: transform .12s; }
.kaufen .bild img { width: 46px; height: 46px; }
.kaufen .marke { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.kaufen .marke i { display: block; width: 30px; height: 30px; border: 3px solid var(--weiss); border-radius: 50%; }

/* Unten: Tasten. Bild und Name liegen auf derselben Fläche, die blaue Kante schließt die Taste nach unten ab. */
.alle { padding: calc(var(--zacke) + 22px) max(var(--rand), calc((100vw - var(--spalte)) / 2)) 0; }
h2 { margin: 0 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
#anzahl-alle { color: var(--leise); font-weight: 500; }

#liste-alle {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px 8px;
}
.alle li { min-width: 0; }
.alle .zeile {
  position: relative; display: grid; grid-template-rows: 72px auto; align-content: start; align-items: start; gap: 0;
  width: 100%; height: 100%; padding: 8px 4px 10px; text-align: center;
  background: var(--weiss); border-radius: 18px; box-shadow: 0 4px 0 var(--blau);
  transition: transform .09s, box-shadow .09s;
}
.alle .zeile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blau); }
.alle .bild { position: relative; display: flex; align-items: center; justify-content: center; }
.alle .bild img {
  display: block; width: 68px; height: 68px;
  filter: drop-shadow(0 2px 1px rgb(23 16 79 / .22));
  transition: transform .12s;
}
@media (hover: hover) {
  .alle .zeile:hover .bild > * { transform: translateY(-3px) rotate(-3deg); }
}
.alle .text { padding: 4px 2px 0; }
.alle .name { font-size: 15px; font-weight: 600; line-height: 1.18; hyphens: auto; overflow-wrap: anywhere; }
.alle .marke {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--himbeere); color: var(--weiss); border-radius: 50%;
}
.alle .marke svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; }

.alle .zeile.faellig { background: var(--rosa-stark); }
.rhythmus { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; line-height: 1.15; color: var(--himbeere-dunkel); }

.name { display: block; }
.text { min-width: 0; overflow-wrap: anywhere; }
.zeile {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
.kaufen .text { flex: 1; }

/* Produkte ohne passendes Bild bekommen ihren Anfangsbuchstaben. */
.buchstabe {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 2px; border-radius: 50%;
  color: var(--weiss); font-size: 28px; font-weight: 800; line-height: 1; transition: transform .12s;
}
.kaufen .buchstabe { width: 44px; height: 44px; margin: 0; font-size: 22px; }
.b0 { background: var(--himbeere); }
.b1 { background: var(--blau-hell); }
.b2 { background: #0E8F6E; }
.b3 { background: #C2410C; }

.neu {
  display: block; width: 100%; min-height: 54px; margin: 8px 0 12px; padding: 8px 18px; border-radius: 27px;
  background: var(--himbeere); color: var(--weiss); text-align: left; font-weight: 600;
}
.leer { margin: 0; }
.alle .leer { padding: 12px 0; color: var(--leise); }
.hinweis { margin: 22px 0 0; font-size: 14px; color: var(--leise); }
.hinweis + .hinweis { margin-top: 6px; }

/* Untere Leiste schwebt über dem Regal, in Daumennähe. */
.leiste { position: fixed; inset: auto 0 0 0; z-index: 5; padding-bottom: env(safe-area-inset-bottom); pointer-events: none; }
.leiste > * { pointer-events: auto; }
.eingabe {
  position: relative; display: flex; gap: 8px;
  max-width: calc(var(--spalte) + 2 * var(--rand)); margin: 0 auto; padding: 10px var(--rand) 12px;
}
#suche {
  flex: 1; min-width: 0; height: 52px; padding: 0 46px 0 20px;
  border: 2px solid var(--blau); border-radius: 26px; background: var(--weiss);
  box-shadow: 0 8px 22px rgb(36 24 184 / .22);
  font-size: 17px; outline: none; appearance: none;
}
#suche:placeholder-shown { padding: 0 8px 0 16px; }
#suche:focus { border-color: var(--himbeere); }
#suche::placeholder { color: var(--leise); font-size: 16px; }
.leeren { position: absolute; top: 10px; right: calc(var(--rand) + 4px); height: 52px; width: 44px; display: grid; place-items: center; }
.leeren svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.nach-oben {
  flex: none; height: 52px; padding: 0 20px; border-radius: 26px;
  background: var(--blau); color: var(--weiss); font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 22px rgb(36 24 184 / .32);
}

.meldung {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--spalte); margin: 0 auto; min-height: 50px; padding: 3px 18px; border-radius: 25px;
  background: var(--tinte); color: var(--weiss);
  width: calc(100% - 2 * var(--rand));
}
#meldung-text { min-width: 0; overflow-wrap: anywhere; }
#rueckgaengig { flex: none; min-height: 44px; padding: 0 2px; color: var(--minze); font-weight: 600; }
.status {
  width: calc(100% - 2 * var(--rand)); max-width: var(--spalte); margin: 0 auto 6px; padding: 8px 14px; border-radius: 14px;
  background: var(--weiss); color: var(--himbeere-dunkel); font-size: 14px; font-weight: 600;
}

.blatt {
  width: 100%; max-width: 460px; margin: auto auto 0; padding: 0 0 env(safe-area-inset-bottom);
  border: 0; border-radius: 24px 24px 0 0; color: var(--tinte); background: var(--weiss);
}
.blatt::backdrop { background: rgb(23 16 79 / .55); }
.blatt form { display: grid; gap: 8px; padding: 20px 16px 16px; }
.blatt label { font-weight: 600; }
.blatt input { height: 52px; padding: 0 16px; border: 2px solid var(--blau); border-radius: 14px; font-size: 17px; }
.blatt button { min-height: 52px; border-radius: 14px; background: var(--rosa); font-weight: 600; }
.blatt .haupt { background: var(--blau); color: var(--weiss); }
.blatt .gefahr { color: var(--himbeere-dunkel); }
[hidden] { display: none !important; }

/* Bewegung: alles antwortet auf den Daumen und liegt über der Seite, ohne Tipps abzufangen. */
.flieger { position: fixed; z-index: 30; margin: 0; pointer-events: none; transform-origin: 0 0; will-change: transform; transition: none; }
.funken { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 31; pointer-events: none; }
.geist { position: fixed; z-index: 2; margin: 0; pointer-events: none; color: var(--weiss); background: var(--blau); }
.geist .bild { visibility: hidden; }
.geist .name { display: inline; background: linear-gradient(var(--minze), var(--minze)) 0 58% / 0 3px no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: strich .22s ease-out forwards; }
.geist .marke svg { width: 32px; height: 32px; }
.geist .marke circle { fill: var(--minze); }
.geist .marke path { fill: none; stroke: var(--blau); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; animation: haken .2s .04s ease-out forwards; }
@keyframes strich { to { background-size: 100% 3px; } }
@keyframes haken { to { stroke-dashoffset: 0; } }

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