html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.is-preview {
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(45, 212, 191, 0.16), transparent 55%),
    #0b1322;
}

body.is-preview::after {
  content: '';
  position: fixed;
  inset: 0;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  pointer-events: none;
  box-sizing: border-box;
}

.minion-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.minion-mover {
  position: absolute;
  left: 0;
  top: 0;
  width: 140px;
  height: 140px;
  will-change: transform;
}

.minion-rig {
  width: 100%;
  height: 100%;
  will-change: transform;
  transform-origin: center center;
}

.minion-sprite {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.nixie-puppet {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  user-select: none;
  filter: drop-shadow(0 8px 14px rgba(8, 28, 52, 0.5));
}

[hidden] {
  display: none !important;
}

.sparkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset -2px -2px 4px rgba(14, 165, 233, 0.35),
    inset 2px 2px 4px rgba(255, 255, 255, 0.85),
    0 0 8px rgba(56, 189, 248, 0.45);
  pointer-events: none;
  will-change: transform, opacity;
  animation: sparkle-pop 800ms ease-out forwards;
}

@keyframes sparkle-pop {
  0% {
    opacity: 0.95;
    transform: translate3d(0, 0, 0) scale(0.55) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -48px), 0) scale(1.25) rotate(160deg);
  }
}

.speech-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  max-width: 260px;
  min-width: 110px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(11, 22, 40, 0.92);
  color: #f0f9ff;
  border: 2px solid #38bdf8;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  word-wrap: break-word;
}

.speech-bubble.is-visible {
  opacity: 1;
}

.preview-hud {
  position: fixed;
  left: 16px;
  bottom: 16px;
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 19, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 9999;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

body.is-preview .preview-hud {
  display: flex;
}

.preview-hud button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}

.preview-hud button:hover {
  background: rgba(72, 198, 239, 0.28);
}

.preview-hud button:active {
  transform: scale(0.96);
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.status-pill.is-linked {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.hud-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 4px;
}
