.score-display {
  position: absolute;
  top: 18px;
  left: 18px; /* Devuelto a su posición inicial; el botón ahora está a la derecha */
  padding: 6px 10px;
  background: rgba(17, 18, 31, 0.85);
  border: 2px solid var(--panel-edge);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text);
}

.battery-display {
  position: absolute;
  top: 40px;
  left: 680px;
  padding: 6px 10px;
  background: rgba(20, 28, 38, 0.85);
  border: 2px solid #4fa2ff;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #9fd6ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.battery-icon svg {
  display: block;
  filter: drop-shadow(0 0 2px rgba(79, 162, 255, 0.6));
}

.battery-icon {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.energy-container {
  position: absolute;
  top: 12px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 3px;
  background: rgba(20, 28, 38, 0.85);
  border: 2px solid #2a3a4d;
}

.energy-text {
  margin: 0 6px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #9fd6ff;
}

.energy-track {
  width: 120px;
  height: 14px;
  background: rgba(12, 18, 26, 0.7);
  border: 2px solid #2a3a4d;
  position: relative;
  overflow: hidden;
}

.energy-bar {
  height: 100%;
  width: 100%;
  position: relative;
  transition: width 0.25s ease, filter 0.25s ease;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background: linear-gradient(90deg, #2ee6a0 0%, #41ffd9 50%, #4fa2ff 100%);
  box-shadow: 0 0 8px rgba(79, 162, 255, 0.45),
    inset 0 0 4px rgba(185, 220, 255, 0.6);
}

/* Estado visual por nivel de energía */
.energy-bar.ok {
  background: linear-gradient(90deg, #2ee6a0 0%, #41ffd9 50%, #4fa2ff 100%);
  box-shadow: 0 0 8px rgba(79, 162, 255, 0.45),
    inset 0 0 4px rgba(185, 220, 255, 0.6);
}

.energy-bar.warn {
  background: linear-gradient(90deg, #ffd54d 0%, #ffb300 60%, #ff8c1a 100%);
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.35),
    inset 0 0 4px rgba(255, 237, 78, 0.45);
}

.energy-bar.low {
  background: linear-gradient(90deg, #ff6b6b 0%, #ff3b30 60%, #c62828 100%);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.35),
    inset 0 0 4px rgba(255, 107, 107, 0.45);
}

.energy-bar.empty {
  background: repeating-linear-gradient(
    90deg,
    #222b33 0px,
    #222b33 6px,
    #1a2229 6px,
    #1a2229 12px
  );
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
  filter: grayscale(40%);
}

/* Efecto de flujo */
.energy-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0px,
    rgba(255, 255, 255, 0.12) 6px,
    rgba(255, 255, 255, 0.02) 6px,
    rgba(255, 255, 255, 0.02) 12px
  );
  mix-blend-mode: screen;
  animation: energyFlow 2.2s linear infinite;
}

@keyframes energyFlow {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(24px);
  }
}

/* Respeto a usuarios y ahorro de recursos: desactivar animaciones si el usuario prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .battery-icon {
    animation: none !important;
  }
  .energy-bar::before {
    animation: none !important;
  }
}

/* Responsive: aún más compacto en pantallas estrechas */
@media (max-width: 520px) {
  .energy-track {
    width: 100px;
    height: 12px;
  }
  .energy-text {
    font-size: 9px;
  }
}

/* Power-up indicator (top-centered banner) */
.powerup-indicator {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(20, 28, 38, 0.9);
  border: 2px solid #8bc4ff;
  color: #e6f2ff;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 4px rgba(79, 162, 255, 0.6);
  box-shadow: 0 0 8px rgba(79, 162, 255, 0.2);
  display: none; /* hidden by default */
}

.powerup-indicator.show {
  display: block;
}

.powerup-indicator.hidden {
  display: none;
}
