/* KreativBüro · Aktion als Comic-Knall (seit 20.11.2026, nur Startseite, Variante A Limette)
   Der Text kommt aus dem Admin (shop-info.php → aktion.text, preis, liste, bis).
   Drei Varianten über data-variante am .kb-knall: "limette" (Mitte, abgedunkelt),
   "schiefer" (Mitte, dunkler Stern), "ecke" (unten rechts, ohne Abdunkeln).
   Kein Rahmen, keine Box: nur der Stern mit hartem und weichem Schatten. */

.kb-knall {
  --k-fill: #9cc000;
  --k-fill-2: #b2d81c;
  --k-line: #1f2a36;
  --k-hart: #1f2a36;
  --k-punkt: rgba(255, 255, 255, .42);
  --k-strahl: #ffffff;
  --k-stern: #d4f05a;
  --k-titel: #1f2a36;
  --k-preis: #1f2a36;
  --k-klein: #2a3a10;
  --k-btn-bg: #1f2a36;
  --k-btn-fg: #d4f05a;
  --k-breite: min(92vw, 600px);
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.kb-knall[hidden] { display: none !important; }
.kb-knall[data-variante="schiefer"] {
  --k-fill: #3e4d60;
  --k-fill-2: #4a5b70;
  --k-line: #9cc000;
  --k-hart: #9cc000;
  --k-punkt: rgba(156, 192, 0, .7);
  --k-strahl: #9cc000;
  --k-stern: #9cc000;
  --k-titel: #ffffff;
  --k-preis: #d4f05a;
  --k-klein: #c4ced8;
  --k-btn-bg: #9cc000;
  --k-btn-fg: #15200a;
}

/* Abdunkeln (nur Mitte-Varianten) */
.kb-knall-schleier {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(27, 38, 49, .35), rgba(27, 38, 49, .72));
  opacity: 0; transition: opacity .35s ease;
  pointer-events: auto;
}
.kb-knall.ist-offen .kb-knall-schleier { opacity: 1; }
.kb-knall[data-variante="ecke"] .kb-knall-schleier { display: none; }

/* Bühne: hält Punkte, Strahlen, Stern und Text */
.kb-knall-buehne {
  position: relative;
  width: var(--k-breite);
  aspect-ratio: 1.18 / 1;
  pointer-events: auto;
  filter: drop-shadow(0 22px 34px rgba(20, 30, 40, .38));
}
.kb-knall[data-variante="ecke"] {
  place-items: end end;
  --k-breite: min(86vw, 380px);
}

.kb-knall-punkte, .kb-knall-strahlen, .kb-knall-stern, .kb-knall-sterne, .kb-knall-blitz { position: absolute; inset: 0; pointer-events: none; }
.kb-knall-punkte {
  inset: -14%;
  background-image: radial-gradient(var(--k-punkt) 28%, transparent 31%);
  background-size: 11px 11px;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, rgba(0,0,0,.6) 60%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 35%, rgba(0,0,0,.6) 60%, transparent 100%);
}
.kb-knall-strahlen { inset: -22%; }
.kb-knall-stern svg, .kb-knall-strahlen svg, .kb-knall-sterne svg { width: 100%; height: 100%; overflow: visible; display: block; }
.kb-knall-stern .k-hart { fill: var(--k-hart); }
.kb-knall-stern .k-flaeche { fill: var(--k-fill); stroke: var(--k-line); stroke-width: 5; stroke-linejoin: miter; stroke-miterlimit: 8; paint-order: stroke; }
.kb-knall-stern .k-glanz { fill: var(--k-fill-2); }
.kb-knall-strahlen path { fill: var(--k-strahl); }
.kb-knall-sterne path { fill: var(--k-stern); }
.kb-knall-sterne .k-hell { fill: #fff; stroke: var(--k-line); stroke-width: 1.4; }
.kb-knall-blitz { border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, rgba(255,255,255,0) 70%); opacity: 0; }

/* Text im Stern */
.kb-knall-text {
  position: absolute;
  left: 17%; right: 17%; top: 21%; bottom: 26%;
  display: grid; place-items: center;
  text-align: center;
  --k: 1;
}
.kb-knall-inhalt { display: grid; justify-items: center; gap: calc(.15em * var(--k)); font-size: calc(16px * var(--k)); line-height: 1; width: 100%; }
.kb-knall-titel {
  margin: 0;
  font-family: var(--f-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-weight: 800; text-transform: uppercase; letter-spacing: .01em;
  font-size: 2.15em; line-height: .95; max-width: 100%;
  color: var(--k-titel);
  text-wrap: balance; overflow-wrap: normal; hyphens: manual;
  rotate: -4deg;
}
.kb-knall-titel.ist-lang { font-size: 1.55em; }
.kb-knall-preis {
  display: flex; align-items: baseline; gap: .3em; flex-wrap: wrap; justify-content: center;
  font-family: var(--f-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-weight: 800; color: var(--k-preis);
  rotate: -4deg;
}
.kb-knall-preis .k-neu { font-size: 3.6em; letter-spacing: -.02em; line-height: .9; }
.kb-knall-preis .k-alt { font-size: 1.25em; color: var(--k-klein); white-space: nowrap; }
.kb-knall-preis .k-alt s { text-decoration-thickness: .12em; }
.kb-knall-bis {
  margin: 0;
  font-family: var(--f-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: .95em; font-weight: 500; color: var(--k-klein);
  rotate: -4deg;
}

/* Knopf ragt unten aus dem Stern */
.kb-knall-los {
  position: absolute; left: 50%; bottom: 7%;
  transform: translateX(-50%) rotate(-4deg);
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  background: var(--k-btn-bg); color: var(--k-btn-fg);
  font-family: var(--f-body, "Figtree", system-ui, sans-serif); font-weight: 800; font-size: 1.05rem;
  text-decoration: none; white-space: nowrap;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .28);
}
.kb-knall-los:hover { filter: brightness(1.12); }
.kb-knall-los:focus-visible, .kb-knall-zu:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Schließen */
.kb-knall-zu {
  position: absolute; top: 6%; right: 7%;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: #fff; color: #1f2a36;
  box-shadow: 3px 4px 0 #1f2a36, 0 6px 16px rgba(0,0,0,.25);
}
.kb-knall-zu svg { width: 18px; height: 18px; }

/* Kleiner Knall unten rechts, nach dem Schließen (öffnet wieder) */
.kb-knall-mini {
  position: fixed; z-index: 890;
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 92px; height: 86px;
  border: 0; padding: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 8px 14px rgba(20, 30, 40, .35));
  display: grid; place-items: center;
}
.kb-knall-mini[hidden] { display: none; }
.kb-knall-mini svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kb-knall-mini .k-hart { fill: #1f2a36; }
.kb-knall-mini .k-flaeche { fill: #9cc000; stroke: #1f2a36; stroke-width: 7; paint-order: stroke; }
.kb-knall-mini span { position: relative; font-family: var(--f-display, system-ui); font-weight: 800; color: #1f2a36; font-size: 1.15rem; line-height: .9; transform: rotate(-6deg); text-align: center; }
.kb-knall-mini small { display: block; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.kb-knall-mini:focus-visible { outline: 3px solid #9cc000; outline-offset: 4px; border-radius: 50%; }

/* ---------- Motion: der Knall ---------- */
.kb-knall.ist-offen .kb-knall-blitz { animation: k-blitz .45s ease-out both; }
.kb-knall.ist-offen .kb-knall-strahlen { animation: k-strahlen .7s cubic-bezier(.2,.9,.3,1) .06s both, k-dreh 40s linear .8s infinite; }
.kb-knall.ist-offen .kb-knall-punkte { animation: k-punkte .7s cubic-bezier(.2,.9,.3,1) .1s both; }
.kb-knall.ist-offen .kb-knall-stern { animation: k-knall .75s cubic-bezier(.3,1.5,.5,1) both, k-wackel 3.2s ease-in-out 1.2s infinite; }
.kb-knall.ist-offen .kb-knall-titel { animation: k-stempel .4s cubic-bezier(.3,1.4,.5,1) .38s both; }
.kb-knall.ist-offen .kb-knall-preis { animation: k-plopp .45s cubic-bezier(.3,1.6,.5,1) .55s both; }
.kb-knall.ist-offen .kb-knall-bis { animation: k-rein .35s ease-out .72s both; }
.kb-knall.ist-offen .kb-knall-los { animation: k-knopf .45s cubic-bezier(.3,1.6,.5,1) .85s both; }
.kb-knall.ist-offen .kb-knall-zu { animation: k-rein .3s ease-out 1s both; }
.kb-knall.ist-offen .kb-knall-sterne path { transform-box: fill-box; transform-origin: center; animation: k-funkel 2.4s ease-in-out infinite; }
.kb-knall.ist-offen .kb-knall-sterne g { transform-box: fill-box; transform-origin: center; animation: k-plopp .4s cubic-bezier(.3,1.6,.5,1) both; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(2) { animation-delay: .5s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(3) { animation-delay: .62s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(4) { animation-delay: .7s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(5) { animation-delay: .78s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(1) { animation-delay: .45s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(2) path { animation-delay: -.8s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(3) path { animation-delay: -1.6s; }
.kb-knall.ist-offen .kb-knall-sterne g:nth-child(4) path { animation-delay: -.4s; }
.kb-knall.ist-zu .kb-knall-buehne { animation: k-weg .38s cubic-bezier(.5,0,.8,.4) both; }
.kb-knall.ist-zu .kb-knall-schleier { opacity: 0; }
.kb-knall-mini.ist-neu { animation: k-plopp .45s cubic-bezier(.3,1.6,.5,1) both; }
.kb-knall-mini svg { animation: k-wackel 3.2s ease-in-out infinite; }
.kb-knall[data-variante="ecke"].ist-offen .kb-knall-buehne { animation: k-ecke .6s cubic-bezier(.3,1.3,.5,1) both; transform-origin: 85% 90%; }

@keyframes k-blitz { 0% { opacity: .95; transform: scale(.1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes k-strahlen { 0% { opacity: 0; transform: scale(.25); } 55% { opacity: 1; transform: scale(1.12); } 100% { opacity: .9; transform: scale(1); } }
@keyframes k-dreh { to { rotate: 360deg; } }
@keyframes k-punkte { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
@keyframes k-knall { 0% { opacity: 0; transform: scale(0) rotate(-28deg); } 35% { opacity: 1; } 60% { transform: scale(1.13) rotate(5deg); } 80% { transform: scale(.96) rotate(-2deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes k-wackel { 0%, 100% { rotate: 0deg; scale: 1; } 50% { rotate: 1.6deg; scale: 1.015; } }
@keyframes k-stempel { 0% { opacity: 0; transform: scale(2.6) rotate(-10deg); } 100% { opacity: 1; transform: none; } }
@keyframes k-plopp { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
@keyframes k-rein { 0% { opacity: 0; translate: 0 8px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes k-knopf { 0% { opacity: 0; transform: translateX(-50%) rotate(-4deg) scale(0); } 100% { opacity: 1; transform: translateX(-50%) rotate(-4deg) scale(1); } }
@keyframes k-funkel { 0%, 100% { scale: 1; opacity: 1; } 50% { scale: .55; opacity: .55; } }
@keyframes k-weg { to { opacity: 0; transform: translate(30vw, 30vh) scale(.12) rotate(25deg); } }
@keyframes k-ecke { 0% { opacity: 0; transform: translate(40%, 40%) scale(.1) rotate(30deg); } 60% { opacity: 1; transform: translate(-3%, -3%) scale(1.08) rotate(-3deg); } 100% { transform: none; } }

/* Ruhig für alle, die Bewegung abgeschaltet haben */
@media (prefers-reduced-motion: reduce) {
  .kb-knall *, .kb-knall-mini, .kb-knall-mini svg { animation: none !important; }
  .kb-knall.ist-offen .kb-knall-buehne { animation: k-sanft .3s ease-out both !important; }
  .kb-knall.ist-zu { display: none; }
}
@keyframes k-sanft { from { opacity: 0; } to { opacity: 1; } }

/* Handy */
@media (max-width: 520px) {
  .kb-knall-text { left: 17%; right: 17%; top: 23%; bottom: 28%; }
  .kb-knall-los { padding: .7rem 1.15rem; font-size: .98rem; bottom: 5%; }
  .kb-knall-zu { top: 2%; right: 3%; }
  .kb-knall[data-variante="ecke"] { --k-breite: min(94vw, 360px); }
}
