/* ============================================================
   CAAKE Academy — Queen Bea (the bee guide)
   Layer, sprite, flight states, spotlight, speech bubble, sparks
   ============================================================ */

#qb-layer { position: fixed; inset: 0; z-index: 130; pointer-events: none; }

/* ---------- bee sprite ---------- */
.qb-bee {
  position: fixed;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(233, 185, 73, 0.25));
  z-index: 131;
}
.qb-bee svg { display: block; width: 100%; height: 100%; }

.qb-wing { fill: rgba(214, 226, 255, 0.55); stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.6; transform-origin: center; }
.qb-wing-l { animation: qbFlapL 0.18s ease-in-out infinite alternate; transform-origin: 90% 50%; }
.qb-wing-r { animation: qbFlapR 0.18s ease-in-out infinite alternate; transform-origin: 10% 50%; }
@keyframes qbFlapL { from { transform: rotate(-30deg) scaleY(1); } to { transform: rotate(-30deg) scaleY(0.35); } }
@keyframes qbFlapR { from { transform: rotate(30deg) scaleY(1); } to { transform: rotate(30deg) scaleY(0.35); } }

.qb-bee.qb-mood-think svg { animation: qbPulse 1.1s ease-in-out infinite; }
.qb-bee.qb-mood-excited svg { animation: qbPulse 0.55s ease-in-out infinite; }
.qb-bee.qb-mood-celebrate svg { animation: qbSpin 0.9s ease-in-out infinite; }
.qb-bee.qb-mood-code svg { animation: qbPulse 0.8s ease-in-out infinite; }
.qb-bee.qb-mood-sleep { opacity: 0.75; }
@keyframes qbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes qbSpin { 0% { transform: rotate(0deg); } 50% { transform: rotate(14deg); } 100% { transform: rotate(0deg); } }

/* ---------- mood badge ---------- */
.qb-badge {
  position: fixed;
  min-width: 22px; height: 22px;
  padding: 0 5px;
  display: grid; place-items: center;
  font-size: 12px; line-height: 1;
  color: #1a1406;
  background: linear-gradient(135deg, #f6d876, #d4af37);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 132;
}
.qb-badge:empty { display: none; }
.qb-badge.qb-mood-code { background: linear-gradient(135deg, #8b5cf6, #5b3fb3); color: #fff; }
.qb-badge.qb-mood-think { background: linear-gradient(135deg, #2dd4bf, #0d9488); color: #062521; }

/* ---------- spotlight ---------- */
.qb-spot {
  position: fixed;
  border: 2px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 0 6px rgba(233, 185, 73, 0.12), 0 0 34px rgba(233, 185, 73, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 129;
}
.qb-spot.qb-spot-on { opacity: 1; animation: qbSpot 1.6s ease-in-out infinite; }
@keyframes qbSpot { 0%, 100% { box-shadow: 0 0 0 6px rgba(233, 185, 73, 0.12), 0 0 30px rgba(233, 185, 73, 0.35); } 50% { box-shadow: 0 0 0 9px rgba(233, 185, 73, 0.2), 0 0 48px rgba(233, 185, 73, 0.6); } }

/* ---------- speech bubble ---------- */
.qb-bubble {
  position: fixed;
  display: none;
  background: rgba(17, 17, 31, 0.97);
  border: 1px solid rgba(233, 185, 73, 0.35);
  border-radius: 16px;
  padding: 16px 18px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 132;
}
.qb-bubble-title { font: 800 16px var(--font-display); color: var(--gold); margin-bottom: 6px; letter-spacing: 0.01em; }
.qb-bubble-body p { margin: 0 0 8px; color: #d9d8e6; }
.qb-bubble-body p:last-child { margin-bottom: 0; }
.qb-bubble-body strong { color: #fff; }
.qb-bubble-body code { color: #f6d876; font-size: 13px; }
.qb-bubble-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.qb-bubble-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--grad-gold);
  color: #1a1406;
  font-weight: 800; font-size: 13px;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow-gold);
}
.qb-bubble-nav {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.qb-nav-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font: 700 12px var(--font-body);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.qb-nav-btn:hover { color: var(--text); border-color: var(--gold); }
.qb-nav-skip { border-color: transparent; color: var(--faint); }
.qb-nav-next { background: var(--gold-soft); color: var(--gold); border-color: rgba(233, 185, 73, 0.4); }

/* ---------- sparks ---------- */
.qb-sparks { position: fixed; pointer-events: none; z-index: 132; }
.qb-spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: qbSpark 0.95s ease-out forwards;
}
@keyframes qbSpark {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--sx), var(--sy)) scale(0.2); opacity: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .qb-wing-l, .qb-wing-r, .qb-bee.qb-mood-think svg, .qb-bee.qb-mood-excited svg,
  .qb-bee.qb-mood-celebrate svg, .qb-bee.qb-mood-code svg, .qb-spot.qb-spot-on { animation: none; }
}
