img:is([sizes="auto" i], [sizes^="auto," i]) {
  contain-intrinsic-size: 3000px 1500px;
}

/* Product card hover effect */
.item-card:hover {
  transform: translateY(-10px) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
}

/* Wide life-card hover effect */
.life-card-wide:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 15px 35px rgba(255, 153, 170, 0.5) !important;
}

.buy-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Game info card hover effect */
.current-score:hover,
.current-level:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Custom toast styles */
.custom-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 350px;
  border: 2px solid #26d0ce;
}

.custom-toast.show {
  transform: translateX(-50%) translateY(0);
}

.custom-toast.success {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  border-color: #26d0ce;
}

.custom-toast.error {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: #ff4757;
}

.custom-toast.warning {
  background: linear-gradient(135deg, #feca57, #ff9ff3);
  border-color: #ffd700;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast-message {
  font-weight: bold;
  font-size: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toast-close {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.toast-close:hover {
  opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
  #power-ups {
    flex-direction: column !important;
    align-items: center !important;
  }

  .item-card {
    max-width: 300px !important;
    width: 100% !important;
  }

  /* On mobile, wide card becomes vertical layout */
  .life-card-wide {
    flex-direction: column !important;
    text-align: center !important;
    width: 95% !important;
  }

  .life-card-wide > div:nth-child(2) {
    text-align: center !important;
  }

  .game-info {
    flex-direction: column !important;
    gap: 15px !important;
  }

  .current-score,
  .current-level {
    min-width: 200px !important;
  }

  .custom-toast {
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }

  .custom-toast.show {
    transform: translateY(0);
  }

  /* Mobile responsive for weapon-ammo-grid */
  .weapon-ammo-grid {
    gap: 8px !important;
  }

  .weapon-group-container {
    padding: 8px !important;
  }

  .weapon-ammo-row,
  .rifle-dual-turret-unlock-row,
  .dual-turret-unlock-row,
  .shotgun-dual-turret-unlock-row,
  .hmg-dual-turret-unlock-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .weapon-purchase-button,
  .rifle-dual-turret-unlock-button,
  .dual-turret-unlock-button,
  .shotgun-dual-turret-unlock-button,
  .hmg-dual-turret-unlock-button {
    width: 100% !important;
    padding: 12px !important;
    font-size: 14px !important;
  }

  .game-data-section {
    padding: 10px 12px 12px 12px !important;
  }

  .weapon-ammo-section {
    padding: 12px !important;
  }

  /* Fixed equip bar: slightly tighter padding on small screens */
  #equipdiv {
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
  }

  #equip {
    max-width: 100% !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
  }

  /* Adjust font sizes for mobile */
  .weapon-ammo-row > div:first-child > div:first-child {
    font-size: 16px !important;
  }

  .weapon-ammo-row > div:first-child > div:last-child {
    font-size: 12px !important;
  }

  .weapon-ammo-row > div,
  .rifle-dual-turret-unlock-row > div,
  .dual-turret-unlock-row > div,
  .shotgun-dual-turret-unlock-row > div,
  .hmg-dual-turret-unlock-row > div {
    font-size: 13px !important;
  }

  .current-score,
  .current-wave {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .current-score span:first-child,
  .current-wave span:first-child {
    font-size: 16px !important;
  }

  .current-score #current-score,
  .current-wave #current-wave {
    font-size: 18px !important;
  }
}

/* Back to game — sticky to viewport bottom (Shoot Anything power-ups) */
#equipdiv {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  height: auto;
  min-height: unset;
  background: linear-gradient(
    to top,
    rgba(5, 5, 7, 0.98) 0%,
    rgba(5, 5, 7, 0.92) 45%,
    rgba(5, 5, 7, 0.75) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10050;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Align bar with main column when left nav + right rail are visible (Game Worlds layout) */
@media (min-width: 1024px) {
  #equipdiv {
    /* centered max-w-[1440px] shell + w-48 nav + gap-4 (matches fixed left nav anchor) */
    left: calc(max(env(safe-area-inset-left, 0px), (100vw - min(100vw, 90rem)) / 2) + 12rem + 1rem);
    /* shell margin + trending rail (~300px) + gap */
    right: calc(max(env(safe-area-inset-right, 0px), (100vw - min(100vw, 90rem)) / 2) + min(300px, 28vw) + 0.75rem);
  }
}

@media (min-width: 1280px) {
  #equipdiv {
    right: calc(max(env(safe-area-inset-right, 0px), (100vw - min(100vw, 90rem)) / 2) + 300px + 0.75rem);
  }
}

#equip {
  text-align: center;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  margin-bottom: 0;
  background: linear-gradient(135deg, #0f766e 0%, #047857 55%, #065f46 100%);
  border: 1px solid rgba(45, 212, 191, 0.35);
  box-shadow:
    0 4px 18px rgba(13, 148, 136, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 14px 22px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#equip:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 26px rgba(13, 148, 136, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  filter: brightness(1.06);
}

#equip:active {
  transform: translateY(0);
}

#equip span {
  font-weight: 700;
  color: #ecfdf5;
  letter-spacing: 0.01em;
}

#charnote {
  text-align: center;
  font-size: 12px;
  color: orangered;
  display: none;
  padding: 10px 0;
}

ul#menu-menu-left li.menu-item-2438 a,
ul#menu-menu-left li.menu-item-2218 a,
ul#menu-menu-left li.menu-item-2399 a {
  color: #999;
}
