.shop-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s ease;
  padding: 2.5rem 0 3.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 100;
}

.shop-popup.active {
  opacity: 1;
  pointer-events: all;
}

.shop-popup.active ~ * {
  pointer-events: none;
}

/* ===== CERRAR ===== */
.popup-close {
  position: absolute;
  top: 25px;
  right: 35px;
  font-size: 28px;
  padding: 5px 15px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 105;
}

/* ===== LAYOUT ===== */
.popup-wrapper {
  width: 85%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
}

/* ===== IZQUIERDA ===== */
.popup-left {
  height: 550px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-deck {
  perspective: 1000px;
}

.popup-deck img {
  width: clamp(120px, 30vw, 210px);
  transition: transform 0.2s ease;
  animation: floatDeck 3s ease-in-out infinite;
}

/* ===== DERECHA ===== */
.popup-right {
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.popup-title {
  font-family: "anton";
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.popup-price {
  font-size: 22px;
  color: #ffcc00;
  font-weight: bold;
}

.popup-desc {
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
}

.popup-options {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  gap: 1rem;
}

.popup-actions {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 1rem 1.8rem;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  background: #2a2a2a;
  color: #fff;
  transition: all 0.25s ease;
}

.btn.yes {
  background: #1b667f;
  color: #fff;
}

.btn.yes:hover {
  background: #1f7a97; 
}

.btn.no {
  background: #1c1c1c;
  color: #ccc;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.arrow.left {
  padding: 10px 12px;
  left: 0px;
}
.arrow.right {
  padding: 7px 14px;
  right: 0px;
}

@keyframes floatDeck {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0);
  }
}

.popup-hud {
  position: absolute;
  top: 1.2rem;
  left: 1rem;
  display: flex;
  align-items: center;
  background: linear-gradient(145deg, #2b2b2b, #1a1a1a);
  border-radius: 40px;
  padding: 9px 16px 9px 10px;
  box-shadow:
  inset 0 0 0 2px rgba(255, 255, 255, 0.08),
  0 8px 20px rgba(0, 0, 0, 0.6);
  z-index: 10;
  gap: 12px;
}

.hud-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffcc00;
}

.hud-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-info {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hud-name {
  font-weight: bold;
  color: #fff;
  font-size: 14px;
}

.hud-level {
  font-size: 12px;
  color: #ffcc00;
  margin-top: 4px;
}

.hud-bar {
  width: 100px;
  height: 6px;
  background: #000;
  border-radius: 10px;
  margin-top: 6px;
  overflow: hidden;
}

.hud-bar-fill {
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, #ffcc00, #ff6600);
  border-radius: 10px;
}

.hud-money {
  font-weight: bold;
  font-size: 16px;
  color: #00ff88;
  margin-left: 10px;
}

.hud-money.flash {
  transform: scale(1.1);
  text-shadow: 0 0 12px #00ff88;
}

.game-msg {
  width: 180px;
  color: #fff;
  position: fixed;
  top: 12px;
  right: 0;
  text-align: center;
  padding: 6px 0;
  border-radius: 5px;
  font-weight: bold;
  z-index: 200;
  opacity: 0;
  transition: 0.3s;
  background: #222;
  transform: translateX(-50%) translateY(-20px);
}

.game-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-msg.success {
  background: linear-gradient(145deg, #00ff88, #00cc66);
  color: #000;
}

.game-msg.error {
  background: linear-gradient(145deg, #ff3b3b, #cc0000);
}

@media (max-width: 768px) {
  .shop-popup {
    align-items: flex-start;
  }

  .popup-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .popup-actions {
    justify-content: center;
  }

  .popup-close {
    top: 13px;
    right: 10px;
  }

  .arrow.left {
    left: 10px;
  }
  .arrow.right {
    right: 10px;
  }

  .popup-hud {
    gap: 0;
  }

  .hud-info {
    display: none;
  }
}

@media (max-width: 550px) {
  .popup-wrapper {
    gap: 0;
  }

  .popup-left {
    height: 480px;
  }

  .hud-money {
    font-size: 14px;
  }
}
