/* BGM toggle */
.bgm-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 182, 193, 0.85);
  border-radius: 999px;
  background: rgba(20, 10, 24, 0.82);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.bgm-toggle:hover {
  transform: scale(1.06);
  background: rgba(255, 182, 193, 0.28);
}

.bgm-toggle.is-muted {
  opacity: 0.72;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Porings dinamicos ? andam, pulam e podem ser arrastados */

.poring-pack {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.poring {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  z-index: 90;
  padding: 0;
  border: 0;
  background: transparent !important;
  box-shadow: none !important;
  cursor: grab;
  pointer-events: auto;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.poring.is-dragging {
  cursor: grabbing;
  z-index: 95;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45));
}

.poring--bem { width: 86px; height: 86px; }
.poring--mal { width: 82px; height: 82px; }
.poring--grande { width: 118px; height: 118px; }
.poring--pequeno { width: 54px; height: 54px; }

.poring img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent !important;
  pointer-events: none;
  display: block;
  animation: poring-idle 0.55s ease-in-out infinite;
}

.poring-hp {
  position: absolute;
  left: 10%;
  right: 10%;
  top: -10px;
  height: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #5d4037;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.poring-hp > i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2c6956, #96d3bd);
  border-radius: inherit;
  transition: width 0.15s ease;
}

.poring--mal .poring-hp > i {
  background: linear-gradient(90deg, #ba1a1a, #ff8a80);
}

.poring-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  background: #874e58;
  color: #fff;
  border: 2px solid #ffb6c1;
  border-radius: 12px;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: "Be Vietnam Pro", sans-serif;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  max-width: 170px;
  white-space: normal;
  text-align: center;
}

.poring--mal .poring-bubble {
  background: #2a1020;
  border-color: #ba1a1a;
}

.poring-dmg {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -10px);
  color: #ba1a1a;
  font-weight: 800;
  font-size: 18px;
  font-family: "JetBrains Mono", monospace;
  text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: dmg-float 0.7s ease forwards;
}

.poring.is-hit img {
  animation: poring-hit 0.25s ease;
  filter: brightness(1.4) saturate(1.2);
}

.poring.is-dead {
  pointer-events: none;
  animation: poring-die 0.55s ease forwards;
}

.poring.is-dead img {
  animation: none;
}

.poring.is-hop img {
  animation: poring-bounce 0.35s ease;
}

.poring.is-dragging img {
  animation: none;
  transform: scale(1.08);
}

@keyframes poring-idle {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-6px) scale(1.03, 0.97); }
}

@keyframes poring-bounce {
  0% { transform: translateY(0) scale(1, 1); }
  40% { transform: translateY(-18px) scale(0.95, 1.08); }
  100% { transform: translateY(0) scale(1, 1); }
}

@keyframes poring-hit {
  0% { transform: scale(1); }
  40% { transform: scale(1.15, 0.85) translateX(-4px); }
  70% { transform: scale(0.9, 1.1) translateX(4px); }
  100% { transform: scale(1); }
}

@keyframes poring-die {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2, 0.6); }
  100% { opacity: 0; transform: scale(0.2, 0.2) translateY(20px); }
}

@keyframes dmg-float {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -36px); }
}

@media (prefers-reduced-motion: reduce) {
  .poring img,
  .poring.is-hop img,
  .poring.is-hit img,
  .poring-dmg { animation: none; }
}

@media (max-width: 960px) {
  .poring--grande { width: 90px; height: 90px; }
  .poring--bem,
  .poring--mal { width: 68px; height: 68px; }
  .poring--pequeno { width: 46px; height: 46px; }
}
