﻿@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700;800&display=swap');

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
  display: none;
}

@font-face {
  font-family: 'Century Gothic';
  src: url('fonts/CenturyGothic-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@keyframes rainbow-fade {
  0% {
    color: #ff0000;
  }

  14% {
    color: #ff7f00;
  }

  28% {
    color: #ffff00;
  }

  42% {
    color: #00ff00;
  }

  56% {
    color: #0000ff;
  }

  70% {
    color: #4b0082;
  }

  84% {
    color: #9400d3;
  }

  100% {
    color: #ff0000;
  }
}

.disabled-feature {
  display: none !important;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  /* Default background color */
}

html,
body {
  overflow: hidden !important;
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial;
  width: 100%;
  height: 100%;
  overflow: hidden;

  background-image: url("backgrounds/bg3.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-color: #0a0a1a;
  /* Default background color - will be updated by theme */

  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

/* PAGE */
.page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;

  overflow: hidden;
  pointer-events: none;
  /* âœ… page never receives clicks */

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 0;
  /* âœ… BELOW ALL UI */
}

/* LOADING SCREEN */
#loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: linear-gradient(rgba(10, 10, 26, 0.85), rgba(10, 10, 26, 0.85)), url("backgrounds/bg3.png");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  /* ABOVE EVERYTHING */
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Centering vertically */
  height: 100%;
  width: 100%;
  padding: 40px;
  box-sizing: border-box;
  position: relative;
}

/* PORTAL EFFECT REMOVED PER USER REQUEST */

/* STATUS & PROGRESS */
.loader-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: -50px;
  width: 100%;
}

#loader-initial {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.loader-text {
  color: #a8dadc;
  font-family: 'Century Gothic', sans-serif;
  font-weight: 800;
  letter-spacing: 12px;
  margin-right: -12px;
  /* Compensate for trailing letter-spacing to ensure absolute center */
  text-transform: uppercase;
  font-size: 28px;
  text-shadow: 0 0 25px rgba(168, 218, 220, 0.8);
  animation: text-glow-premium 2s ease-in-out infinite alternate;
  margin-bottom: 20px;
}

.loader-progress-bar {
  width: 480px;
  /* Much larger bar */
  max-width: 85vw;
  height: 14px;
  /* Thicker bar */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.loader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #457b9d, #a8dadc, #f1faee);
  background-size: 200% 100%;
  box-shadow: 0 0 15px rgba(168, 218, 220, 0.6);
  animation:
    progress-slide 2s linear infinite,
    progress-grow-premium 3.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Glassy Shimmer overlay on the fill */
.loader-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: bar-shimmer 1.5s infinite;
}

@keyframes bar-shimmer {
  to {
    left: 200%;
  }
}

/* ANIMATIONS */
/* UNUSED ANIMATIONS REMOVED */

@keyframes text-glow-premium {
  from {
    opacity: 0.6;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes progress-slide {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes progress-grow-premium {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

.loader-copyright {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Century Gothic', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.8;
  color: #a8dadc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
  width: 100%;
}

.studio-name {
  font-weight: bold;
  color: #fb8500;
  letter-spacing: 2px;
}

.version-tag {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fb8500;
  background: rgba(251, 133, 0, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(251, 133, 0, 0.4);
  align-self: center;
  margin-top: 40px;
  margin-bottom: 0px;
  box-shadow: 0 0 30px rgba(251, 133, 0, 0.4), 0 0 10px rgba(251, 133, 0, 0.2) inset;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(251, 133, 0, 0.6);
}

.discord-contact {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #a8dadc;
  margin-top: 12px;
  opacity: 1.0;
  text-shadow: 0 0 10px rgba(168, 218, 220, 0.3);
}

/* NEBULA & ATMOSPHERE */
.nebula-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120vw;
  height: 120vh;
  background: radial-gradient(circle, rgba(168, 218, 220, 0.1) 0%, transparent 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  animation: nebula-drift-premium 25s ease-in-out infinite alternate;
}

@keyframes nebula-drift-premium {
  0% {
    transform: translate(-50%, -55%) scale(1);
    opacity: 0.4;
  }

  100% {
    transform: translate(-45%, -45%) scale(1.3);
    opacity: 0.8;
  }
}

/* SCATTERED ITEMS */
.item-scatter-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.item-scatter {
  position: absolute;
  width: 60px;
  height: 60px;
  object-fit: contain;
  opacity: 0.12;
  filter: blur(1.5px) grayscale(0.5) drop-shadow(0 0 15px rgba(168, 218, 220, 0.2));
  image-rendering: pixelated;
  animation: item-float-random var(--d) ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes item-float-random {
  0% {
    transform: translate(0, 0) rotate(var(--r));
    opacity: 0.12;
  }

  100% {
    transform: translate(40px, -40px) rotate(calc(var(--r) + 20deg));
    opacity: 0.22;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* VIEWPORT CONTAINER */
.viewport {
  position: relative;
  width: 100%;
  /* max-width: 420px; User requested removal of side constraints */
  margin: 0 auto;
  /* Respect iOS safe areas so content isn't cut off by notches */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* CHARACTER */
.character {
  position: relative;
  width: 300px;
  pointer-events: none;
}

/* SCENE SCALE WRAPPER (for zooming character only) */
.character-scene {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  /* Prevent Safari from optimizing for speed at the cost of quality */
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

.character-scene img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  /* Removed backface-visibility to prevent GPU artifacts on high-DPI mobile screens */
}

/* Make the character a bit smaller on mobile by default */
@media (max-width: 600px) {
  /* JS applySceneScale handles the default mobile scale of 0.85 on load */
}

/* PLATFORM GLOW */
.platform-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(168, 218, 220, 0.3) 0%, rgba(168, 218, 220, 0.08) 30%, rgba(168, 218, 220, 0.03) 60%, transparent 100%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* BASE WRAPPER */
.base-wrapper {
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  /* Higher than platform-line (z-index 1) */
  z-index: 10;
}

.base-wrapper img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* BASE */
.base {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  position: relative;
  z-index: 2;
  /* clip-path removed to fix mobile artifacts */
}

/* NEW BODY PARTS */
.body,
.leg,
.feet,
.pupil {
  position: absolute;
  top: -73px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: block;
  image-rendering: pixelated;
  z-index: 23;
  pointer-events: none;
}

/* Individual positioning and scaling for body parts - EDIT THESE VALUES */
.body {
  transform: translateX(-50%) translate(0px, 73px) scale(1);
}

.leg {
  transform: translateX(-50%) translate(0px, 73px) scale(1);
}

.feet {
  transform: translateX(-50%) translate(0px, 73px) scale(1);
}

.pupil {
  transform: translateX(-50%) translate(-18.05px, 75px) scale(1.043);
  z-index: 20;
  /* Lowered from 23 to sit behind eyes (23) */
}

/* LAYERS (GENERAL) */
.layer,
.platforms {
  position: absolute;
  top: -73px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  pointer-events: none;
}

.platforms {
  width: 300px;
  z-index: 1;
  display: none;
}

/* CHARACTER VISUALS MUST NEVER BLOCK UI */
.base-wrapper,
.layer,
.platforms {
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

.head {
  /* ADJUST THESE VALUES TO POSITION THE HEAD */
  --head-x: -17px;
  /* Move left/right (negative = left, positive = right) */
  --head-y: 94.3px;
  /* Move up/down (negative = up, positive = down) */
  --head-scale: 1.38;
  /* Size (1 = normal, 2 = double, 0.5 = half) */

  transform:
    translateX(-50%) translate(var(--head-x), var(--head-y)) scale(var(--head-scale));
}

.capesabove {
  /* ADJUST THESE VALUES TO POSITION THE CAPE ABOVE PART */
  --capeabove-x: 100px;
  /* Move left/right (negative = left, positive = right) */
  --capeabove-y: 100px;
  /* Move up/down (negative = up, positive = down) */
  --capeabove-scale: 3;
  /* Size (1 = normal, 2 = double, 0.5 = half) */

  transform:
    translateX(-50%) translate(var(--capeabove-x), var(--capeabove-y)) scale(var(--capeabove-scale));
}

.arm {
  /* ADJUST THESE VALUES TO POSITION THE ARM */
  --arm-x: 1px;
  /* Move left/right (negative = left, positive = right) */
  --arm-y: 112.5px;
  /* Move up/down (negative = up, positive = down) */
  --arm-scale: 1.38;
  /* Size (1 = normal, larger = bigger) */

  transform:
    translateX(-50%) translate(var(--arm-x), var(--arm-y)) scale(var(--arm-scale));
}

.shirtsabove {
  /* ADJUST THESE VALUES TO POSITION THE SHIRT HAND ABOVE */
  --shirtsabove-x: 0px;
  /* Move left/right (negative = left, positive = right) */
  --shirtsabove-y: 100px;
  /* Move up/down (negative = up, positive = down) */
  --shirtsabove-scale: 1;
  /* Size (1 = normal, larger = bigger) */

  transform:
    translateX(-50%) translate(var(--shirtsabove-x), var(--shirtsabove-y)) scale(var(--shirtsabove-scale));
}


/* SPECIAL LAYERING SYSTEM - No conflicts */
/* BACK */
.wings {
  z-index: 1;
}

.backpacks {
  z-index: 1;
}

.pets-back {
  z-index: 1;
}

.pets-back.floating {
  /* Floating animation - Duration (1.5s is faster), Speed (ease-in-out) */
  animation: reaper-float 1.5s ease-in-out infinite;
}

/* Pet floating animations */
#pets[src*="spr_wa_pet_alien"],
#pets[src*="spr_wa_pet_lunar_parrot"],
#pets[src*="spr_wa_pet_moon_pet"],
#pets[src*="pet3"],
#pets[src*="spr_wa_pet_amethyst_lock"],
#pets[src*="spr_wa_pet_ice_cream"],
#pets[src*="spr_wa_pet_bat"],
#pets[src*="spr_wa_pet_blue_octopus"],
#pets[src*="spr_wa_pet_whale"],
#pets[src*="spr_wa_pet_world_lock"],
#pets[src*="spr_wa_pet_octopus"],
#pets[src*="spr_wa_pet_bots"],
#pets[src*="spr_wa_pet_candy"],
#pets[src*="spr_wa_pet_dark_spirit"],
#pets[src*="spr_wa_pet_spirit"],
#pets[src*="spr_wa_pet_vampire_parrot"],
#pets[src*="spr_wa_pet_xmas_parrot"],
#pets[src*="spr_wa_pet_x_phoenix"],
#pets[src*="spr_wa_pet_zombie"],
#pets[src*="spr_wa_pet_water"],
#pets[src*="spr_wa_pet_diamond_ore"],
#pets[src*="spr_wa_pet_ruby_ore"],
#pets[src*="spr_wa_pet_gold_ore"],
#pets[src*="spr_wa_pet_emerald_ore"],
#pets[src*="spr_wa_pet_dolphin"],
#pets[src*="spr_wa_pet_dragon"],
#pets[src*="spr_wa_pet_egg"],
#pets[src*="spr_wa_pet_evil_eyeball"],
#pets[src*="spr_wa_pet_evil_skulls"],
#pets[src*="spr_wa_pet_skull"],
#pets[src*="spr_wa_pet_fire"],
#pets[src*="spr_wa_pet_flaming_bat"],
#pets[src*="spr_wa_pet_frost_bird"],
#pets[src*="spr_wa_pet_gingerbread"],
#pets[src*="spr_wa_pet_dj_parrot"],
#pets[src*="spr_wa_pet_golden_santa"],
#pets[src*="spr_wa_pet_ic_parrot"],
#pets[src*="spr_wa_pet_parrot"],
#pets[src*="spr_wa_pet_spirit_parrot"],
#pets[src*="spr_wa_pet_phoenix"],
#pets[src*="spr_wa_pet_pumpkin"],
#pets[src*="spr_wa_pet_raven"],
#pets[src*="spr_wa_pet_reaper"],
#pets[src*="spr_wa_pet_robot"],
#pets[src*="spr_wa_pet_shark"],
#pets[src*="spr_wa_pet_skeleton_bat"],
#pets[src*="spr_wa_pet_snowball"],
#pets[src*="spr_wa_pet_spaceman"],
#pets[src*="spr_wa_pet_megalodon"],
#pets[src*="spr_wa_pet_mini_brea"],
#pets[src*="spr_wa_pet_mini_earth"],
#pets[src*="spr_wa_pet_music_note"],
#pets[src*="spr_wa_pet_onion"],
#pets[src*="spr_wa_pet_neon_dragon"],
#pets[src*="spr_wa_pet_pick"],
.backpacks {
  animation: reaper-float 2.0s ease-in-out infinite;
}

.capes {
  z-index: 1;
}

.shirtsbehind {
  z-index: 2;
}

@keyframes reaper-float {

  0%,
  100% {
    top: -73px;
  }

  50% {
    /* Larger distance: -103px (30px offset from -73px) */
    top: -160px;
  }
}

/* BODY */
.base {
  z-index: 10;
}

.body {
  z-index: 11;
}

.leg {
  z-index: 11;
}

.feet {
  z-index: 11;
}

.arm {
  z-index: 50;
}

.head {
  z-index: 19;
  /* Lowered from 21 to sit behind pupil (20) and eyes (23) */
}

.capesabove {
  z-index: 28;
}

/* highest - above hair */
.faces {
  z-index: 29;
}

/* middle - above capebelow */
.eyes {
  z-index: 23;
}

.hair {
  z-index: 26;
}

/* lowest - below faces */

/* HEAD ITEMS */
.headgears {
  z-index: 30;
}

.headgearsabove {
  /* Outfit-provided headgear/head (should render above base head) */
  z-index: 31;
}

.shirtstop {
  z-index: 48;
}

.hat {
  z-index: 27;
}

/* CLOTHING */
.shirts {
  z-index: 22;
}

.pants {
  z-index: 25;
}

.shoes {
  z-index: 24;
}

.rightshoe {
  /* ADJUST THESE VALUES TO ASSEMBLE RIGHT SHOE */
  --rightshoe-x: 0px;
  --rightshoe-y: 0px;
  --rightshoe-scale: 1;

  transform:
    translateX(-50%) translate(var(--rightshoe-x), var(--rightshoe-y)) scale(var(--rightshoe-scale));
  z-index: 25;
}

/* Outfit-provided shoes (rendered behind user-selected shoes) */
.outfitshoes {
  z-index: 12;
}

.outfitrightshoe {
  /* ADJUST THESE VALUES TO ASSEMBLE OUTFIT RIGHT SHOE */
  --outfitrightshoe-x: 0px;
  --outfitrightshoe-y: 0px;
  --outfitrightshoe-scale: 1;

  transform:
    translateX(-50%) translate(var(--outfitrightshoe-x), var(--outfitrightshoe-y)) scale(var(--outfitrightshoe-scale));
  z-index: 12;
}

.hands {
  z-index: 49;
}

.shirtsabove {
  z-index: 51;
}

/* PETS */
.pets {
  z-index: 60;
}

.pets-back {
  z-index: 1;
}

/* New layers: Cars / Floaties / Scarfs */
.cars {
  z-index: 40;
}

.floaties {
  z-index: 39;
}

.scarfs {
  z-index: 24;
}



/* GHOST OUTFIT HIDDEN STATE */
/* Layout anchor: hide visually but keep layout position */
body.ghost-active #base {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Absolute layers: safe to fully remove from display */
body.ghost-active #body,
body.ghost-active #head,
body.ghost-active #arm,
body.ghost-active #leg,
body.ghost-active #feet,
body.ghost-active #pupil,
body.ghost-active #skin {
  display: none !important;
}





/* HAMBURGER BUTTON */
.hamburger {
  position: fixed;
  top: 43px;
  left: 25px;
  width: 30px;
  height: 24px;
  cursor: pointer;
  z-index: 3000;
  pointer-events: auto;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg) !important;
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg) !important;
}

/* HAMBURGER BARS */
.hamburger span {
  display: block;
  width: 100%;
  height: 4px;

  background-color: #f0f0f0;
  border-radius: 2px;

  /* ðŸ”’ HARD RESET â€” THIS IS IMPORTANT */
  margin: 0;
  padding: 0;
  box-shadow: none;
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

/* SIDE MENU */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 100vh;

  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 20px;

  transform: translateX(-100%);
  transition: transform 0.3s ease;

  z-index: 1500;

  pointer-events: none;
  /* âœ… CLOSED = NO CLICKS */
}

.side-menu.open {
  transform: translateX(0);
  pointer-events: auto;
  /* âœ… OPEN = INTERACTIVE */
}

.side-menu:not(.open) * {
  pointer-events: none;
}

.side-menu h3 {
  margin-top: 0;
  text-align: center;
}

.menu-header h3 {
  margin-top: 10px;
  font-size: 14px;
  color: #fff;
  text-align: center;
  padding-bottom: 10px;
}

.creator-text {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  font-size: 22px;
  text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

.creator-text-large {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  font-size: 18px !important;
  text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
  letter-spacing: 0.5px;
  text-align: left;
  padding-left: 45px;
  margin-top: 33px;
  display: block;
  max-width: 180px;
}

.menu-header {
  position: relative;
  /* Anchor for absolute children */
  margin: 0;
  font-size: 14px;
  color: #fff;
  text-align: center;
  padding-bottom: 5px;
}

.menu-reset-btn,
.menu-random-btn,
.menu-filter-btn {
  position: absolute;
  top: 33px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  background: rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-reset-btn {
  right: 15px;
}

.menu-random-btn {
  right: 55px;
}

.menu-filter-btn {
  right: 95px;
}

.menu-filter-btn.active {
  background: rgba(64, 150, 255, 0.4);
  border-color: #4096ff;
  color: #4096ff;
}

.menu-reset-btn:hover,
.menu-random-btn:hover,
.menu-filter-btn:hover {
  transform: scale(1.1);
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.2);
}

.menu-reset-btn:active,
.menu-random-btn:active,
.menu-filter-btn:active {
  transform: scale(0.9);
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px rgba(255, 107, 107, 0.5));
  }

  to {
    filter: drop-shadow(0 0 15px rgba(78, 205, 196, 0.8));
  }
}

.menu-scroll {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.menu-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-moz-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-ms-overflow-style {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-webkit-scrollbar-track {
  background: transparent !important;
}

.menu-scroll::-moz-scrollbar-track {
  background: transparent !important;
}

.menu-scroll::-ms-overflow-style-track {
  background: transparent !important;
}

.menu-scroll::-webkit-scrollbar-thumb {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-moz-scrollbar-thumb {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-ms-overflow-style-thumb {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-moz-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-ms-overflow-style-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.menu-scroll::-webkit-scrollbar-corner {
  display: none !important;
  background: transparent !important;
}

.menu-scroll::-moz-scrollbar-corner {
  display: none !important;
  background: transparent !important;
}

.menu-scroll::-ms-overflow-style-corner {
  display: none !important;
  background: transparent !important;
}

/* Enhanced menu items with better color */
/* Main Category Menu Items (Body) */
.menu-item,
.menu-item-with-icon {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(40, 44, 52, 0.95), rgba(30, 34, 42, 0.9));
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #e0e0e0;
}

/* Active State for Open Menus (Blue Highlight) */
.menu-active {
  background: linear-gradient(135deg, rgba(64, 150, 255, 0.8), rgba(20, 100, 220, 0.9)) !important;
  border: 1px solid rgba(100, 200, 255, 0.6) !important;
  box-shadow: 0 0 15px rgba(64, 150, 255, 0.5) !important;
  color: white !important;
  transform: translateY(-1px);
}

.menu-active .category-label {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Hover State for Main Menus */
.menu-item:hover,
.menu-item-with-icon:hover {
  background: linear-gradient(135deg, rgba(60, 64, 72, 0.95), rgba(50, 54, 62, 0.9));
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* SPECIALS SECTION HIGHLIGHT */
.specials-menu-item {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(255, 140, 0, 0.25));
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
}

.specials-menu-item:hover {
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.5), rgba(255, 193, 7, 0.4));
  border-color: rgba(255, 241, 118, 0.9);
}

.menu-item:hover {
  background: linear-gradient(135deg, rgba(120, 180, 220, 0.35), rgba(100, 150, 255, 0.25));
  border-color: rgba(180, 200, 240, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* SUBMENU ITEM COLOR ACCENT */
.submenu li {
  background: linear-gradient(135deg,
      rgba(120, 160, 255, 0.18),
      rgba(80, 120, 200, 0.12));
  border: 1px solid rgba(120, 160, 255, 0.25);
}

/* Hover enhancement */
.submenu li:hover {
  background: linear-gradient(135deg,
      rgba(140, 190, 255, 0.35),
      rgba(100, 150, 255, 0.25));
  border-color: rgba(160, 200, 255, 0.45);
}

/* Enhanced submenu items */
/* Submenu Items (Sub-body) - Nested Look */
.submenu li {
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  margin-bottom: 6px;
  margin-left: 15px;
  /* Indent to show hierarchy */
  border-left: 3px solid rgba(255, 255, 255, 0.1);
  /* Visual marker */
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  /* Subtle border */
  position: relative;
  overflow: hidden;
  box-shadow: none;
  /* Flatter look for subitems */
}

.submenu li:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.menu-item:hover::before {
  left: 100%;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu li {
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
}

.side-menu li:hover {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* SUBMENU */
.submenu {
  display: none;
  background: transparent;
}

.submenu li {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* MENU ITEM ICON FIX */
.submenu .item-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: pixelated;
}

/* SEARCH */
#menuSearch {
  width: calc(100% + 10px);
  padding: 14px 14px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 12px;
  margin: 15px 0px 15px 20px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

#menuSearch:focus {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#menuSearch::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* SEARCH HIGHLIGHT */
.highlight {
  background: rgba(255, 255, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 0, 0.5) !important;
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* EQUIPPED ITEMS */
.equipped {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.1)) !important;
  border-left: 4px solid #2ecc71 !important;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.3) !important;
  position: relative;
}

.submenu li.equipped {
  box-shadow: 0 0 14px rgba(120, 255, 120, 0.6);
}

/* Inventory slot highlight when the equipped item is in a slot */
.inventory .inventory-slot.slot.inventory-equipped {
  box-shadow: inset 0 0 0 3px rgba(46, 204, 113, 0.25);
  border: 2px solid rgba(46, 204, 113, 0.6);
}

/* BACKGROUND THEME MENU */
.bg-menu {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3000;
  pointer-events: auto;
}

.bg-menu img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4);
  image-rendering: pixelated;
  transition: transform 0.15s ease, border 0.15s ease;
}

.bg-menu img:hover {
  transform: scale(1.1);
  border-color: white;
}

/* INVENTORY BAR */
.inventory {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1600;
  pointer-events: auto;
}

.inventory-slot {
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-slot img {
  max-width: 110%;
  max-height: 110%;
  image-rendering: pixelated;
}

.download-all {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(56, 255, 56, 0.6);
  color: #44ff44;
  min-height: 40px;
  padding: 0 14px;
  width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(56, 255, 56, 0.2);
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}

.download-all::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.download-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 255, 56, 0.4);
  background: linear-gradient(135deg, #44ff44, #35e535, #28c628);
}

.download-all:hover::before {
  left: 100%;
}

.download-all:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(56, 255, 56, 0.3);
}

/* PLAYER OPTIONS BUTTON */
.player-options-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 165, 0, 0.6);
  color: #ffa500;
  min-height: 40px;
  padding: 0 14px;
  width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.2);
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}

.player-options-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.player-options-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
  background: linear-gradient(135deg, #ffa500, #ff8c00, #ff7700);
}

.player-options-btn:hover::before {
  left: 100%;
}

.player-options-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 165, 0, 0.3);
}

/* PLAYER INFO DISPLAY */
.player-info-container {
  position: absolute;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 100;
  pointer-events: none;
}

.player-name {
  font-family: 'Century Gothic', 'CenturyGothic', 'Poppins', 'Arial Black', sans-serif;
  font-weight: bold;
  font-size: 70px;
  position: relative;
  top: -2.5px;
  /* Move name down by 10px */
  left: 0px;
  /* Move name right by 20px */
  color: white;
  text-shadow: 4px 6px 0px rgba(0, 0, 0, 1), 0px 4px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  image-rendering: auto;
}

.player-level {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: pixelated;
  /* Removed drop-shadow to fix mobile lines/artifacts */
}

.player-badge {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: pixelated;
  /* Removed drop-shadow to fix mobile lines/artifacts */
}

/* PLAYER OPTIONS MODAL */
.player-options-box {
  min-width: 320px;
  max-width: 500px;
  max-height: 80vh;
  margin: auto;
  /* Centering with margin auto is robust for overflow */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
  padding: 20px;
}

.player-options-box::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

@media (max-width: 768px) {
  .player-options-box {
    min-width: 85vw;
    max-width: 85vw;
    max-height: 85vh;
  }

  /* Force crisp rendering on mobile for character layers */
  #platform-tiles,
  .platform,
  .platform-glow,
  .layer,
  .base-wrapper img {
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: pixelated !important;
    image-rendering: -moz-crisp-edges !important;
    image-rendering: crisp-edges !important;
    -ms-interpolation-mode: nearest-neighbor !important;
  }
}

.player-option-section {
  margin-bottom: 20px;
}

.player-option-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffa500 0%, #ff7700 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-reset-btn,
.menu-random-btn,
.menu-filter-btn {
  position: absolute;
  top: 15px;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  color: #a8dadc;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 10;
}

.menu-reset-btn {
  right: 15px;
}

.menu-random-btn {
  right: 60px;
}

.menu-filter-btn {
  right: 105px;
}

.menu-reset-btn:hover,
.menu-random-btn:hover,
.menu-filter-btn:hover {
  background: rgba(168, 218, 220, 0.2);
  border-color: #a8dadc;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.menu-filter-btn.active {
  background: rgba(251, 133, 0, 0.3);
  border-color: #fb8500;
  color: #fb8500;
}

.menu-reset-btn:active,
.menu-random-btn:active,
.menu-filter-btn:active {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 20px;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  /* Visual centering fix for &times; glyph */
  text-indent: 0.5px;
  padding-bottom: 2px;
}

.modal-close-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.6);
  transform: scale(1.1);
}

.player-name-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.player-name-input:focus {
  outline: none;
  border-color: rgba(255, 165, 0, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.player-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.player-color-item {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.player-color-item:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.player-color-item.selected {
  border-color: rgba(255, 165, 0, 0.8);
  border-width: 6px;
  background-color: rgba(255, 165, 0, 0.2);
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.5);
  transform: scale(1.05);
}

.player-level-grid,
.player-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.player-level-item,
.player-badge-item {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-level-item img,
.player-badge-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.player-level-item:hover,
.player-badge-item:hover {
  transform: scale(1.1);
  border-color: rgba(255, 165, 0, 0.6);
  background: rgba(255, 165, 0, 0.2);
}

.player-level-item.selected {
  border-color: rgba(255, 165, 0, 0.8);
  background: rgba(255, 165, 0, 0.3);
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.5);
}

.player-badge-item.selected {
  border-color: rgba(255, 165, 0, 0.8);
  background: rgba(255, 165, 0, 0.3);
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.5);
}

/* ZOOM CONTROLS (character only) */
.zoom-controls {
  position: fixed;
  right: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: auto;
}

.zoom-controls button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.zoom-controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

/* Download modal (hidden by default) */
.download-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  /* Controlled by .show */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* PERFECT CENTERING */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.download-modal.show {
  display: flex !important;
}

.download-modal::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}



.download-box {
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 30px 35px;
  border-radius: 20px;
  color: #fff;
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  /* PREVENT CLIPPING */
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  margin: auto;
  /* ROBUST CENTERING */
}

.download-box h3 {
  margin: 0 0 25px 0;
  font-size: 26px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
}

.download-box label {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  font-weight: 500;
  position: relative;
}

.download-box label.active {
  background-color: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.download-box label:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(4px);
}

.download-box label span {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.download-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.download-actions button {
  flex: 1;
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.download-actions button:first-child {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-actions button:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.download-actions button.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-actions button.cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* INVENTORY SLOT HOVER EFFECT */
.inventory-slot {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.inventory-slot:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.08);
}

.inventory-slot img {
  transition: transform 0.2s ease;
}

.inventory-slot:hover img {
  transform: scale(1.05);
}

.side-menu {
  overflow: hidden !important;
}

.menu-scroll {
  height: calc(100vh - 160px);
  /* header + search */
  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE */

  overscroll-behavior: contain;
}

/* Chrome / Edge / Safari */
.menu-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* STICKY MENU HEADER (TITLE + SEARCH) */
.menu-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#menuSearch {
  position: sticky;
  top: 0;
  z-index: 5;
  background: transparent;
  padding: 8px;
}

/* FIX SEARCH BAR WIDTH (revert to old look) */
.menu-header input#menuSearch {
  width: calc(100% - 20px);
  margin-left: 20px;
  box-sizing: border-box;
}

.menu-header {
  padding-right: 6px;
}

/* SEARCH BAR â€“ CLEAN TRANSPARENT STYLE */
#menuSearch {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 6px;
}

:root {
  --menu-bg: rgba(0, 0, 0, 0.3);
  --menu-glass: rgba(0, 0, 0, 0.2);
  --theme-border-color: #ffffff;
}

/* subtle float */
@keyframes credit-float {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

.platform-menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 10;
}

/* OLD PLATFORM STYLES REMOVED */

.platform-menu img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* PLATFORM SELECTOR â€” SAME SYSTEM AS THEMES */
.platform-menu {
  position: fixed;
  top: 75px;
  /* â¬‡ below bg-menu */
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  gap: 10px;

  z-index: 2900;
  /* below bg-menu (3000) */
  pointer-events: auto;
}

.platform-menu img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  cursor: pointer;

  border: 2px solid rgba(255, 255, 255, 0.4);
  image-rendering: pixelated;

  transition: transform 0.15s ease, border 0.15s ease;
}

.platform-menu img:hover {
  transform: scale(1.1);
  border-color: white;
}

.unequip-bar {
  margin-bottom: 80px;
  /* space above inventory */
  gap: 12px;
  /* space between buttons */
  justify-content: center;
  /* center the buttons */
  left: 50%;
  transform: translateX(-50%);
}

.no-inventory {
  pointer-events: auto;
}

.no-inventory img {
  display: none !important;
}

.unequip-all {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 56, 56, 0.6);
  color: #ff4444;
  min-height: 40px;
  padding: 0 14px;
  width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 56, 56, 0.2);
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}

.unequip-all::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.unequip-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 56, 56, 0.4);
  background: linear-gradient(135deg, #ff4444, #e53935, #c62828);
}

.unequip-all:hover::before {
  left: 100%;
}

.unequip-all:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 56, 56, 0.3);
}

.remove-all {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  text-align: center;
  line-height: 1.1;

  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #555;
  color: #fff;
  cursor: pointer;
}

/* FORCE UI INTERACTIVITY */
.hamburger,
.side-menu,
.bg-menu,
.platform-menu,
.inventory,
.inventory-slot,
.unequip-all {
  pointer-events: auto !important;
}

.download-btn {
  min-width: 90px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;

  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.15s ease, background 0.2s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}



/* SAVE SLOTS CONTAINER */
.save-slots-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 100%;
  gap: 8px;
  margin-bottom: 15px;
}

.add-slot-btn {
  width: 100%;
  padding: 10px;
  background: rgba(100, 255, 100, 0.2);
  color: rgba(100, 255, 100, 1);
  border: 2px solid rgba(100, 255, 100, 0.4);
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Century Gothic', 'Poppins', sans-serif;
}

.add-slot-btn:hover {
  background: rgba(100, 255, 100, 0.4);
  border-color: rgba(100, 255, 100, 0.8);
  box-shadow: 0 0 15px rgba(100, 255, 100, 0.5);
  transform: scale(1.02);
}

/* SAVE SLOTS */
.save-slots {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 15px;
  z-index: 10000;
  pointer-events: auto;
}

.save-slot-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
}

.save-slot {
  width: 100%;
  height: 100px;
  background: rgba(20, 20, 40, 0.85);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 165, 0, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}



.save-slot:hover {
  border-color: rgba(255, 165, 0, 0.8);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 165, 0, 0.3);
}

.save-slot.has-save {
  border-color: rgba(100, 255, 100, 0.5);
}

.save-slot.has-save:hover {
  border-color: rgba(100, 255, 100, 0.9);
  box-shadow: 0 8px 20px rgba(100, 255, 100, 0.4);
}

.save-slot-preview {
  flex: 1;
  background: rgba(10, 10, 20, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.save-slot-preview::before {
  content: 'Empty';
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  font-family: 'Century Gothic', 'Poppins', sans-serif;
  position: absolute;
}

.save-slot.has-save .save-slot-preview::before {
  content: none;
}

.save-slot-label {
  padding: 6px;
  background: rgba(10, 10, 20, 0.9);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Century Gothic', 'Poppins', sans-serif;
  border-top: 1px solid rgba(255, 165, 0, 0.2);
}

.save-slot-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.save-slot-btn {
  flex: 1;
  height: 28px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  font-family: Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-btn {
  background: rgba(100, 255, 100, 0.2);
  color: rgba(100, 255, 100, 1);
  border: 2px solid rgba(100, 255, 100, 0.4);
}

.save-btn:hover {
  background: rgba(100, 255, 100, 0.4);
  border-color: rgba(100, 255, 100, 0.8);
  box-shadow: 0 0 10px rgba(100, 255, 100, 0.5);
  transform: scale(1.05);
}

.delete-btn {
  background: rgba(255, 100, 100, 0.2);
  color: rgba(255, 100, 100, 1);
  border: 2px solid rgba(255, 100, 100, 0.4);
}

.delete-btn:hover {
  background: rgba(255, 100, 100, 0.4);
  border-color: rgba(255, 100, 100, 0.8);
  box-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .save-slots {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .save-slot {
    width: 70px;
    height: 85px;
  }

  .save-slot-label {
    font-size: 10px;
    padding: 4px;
  }

  .save-slot-preview:empty::before {
    font-size: 10px;
  }

  .save-slot-btn {
    width: 32.5px;
    height: 25px;
    font-size: 16px;
  }
}

/* =========================================
   TOP DRAWER MENU (New Implementation)
   ========================================= */

.top-drawer {
  position: fixed;
  top: 0;
  left: 50%;
  /* Center relative to screen */
  transform: translateX(-50%) translateY(-100%);
  /* Start hidden above */
  width: 100%;
  max-width: 600px;
  /* Limit width */

  background: rgba(10, 15, 30, 0.85);
  /* Deep dark blue-black to match theme */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3500;

  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bouncy spring effect */

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0 0 20px 20px;

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);

  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.top-drawer.open {
  transform: translateX(-50%) translateY(0%);
}

.drawer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 25px 30px;
  width: 100%;
  box-sizing: border-box;
}

.drawer-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drawer-section-title {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ffa500, #ff4444);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(255, 100, 50, 0.3);
  align-self: flex-start;
  margin-left: 10px;
}

/* Backgrounds Row */
.bg-menu-drawer,
.platform-menu-drawer {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.bg-menu-drawer img,
.platform-menu-drawer img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.15);
  image-rendering: pixelated;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.platform-menu-drawer img {
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
}

.bg-menu-drawer img:hover,
.bg-menu-drawer img.equipped,
.platform-menu-drawer img:hover,
.platform-menu-drawer img.equipped {
  transform: scale(1.15) translateY(-3px);
  border-color: #44ff44;
  /* Neon green accent */
  box-shadow: 0 8px 20px rgba(68, 255, 68, 0.4);
  z-index: 10;
}

/* Drawer Handle (The Arrow) */
.drawer-handle {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 36px;

  background: rgba(10, 15, 30, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 0 0 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: none;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8b8d8;

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  z-index: 3501;
}

.drawer-handle:hover {
  background: rgba(20, 25, 45, 0.95);
  color: white;
  box-shadow: 0 10px 30px rgba(100, 150, 255, 0.3);
  height: 42px;

  /* Slight expansion on hover */
  bottom: -42px;
}

.arrow {
  font-size: 14px;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.top-drawer.open .arrow {
  transform: rotate(180deg);
}

/* Hide old menus if they exist (override) */

/* =========================================
   MOBILE FIXES & MENU STATE
   ========================================= */

/* Ensure side menu is on top of everything and has local blur */
.side-menu {
  z-index: 9999 !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  background: rgba(0, 0, 0, 0.45) !important;
}

.hamburger {
  z-index: 10000 !important;
}

/* Blur Inventory and Buttons when Menu is Open - REMOVED per user request for local blur only */

/* Mobile specific adjustments */
/* =========================================
   ROADMAP FEATURE
   ========================================= */

.roadmap-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5000;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  /* Shrink-wrap buttons to content */
}

.roadmap-btn {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: white;
  padding: 6px 20px 6px 6px;
  border-radius: 30px;
  font-family: 'Century Gothic', sans-serif;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
}

.roadmap-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(110, 142, 251, 0.6), 0 0 15px rgba(167, 119, 227, 0.4);
  background: linear-gradient(135deg, #7e9efb, #b787e3);
}

.roadmap-btn:active {
  transform: scale(0.95);
}

/* WORLD PLANNER TELEPORT BTN (Set Planner side) */
.roadmap-btn.world-planner-teleport {
  background: linear-gradient(135deg, #2a9d8f, #264653);
  box-shadow: 0 4px 15px rgba(42, 157, 143, 0.4);
}

.roadmap-btn.world-planner-teleport:hover {
  background: linear-gradient(135deg, #40b3a2, #2d5a6b);
  box-shadow: 0 8px 25px rgba(42, 157, 143, 0.6);
}

/* SET PLANNER TELEPORT BTN (World Planner side) */
.wp-teleport-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5000;
  background: linear-gradient(135deg, #e76f51, #f4a261);
  color: white;
  padding: 6px 20px 6px 6px;
  border-radius: 30px;
  font-family: 'Century Gothic', sans-serif;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(231, 111, 81, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: auto;
  width: fit-content;
}

.wp-teleport-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.wp-teleport-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 111, 81, 0.6);
  background: linear-gradient(135deg, #f08369, #ffb37a);
}

.wp-teleport-btn:active {
  transform: scale(0.95);
}

.roadmap-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Roadmap Modal & Box */
.roadmap-box {
  background: rgba(15, 20, 35, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 35px;
  width: 90%;
  max-width: 500px;
  /* Increased to fix text overflow */
  /* Increased to fix text overflow */
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.05);
  margin: auto;
  /* Ensure centered positioning even on short viewports */
  color: #e0e6ed;
  max-height: 85vh;
  /* Prevent modal from exceeding screen height */
  overflow-y: auto;
  /* Enable scrolling if content is too tall */
  overscroll-behavior: contain;
  /* Prevent body scroll chaining */
  /* Hide scrollbar */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.roadmap-box::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* Mobile Responsive Modal */
@media (max-width: 768px) {
  .roadmap-box {
    width: 90vw;
    min-width: 90vw;
    max-width: 90vw;
    height: auto;
    max-height: 85vh;
    padding: 25px 20px;
  }
}

@keyframes roadmap-modal-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.roadmap-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 25px;
}

.roadmap-header h3 {
  margin: 10px 0 0;
  font-family: 'Century Gothic', sans-serif;
  font-size: 24px;
  background: linear-gradient(90deg, #fff, #a777e3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.roadmap-title-icon {
  font-size: 40px;
  display: block;
}

.roadmap-intro {
  font-family: 'Century Gothic', sans-serif;
  font-size: 15px;
  /* Increased from 14px */
  color: #a8b8d8;
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.6;
}

.roadmap-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.roadmap-list li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Left-align for compact look */
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(-15px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.roadmap-list.active li {
  opacity: 1;
  transform: translateX(0);
}

/* Animation Removed - Replaced by Transitions */

.roadmap-list li:nth-child(1) {
  transition-delay: 0.05s;
}

.roadmap-list li:nth-child(2) {
  transition-delay: 0.1s;
}

.roadmap-list li:nth-child(3) {
  transition-delay: 0.15s;
}

.roadmap-list li:nth-child(4) {
  transition-delay: 0.2s;
}

.roadmap-list li:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(0.96);
  /* Smooth shrink via transition */
  border-color: rgba(110, 142, 251, 0.3);
}

/* ROADMAP ANIMATED ICONS */
.roadmap-icon-anim {
  width: 48px;
  height: 48px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
  /* Very slow smooth bob + snappy frame switch */
  animation:
    roadmap-bob 3s ease-in-out infinite alternate,
    roadmap-frames 0.6s steps(1) infinite alternate;
}

.roadmap-icon-space {
  --frame-1: url('roadmap/space/1.png');
  --frame-2: url('roadmap/space/2.png');
  background-image: var(--frame-1);
}

.roadmap-icon-lock {
  width: 64px;
  height: 64px;
  --frame-1: url('roadmap/spr_fg_amethyst_lock/1.png');
  --frame-2: url('roadmap/spr_fg_amethyst_lock/2.png');
  background-image: var(--frame-1);
  margin-bottom: 15px;
}

@keyframes roadmap-frames {
  0% {
    background-image: var(--frame-1);
  }

  100% {
    background-image: var(--frame-2);
  }
}

@keyframes roadmap-bob {
  0% {
    transform: translateY(0);
    filter: drop-shadow(0 0 10px rgba(110, 142, 251, 0.4));
  }

  100% {
    transform: translateY(-20px);
    filter: drop-shadow(0 0 25px rgba(110, 142, 251, 0.7));
  }
}

.roadmap-btn .roadmap-icon-anim {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  /* Shift right (closer to text) */
  animation: none;
  /* Remove the bobbing animation */
  transform: translate(10px, -3px);
  /* Shift icon 10px right and keep 3px up */
}

/* Consolidated roadmap item container style below */

/* Consolidated roadmap image icon style below */

/* INDIVIDUAL ICON SCALING */
.skins-icon {
  --base-scale: 2.1;
}

.colors-icon {
  --base-scale: 1.6;
}

.wrench-icon {
  --base-scale: 1.6;
}

.community-icon {
  --base-scale: 1.5;
}

/* Row hover shrinks everything together (no need for icon-specific hover) */

/* Consolidated roadmap item text style below */

.roadmap-footer {
  margin-top: 30px;
  text-align: center;
}

.roadmap-soon {
  font-family: 'Century Gothic', sans-serif;
  font-size: 16px;
  font-weight: bold;
  color: #6e8efb;
  text-shadow: 0 0 10px rgba(110, 142, 251, 0.3);
  animation: roadmap-pulse 2s infinite ease-in-out;
}

@keyframes roadmap-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Combined into unified media query above */

/* DOWNLOAD OPTIONS ROADMAP STYLE */
.download-option {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0 !important;
  /* Reset padding as container handles it */
  margin-bottom: 12px;
  display: flex !important;
  align-items: center;
  gap: 0 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  width: 100%;
  overflow: hidden;
}

.download-option.active {
  background: rgba(110, 142, 251, 0.15) !important;
  border-color: rgba(110, 142, 251, 0.4) !important;
}

.download-option:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(0.98);
}

.download-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.download-image-icon {
  max-width: 45px;
  max-height: 45px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(110, 142, 251, 0.5));
}

.download-text {
  padding-left: 15px;
  font-family: 'Century Gothic', sans-serif;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

/* UNIFIED ROADMAP SIDEBAR STYLE (Categories & Sub-items) */
.menu-item-with-icon,
.submenu li {
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 8px;
  margin-right: 15px;
  /* Added margin to prevent clipping */
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  width: auto;
  /* Changed from 100% to auto to respect margins */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-item-with-icon:hover,
.submenu li:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
  /* Removed translateX(5px) to prevent clipping */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.roadmap-item-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  /* Increased from 80px */
  height: 70px;
  /* Increased from 60px */
  flex-shrink: 0;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.roadmap-image-icon {
  width: auto;
  height: auto;
  max-width: 45px;
  max-height: 45px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(var(--base-scale, 1));
}

.menu-item-with-icon:hover .roadmap-image-icon,
.submenu li:hover .roadmap-image-icon {
  transform: scale(1.1);
}

.roadmap-item-text {
  padding-left: 30px;
  /* Increased from 15px */
  font-family: 'Century Gothic', sans-serif;
  font-size: 17px;
  /* Increased from 14px */
  color: #fff;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Category specific naming convention for hierarchy */
.menu-item-text.category-label {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.download-box h3 {
  margin-top: 5px;
  font-family: 'Century Gothic', sans-serif;
  font-size: 22px;
  background: linear-gradient(90deg, #fff, #a777e3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.download-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #ccc;
}

.download-option.active {
  background: rgba(110, 142, 251, 0.2);
  border-color: rgba(110, 142, 251, 0.5);
  color: white;
  box-shadow: 0 0 15px rgba(110, 142, 251, 0.2);
}

.download-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.download-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.download-row .download-option {
  margin-bottom: 0;
  flex: 1;
}

.download-row .download-icon-container {
  width: 60px;
  /* More compact for split row */
}

.download-row .download-text {
  padding-left: 10px;
  font-size: 13px;
}

.download-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}

.download-actions button {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-family: 'Century Gothic', sans-serif;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.download-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(110, 142, 251, 0.6);
}

.download-actions button:active {
  transform: scale(0.95);
}

/* Mobile GPU acceleration for better quality on Safari/iOS */
@media (max-width: 768px),
(-webkit-min-device-pixel-ratio: 2) {}

/* Platform Extenders for Infinite Tiling */
/* Platform Extenders for Infinite Tiling */
.platform-extender {
  position: absolute;
  top: 306px;
  width: 2000px;
  height: 700px;
  transform: scale(6.2);
  transform-origin: top center;
  background-repeat: repeat-x;
  z-index: 1;
  display: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  pointer-events: none;
}

.platform-extender.left {
  right: 50%;
  margin-right: 6640px;
  /* Half of platform width (300px/2) */
  background-position: right top;
  /* Tile from the center outwards */
}

.platform-extender.right {
  left: 50%;
  margin-left: 6640px;
  /* Half of platform width (300px/2) */
  background-position: left top;
  /* Tile from the center outwards */
}

/* Utility to permanently hide items regardless of JS toggle */
.always-hidden {
  display: none !important;
}

/* SELECTION MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  /* Hidden by default, shown by JS after loading */
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 100000;
  transition: opacity 0.5s ease;
  opacity: 0;
}

#set-planner-container {
  display: none;
  /* Hidden until selected */
}

.selection-card-container {
  display: flex;
  gap: 40px;
  max-width: 95vw;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInSelection 0.8s ease-out;
}

@keyframes fadeInSelection {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.selection-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  width: 280px;
  border-radius: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.selection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(168, 218, 220, 0.5), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.selection-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(168, 218, 220, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 218, 220, 0.1);
}

.selection-card:hover::before {
  transform: translateX(100%);
}

.card-icon {
  font-size: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  transition: transform 0.3s ease;
}

.selection-card:hover .card-icon {
  transform: scale(1.1);
}

.card-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.selection-card h2 {
  color: #f1faee;
  margin: 10px 0;
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
}

.selection-card p {
  color: #a8dadc;
  opacity: 0.7;
  font-size: 14px;
}

/* WORLD PLANNER UI */
#world-planner-container {
  position: fixed;
  inset: 0;
  background: #0a0a1a;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.wp-header {
  height: 70px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 10;
}

.wp-title {
  color: #f1faee;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 2px;
}

.wp-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

#blockSearch {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 12px;
  color: #f1faee;
  width: 250px;
  transition: all 0.3s ease;
}

#blockSearch:focus {
  outline: none;
  border-color: #457b9d;
  background: rgba(255, 255, 255, 0.08);
}

.wp-back-btn {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: #e63946;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wp-back-btn:hover {
  background: rgba(230, 57, 70, 0.25);
  transform: translateY(-2px);
}

.wp-canvas-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Removed solid background to allow ::before theme to show */
}

/* BLURRED THEME BACKGROUND */
.wp-canvas-container::before {
  content: '';
  position: absolute;
  inset: -20px;
  /* Slight bleed to avoid edges during zoom/pan */
  background-image: var(--wp-theme-bg, none);
  background-color: #050510;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(12px) brightness(0.75) saturate(1.4);
  z-index: -2;
  /* Far back */
  transition: background-image 0.5s ease;
  pointer-events: none;
}

/* GRID BACKGROUND */
#wp-grid-bg {
  position: absolute;
  inset: 0;
  background-image: var(--wp-theme-bg, none);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
  transition: background-image 0.5s ease;
}

#worldCanvas,
#wpCanvas,
#wpTempCanvas,
#wpRainbowAnimatedCanvas,
#wpStaticBGCanvas,
#wpStaticBlockCanvas,
#wpStaticShadowCanvas {
  will-change: transform;
}

#worldCanvas {
  background: transparent;
  image-rendering: pixelated;
  cursor: crosshair;
  position: relative;
  z-index: 1;
  transform-origin: 0 0;
}

/* FOOTER WRAPPER */
.wp-footer-ui {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 100;
  pointer-events: none;
  width: auto;
}

.wp-footer-ui>* {
  pointer-events: auto;
}

/* TOOLBAR */
.wp-toolbar {
  background: rgba(10, 10, 26, 0.1);
  /* 10% opacity dark */
  backdrop-filter: blur(8px);
  /* Reduced blur for see-through */
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.wp-tool-btn {
  width: auto;
  min-width: 44px;
  height: 54px;
  /* Increased height for labels */
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #a8dadc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 8px;
  gap: 4px;
}

.wp-tool-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  color: #a8dadc;
}

.wp-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.wp-tool-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(168, 218, 220, 0.4);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.wp-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.wp-tool-btn svg {
  width: 18px;
  height: 18px;
  stroke: #a8dadc;
  stroke-width: 2.5;
  transition: all 0.2s ease;
}

.wp-tool-btn:hover svg {
  stroke: #f1faee;
  transform: scale(1.1);
}

.wp-tool-btn.active svg {
  stroke: #f1faee;
  filter: drop-shadow(0 0 5px rgba(168, 218, 220, 0.5));
}

/* BLOCK COUNT MODAL */
.wp-count-modal-content {
  padding: 10px 0;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wp-count-modal-content::-webkit-scrollbar {
  width: 4px;
}

.wp-count-modal-content::-webkit-scrollbar-thumb {
  background: rgba(168, 218, 220, 0.2);
  border-radius: 4px;
}

.wp-count-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.wp-count-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 218, 220, 0.2);
}

.wp-count-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}

.wp-count-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.wp-count-name {
  font-size: 11px;
  color: #a8dadc;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.6;
}

.wp-count-val {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #f1faee;
  line-height: 1;
}

/* INVENTORY DRAWER */
.wp-inventory-drawer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wp-inventory-drawer.closed .wp-inventory {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  overflow: hidden;
}

.wp-drawer-toggle {
  background: rgba(10, 10, 26, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #a8dadc;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.wp-drawer-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.wp-inventory-drawer.closed .wp-drawer-toggle i {
  transform: rotate(180deg);
}

.wp-inventory-drawer:not(.closed) .wp-drawer-toggle {
  background: rgba(168, 218, 220, 0.2);
  border-color: rgba(168, 218, 220, 0.3);
}

.wp-inventory {
  background: rgba(10, 10, 26, 0.1);
  /* 10% opacity dark */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
}

.wp-slot {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.wp-slot:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.wp-slot.active {
  border: 2px solid #a8dadc;
  background: rgba(168, 218, 220, 0.1);
  box-shadow: 0 0 15px rgba(168, 218, 220, 0.3);
}

.wp-slot img,
.wp-cat-item img,
.wp-tool-btn img,
.wp-count-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* REWORKED BLOCKS MENU (CATALOGUE) */
.wp-catalogue {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  height: 80vh;
  max-height: 700px;
  background: rgba(10, 10, 26, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  padding: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 1000;
}

.wp-catalogue.hidden {
  transform: translate(-50%, -40%) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

.wp-catalogue-header {
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wp-tabs {
  display: flex;
  gap: 10px;
}

.wp-tab-btn {
  background: transparent;
  border: none;
  color: #a8dadc;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.wp-tab-btn:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.05);
}

.wp-tab-btn.active {
  background: rgba(168, 218, 220, 0.15);
  color: #f1faee;
  opacity: 1;
}

.wp-catalogue-close {
  background: transparent;
  border: none;
  color: #e63946;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease;
}

.wp-catalogue-close:hover {
  transform: scale(1.1);
}

.wp-catalogue-grid {
  flex: 1;
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 40px 30px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: none;
  /* Firefox */
}

.wp-catalogue-grid::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.wp-cat-item {
  aspect-ratio: 1;
  background: transparent;
  border: none;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  overflow: visible;
  padding: 15px;
}

.wp-cat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-8px) scale(1.05);
}

.wp-cat-item.active {
  background: rgba(168, 218, 220, 0.1);
}

.wp-cat-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.wp-cat-item:hover img {
  transform: scale(1.15);
}

.wp-cat-name {
  margin-top: 15px;
  font-size: 13px;
  color: #f1faee;
  text-align: center;
  font-weight: 700;
  width: 100%;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  opacity: 0.9;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.wp-group-header {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 800;
  color: #a8dadc;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 20px 0 10px;
  border-bottom: 1px solid rgba(168, 218, 220, 0.1);
  margin-bottom: 5px;
}

.wp-group-header:first-child {
  padding-top: 5px;
}

/* POPUPS (RESTORED) */
.wp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  max-height: 85vh;
  background: rgba(15, 15, 35, 0.7);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 30px;
  z-index: 2000;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  animation: wpPopupScale 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: auto;
}

@media (max-width: 768px) {
  .wp-popup {
    max-height: 70vh;
    width: 85vw;
    padding: 25px;
    top: 40%;
  }
}

@keyframes wpPopupScale {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.wp-popup.hidden {
  display: none !important;
}

.wp-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.wp-popup-header h3 {
  margin: 0;
  color: #f1faee;
  letter-spacing: 1px;
}

.wp-popup-close {
  background: transparent;
  border: none;
  color: #e63946;
  font-size: 28px;
  cursor: pointer;
}

.wp-bg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
  overflow-y: auto;
  padding: 15px;
  /* Increased from 10px */
  scrollbar-width: none;
}

.wp-bg-list::-webkit-scrollbar {
  display: none;
}

.wp-bg-item {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  /* Ensure image/labels stay inside */
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Stretch to fill */
  border: 2px solid transparent;
  min-height: 140px;
  /* Slightly taller for name */
}

.wp-bg-item:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(168, 218, 220, 0.4);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.wp-bg-item.active {
  border-color: #a8dadc;
  box-shadow: 0 0 25px rgba(168, 218, 220, 0.4);
}

.wp-bg-item.active::after {
  content: '\2713';
  position: absolute;
  top: 12px;
  right: 12px;
  background: #a8dadc;
  color: #1d3557;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  z-index: 2;
}

.wp-bg-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.wp-bg-item:hover img {
  opacity: 1;
  transform: scale(1.08);
}

.wp-bg-item .wp-cat-name {
  background: rgba(10, 10, 26, 0.8);
  padding: 10px;
  margin: 0;
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1faee;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}


/* COUNT MODAL ITEMS */
.wp-count-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 18px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.wp-count-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
  border-color: rgba(168, 218, 220, 0.3);
}

.wp-count-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wp-count-details {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wp-count-name {
  color: #f1faee;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.wp-count-val {
  background: rgba(168, 218, 220, 0.2);
  color: #a8dadc;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  min-width: 45px;
  text-align: center;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* SAVE SLOTS */
.wp-save-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: none;
}

.wp-save-slots::-webkit-scrollbar {
  display: none;
}

.wp-save-slot {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  align-items: center;
  gap: 20px;
}

.wp-save-slot:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(168, 218, 220, 0.3);
  transform: translateY(-2px);
}

.wp-save-slot-preview {
  width: 120px;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  image-rendering: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wp-save-slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wp-save-slot-label {
  font-size: 12px;
  color: #f1faee;
  font-weight: 600;
}

.wp-save-slot-actions {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.wp-save-btn {
  background: #457b9d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.wp-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(230, 57, 70, 0.1);
  color: #e63946;
  border: 1px solid rgba(230, 57, 70, 0.2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.wp-delete-btn:hover {
  background: #e63946;
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.wp-add-slot-btn {
  margin-top: 20px;
  background: rgba(168, 218, 220, 0.1);
  border: 1px dashed rgba(168, 218, 220, 0.5);
  color: #a8dadc;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.wp-add-slot-btn:hover {
  background: rgba(168, 218, 220, 0.2);
}

/* VIEW EXIT BUTTON */
.wp-view-exit-btn {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1faee;
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.wp-view-exit-btn.hidden {
  top: -100px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wp-view-exit-btn:hover {
  background: rgba(69, 123, 157, 0.9);
  transform: translateX(-50%) scale(1.05);
}

/* MOBILE LOADING SCREEN FIXES */
/* MOBILE & LANDSCAPE LOADING SCREEN FIXES */
@media (max-width: 1024px),
(max-height: 650px) {
  .loader-content {
    padding: 15px;
    justify-content: center;
    gap: 10px;
  }

  .loader-text {
    font-size: 20px;
    margin-bottom: 10px;
    margin-top: 20px;
  }

  .loader-status {
    margin-top: 0;
    gap: 5px;
  }

  /* Force relative positioning to prevent overlap */
  .loader-copyright {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 15px;
    width: 100%;
    padding-bottom: 10px;
  }

  .version-tag {
    margin-top: 15px;
    font-size: 12px;
    padding: 4px 10px;
    align-self: center;
  }

  /* Compact Selection Cards */
  .selection-card-container {
    gap: 12px;
    flex-direction: row;
    align-items: center;
    margin-bottom: 0px;
  }

  .selection-card {
    width: 35vw;
    min-width: 110px;
    max-width: 150px;
    padding: 15px 8px;
    border-radius: 14px;
  }

  .card-icon {
    margin-bottom: 6px;
  }

  .card-icon img {
    width: 40px;
    height: 40px;
  }

  .selection-card h2 {
    font-size: 13px;
    margin: 4px 0 0 0;
    line-height: 1.1;
  }
}