/* --- Carrusel de apertura de cajas --- */
.carousel-outer {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.carousel-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, #031025, #081229);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.carousel {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  will-change: transform;
  transition: none;
}

.carousel .slot {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  /* Asegura que no se encojan */
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 12px rgba(124, 92, 255, 0.04);
  font-size: 15px;
  font-weight: 600;
  color: #e8eaff;
  transition: box-shadow .3s, border .3s;
}

.carousel .slot.winner {
  box-shadow: 0 0 24px 6px var(--accent), 0 0 60px 10px var(--accent-2);
  border: 2.5px solid var(--accent-2);
  z-index: 2;
}

.carousel-center-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 4px;
  background: linear-gradient(180deg, #fff 60%, #7c5cff 100%);
  border-radius: 2px;
  box-shadow: 0 0 16px 2px #7c5cff99;
  pointer-events: none;
  z-index: 10;
}

/* Copiado de styles.css — estilos de LootArena
   Estética: tema oscuro, glassmorphism, acentos Valorant (Rojo/Blanco)
*/
:root {
  --bg1: #0f172a;
  --bg2: #1e1e2f;
  --bg3: #2a2a40;
  --accent: #ff4655;
  /* Valorant Red */
  --accent-2: #ff8f97;
  /* Lighter Red/Orange hint */
  --muted: #9aa7bd;
  --glass: rgba(255, 255, 255, 0.04);
  --card-bg: rgba(255, 255, 255, 0.03);
  --radius: 14px;
  --rarity-common: #9ca3af;
  --rarity-rare: #3b82f6;
  --rarity-epic: #8b5cf6;
  --rarity-legend: #f59e0b;
  --rarity-custom: #f97316;
  --rarity-equal: #10b981;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', 'Poppins', 'Segoe UI', system-ui, -apple-system;
  background: linear-gradient(180deg, #0f1923 0%, #050910 100%);
  color: #e8f0ff;
  display: flex;
  flex-direction: column;
}

/* Top nav */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  z-index: 40;
  background: rgba(15, 25, 35, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 70, 85, 0.2)
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px
}

.brand img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3))
}

.logo {
  font-size: 26px;
  letter-spacing: 0.8px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5)
}

.tag {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9
}

.main-nav {
  display: flex;
  gap: 18px;
  align-items: center
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all .18s ease-in-out;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-link:hover {
  background: rgba(255, 70, 85, 0.1);
  color: #ff4655;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(255, 70, 85, 0.2), rgba(255, 70, 85, 0.1));
  border: 1px solid rgba(255, 70, 85, 0.3);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 70, 85, 0.15)
}

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

.mini-wallet {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-wallet .coin {
  font-size: 16px;
  color: #ff4655;
}

/* Layout */
.container {
  max-width: 95%;
  margin: 90px auto 40px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.content {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05)
}

.card-title {
  font-size: 14px;
  color: #ff4655;
  margin: 0 0 8px 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Wallet */
.wallet-row {
  display: flex;
  gap: 12px;
  align-items: center
}

.coin.big {
  font-size: 40px;
  color: #ff4655;
}

.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.clicker-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px
}

.clicker {
  padding: 14px 22px;
  border-radius: 4px;
  background: #ff4655;
  border: none;
  color: white;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 70, 85, 0.4);
  transition: transform .12s ease, box-shadow .18s ease;
  text-transform: uppercase;
}

.clicker:hover {
  transform: translateY(-3px);
  background: #ff5865;
}

.multiplier {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Boxes Grid Layout */
.boxes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  align-items: stretch;
  padding-bottom: 40px;
  justify-content: flex-start;
}

/* New Card Style matching user request */
.box {
  position: relative;
  aspect-ratio: 3/4;
  /* Slightly taller */
  width: clamp(140px, 20vw, 200px);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  /* More angular like Valorant UI */
  overflow: hidden;
  background: linear-gradient(135deg, #1f2326 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
  border-color: #ff4655;
}

/* Background Gradients by Rarity - Reverted to Full Gradient */
.box.common {
  background: linear-gradient(135deg, #374151, #1f2937);
}

.box.rare {
  background: linear-gradient(135deg, #1e40af, #172554);
}

.box.epic {
  background: linear-gradient(135deg, #6b21a8, #4c1d95);
}

.box.legendary {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}

.box.equal {
  background: linear-gradient(135deg, #059669, #064e3b);
}

.box.custom-style {
  background: linear-gradient(135deg, #4c0519, #881337);
  border-color: #f43f5e;
}

/* Valorant tiers */
.box.Select {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

.box.Deluxe {
  background: linear-gradient(135deg, #064e3b, #022c22);
}

.box.Premium {
  background: linear-gradient(135deg, #7c2d4a, #4a1830);
}

.box.Ultra {
  background: linear-gradient(135deg, #925e0a, #3d2505);
}

.box.Exclusive {
  background: linear-gradient(135deg, #9a3412, #3b1f0a);
}

/* Layout base: sticky footer without overlap */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* Iridescent effect overlay */
.box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0%, transparent 40%, rgba(255, 255, 255, 0.02) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Image styling */
.box-img-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  padding: 20px;
}

.box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.box:hover img {
  transform: scale(1.1);
}

/* Badges */
.box-badge {
  position: absolute;
  z-index: 5;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.box-price {
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.box-name {
  bottom: 10px;
  left: 10px;
  background: #000;
  color: #fff;
  font-size: 12px;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.box-fav {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  transition: color 0.2s;
}

.box:hover .box-fav {
  color: #fff;
}

/* Estilos de rareza para cajas */
.std-box.common,
.box.common {
  border: 1px solid var(--rarity-common);
  box-shadow: 0 0 10px rgba(156, 163, 175, 0.2), 0 4px 20px rgba(156, 163, 175, 0.1) inset;
  background: linear-gradient(180deg, rgba(156, 163, 175, 0.15), transparent);
}

.std-box.rare,
.box.rare {
  border: 1px solid var(--rarity-rare);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2), 0 4px 20px rgba(59, 130, 246, 0.1) inset;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.15), transparent);
}

.std-box.epic,
.box.epic {
  border: 1px solid var(--rarity-epic);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2), 0 4px 20px rgba(139, 92, 246, 0.1) inset;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.15), transparent);
}

.std-box.legendary,
.box.legendary {
  border: 1px solid var(--rarity-legend);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25), 0 4px 20px rgba(245, 158, 11, 0.15) inset;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.2), transparent);
}

.std-box.custom-style,
.box.custom-style {
  border: 1px solid var(--rarity-custom);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.15) inset;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.2), transparent);
}

.std-box.equal,
.box.equal {
  border: 1px solid var(--rarity-equal);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25), 0 4px 20px rgba(16, 185, 129, 0.15) inset;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), transparent);
}

/* Valorant tier borders */
.std-box.Select,
.box.Select {
  border: 1px solid #5a9fe2;
}

.std-box.Deluxe,
.box.Deluxe {
  border: 1px solid #00d577;
}

.std-box.Premium,
.box.Premium {
  border: 1px solid #d1548d;
}

.std-box.Ultra,
.box.Ultra {
  border: 1px solid #e4b836;
}

.std-box.Exclusive,
.box.Exclusive {
  border: 1px solid #f59e0b;
}

/* Blinking Effect for Equal Box Weapons */
@keyframes weapon-blink {
  0% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
    transform: scale(1.02);
  }

  100% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transform: scale(1);
  }
}

.box.equal-fire img {
  animation: weapon-blink 2s infinite ease-in-out;
}

/* Remove Fire Overlay */
.box.equal-fire::after {
  display: none;
}

/* Remove Fire Border Animation from Box */
.box.equal-fire {
  animation: none;
  border: 1px solid var(--rarity-equal) !important;
  /* Revert to standard equal green border */
}

/* Battle Box Cards */
.std-box-card {
  width: clamp(140px, 20vw, 200px);
  aspect-ratio: 3/4;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}


/* rarity badges */
.badge-rarity {
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  font-size: 12px
}

.badge-rarity.common {
  background: var(--rarity-common)
}

.badge-rarity.rare {
  background: var(--rarity-rare)
}

.badge-rarity.epic {
  background: var(--rarity-epic)
}

.badge-rarity.legend {
  background: var(--rarity-legend)
}

/* Inventory */
.inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 12px
}

.item {
  width: 140px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.02)
}

.item .name {
  font-size: 13px;
  font-weight: 700
}

.item .rarity {
  font-size: 12px;
  color: var(--muted)
}

.item .actions {
  display: flex;
  gap: 8px;
  margin-top: 6px
}

/* Button Styling - Valorant Sharpness */
.btn {
  padding: 8px 16px;
  border-radius: 2px;
  /* Sharp corners */
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  color: #ece8e1;
  cursor: pointer;
  transition: all .12s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn.primary {
  background: #ff4655;
  /* Valorant Red */
  border-color: #ff4655;
  color: white;
  box-shadow: 0 4px 15px rgba(255, 70, 85, 0.25);
}

.btn.primary:hover {
  background: #ff5865;
  box-shadow: 0 6px 20px rgba(255, 70, 85, 0.4);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Progress */
.progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 10%;
  transition: width .7s cubic-bezier(.2, .9, .2, 1)
}

/* Modal and carousel keep previous behavior but styled */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.6), rgba(2, 6, 23, 0.7));
  z-index: 999
}

.modal.hidden {
  display: none
}

.modal-content {
  width: 66.666vw;
  max-width: 1200px;
  min-width: 640px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  padding: 20px;
  border-radius: 12px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.7)
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 18px
}

.carousel-wrap {
  height: 160px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, #031025, #081229);
  border: 1px solid rgba(255, 255, 255, 0.02)
}

.carousel {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  transition: transform 1.6s cubic-bezier(.2, .8, .2, 1)
}

.carousel .slot {
  width: 160px;
  height: 120px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.02)
}

.result {
  margin-top: 16px;
  text-align: center
}

.result.hidden {
  display: none
}

.result-item {
  font-size: 20px;
  font-weight: 900
}

.footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  opacity: 0.9;
  position: relative;
  /* Changed from fixed */
  margin-top: auto;
  /* Push to bottom */
  background: linear-gradient(0deg, rgba(8, 12, 24, 0.95), rgba(8, 12, 24, 0.8));
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 30;
  font-size: 12px;
}

.container {
  max-width: 95%;
  margin: 90px auto 40px;
  padding: 20px;
  padding-bottom: 160px;
  /* extra space for footer */
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 24px;
}

@media (max-width:768px) {
  .modal-content {
    width: 94vw;
    min-width: 0;
    padding: 16px
  }

  .topbar {
    flex-direction: column;
    height: auto;
    padding: 10px;
    gap: 10px;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .main-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 14px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .controls {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  .container {
    margin-top: 140px;
    padding: 10px;
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .box {
    width: 48%;
    min-width: 160px;
  }
}

/* Notifications */
.notify-container {
  position: fixed;
  top: 80px;
  /* Below topbar */
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notify-item {
  background: rgba(18, 25, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: notifyIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
}

.notify-item.success {
  border-left: 4px solid #10b981;
}

.notify-item.error {
  border-left: 4px solid #ef4444;
}

.notify-item.info {
  border-left: 4px solid #3b82f6;
}

@keyframes notifyIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

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

@keyframes notifyOut {
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* UPGRADE PAGE STYLES */
/* UPGRADE PAGE STYLES (CS2 Match) */
.upgrade-main-container {
  max-width: 1200px;
  margin: 100px auto 40px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-height: calc(100vh - 140px);
}

.upgrade-top-area {
  background: rgba(13, 17, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.upgrade-panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 600px;
  /* Fixed height for panels */
}

@media (max-width: 1024px) {
  .upgrade-panels-row {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.upgrade-panel {
  background: rgba(13, 17, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.panel-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
}

.panel-header h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #cbd5e1;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.item-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-list::-webkit-scrollbar {
  width: 6px;
}

.item-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.item-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.item-card-mini:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.item-card-mini.selected {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.1), transparent);
  border-color: var(--accent);
}

.item-img-placeholder {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.item-details {
  flex: 1;
}

.item-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.item-price {
  font-size: 12px;
  color: var(--muted);
}

/* CENTER ARENA */
.upgrade-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  position: relative;
}

.upgrade-slots {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.slot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.slot-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Slot Styling */
/* Slot Styling */
.selected-items-area {
  min-width: 280px;
  width: auto;
  height: 180px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  max-width: 600px;
  /* Prevent it from getting too wide on huge screens */
}

.selected-items-area.filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  justify-content: flex-start;
  /* Align items to top/start */
}

.selected-items-area.filled .item-grid {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  /* Horizontal scroll */
  overflow-y: hidden;
  padding: 10px 10px 30px 10px;
  /* Bottom padding for overlay text */
  align-items: center;
  justify-content: flex-start;
  /* Start from left */
}

/* Scrollbar styling for the grid */
.selected-items-area.filled .item-grid::-webkit-scrollbar {
  height: 6px;
}

.selected-items-area.filled .item-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.mini-item-icon {
  width: 90px;
  height: 110px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}


.selected-items-area.empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.item-slot.invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) inset;
}

.vs-divider {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.2);
}

/* ROULETTE */
.roulette-container {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roulette-svg {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
  /* Will be animated */
}

.roulette-info {
  position: absolute;
  text-align: center;
}

.win-percent {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px rgba(124, 92, 255, 0.5);
}

.win-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.btn-upgrade {
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.2);
  transition: all 0.2s;
}

.btn-upgrade:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-upgrade:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(124, 92, 255, 0.3);
}

.btn-filter {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #9aa7bd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-filter.active {
  background: rgba(124, 92, 255, 0.15);
  border-color: var(--accent);
  color: white;
}

@media (max-width: 1000px) {
  .upgrade-layout {
    grid-template-columns: 1fr;
    height: auto;
    margin-top: 140px;
    /* Ajuste para el nuevo header móvil */
    padding: 10px;
    padding-bottom: 160px;
  }

  .upgrade-panel {
    height: 380px;
  }

  .upgrade-panel {
    height: 380px;
  }

  .upgrade-center {
    padding: 40px 0;
    order: -1;
    /* Pone la ruleta arriba en móvil */
  }

  .item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    overflow-y: visible;
  }

  .upgrade-slots {
    flex-direction: row;
    gap: 10px;
  }

  .item-slot {
    width: 110px;
    height: 110px;
  }

  .vs-divider {
    font-size: 18px;
  }

  .roulette-container {
    width: 240px;
    height: 240px;
  }
}

@media (max-width: 600px) {
  .item-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .roulette-container {
    width: 200px;
    height: 200px;
  }

  .btn-upgrade {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }

  .footer {
    font-size: 11px;
    padding: 12px;
  }
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Battle Mode Buttons - Selected State */
.mode-btn.active {
  background: #10b981 !important;
  /* Green */
  color: white;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

/* BATTLES CHAT LAYOUT */
.container.battles-layout {
  display: flex;
  justify-content: center;
  max-width: 1400px;
  /* Wider max width for battles */
}

.battles-content {
  width: 100%;
  max-width: 1000px;
  /* Controls the centered width */
}

/* 
.battles-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  max-height: 800px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 90px;
}
...
*/

.chat-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: #cbd5e1;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.chat-msg {
  font-size: 13px;
  word-break: break-word;
  line-height: 1.4;
  animation: fadeIn 0.2s;
}

.chat-msg .user {
  font-weight: 700;
  color: var(--accent-2);
  margin-right: 4px;
}

.chat-msg.system {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  font-size: 12px;
}

.chat-input-area {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: white;
  font-size: 13px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 1000px) {
  .container.battles-layout {
    grid-template-columns: 1fr;
    display: block;
    /* Cambia a bloque para que no use grid columnas raras */
  }

  .battles-content {
    width: 100%;
  }

  /* Ajustes de tablas en móvil */
  #battlesTable {
    overflow-x: auto;
  }

  .arena-grid {
    overflow-x: auto;
    padding-bottom: 20px;
  }

  /* Ajustes de creación */
  #view-create>.card>div:nth-child(2) {
    grid-template-columns: 1fr;
  }
}

/* Filters Styles */
.advanced-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px;
}

.filter-group h4 {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.filter-group input:focus {
  border-color: var(--accent);
}

.price-inputs {
  display: flex;
  gap: 8px;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.checkbox-list label:hover {
  color: #fff;
}

.checkbox-list input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Rarity Colors for Filters */
.rarity-list label.rarity-blue {
  color: #5a9fe2;
}

.rarity-list label.rarity-purple {
  color: #00d577;
}

/* Deluxe (Green) */
.rarity-list label.rarity-pink {
  color: #d1548d;
}

/* Premium (Pink) */
.rarity-list label.rarity-red {
  color: #e4b836;
}

/* Ultra (Yellow) - Though removed in HTML, kept for safety */
.rarity-list label.rarity-gold {
  color: #f59e0b;
}

/* Exclusive (Orange) */

/* Custom Scrollbar for lists */
.checkbox-list::-webkit-scrollbar {
  width: 4px;
}

.checkbox-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Responsive Filters */
@media (max-width: 768px) {
  .advanced-filters {
    display: none;
    /* Hidden by default on mobile, maybe toggle? */
  }

  .advanced-filters.open {
    display: flex;
  }
}

/* --- Fix Dropdown Menus (Selects) in Dark Mode --- */
select,
.btn-select {
  background-color: #1e293b !important;
  /* Force dark background */
  color: #e8f0ff !important;
  /* Force light text */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  -webkit-appearance: none;
  /* Removes default OS styling for better control */
  -moz-appearance: none;
  appearance: none;
  /* Custom Arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 30px;
  /* Space for arrow */
}

select option {
  background-color: #0b0f1a !important;
  /* Force dark background for options */
  color: #e8f0ff !important;
  /* Force light text */
  padding: 10px;
}

/* Ensure .btn selects override any gradient background if necessary for better visibility */
select.btn {
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

select:focus {
  border-color: var(--accent);
}
/* --- HOTFIX: Remove persistent FN badges --- */
.item-name span {
    display: none !important;
}
