/* =====================================================================
   Bunker-Adventskalender – Gestaltung & Animationen
   modules/addons/bh_advent/assets/bh-advent.css
   ===================================================================== */
.bha, .bha-launch {
  --r: #d43e29;
  --r2: #ff6a4d;
  --gold: #f2c14e;
  --gold2: #b8862a;
  --gruen: #3ecf7a;
  --blau: #4aa3ff;
  --stahl1: #4a4d52;
  --stahl2: #2a2c30;
  --stahl3: #17181b;
  --txt: #ececec;
  --mut: #9a9ca2;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
html.bha-lock, html.bha-lock body { overflow: hidden !important; }

/* ---------------- Startknopf ---------------- */
.bha-launch {
  position: fixed;
  left: 14px;
  bottom: 62px;
  z-index: 1022;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 1px solid rgba(242, 193, 78, .45);
  border-radius: 999px;
  background: linear-gradient(135deg, #2a1712, #151517 60%);
  color: #fff;
  font: 700 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(212, 62, 41, .5);
  transform: translateY(120px);
  opacity: 0;
  transition: transform .7s cubic-bezier(.2, 1.4, .3, 1), opacity .4s, box-shadow .3s;
  animation: bhaLaunchPuls 2.8s ease-in-out 1.5s infinite;
}
.bha-launch.da { transform: none; opacity: 1; }
.bha-launch:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 4px rgba(212, 62, 41, .25); }
.bha-launch-tuer { width: 40px; height: 40px; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.bha-launch-tuer svg { width: 100%; height: 100%; display: block; }
.bha-launch:hover .bha-rad { animation: bhaRadWackel .9s ease-in-out; }
.bha-launch-badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--r); color: #fff; font-size: 12px;
  box-shadow: 0 0 12px rgba(212, 62, 41, .7);
}
.bha-launch.alles .bha-launch-badge { background: var(--gruen); box-shadow: 0 0 12px rgba(62, 207, 122, .6); }
@keyframes bhaLaunchPuls { 0%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(212, 62, 41, .45); } 50% { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 8px rgba(212, 62, 41, 0); } }
@media (max-width: 575.98px) { .bha-launch-txt { display: none; } .bha-launch { padding-right: 8px; } }

/* ---------------- Overlay ---------------- */
.bha {
  position: fixed; inset: 0; z-index: 2147483000;
  overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(ellipse at 50% 0%, #2a1611 0%, #0e0e10 55%, #070708 100%);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  opacity: 0;
  transition: opacity .4s ease;
  -webkit-font-smoothing: antialiased;
}
.bha.an { opacity: 1; }
.bha.weg { opacity: 0; }
.bha * { box-sizing: border-box; }
.bha [hidden] { display: none !important; }
.bha-schnee { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.bha-glow {
  position: fixed; left: 50%; top: -30vh; width: 120vw; height: 70vh; margin-left: -60vw;
  background: radial-gradient(ellipse at center, rgba(212, 62, 41, .25), transparent 65%);
  pointer-events: none; animation: bhaGlow 6s ease-in-out infinite alternate;
}
@keyframes bhaGlow { to { opacity: .55; transform: scale(1.1); } }

.bha-shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 34px 22px 60px; transition: filter .45s, transform .45s, opacity .45s; }
.bha.mit-stage .bha-shell { filter: blur(6px) brightness(.45); transform: scale(.97); pointer-events: none; }
.bha-zu {
  position: fixed; top: 16px; right: 18px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .45);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: transform .25s, border-color .2s;
}
.bha-zu:hover { transform: rotate(90deg); border-color: var(--r); }

.bha-kopf { text-align: center; margin: 0 auto 26px; max-width: 760px; }
.bha-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid rgba(242, 193, 78, .4); border-radius: 999px; color: var(--gold); font: 700 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; background: rgba(242, 193, 78, .06); }
.bha-kicker svg { width: 14px; height: 14px; fill: var(--gold); animation: bhaFunkel 2.4s ease-in-out infinite; }
.bha-kicker b { color: #fff; }
@keyframes bhaFunkel { 50% { transform: scale(1.35) rotate(25deg); opacity: .6; } }
.bha-kopf h2 {
  margin: 16px 0 10px; font-size: clamp(28px, 4.6vw, 48px); font-weight: 900; letter-spacing: -.01em; line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #c8c8c8); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(212, 62, 41, .25);
}
.bha.an .bha-kopf h2 { animation: bhaTitel .9s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes bhaTitel { from { opacity: 0; transform: translateY(18px); letter-spacing: .08em; } }
.bha-kopf p { margin: 0 auto; color: var(--mut); font-size: 15px; line-height: 1.6; }
.bha-fortschritt { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; color: var(--mut); font-size: 13px; }
.bha-fortschritt b { color: #fff; }
.bha-fb { width: 180px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bha-fb i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--r), var(--gold)); box-shadow: 0 0 10px rgba(242, 193, 78, .6); transition: width .8s cubic-bezier(.2, .9, .3, 1); }
.bha-fuss { margin: 26px auto 0; text-align: center; color: var(--mut); font-size: 13px; }

/* ---------------- Bunkerwand mit Türchen ---------------- */
.bha-wand {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px;
  padding: 22px; border-radius: 20px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .04), transparent 40%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 128px),
    linear-gradient(180deg, #2b2b2e, #1d1d20);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 20px 60px rgba(0, 0, 0, .5), 0 30px 80px rgba(0, 0, 0, .6);
  perspective: 1100px;
}
@media (max-width: 991.98px) { .bha-wand { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px; } }
@media (max-width: 575.98px) { .bha-kopf { padding-top: 34px; } }
@media (max-width: 479.98px) { .bha-wand { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 10px; } .bha-shell { padding: 22px 12px 40px; } }

.bha-slot {
  position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 14px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #121214, #050506 75%);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, .9), inset 0 0 0 2px #0b0b0c, 0 1px 0 rgba(255, 255, 255, .06);
  perspective: 600px; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
  opacity: 0;
}
.bha.an .bha-slot { opacity: 1; animation: bhaRein .7s cubic-bezier(.2, 1.1, .3, 1) backwards; animation-delay: calc(var(--i) * 35ms + .15s); }
@keyframes bhaRein { from { opacity: 0; transform: translateY(-40px) rotateX(55deg) scale(.7); } to { opacity: 1; transform: none; } }
.bha-slot:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Fach hinter der Tür */
.bha-fach {
  position: absolute; inset: 8%; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(255, 210, 140, .25), transparent 65%), #0b0b0c;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, .9);
}
.bha-fach svg { width: 42%; height: 42%; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(242, 193, 78, .7)); opacity: 0; transform: scale(.6); transition: opacity .4s .35s, transform .5s .35s cubic-bezier(.2, 1.5, .3, 1); }
.bha-slot.offen .bha-fach svg { opacity: 1; transform: none; }
.bha-slot.offen .bha-fach { animation: bhaFachGlow 3s ease-in-out infinite; }
@keyframes bhaFachGlow { 50% { box-shadow: inset 0 8px 18px rgba(0, 0, 0, .9), inset 0 0 22px rgba(242, 193, 78, .25); } }

/* Die kleine Tür */
.bha-tuer {
  position: absolute; inset: 0; display: block; transform-origin: 4% 50%;
  transition: transform .9s cubic-bezier(.5, 0, .2, 1.15), filter .3s;
  transform-style: preserve-3d; backface-visibility: hidden;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
}
.bha-tuer svg { width: 100%; height: 100%; display: block; }
.bha-slot.offen .bha-tuer { transform: rotateY(-112deg); filter: drop-shadow(-10px 6px 12px rgba(0, 0, 0, .6)) brightness(.8); }
.bha-slot.bereit:hover .bha-tuer { transform: translateZ(14px); }
.bha-slot.bereit:hover .bha-rad { animation: bhaRadWackel .9s ease-in-out; }
@keyframes bhaRadWackel { 25% { transform: translate(50px, 52px) rotate(-30deg); } 60% { transform: translate(50px, 52px) rotate(18deg); } 100% { transform: translate(50px, 52px) rotate(0); } }

.bha-platte { fill: url(#bhaStahl); fill: #3a3c41; }
.bha-tuer .bha-platte, .bha-launch-tuer .bha-platte { fill: url(#bhaPl); }
.bha-platte-kante { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 1.5; }
.bha-niet { fill: #6d7076; stroke: #121214; stroke-width: .8; }
.bha-ring { fill: url(#bhaRg); stroke: #6a6d73; stroke-width: 3; }
.bha-ring.gold { stroke: var(--gold); filter: drop-shadow(0 0 3px rgba(242, 193, 78, .8)); }
.bha-ring-innen { fill: #1b1c1f; stroke: #0d0d0f; stroke-width: 2; }
.bha-rad-reif { fill: none; stroke: #8a8d93; stroke-width: 3.2; }
.bha-speichen rect { fill: #8a8d93; }
.bha-nabe { fill: #26282c; stroke: var(--r); stroke-width: 2.2; }
.bha-zahl { fill: #fff; font: 900 15px/1 system-ui, sans-serif; paint-order: stroke; stroke: #000; stroke-width: 2.5px; }
.bha-led { fill: #5a1a12; }
.bha-slot.bereit .bha-led { fill: var(--gold); animation: bhaLed 1.6s ease-in-out infinite; }
.bha-slot.offen .bha-led { fill: var(--gruen); }
.bha-slot.heute .bha-led { fill: var(--r2); animation-duration: .8s; }
@keyframes bhaLed { 50% { opacity: .35; } }
.bha-slot.heute::after {
  content: "HEUTE"; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 3;
  padding: 3px 8px; border-radius: 6px; background: var(--r); color: #fff; font: 800 9px/1 var(--mono); letter-spacing: .14em;
  box-shadow: 0 0 14px rgba(212, 62, 41, .8); animation: bhaHeute 1.4s ease-in-out infinite;
}
@keyframes bhaHeute { 50% { transform: translateX(-50%) translateY(-3px); } }
.bha-slot.sonder.bereit::before {
  content: ""; position: absolute; inset: -3px; border-radius: 16px; z-index: 0;
  background: conic-gradient(from var(--w, 0deg), transparent 0 70%, var(--gold) 85%, transparent 100%);
  animation: bhaKreis 3s linear infinite; opacity: .8;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px;
}
@property --w { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes bhaKreis { to { --w: 360deg; } }

/* gesperrte Türen */
.bha-kette { position: absolute; right: 7%; bottom: 7%; width: 26%; height: 26%; display: none; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .8)); }
.bha-kette svg { width: 100%; height: 100%; fill: #222; stroke: #9a9ca2; stroke-width: 1.8; }
.bha-slot.zu .bha-kette { display: block; }
.bha-slot.zu .bha-tuer { filter: grayscale(.7) brightness(.55) drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
.bha-slot.zu { cursor: not-allowed; }
.bha-slot.ruettel { animation: bhaRuettel .45s ease-in-out !important; opacity: 1; }
@keyframes bhaRuettel { 20% { transform: translateX(-6px) rotate(-2deg); } 40% { transform: translateX(5px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.bha-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 6; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(212, 62, 41, .5);
  background: rgba(15, 15, 17, .95); color: #fff; font-size: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2, 1.4, .3, 1), opacity .3s;
}
.bha-toast.an { transform: translate(-50%, 0); opacity: 1; }

/* =====================================================================
   Rätsel-Ansicht
   ===================================================================== */
.bha-stage { position: fixed; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 70px 22px 30px; overflow-y: auto; }
.bha-stage-in { display: grid; grid-template-columns: minmax(260px, 420px) minmax(300px, 520px); gap: 36px; align-items: center; width: 100%; max-width: 1000px; }
@media (max-width: 860px) {
  .bha-stage { align-items: flex-start; padding-top: 64px; }
  .bha-stage-in { grid-template-columns: 1fr; gap: 18px; justify-items: center; }
  .bha-tresor { width: min(62vw, 260px) !important; }
  .bha-panel { width: 100%; }
}
.bha-zurueck {
  position: fixed; top: 18px; left: 18px; z-index: 6; padding: 10px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .5); color: #fff; font-size: 14px; cursor: pointer;
  opacity: 0; transform: translateX(-20px); transition: opacity .4s .3s, transform .4s .3s, border-color .2s;
}
.bha-stage.an .bha-zurueck { opacity: 1; transform: none; }
.bha-zurueck:hover { border-color: var(--r); }
.bha-stage.weg { opacity: 0; transition: opacity .35s; }

/* Tresor */
.bha-tresor { position: relative; width: 100%; aspect-ratio: 1 / 1; justify-self: center; perspective: 1200px; }
.bha-hohl {
  position: absolute; inset: 9%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #1a1a1c, #050505 70%); box-shadow: inset 0 18px 40px rgba(0, 0, 0, .95), 0 0 0 10px #101012, 0 0 0 12px #2a2b2f;
}
.bha-licht { position: absolute; inset: -20%; background: radial-gradient(circle, rgba(255, 236, 200, .95), rgba(255, 170, 90, .35) 35%, transparent 65%); opacity: 0; transform: scale(.3); }
.bha-stage.sonder .bha-licht { background: radial-gradient(circle, rgba(255, 245, 210, 1), rgba(242, 193, 78, .55) 35%, transparent 65%); }
.bha-stage.auf .bha-licht { animation: bhaLicht 1.6s ease-out .25s forwards; }
@keyframes bhaLicht { 0% { opacity: 0; transform: scale(.3); } 35% { opacity: 1; transform: scale(1.15); } 100% { opacity: .55; transform: scale(1); } }
.bha-hohl-icon { position: relative; width: 36%; height: 36%; opacity: 0; transform: translateY(20px) scale(.5); }
.bha-hohl-icon svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 14px rgba(255, 210, 120, .95)); }
.bha-stage.auf .bha-hohl-icon { animation: bhaIcon .9s cubic-bezier(.2, 1.6, .3, 1) .6s forwards, bhaSchweb 3s ease-in-out 1.6s infinite; }
@keyframes bhaIcon { to { opacity: 1; transform: none; } }
@keyframes bhaSchweb { 50% { transform: translateY(-8px); } }

.bha-gtuer { position: absolute; inset: 0; transform-origin: 3% 50%; transform-style: preserve-3d; transition: transform 1.25s cubic-bezier(.55, 0, .15, 1.12), filter .6s; filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .75)); }
.bha-stage.auf .bha-gtuer { transform: rotateY(-118deg); filter: drop-shadow(-24px 22px 30px rgba(0, 0, 0, .7)) brightness(.75); }
.bha-gross { width: 100%; height: 100%; display: block; overflow: visible; }
.bha-g-platte { fill: #2b2d31; stroke: #0c0c0e; stroke-width: 4; }
.bha-g-kante { fill: none; stroke: #5a5d63; stroke-width: 3; }
.bha-g-kante.gold { stroke: var(--gold); filter: drop-shadow(0 0 4px rgba(242, 193, 78, .9)); }
.bha-g-innen { fill: #1a1b1e; stroke: #3a3c41; stroke-width: 2; }
.bha-g-led { fill: #3a1510; transition: fill .2s; }
.bha-g-led.an { fill: var(--gruen); filter: drop-shadow(0 0 3px var(--gruen)); }
.bha-stage.nein .bha-g-led:not(.an) { animation: bhaLedRot .5s 2; }
@keyframes bhaLedRot { 50% { fill: var(--r2); } }
.bha-riegel { fill: #8d9096; stroke: #111; stroke-width: 1.5; transition: transform .35s cubic-bezier(.5, 0, .2, 1.6); transition-delay: calc(var(--i) * 25ms); }
.bha-stage.riegel .bha-riegel { transform: translateY(22px); }
.bha-g-rad { transform-origin: 0 0; }
.bha-g-reif { fill: none; stroke: #9a9da3; stroke-width: 9; }
.bha-g-reif-r { fill: none; stroke: #2a2b2f; stroke-width: 1.5; stroke-dasharray: 3 7; }
.bha-g-speiche { fill: #9a9da3; stroke: #222; stroke-width: 1; }
.bha-g-knauf { fill: var(--r); stroke: #5a160d; stroke-width: 2; transition: fill .4s; }
.bha-stage.sonder .bha-g-knauf { fill: var(--gold); stroke: var(--gold2); }
.bha-stage.gruen .bha-g-knauf { fill: var(--gruen); stroke: #145a32; }
.bha-g-nabe { fill: #4a4c51; stroke: #111; stroke-width: 2; }
.bha-g-nabe2 { fill: #161719; stroke: var(--r); stroke-width: 2.5; transition: stroke .4s; }
.bha-stage.gruen .bha-g-nabe2 { stroke: var(--gruen); }
.bha-g-zahl { fill: #fff; font: 900 22px/1 system-ui, sans-serif; }
.bha-stage .bha-g-rad { animation: bhaRadIdle 6s ease-in-out infinite; }
@keyframes bhaRadIdle { 50% { transform: rotate(-6deg); } }
.bha-stage.prueft .bha-g-rad { animation: bhaRadPruef .5s ease-in-out infinite alternate; }
@keyframes bhaRadPruef { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
.bha-stage.dreht .bha-g-rad { animation: bhaRadAuf 1.15s cubic-bezier(.55, 0, .25, 1) forwards; }
@keyframes bhaRadAuf { 0% { transform: rotate(0); } 15% { transform: rotate(-25deg); } 100% { transform: rotate(540deg); } }
.bha-stage.nein .bha-tresor { animation: bhaNein .5s ease-in-out; }
@keyframes bhaNein { 15% { transform: translateX(-10px) rotate(-1.5deg); } 35% { transform: translateX(9px) rotate(1.5deg); } 55% { transform: translateX(-6px); } 75% { transform: translateX(4px); } }
.bha-stage.nein .bha-tresor::after { content: ""; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, rgba(212, 62, 41, .45), transparent 70%); animation: bhaRotblitz .6s ease-out forwards; pointer-events: none; }
@keyframes bhaRotblitz { from { opacity: 1; transform: scale(.8); } to { opacity: 0; transform: scale(1.25); } }
.bha-stage.ruck .bha-tresor { animation: bhaRuck .35s linear; }
@keyframes bhaRuck { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(2px, 1px); } }

/* Dampf */
.bha-dampf { position: absolute; inset: 0; pointer-events: none; }
.bha-dampf i { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; margin: -23% 0 0 -23%; border-radius: 50%; background: radial-gradient(circle, rgba(230, 230, 230, .55), transparent 65%); filter: blur(8px); opacity: 0; }
.bha-stage.dampf .bha-dampf i { animation: bhaDampf 1.6s ease-out forwards; }
.bha-dampf i:nth-child(1) { --dx: -70%; --dy: -40%; }
.bha-dampf i:nth-child(2) { --dx: 70%; --dy: -45%; animation-delay: .06s !important; }
.bha-dampf i:nth-child(3) { --dx: -80%; --dy: 35%; animation-delay: .12s !important; }
.bha-dampf i:nth-child(4) { --dx: 80%; --dy: 40%; animation-delay: .03s !important; }
.bha-dampf i:nth-child(5) { --dx: 0%; --dy: -85%; animation-delay: .09s !important; }
.bha-dampf i:nth-child(6) { --dx: 0%; --dy: 85%; animation-delay: .15s !important; }
@keyframes bhaDampf { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(2); } }

/* Terminal-Panel */
.bha-panel {
  position: relative; border-radius: 18px; padding: 2px;
  background: linear-gradient(140deg, rgba(212, 62, 41, .7), rgba(255, 255, 255, .06) 40%, rgba(242, 193, 78, .35));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  opacity: 0; transform: translateX(30px);
  transition: opacity .5s .35s, transform .6s .35s cubic-bezier(.2, 1, .3, 1);
}
.bha-stage.an .bha-panel { opacity: 1; transform: none; }
.bha-stage.sonder .bha-panel { background: linear-gradient(140deg, rgba(242, 193, 78, .85), rgba(255, 255, 255, .06) 40%, rgba(212, 62, 41, .5)); }
.bha-panel-in {
  position: relative; overflow: hidden; border-radius: 16px; padding: 22px 22px 20px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 100% 0, rgba(212, 62, 41, .15), transparent 50%),
    #0f1012;
  transition: transform .26s ease-in, opacity .26s;
}
.bha-panel-in::after { content: ""; position: absolute; left: 0; right: 0; height: 60px; top: -60px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .05), transparent); animation: bhaScan 4s linear infinite; pointer-events: none; }
@keyframes bhaScan { to { top: 110%; } }
.bha-panel-in.wechsel { transform: rotateX(80deg); opacity: 0; }
.bha-p-kopf { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px dashed rgba(255, 255, 255, .12); color: var(--mut); font: 700 12px/1.2 var(--mono); letter-spacing: .12em; }
.bha-p-kopf .gold { color: var(--gold); }
.bha-p-led { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: bhaLed 1.2s infinite; flex: 0 0 auto; }
.bha-p-led.gruen { background: var(--gruen); box-shadow: 0 0 10px var(--gruen); animation: none; }
.bha-p-led.rot { background: var(--r); box-shadow: 0 0 10px var(--r); }
.bha-p-text { min-height: 3em; margin: 0 0 16px; font-size: 17px; line-height: 1.55; color: #fff; }
.bha-p-text.tippt::after { content: "▌"; color: var(--r2); animation: bhaLed .7s steps(1) infinite; }
.bha-p-meldung { min-height: 22px; margin: 10px 0 0; font: 600 13px/1.4 var(--mono); }
.bha-p-meldung.falsch { color: var(--r2); animation: bhaFlacker .4s steps(2) 2; }
.bha-p-meldung.richtig { color: var(--gruen); }
.bha-p-meldung.laeuft { color: var(--gold); }
.bha-p-meldung.warn { color: var(--gold); }
@keyframes bhaFlacker { 50% { opacity: .3; } }
.bha-p-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.bha-p-hinweis { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: rgba(242, 193, 78, .08); border: 1px solid rgba(242, 193, 78, .3); color: #f5dfa8; font-size: 14px; animation: bhaRein2 .4s ease-out; }
@keyframes bhaRein2 { from { opacity: 0; transform: translateY(-6px); } }
.bha-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05); color: #fff;
  font: 700 14px/1 system-ui, sans-serif; cursor: pointer; text-decoration: none !important; transition: transform .15s, box-shadow .2s, background .2s;
}
.bha-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.bha-btn:hover { transform: translateY(-1px); color: #fff; }
.bha-btn.rot { background: linear-gradient(180deg, var(--r2), var(--r)); border-color: var(--r); box-shadow: 0 8px 22px rgba(212, 62, 41, .4); }
.bha-btn.rot:hover { box-shadow: 0 10px 28px rgba(212, 62, 41, .6); }
.bha-btn.klein { padding: 8px 12px; font-size: 13px; }
.bha-btn:disabled { opacity: .45; cursor: default; transform: none; }
.bha-btn.puls { animation: bhaBtnPuls 1.2s ease-in-out infinite; border-color: var(--gold); color: var(--gold); }
@keyframes bhaBtnPuls { 50% { box-shadow: 0 0 0 6px rgba(242, 193, 78, .15); } }
.bha-klein { margin: 10px 0 0; color: var(--mut); font-size: 12.5px; }
.bha-laden { display: flex; align-items: center; gap: 12px; color: var(--mut); font: 600 14px var(--mono); padding: 30px 0; }
.bha-laden span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--r); animation: bhaDreh .8s linear infinite; }
@keyframes bhaDreh { to { transform: rotate(360deg); } }

/* Eingabe: Text-Terminal */
.bha-term { display: flex; align-items: center; gap: 10px; padding: 4px 14px; border-radius: 12px; border: 1px solid rgba(62, 207, 122, .35); background: #060807; box-shadow: inset 0 0 20px rgba(62, 207, 122, .08); }
.bha-term span { color: var(--gruen); font: 800 18px var(--mono); }
.bha-term input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: transparent; color: #b6ffd2; font: 700 18px var(--mono); letter-spacing: .08em; text-transform: uppercase; caret-color: var(--gruen); }
.bha-term input::placeholder { color: rgba(182, 255, 210, .3); text-transform: none; letter-spacing: 0; }
.bha-term:focus-within { border-color: var(--gruen); box-shadow: inset 0 0 20px rgba(62, 207, 122, .15), 0 0 0 3px rgba(62, 207, 122, .15); }

/* Eingabe: Zahlenschloss */
.bha-schloss { display: flex; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #2c2e33, #18191c); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .08), 0 10px 24px rgba(0, 0, 0, .5); outline: 0; }
.bha-schloss:focus-visible { box-shadow: 0 0 0 3px rgba(242, 193, 78, .4); }
.bha-trommel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bha-trommel button { width: 46px; height: 24px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--mut); font-size: 11px; cursor: pointer; }
.bha-trommel button:hover { background: rgba(212, 62, 41, .3); color: #fff; }
.bha-fenster {
  position: relative; width: 46px; height: 62px; overflow: hidden; border-radius: 8px;
  background: linear-gradient(180deg, #0b0b0c, #26272b 30%, #303237 50%, #26272b 70%, #0b0b0c);
  box-shadow: inset 0 0 0 2px #0a0a0b, inset 0 6px 10px rgba(0, 0, 0, .8), inset 0 -6px 10px rgba(0, 0, 0, .8);
}
.bha-fenster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 30%, transparent 70%, rgba(0, 0, 0, .7)); pointer-events: none; }
.bha-band { position: absolute; left: 0; right: 0; top: 0; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.bha-band span { display: block; height: 62px; line-height: 62px; text-align: center; color: #fff; font: 800 32px/62px var(--mono); text-shadow: 0 2px 0 #000; }
.bha-trommel.aktiv .bha-fenster { box-shadow: inset 0 0 0 2px var(--gold), inset 0 6px 10px rgba(0, 0, 0, .8), 0 0 14px rgba(242, 193, 78, .35); }
.bha-trommel.klick .bha-fenster { animation: bhaKlick .2s; }
@keyframes bhaKlick { 50% { transform: scale(1.06); } }

/* Eingabe: Hebel-Auswahl */
.bha-hebel { display: grid; gap: 10px; }
.bha-hebel button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .03); color: #fff; font-size: 15px; text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.bha-hebel button:hover { border-color: rgba(212, 62, 41, .6); transform: translateX(3px); }
.bha-hebel button[aria-checked="true"] { border-color: var(--gold); background: rgba(242, 193, 78, .08); }
.bha-schalter { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 11px; background: #0a0a0b; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8); }
.bha-schalter i { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, #c9cbd0, #7a7d83); transition: left .3s cubic-bezier(.3, 1.6, .5, 1), background .3s; }
.bha-hebel button[aria-checked="true"] .bha-schalter i { left: 19px; background: radial-gradient(circle, #fff3c4, var(--gold)); box-shadow: 0 0 10px var(--gold); }

/* =====================================================================
   Mini-Spiele
   ===================================================================== */
.bha-zug { text-align: center; font-family: var(--mono); }
.bha-zug b { color: #fff; }

/* Memory */
.bha-memo { display: grid; grid-template-columns: repeat(var(--sp), minmax(0, 1fr)); gap: 9px; max-width: 380px; margin: 0 auto; perspective: 900px; }
.bha-karte { position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.5, .5, 1); animation: bhaKarteRein .5s cubic-bezier(.2, 1.3, .3, 1) backwards; animation-delay: calc(var(--d, 0) * 45ms + .4s); }
@keyframes bhaKarteRein { from { opacity: 0; transform: translateY(-20px) rotateY(180deg) scale(.6); } }
.bha-karte span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bha-karte .r { background: repeating-linear-gradient(45deg, #2b2d31 0 6px, #232428 6px 12px); box-shadow: inset 0 0 0 2px #3c3f45, 0 6px 12px rgba(0, 0, 0, .5); }
.bha-karte .r svg { width: 40%; height: 40%; fill: none; stroke: var(--r); stroke-width: 1.8; opacity: .8; }
.bha-karte .v { transform: rotateY(180deg); background: radial-gradient(circle at 50% 40%, #2c1a14, #121214); box-shadow: inset 0 0 0 2px var(--gold), 0 6px 12px rgba(0, 0, 0, .5); }
.bha-karte .v svg { width: 56%; height: 56%; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(242, 193, 78, .7)); }
.bha-karte:hover:not(.auf) { transform: translateY(-3px) rotateY(10deg); }
.bha-karte.auf { transform: rotateY(180deg); }
.bha-karte.paar { animation: bhaPaar .6s ease-out forwards; }
.bha-karte.paar .v { box-shadow: inset 0 0 0 2px var(--gruen), 0 0 22px rgba(62, 207, 122, .55); }
.bha-karte.paar .v svg { stroke: var(--gruen); filter: drop-shadow(0 0 8px rgba(62, 207, 122, .9)); }
@keyframes bhaPaar { 0% { transform: rotateY(180deg) scale(1); } 40% { transform: rotateY(180deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(.96); } }
.bha-karte.nein .v { box-shadow: inset 0 0 0 2px var(--r), 0 0 18px rgba(212, 62, 41, .6); animation: bhaKarteNein .35s; }
@keyframes bhaKarteNein { 25% { transform: rotateY(180deg) translateX(-4px); } 75% { transform: rotateY(180deg) translateX(4px); } }

/* Lichter aus */
.bha-lichter { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; max-width: 340px; margin: 0 auto; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, #232428, #141517); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), 0 14px 30px rgba(0, 0, 0, .55); }
.bha-lampe { position: relative; aspect-ratio: 1 / 1; padding: 0; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 50% 35%, #3a3c41, #1b1c1f 70%); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .8), 0 0 0 3px #0c0c0d, 0 2px 0 4px #2c2e32; transition: transform .12s; }
.bha-lampe i { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #5a4a30, #2a2418); transition: background .25s, box-shadow .25s; }
.bha-lampe.an i { background: radial-gradient(circle at 40% 35%, #fff8d6, #ffcf5a 45%, #d48a12); box-shadow: 0 0 18px 6px rgba(255, 200, 80, .7), 0 0 40px 10px rgba(255, 170, 50, .3); animation: bhaGluehen 1.8s ease-in-out infinite; }
@keyframes bhaGluehen { 50% { box-shadow: 0 0 22px 8px rgba(255, 200, 80, .85), 0 0 50px 14px rgba(255, 170, 50, .35); } }
.bha-lampe:active { transform: scale(.92); }
.bha-lampe.druck::after { content: ""; position: absolute; inset: -20%; border-radius: 50%; border: 2px solid rgba(255, 210, 120, .7); animation: bhaWelle .5s ease-out forwards; pointer-events: none; }
@keyframes bhaWelle { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.alle-aus .bha-lichter { animation: bhaGeschafft .8s ease-out; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), 0 0 0 2px var(--gruen), 0 0 40px rgba(62, 207, 122, .4); }
@keyframes bhaGeschafft { 30% { transform: scale(1.04); } }

/* Schiebepuzzle */
.bha-puzzle { position: relative; width: min(100%, 300px); aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 14px; background: #0a0a0b; box-shadow: inset 0 6px 16px rgba(0, 0, 0, .9), 0 0 0 6px #2b2d31, 0 0 0 8px #141517, 0 18px 36px rgba(0, 0, 0, .6); }
.bha-platte-s {
  position: absolute; width: calc((100% - 16px) / 3); height: calc((100% - 16px) / 3);
  left: calc(4px + var(--x) * ((100% - 16px) / 3 + 4px)); top: calc(4px + var(--y) * ((100% - 16px) / 3 + 4px));
  padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(145deg, #5a5d63, #33353a 55%, #26282c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .4), 0 6px 10px rgba(0, 0, 0, .55);
  transition: left .28s cubic-bezier(.3, 1.3, .5, 1), top .28s cubic-bezier(.3, 1.3, .5, 1), box-shadow .3s;
}
.bha-platte-s::before, .bha-platte-s::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #8a8d93; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6); top: 8px; }
.bha-platte-s::before { left: 8px; }
.bha-platte-s::after { right: 8px; }
.bha-platte-s span { color: #fff; font: 900 clamp(24px, 6vw, 36px)/1 system-ui, sans-serif; text-shadow: 0 2px 0 #000, 0 0 12px rgba(212, 62, 41, .5); }
.bha-platte-s.richtig { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(62, 207, 122, .65), 0 6px 10px rgba(0, 0, 0, .55); }
.bha-platte-s.richtig span { text-shadow: 0 2px 0 #000, 0 0 12px rgba(62, 207, 122, .7); }
.bha-platte-s.wackel { animation: bhaWackel .3s; }
@keyframes bhaWackel { 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
.geloest .bha-puzzle { box-shadow: inset 0 6px 16px rgba(0, 0, 0, .9), 0 0 0 6px var(--gruen), 0 0 40px rgba(62, 207, 122, .45); transition: box-shadow .5s; }

/* Leuchtfolge */
.bha-simon { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bha-simon-feld { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 280px); aspect-ratio: 1 / 1; padding: 14px; border-radius: 50%; background: radial-gradient(circle, #232428, #0e0e10 70%); box-shadow: inset 0 0 0 4px #2c2e32, 0 18px 40px rgba(0, 0, 0, .6); }
.bha-sim { border: 0; cursor: pointer; opacity: .35; transition: opacity .12s, transform .12s, box-shadow .12s, filter .12s; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .35); }
.bha-sim.rot { background: var(--r); border-radius: 100% 8px 8px 8px; }
.bha-sim.gold { background: var(--gold); border-radius: 8px 100% 8px 8px; }
.bha-sim.gruen { background: var(--gruen); border-radius: 8px 8px 8px 100%; }
.bha-sim.blau { background: var(--blau); border-radius: 8px 8px 100% 8px; }
.bha-sim.an { opacity: 1; transform: scale(1.04); filter: brightness(1.35); box-shadow: 0 0 30px currentColor, inset 0 -6px 0 rgba(0, 0, 0, .2); }
.bha-sim.rot.an { color: var(--r); } .bha-sim.gold.an { color: var(--gold); } .bha-sim.gruen.an { color: var(--gruen); } .bha-sim.blau.an { color: var(--blau); }
.bha-sim:active { transform: scale(.96); }
.bha-simon-mitte { position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(-50%, -50%); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, #1b1c1f, #0a0a0b); box-shadow: 0 0 0 6px #0e0e10, 0 0 0 8px #2c2e32; color: var(--mut); font-family: var(--mono); pointer-events: none; }
.bha-simon-mitte b { color: #fff; font-size: 26px; line-height: 1; }
.fehler .bha-simon-feld { animation: bhaNein .45s; box-shadow: inset 0 0 0 4px var(--r), 0 0 30px rgba(212, 62, 41, .5); }
.geschafft .bha-simon-feld { box-shadow: inset 0 0 0 4px var(--gruen), 0 0 40px rgba(62, 207, 122, .5); }
.geschafft .bha-sim { opacity: 1; animation: bhaSimJubel .9s ease-in-out; }
@keyframes bhaSimJubel { 50% { filter: brightness(1.5); } }

/* Belohnung */
.bha-preis { text-align: center; animation: bhaPreis .7s cubic-bezier(.2, 1.3, .3, 1) both; }
@keyframes bhaPreis { from { opacity: 0; transform: translateY(24px) scale(.94); } }
.bha-preis-icon { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(242, 193, 78, .25), transparent 70%); animation: bhaSchweb 3s ease-in-out infinite; }
.bha-preis-icon svg { width: 38px; height: 38px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(242, 193, 78, .8)); }
.bha-preis h3 { margin: 0 0 10px; font-size: 24px; font-weight: 800; color: #fff; }
.bha-preis p { margin: 0 0 14px; color: #d6d6d6; font-size: 15.5px; line-height: 1.6; }
.bha-code { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.bha-code-txt { padding: 14px 20px; border-radius: 12px; border: 2px dashed var(--gold); background: rgba(242, 193, 78, .08); color: var(--gold); font: 900 24px/1 var(--mono); letter-spacing: .14em; min-width: 7ch; }
.bha-code-txt.fertig { animation: bhaCodeGlow 2s ease-in-out infinite; }
@keyframes bhaCodeGlow { 50% { box-shadow: 0 0 24px rgba(242, 193, 78, .45); } }
.bha-konfetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; }

/* Ruhige Darstellung */
.bha.ruhig *, .bha-launch { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  .bha *, .bha-launch { animation: none !important; transition-duration: .01s !important; }
  .bha-slot { opacity: 1 !important; }
}

/* Spielbretter fahren hoch */
.bha-eingabe > :first-child { animation: bhaBoot .7s cubic-bezier(.2, 1.2, .3, 1) .35s backwards; }
@keyframes bhaBoot { from { opacity: 0; transform: perspective(700px) rotateX(35deg) translateY(16px) scale(.94); filter: brightness(2) blur(2px); } }
/* Paar gefunden: Funkenring */
.bha-karte.paar::after { content: ""; position: absolute; inset: -10%; border-radius: 14px; border: 2px solid rgba(62, 207, 122, .8); animation: bhaWelle .6s ease-out forwards; pointer-events: none; transform: rotateY(180deg); }
/* Lampen gehen nacheinander „Welle“ aus, wenn gelöst */
.alle-aus .bha-lampe i { animation: bhaAus .6s ease-out both; }
.alle-aus .bha-lampe:nth-child(odd) i { animation-delay: .1s; }
@keyframes bhaAus { 0% { box-shadow: 0 0 30px 10px rgba(62, 207, 122, .8); background: radial-gradient(circle, #d6ffe6, var(--gruen)); } 100% { box-shadow: none; } }
/* Puzzle: richtige Platte leuchtet kurz auf */
.bha-platte-s.richtig { animation: bhaRichtig .5s ease-out; }
@keyframes bhaRichtig { 40% { filter: brightness(1.4); } }
