/* ═══════════════════════════════════════════════
   SATURN MASCOT — roaming companion
   ═══════════════════════════════════════════════ */

.mascot {
  position: fixed;
  z-index: 9998;
  cursor: pointer;
  user-select: none;
  transition: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.mascot__emoji {
  font-size: 32px;
  display: block;
  animation: mascot-bob 2s ease-in-out infinite;
}

/* Bobbing while roaming */
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
}

/* Docked state — bottom right */
.mascot.docked {
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  bottom: 20px !important;
  right: 20px !important;
  left: auto !important;
  top: auto !important;
}

.mascot.docked .mascot__emoji {
  animation: mascot-idle 3s ease-in-out infinite;
}

@keyframes mascot-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}

/* Speech bubble */
.mascot__bubble {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--bg-card, #1A1A1A);
  color: var(--text-primary, #F0E6DC);
  font-family: var(--font-body, sans-serif);
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 12px 12px 4px 12px;
  border: 1px solid var(--border-subtle, #2A2520);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  max-width: 200px;
  white-space: normal;
  opacity: 0;
  transform: translateY(4px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.mascot__bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mascot__bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--bg-card, #1A1A1A);
}

/* Glass theme override */
[data-style="glass"] .mascot__bubble {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

[data-style="glass"] .mascot__bubble::after {
  border-top-color: rgba(255,255,255,0.06);
}

/* Mobile: push mascot above bottom nav bar */
@media (max-width: 768px) {
  .mascot.docked {
    bottom: 80px !important;
  }
}

@media (max-width: 480px) {
  .mascot__emoji { font-size: 28px; }
  .mascot__bubble { max-width: 160px; font-size: 0.72rem; }
  .mascot.docked {
    bottom: 76px !important;
    right: 12px !important;
  }
}
