/* Bundi – DCB-Maskottchen. Nur transform/opacity-Animationen, keine Layout-Last. */
#bundi, #bundi-chat, #bundi-back { --bd-red: var(--red, #e3121b); --bd-gold: var(--gold, #ffc61a); font-family: var(--body, system-ui, sans-serif); }
#bundi { position: fixed; left: 0; bottom: 4px; z-index: 70; width: 58px; height: 76px; pointer-events: none; will-change: transform; transition: transform 0s linear; }
#bundi[hidden], #bundi-chat[hidden], #bundi-back[hidden] { display: none; }
.bd-hit { position: absolute; inset: 0; pointer-events: auto; cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
.bd-hit:focus-visible { outline: 2px solid var(--bd-gold); outline-offset: 2px; border-radius: 12px; }
.bd-flip { position: absolute; inset: 0; transform-origin: 50% 100%; }
.bd-flip.left { transform: scaleX(-1); }
.bd-svg { width: 100%; height: 100%; overflow: visible; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.55)); }
.bd-svg * { transform-box: fill-box; }
.bd-leg, .bd-arm { transform-origin: 50% 0; }
.bd-eyes { transform-origin: 50% 50%; animation: bd-blink 5.2s infinite; }
.bd-ant { animation: bd-ant 1.6s ease-in-out infinite; }
.bd-head { transform-origin: 50% 100%; }
.bd-glow { opacity: .0; }

#bundi.walking .bd-leg.l, #bundi.walking .bd-arm.r { animation: bd-sw .5s ease-in-out infinite alternate; }
#bundi.walking .bd-leg.r, #bundi.walking .bd-arm.l { animation: bd-sw .5s ease-in-out infinite alternate-reverse; }
#bundi.walking .bd-body, #bundi.walking .bd-head { animation: bd-bob .25s ease-in-out infinite alternate; }
#bundi.wave .bd-arm.r { animation: bd-wave .55s ease-in-out 4 alternate; }
#bundi.jump .bd-flip { animation: bd-jump .6s cubic-bezier(.3,.8,.4,1); }
#bundi.spin .bd-flip { animation: bd-spin .8s ease-in-out; }
#bundi.sit .bd-leg.l { transform: rotate(72deg) translate(0, 2px); }
#bundi.sit .bd-leg.r { transform: rotate(-72deg) translate(0, 2px); }
#bundi.sit .bd-flip { transform: translateY(6px); }
#bundi.sit .bd-flip.left { transform: translateY(6px) scaleX(-1); }
#bundi.talk .bd-head { animation: bd-talk .28s ease-in-out infinite alternate; }
#bundi.think .bd-eyes { animation: bd-think 1s steps(2) infinite; }

@keyframes bd-sw { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }
@keyframes bd-bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes bd-wave { from { transform: rotate(150deg); } to { transform: rotate(205deg); } }
@keyframes bd-jump { 0%, 100% { transform: translateY(0) scale(1, 1); } 20% { transform: translateY(0) scale(1.08, .9); } 55% { transform: translateY(-30px) scale(.95, 1.08); } 85% { transform: translateY(0) scale(1.08, .92); } }
@keyframes bd-spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(720deg); } }
@keyframes bd-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes bd-ant { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bd-talk { from { transform: translateY(0); } to { transform: translateY(-1.5px) rotate(1.5deg); } }
@keyframes bd-think { 0% { transform: translate(-2px, -1px); } 100% { transform: translate(2px, -1px); } }

/* Sprechblase */
.bd-bubble { position: absolute; bottom: 84px; min-width: 120px; max-width: 230px; padding: 9px 12px; border-radius: 12px 12px 12px 3px; background: #f5f5f5; color: #111; font: 600 13.5px/1.35 var(--body, system-ui, sans-serif); box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .2s, transform .2s; pointer-events: none; }
.bd-bubble.on { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.bd-bubble::after { content: ""; position: absolute; bottom: -6px; left: 18px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 0 0 3px 0; }
.bd-bubble.c { left: 50%; margin-left: -115px; }
.bd-bubble.r { right: 0; border-radius: 12px 12px 3px 12px; }
.bd-bubble.r::after { left: auto; right: 18px; }
.bd-bubble.l { left: 0; }
.bd-bubble b { color: var(--bd-red); }

/* Chat */
#bundi-chat { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column; background: #101010; color: var(--text, #f5f5f5); border: 1px solid var(--line-2, #363636); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.7); overflow: hidden; animation: bd-pop .22s ease-out; }
@keyframes bd-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.bdc-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: linear-gradient(180deg, #1a1a1a, #121212); border-bottom: 1px solid var(--line, #262626); position: relative; }
.bdc-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--flag, linear-gradient(90deg, #111 0 33%, #e3121b 33% 66%, #ffc61a 66%)); }
.bdc-av { width: 34px; height: 34px; flex: none; border-radius: 50%; background: #0a0a0a; border: 1px solid var(--line-2, #363636); display: grid; place-items: center; overflow: hidden; }
.bdc-av svg { width: 26px; height: 26px; }
.bdc-t { flex: 1; min-width: 0; line-height: 1.15; }
.bdc-t b { display: block; font: 800 17px/1 var(--display, "Arial Narrow", sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.bdc-t span { font-size: 12px; color: var(--muted, #a1a1a1); }
.bdc-t span i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green, #22c55e); margin-right: 5px; box-shadow: 0 0 8px var(--green, #22c55e); }
.bdc-x { background: none; border: 0; color: var(--muted, #a1a1a1); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.bdc-x:hover, .bdc-x:focus-visible { background: #222; color: #fff; }
.bdc-log { flex: 1; overflow-y: auto; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 9px; scroll-behavior: smooth; overscroll-behavior: contain; }
.bdc-m { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; animation: bd-pop .18s ease-out; }
.bdc-m.bot { align-self: flex-start; background: #1b1b1b; border: 1px solid var(--line, #262626); border-bottom-left-radius: 4px; }
.bdc-m.me { align-self: flex-end; background: var(--bd-red); color: #fff; border-bottom-right-radius: 4px; }
.bdc-m.typing { color: var(--muted, #a1a1a1); letter-spacing: .25em; }
.bdc-ln { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.bdc-ln a { font: 700 12.5px/1 var(--display, sans-serif); letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; border-radius: 99px; border: 1px solid var(--bd-gold); color: var(--bd-gold); text-decoration: none; }
.bdc-ln a:hover, .bdc-ln a:focus-visible { background: var(--bd-gold); color: #000; }
.bdc-chips { display: flex; gap: 6px; padding: 6px 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.bdc-chips::-webkit-scrollbar { display: none; }
.bdc-chips button { flex: none; background: #181818; border: 1px solid var(--line-2, #363636); color: #ddd; border-radius: 99px; padding: 7px 11px; font: 600 12.5px/1 var(--body, sans-serif); cursor: pointer; white-space: nowrap; }
.bdc-chips button:hover, .bdc-chips button:focus-visible { border-color: var(--bd-gold); color: var(--bd-gold); }
.bdc-form { display: flex; gap: 8px; padding: 8px 12px 6px; border-top: 1px solid var(--line, #262626); flex: none; }
.bdc-form input { flex: 1; min-width: 0; background: #0a0a0a; color: #fff; border: 1px solid var(--line-2, #363636); border-radius: 10px; padding: 10px 12px; font: 500 16px/1.2 var(--body, sans-serif); }
.bdc-form input:focus { outline: 2px solid var(--bd-gold); outline-offset: 0; border-color: transparent; }
.bdc-form button { background: var(--bd-red); color: #fff; border: 0; border-radius: 10px; padding: 0 14px; font: 800 14px/1 var(--display, sans-serif); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.bdc-form button:hover, .bdc-form button:focus-visible { background: var(--red-2, #ff3b3f); }
.bdc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 9px; font-size: 11px; color: #777; flex: none; }
.bdc-foot button { background: none; border: 0; color: #888; font: inherit; text-decoration: underline; cursor: pointer; padding: 2px; }
.bdc-foot button:hover { color: #fff; }

#bundi-back { position: fixed; right: 12px; bottom: 12px; z-index: 70; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: #141414; border: 1px solid var(--line-2, #363636); cursor: pointer; display: grid; place-items: center; opacity: .75; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
#bundi-back:hover, #bundi-back:focus-visible { opacity: 1; border-color: var(--bd-gold); }
#bundi-back svg { width: 24px; height: 24px; }

@media (max-width: 700px) {
  #bundi { width: 46px; height: 60px; }
  .bd-bubble { bottom: 68px; font-size: 13px; max-width: 200px; }
  #bundi-chat { right: 0; left: 0; bottom: 0; width: 100%; height: min(78vh, 640px); border-radius: 16px 16px 0 0; border-inline: 0; border-bottom: 0; }
}
@media print { #bundi, #bundi-chat, #bundi-back { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  #bundi *, #bundi-chat, .bdc-m, .bd-bubble { animation: none !important; transition: none !important; }
}
