/* ==========================================================================
   1. GLOBAL & BACKGROUND DEFINITIONS (Core Aesthetic)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
  position: relative;
  background: #e2e5fc url("bg.jpg") no-repeat center center fixed;
  background-size: cover;
}

/* 🌈 Glowing Ambient Overlay (Pastel Lighting Effect) */
.bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 20% 30%, rgba(255, 182, 193, 0.45) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(135, 206, 250, 0.45) 0%, transparent 50%);
  animation: moveBg 12s infinite alternate ease-in-out;
  will-change: transform;
}

@keyframes moveBg {
  0% { transform: scale(1) translate(-15px, -15px); }
  100% { transform: scale(1.05) translate(15px, 15px); }
}

/* ==========================================================================
   2. AUTHENTICATION SCREENS (Portal, Login, Sign Up)
   ========================================================================== */
.auth-container {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.23);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 40px rgba(165, 148, 249, 0.2);
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 💫 Title & Text Typography Elements */
h2 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(255, 182, 193, 0.8), 
               0 2px 4px rgba(120, 110, 200, 0.4);
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin-bottom: 30px;
}

.switch-text {
  color: #fff;
  font-size: 13px;
  margin-top: 15px;
}

.switch-text span {
  color: #dda1ff;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

/* ✏️ Soft Rounded Inputs */
input {
  display: block;
  width: 100%;
  margin: 12px auto;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  color: #333333;
  outline: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #bfa3ff;
  box-shadow: 0 0 12px rgba(191, 163, 255, 0.4);
}

/* 🚀 Interactive Global Buttons */
button {
  margin-top: 15px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ccb1f5, #9ecfff);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(158, 207, 255, 0.4);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(204, 177, 245, 0.6);
}

.secondary-btn {
  background: transparent !important;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.back-btn {
  background: transparent;
  box-shadow: none;
  padding: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 20px;
}

.back-btn:hover {
  transform: none;
  color: #fff;
}

#msg {
  color: #ff5252;
  font-size: 13px;
  margin-top: 12px;
  font-weight: 600;
}

/* ⏳ Loading Progress Components */
.progress-container {
  display: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  margin-top: 25px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ccb1f5, #9ecfff, #ffb3c1);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: glowShimmer 2s linear infinite;
  transition: width 0.4s ease;
}

@keyframes glowShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ==========================================================================
   3. MAIN LOBBY DASHBOARD (The 7 Grid Modes View)
   ========================================================================== */
.lobby-container {
  display: none;
  position: absolute;
  inset: 20px;
  z-index: 20;
  height: calc(100vh - 40px);
  box-sizing: border-box;
  flex-direction: column;
  animation: fadeIn 0.6s ease-in-out forwards;
}

/* Top Dashboard Navbar Layout */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 25px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(165, 148, 249, 0.2);
  margin-bottom: 25px;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-icon {
  font-size: 28px;
  background: rgba(255, 255, 255, 0.4);
  padding: 6px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 192, 203, 0.6);
}

.profile-info h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.player-level {
  font-size: 12px;
  color: #dda1ff;
  font-weight: bold;
}

.currency-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.currency-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 16px;
  border-radius: 20px;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(142, 197, 252, 0.3);
}

/* 🏢 7-Mode Copyright-Safe Responsive Grid Element */
.lobby-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 16px;
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto; 
  padding-bottom: 25px;
  overflow-y: auto;
}

.menu-card {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  height: 170px; 
  padding: 15px;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(165, 148, 249, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.menu-card.titan h3 {
  text-shadow: 0 2px 8px rgba(255, 99, 71, 0.8) !important; /* Enhanced boss glow */
}

.card-icon {
  font-size: 34px; 
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

.menu-card h3 {
  color: #fff;
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(221, 161, 255, 0.4);
}

.menu-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  margin: 0;
  line-height: 1.4;
}

/* Card Hover Actions */
.menu-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 25px rgba(224, 195, 252, 0.45);
}

.menu-card:hover .card-icon {
  transform: scale(1.12) rotate(4deg);
}

/* Exit Button Component */
.logout-btn {
  width: auto !important;
  margin-top: 0 !important;
  padding: 8px 16px !important;
  font-size: 12px !important;
  background: rgba(255, 107, 107, 0.3) !important;
  border: 1px solid rgba(255, 107, 107, 0.5) !important;
  box-shadow: none !important;
}

.logout-btn:hover {
  background: rgba(255, 107, 107, 0.6) !important;
  transform: scale(1.02);
}

/* 🎨 Customized Dashboard Menu Scrollbar UI Track */
.lobby-menu::-webkit-scrollbar {
  width: 6px;
}

.lobby-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* ==========================================================================
   4. VAULT OF ELEMENTS INVENTORY PANEL (Structure & Grid Layouts)
   ========================================================================== */
.vault-container {
  display: flex !important; /* Locks flex display structure to maps correctly to toggle engines */
  position: absolute;
  inset: 20px;
  z-index: 30;
  height: calc(100vh - 40px);
  box-sizing: border-box;
  flex-direction: column;
  animation: fadeIn 0.5s ease-in-out forwards;
  overflow-y: auto;
  padding-right: 8px;
}

.vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 25px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left h2 {
  margin: 0;
}

.vault-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.slots-indicator {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.small-back-btn {
  width: auto !important;
  margin-top: 0 !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* Inventory Cards Layout Grid Configuration */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 20px;
  padding-right: 4px;
}

/* ==========================================================================
   5. ITEM SLOT CARD DESIGNS (Active Cards, Backpack & Dropdowns)
   ========================================================================== */
/* 🃏 Trading Card Frame Template Blueprint */
.element-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 250px; 
  box-sizing: border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.element-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 30px rgba(221, 161, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.75);
}

.card-name {
  font-weight: bold;
  font-size: 13px;
  width: 100%;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🖼️ Image Container Canvas Framing */
.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 110px;
  margin: 6px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.card-artwork-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.element-card:hover .card-artwork-frame {
  transform: scale(1.08);
}

.element-tag {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 9px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 2px 6px;
  border-radius: 20px;
}

.card-power {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  color: #dda1ff;
  font-weight: bold;
  width: 80%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 🎒 Backpack Card Selector Dropdowns Styling */
.element-card select {
  font-family: inherit;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  outline: none;
}

/* ➕ Empty Unlocked Vacant Slot Styling */
.empty-slot {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 2px dashed rgba(255, 255, 255, 0.25) !important;
  box-shadow: none !important;
  opacity: 0.75;
}

/* 🔒 Locked Card Grid Slot Styling */
.locked-slot {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  height: 250px;
  box-sizing: border-box;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.lock-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ==========================================================================
   6. INTERACTIVE INVENTORY CARD ACTION BUTTONS
   ========================================================================== */
.card-action-btn {
  width: 100%;
  margin-top: 6px !important;
  padding: 8px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease;
}

/* Unified Action Hover State Handling for Item Actions */
.card-action-btn:hover,
.locked-slot .buy-slot-btn:hover {
  transform: translateY(-2px) !important;
}

/* 🎒 Un-equip Action Button (Warm Warning Palette) */
.unequip-btn {
  background: linear-gradient(135deg, #ff9999, #ff5e62) !important;
  box-shadow: 0 3px 10px rgba(255, 94, 98, 0.3) !important;
}

.unequip-btn:hover {
  box-shadow: 0 5px 15px rgba(255, 94, 98, 0.5) !important;
}

/* ⚔️ Equip Action Button (Cool Matrix-Cyan Palette) */
.equip-btn {
  background: linear-gradient(135deg, #abecd6, #11998e) !important;
  box-shadow: 0 3px 10px rgba(17, 153, 142, 0.3) !important;
}

.equip-btn:hover {
  box-shadow: 0 5px 15px rgba(17, 153, 142, 0.5) !important;
}

/* Mini Upgrade Buttons inside inventory loops */
.buy-slot-btn {
  width: 100% !important;
  margin-top: 8px !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}

/* Premium Upgrade Button inside Locked Card Grid Slots */
.locked-slot .buy-slot-btn {
  background: linear-gradient(135deg, #a8ff78, #78ffd6) !important;
  color: #1a4a3a !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(120, 255, 214, 0.3);
  border: none;
  cursor: pointer;
}

.locked-slot .buy-slot-btn:hover {
  box-shadow: 0 6px 18px rgba(120, 255, 214, 0.5) !important;
}

/* ==========================================================================
   7. SCROLLBARS, REWARDS, & STRUCTURE FIXES
   ========================================================================== */
.section-break {
  margin-top: 35px !important; /* Pushes backpack layout accurately below active layouts */
  background: rgba(0, 0, 0, 0.2) !important; 
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.reward-modal-style {
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 15px; 
  padding: 20px;
}

/* 🎨 Adorable Pastel Scrollbar Track Engines */
.cards-grid::-webkit-scrollbar,
.vault-container::-webkit-scrollbar {
  width: 8px;
}

.cards-grid::-webkit-scrollbar-track,
.vault-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.cards-grid::-webkit-scrollbar-thumb,
.vault-container::-webkit-scrollbar-thumb {
  background: linear-gradient(#ccb1f5, #9ecfff);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.menu-card.leaderboard-card:hover {
    border-color: #ffd700 !important; /* Elegant Gold Border on Hover */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.menu-card.leaderboard-card .card-icon {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); /* Glowing trophy */
}
/* Sleek Neon Art Frames for when image files are missing */
.card-artwork-frame-fallback {
    width: 100%;
    height: 150px;
    background: #0d1117;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
    border: 1px solid #21262d;
    transition: all 0.3s ease;
}

/* Neon element glow matching your color palette */
.card-artwork-frame-fallback[data-elem="🔥"] { border-color: #ff4500; box-shadow: inset 0 0 15px rgba(255, 69, 0, 0.2); text-shadow: 0 0 10px rgba(255, 69, 0, 0.6); }
.card-artwork-frame-fallback[data-elem="💧"] { border-color: #00d2ff; box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.2); text-shadow: 0 0 10px rgba(0, 210, 255, 0.6); }
.card-artwork-frame-fallback[data-elem="🪨"] { border-color: #ffaa00; box-shadow: inset 0 0 15px rgba(255, 170, 0, 0.2); text-shadow: 0 0 10px rgba(255, 170, 0, 0.6); }
.card-artwork-frame-fallback[data-elem="💨"] { border-color: #00ffcc; box-shadow: inset 0 0 15px rgba(0, 255, 204, 0.2); text-shadow: 0 0 10px rgba(0, 255, 204, 0.6); }