/* styles.css */
@font-face {
    font-family: 'PermanentMarker';
    src: url('../fonts/PermanentMarker-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'PressStart2P';
    src: url('./fonts/PressStart2P-Regular.woff2') format('woff2'),
         url('./fonts/PressStart2P-Regular.woff') format('woff'),
         url('./fonts/PressStart2P-Regular.ttf') format('truetype');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

:root{
  --cursor-value: url("./Game/Source/cursor.png") 5 2, pointer;
}

/* Aplica globalmente */
html, body, canvas, .hud-cursor, button, a, img,
#game-hud, .corner-box, .round-btn, .hud-panel, [data-draggable="true"] {
  cursor: var(--cursor-value);
}



/* Panel de Misiones */
.missions-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 4px solid #4a4a8a;
  border-radius: 20px;
  color: #ffff00;
  font-family: 'PressStart2P', monospace;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.missions-panel.hidden {
  display: none;
}

.missions-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.missions-overlay.hidden {
  display: none;
}

.missions-header {
  padding: 20px;
  background: rgba(42, 42, 74, 0.9);
  border-bottom: 3px solid #5a5aff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.missions-title-container {
  flex: 1;
}

#missions-npc-title {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
}

.missions-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reset-time {
  color: #88ff88;
  font-size: 12px;
}

.progress {
  color: #ffff88;
  font-size: 12px;
}

.close-button {
  background: none;
  border: none;
  color: #ff5555;
  font-size: 28px;
  cursor: pointer;
  padding: 0 10px;
  transition: transform 0.2s;
}

.close-button:hover {
  transform: scale(1.2);
  color: #ff7777;
}

.missions-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.missions-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mission-card {
  background: rgba(42, 42, 74, 0.9);
  border: 2px solid #5a5aff;
  border-radius: 15px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  transition: all 0.3s ease;
}

.mission-card.completed {
  background: rgba(42, 90, 42, 0.9);
  border-color: #5aff5a;
}

.mission-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mission-title {
  font-size: 14px;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
}

.mission-description {
  font-size: 11px;
  color: #cccccc;
  line-height: 1.4;
  margin: 0;
}

.mission-requirements {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.item-amount {
  color: #ffff88;
  font-size: 16px;
}

.mission-rewards {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exp-reward {
  color: #ffff00;
  font-size: 14px;
}

.mission-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.complete-button {
  background: linear-gradient(135deg, #4a4a8a 0%, #3a3a7a 100%);
  border: 2px solid #8888ff;
  border-radius: 10px;
  color: white;
  font-family: 'PressStart2P', monospace;
  font-size: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
  text-align: center;
}

.complete-button:hover:not(.disabled) {
  background: linear-gradient(135deg, #5a5aff 0%, #4a4aff 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 90, 255, 0.4);
}

.complete-button.completed {
  background: linear-gradient(135deg, #2a8a2a 0%, #1a7a1a 100%);
  border-color: #5aff5a;
  cursor: default;
}

.complete-button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.missions-footer {
  padding: 15px 20px;
  background: rgba(42, 42, 74, 0.9);
  border-top: 3px solid #4a4a8a;
  display: flex;
  justify-content: center;
}

.refresh-button {
  background: linear-gradient(135deg, #2a4a8a 0%, #1a3a7a 100%);
  border: 2px solid #4a8aff;
  border-radius: 10px;
  color: white;
  font-family: 'PressStart2P', monospace;
  font-size: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-button:hover {
  background: linear-gradient(135deg, #3a5aff 0%, #2a4aff 100%);
  transform: translateY(-2px);
}

/* Scrollbar personalizada */
.missions-content::-webkit-scrollbar {
  width: 8px;
}

.missions-content::-webkit-scrollbar-track {
  background: rgba(42, 42, 74, 0.5);
  border-radius: 4px;
}

.missions-content::-webkit-scrollbar-thumb {
  background: #5a5aff;
  border-radius: 4px;
}

.missions-content::-webkit-scrollbar-thumb:hover {
  background: #6a6aff;
}

/* Responsive */
@media (max-width: 768px) {
  .missions-panel {
    width: 95%;
    max-height: 90vh;
  }
  
  .mission-card {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .mission-actions {
    margin-top: 15px;
  }
  
  #missions-npc-title {
    font-size: 16px;
  }
}








/* Durante arrastre */
.dragging, .dragging * { cursor: grabbing !important; }

  /* Estilos para grupos de ingredientes OR */
.ingredient-group {
  margin-bottom: 15px;
  padding: 10px;
  border: 2px solid #4a5568;
  border-radius: 8px;
  background: rgba(74, 85, 104, 0.1);
}

.group-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #e2e8f0;
  font-size: 14px;
}

.alternatives-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alternative-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.alternative-item.available:hover {
  background: rgba(72, 187, 120, 0.1);
}

.alternative-item.selected {
  border-color: #48bb78;
  background: rgba(72, 187, 120, 0.15);
}

.alternative-item.unavailable {
  opacity: 0.6;
  cursor: not-allowed;
}

.alternative-selector {
  margin-right: 10px;
}

.alternative-selector input[type="radio"] {
  display: none;
}

.alternative-selector label {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #718096;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.alternative-item.selected .alternative-selector label {
  border-color: #48bb78;
  background: #48bb78;
}

.alternative-selector label:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0;
}

.alternative-item.selected .alternative-selector label:after {
  opacity: 1;
}

.alternative-info {
  flex: 1;
  margin-left: 10px;
}

.alternative-name {
  font-weight: 500;
  color: #e2e8f0;
}

.alternative-quantity {
  font-size: 12px;
  color: #a0aec0;
}

.alternative-quantity.available {
  color: #48bb78;
}

.alternative-quantity.missing {
  color: #f56565;
}

.alternative-status {
  margin-left: 10px;
  font-size: 14px;
}

/* Botón de actualizar todos */
.refresh-all-container {
  margin-bottom: 20px;
  text-align: center;
}

.refresh-all-button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.refresh-all-button:hover {
  background-color: #2980b9;
}

/* Ajustar layout de ingredientes para acomodar el botón */
.ingredient-item {
  display: flex;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.alternative-item {
  display: flex;
  align-items: center;
  padding: 8px;
  margin-bottom: 5px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* badge: oculta por defecto - AUMENTAMOS ESPECIFICIDAD */
#game-hud .label-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px) scale(.98);
  background: linear-gradient(135deg,#1f8ef1,#1177d1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(17,119,209,0.18);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, transform 120ms cubic-bezier(.2,.9,.2,1), visibility 120ms;
  z-index: 1001;
  text-transform: none;
}

/* posición base para los botones - AUMENTAMOS ESPECIFICIDAD */
#game-hud .corner-box .inner-btn,
#game-hud .round-buttons .round-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* MOSTRAR SOLO AL HOVER - ESPECIFICIDAD MÁXIMA */
#game-hud .round-buttons .round-btn:hover .label-badge,
#game-hud .corner-box .inner-btn:hover .label-badge {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px) scale(.98);
}

/* OCULTAR POR DEFECTO */
#game-hud .round-buttons .round-btn .label-badge,
#game-hud .corner-box .inner-btn .label-badge {
  opacity: 0;
  visibility: hidden;
}

/* ajuste especial para la badge dentro de corner-box */
#game-hud .corner-box .inner-btn .label-badge {
  left: auto;
  right: calc(-6px);
  bottom: 0;
  transform: none;
}

/* MOSTRAR/OCULTAR CORREGIDO PARA CORNER-BOX */
#game-hud .corner-box .inner-btn:hover .label-badge {
  transform: translateY(-5px);
  opacity: 1 !important;
  visibility: visible !important;
}

/* ajuste específico para badges de botones redondos */
#game-hud .round-buttons .round-btn .label-badge {
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(0px) scale(.98);
}

#game-hud .round-buttons .round-btn:hover .label-badge {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1 !important;
  visibility: visible !important;
}

.quests-label {
  bottom: -25px !important;
  transform: translateY(-10px) scale(0.98) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 120ms ease, transform 120ms cubic-bezier(.2,.9,.2,1), visibility 120ms !important;
}

.corner-box .inner-btn:hover .quests-label {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
}



/* ───────────────────────────────────────────────────────── */
/* ANIMACIONES PARA MOSTRAR/OCULTAR BOTONES REDONDOS */
/* ───────────────────────────────────────────────────────── */
/* Contenedor de botones redondos - Asegurar que cuando esté oculto no interfiera */
.round-buttons {
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
  transform: translateY(0);
  opacity: 1;
}

/* Cuando está oculto, moverlo completamente fuera del área de clics */
.round-buttons.hidden {
  transform: translateY(-100px);
  opacity: 0;
  pointer-events: none; /* Esto evita que capture eventos */
  visibility: hidden; /* Esto asegura que no ocupe espacio para eventos */
}

/* Cada botón individual también debe tener pointer-events: none cuando esté oculto */
.round-buttons.hidden .round-btn {
  pointer-events: none !important;
}

/* Asegurarse de que el botón Hide/Show esté siempre por encima */
.inner-btn {
  position: relative;
  z-index: 1002 !important; /* Valor alto para estar por encima */
}

/* El contenedor de botones redondos debe tener un z-index menor cuando esté oculto */
.round-buttons.hidden {
  z-index: 900 !important; /* Valor bajo cuando está oculto */
}

.round-buttons:not(.hidden) {
  z-index: 1000; /* Valor normal cuando está visible */
}

/* Asegurar que las badges también se oculten completamente */
.round-buttons.hidden .round-btn .label-badge {
  display: none !important;
  pointer-events: none !important;
}

/* Retardos escalonados para efecto de cascada al ocultar */
.round-buttons.hidden .round-btn:nth-child(1) { transition-delay: 0s; }
.round-buttons.hidden .round-btn:nth-child(2) { transition-delay: 0.05s; }
.round-buttons.hidden .round-btn:nth-child(3) { transition-delay: 0.1s; }
.round-buttons.hidden .round-btn:nth-child(4) { transition-delay: 0.15s; }
.round-buttons.hidden .round-btn:nth-child(5) { transition-delay: 0.2s; }

/* Retardos escalonados para efecto de cascada al mostrar */
.round-buttons:not(.hidden) .round-btn:nth-child(1) { transition-delay: 0.2s; }
.round-buttons:not(.hidden) .round-btn:nth-child(2) { transition-delay: 0.15s; }
.round-buttons:not(.hidden) .round-btn:nth-child(3) { transition-delay: 0.1s; }
.round-buttons:not(.hidden) .round-btn:nth-child(4) { transition-delay: 0.05s; }
.round-buttons:not(.hidden) .round-btn:nth-child(5) { transition-delay: 0s; }

/* Efecto visual en el botón Hide al hacer clic */
#toggle-round-buttons:active {
  transform: scale(0.92);
  transition: transform 0.1s ease;
}

/* Asegurar que las badges también se oculten cuando los botones estén ocultos */
.round-buttons.hidden .round-btn .label-badge {
  display: none !important;
}



/* =========================
   Loading Overlay Styles para Phaser
   ========================= */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-family: 'Press Start 2P', monospace;
}

#loading-overlay .loading-pixel {
  position: relative;
  width: 100px;
  height: 100px;
  image-rendering: pixelated;
  margin: 20px auto;
}

#loading-overlay .loading-pixel::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #4cc9f0;
  animation: pixelLoad 1.5s infinite;
}

@keyframes pixelLoad {
  0%, 100% {
    transform: translate(0, 0);
    background: #4cc9f0;
  }
  25% {
    transform: translate(80px, 0);
    background: #4361ee;
  }
  50% {
    transform: translate(80px, 80px);
    background: #3a0ca3;
  }
  75% {
    transform: translate(0, 80px);
    background: #7209b7;
  }
}

#loading-overlay .loading-text {
  color: #4cc9f0;
  font-size: 18px;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 0 8px rgba(76, 201, 240, 0.7);
}

#loading-overlay .loading-bar-container {
  width: 80%;
  max-width: 600px;
  margin: 20px auto;
  border: 3px solid #4cc9f0;
  border-radius: 10px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px rgba(76, 201, 240, 0.3);
}

#loading-overlay .loading-bar-fill {
  height: 30px;
  background: linear-gradient(90deg, #4cc9f0, #4361ee, #3a0ca3);
  border-radius: 5px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

#loading-overlay .loading-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  #loading-overlay .loading-text {
    font-size: 14px;
  }
  
  #loading-overlay .loading-pixel {
    width: 80px;
    height: 80px;
  }
  
  #loading-overlay .loading-pixel::before {
    width: 16px;
    height: 16px;
  }
  
  @keyframes pixelLoad {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(64px, 0); }
    50% { transform: translate(64px, 64px); }
    75% { transform: translate(0, 64px); }
  }
}






/* crafting-hub.css - VERSIÓN COMPLETA REPARADA */
:root{
  --crafting-primary: #6a11cb;
  --crafting-secondary: #7b2cbf;
  --crafting-dark: #3b0b6b;
  --crafting-light: #a46be6;
  --crafting-accent: #ff6ec7;
  --crafting-bg: rgba(22,8,40,0.96);
  --crafting-border: #3a1c6b;
  --crafting-text: #fff;
  --crafting-text-secondary: #d6c6f7;
  --pixel-border: 2px;
  --touch-size: 44px;
}

*{box-sizing:border-box}
body{margin:0;font-family:"Press Start 2P",monospace,Arial;background:transparent;color:var(--crafting-text)}

/* ================================
   PANEL PRINCIPAL
   ================================ */
#crafting-hub {
  position: fixed;
  inset: 0;
  display: none; /* OCULTO POR DEFECTO */
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.95));
  z-index: 9999;
  padding: 12px;
}

.crafting-hub-hidden {
  display: none !important;
}

.crafting-hub-visible {
  display: flex !important;
}

.crafting-container{
  width:100%;
  max-width:1200px;
  height:90vh;
  max-height:800px;
  background:linear-gradient(180deg,var(--crafting-bg), rgba(48,14,82,0.95));
  border:var(--pixel-border) solid var(--crafting-border);
  box-shadow:0 8px 30px rgba(0,0,0,0.7), 0 0 18px rgba(106,17,203,0.35);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:12px;
  position: relative;
}

.crafting-container::before{
  content:"";
  position:absolute;
  inset:-4px;
  background:conic-gradient(from 120deg, var(--crafting-accent), var(--crafting-primary), var(--crafting-light));
  opacity:0.16;
  pointer-events:none;
  border-radius:14px;
}

.crafting-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  gap:12px;
  background:linear-gradient(90deg,var(--crafting-primary),var(--crafting-secondary));
  border-bottom:var(--pixel-border) solid var(--crafting-border);
  flex-shrink: 0;
}

.crafting-title{
  margin:0;
  font-size:16px;
  user-select: none;
}

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

.header-status{
  font-size:12px;
  color:var(--crafting-text-secondary);
  user-select: none;
}

.crafting-close-btn{
  width:var(--touch-size);
  height:var(--touch-size);
  min-width:var(--touch-size);
  background:var(--crafting-accent);
  border:var(--pixel-border) solid var(--crafting-border);
  color:#120018;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  cursor:pointer;
  border-radius:6px;
  user-select: none;
}

.crafting-close-btn:hover{
  transform:scale(1.03);
}

/* ================================
   CONTENIDO PRINCIPAL - LAYOUT
   ================================ */
.crafting-main{
  display:flex;
  flex:1;
  min-height:0;
  gap:0;
  padding:0;
  overflow: hidden;
}

/* ================================
   SIDEBAR - LISTA DE RECETAS (OCUPA TODO EN MÓVIL)
   ================================ */
.crafting-sidebar{
  width:100%;
  background:rgba(58,28,107,0.24);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  position: relative;
}

.crafting-filters{
  padding:12px 16px;
  border-bottom:var(--pixel-border) solid var(--crafting-border);
  flex-shrink: 0;
}

.filter-title{
  margin:0 0 8px 0;
  font-size:12px;
  color:var(--crafting-text-secondary);
  user-select: none;
}

.filter-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:4px;
}

.filter-btn{
  background:linear-gradient(180deg,var(--crafting-secondary),var(--crafting-dark));
  color:var(--crafting-text);
  border:var(--pixel-border) solid var(--crafting-border);
  padding:8px 12px;
  font-size:11px;
  cursor:pointer;
  min-width:80px;
  border-radius:6px;
  user-select: none;
}

.filter-btn.active{
  background:linear-gradient(180deg,var(--crafting-accent),var(--crafting-light));
  color:var(--crafting-dark);
}

.crafting-search{
  padding:12px 16px;
  border-bottom:var(--pixel-border) solid var(--crafting-border);
  flex-shrink: 0;
}

.search-input{
  width:100%;
  padding:12px 14px;
  font-size:14px;
  border-radius:8px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:rgba(255,255,255,0.04);
  color:var(--crafting-text);
  font-family: "Press Start 2P", monospace;
}

.search-input::placeholder{
  color:var(--crafting-text-secondary);
}

/* ================================
   LISTA DE RECETAS - EXPANDIDA
   ================================ */
.recipes-list-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.recipes-list-header {
  padding: 12px 16px;
  border-bottom: var(--pixel-border) solid var(--crafting-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.recipes-list-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--crafting-text-secondary);
}

.recipes-count {
  font-size: 12px;
  color: var(--crafting-light);
}

.recipes-list{
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.recipe-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:rgba(74,13,143,0.18);
  cursor:pointer;
  border-radius:8px;
  min-height:70px;
  user-select: none;
  transition: all 0.2s ease;
  width: 100%;
}

.recipe-item:hover{
  transform:translateX(4px);
  background:rgba(106,17,203,0.25);
}

.recipe-item.selected{
  background:linear-gradient(90deg,var(--crafting-light),var(--crafting-accent));
  color:var(--crafting-dark);
  box-shadow: 0 4px 12px rgba(255,110,199,0.3);
}

.recipe-item-img{
  width:54px;
  height:54px;
  object-fit:contain;
  image-rendering:pixelated;
  border-radius:6px;
  border:2px solid var(--crafting-border);
  background:rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.recipe-item-info{
  flex: 1;
  min-width: 0;
}

.recipe-item-name{
  font-size:14px;
  margin:0 0 6px 0;
  line-height:1.3;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-item-meta{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

.recipe-item-level{
  font-size:10px;
  color:var(--crafting-text-secondary);
  display:flex;
  align-items:center;
  gap:4px;
}

.recipe-item-category{
  font-size:10px;
  color:var(--crafting-light);
  padding:2px 6px;
  background:rgba(164,107,230,0.1);
  border-radius:4px;
}

.recipe-item-status{
  margin-left: auto;
  font-size: 12px;
}

.recipe-item-status.can-craft{
  color: #4ade80;
}

.recipe-item-status.cannot-craft{
  color: #f87171;
}

/* ================================
   PANEL DE DETALLES (OCULTO EN MÓVIL POR DEFECTO)
   ================================ */
.crafting-details{
  display:none;
  flex-direction:column;
  width: 65%;
  min-width: 0;
  background:rgba(58,28,107,0.3);
  border-left:var(--pixel-border) solid var(--crafting-border);
  overflow: hidden;
}

.crafting-details.visible {
  display: flex;
}

.details-header {
  padding: 16px;
  border-bottom: var(--pixel-border) solid var(--crafting-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(42, 20, 84, 0.5);
  flex-shrink: 0;
}

.details-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--crafting-text);
}

.close-details-btn {
  background: transparent;
  border: var(--pixel-border) solid var(--crafting-border);
  color: var(--crafting-text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.recipe-details{
  flex: 1;
  padding:16px;
  overflow:auto;
  min-width:0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header dentro de detalles */
.recipe-header{
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--crafting-border);
}

.recipe-result-img{
  width:80px;
  height:80px;
  object-fit:contain;
  image-rendering:pixelated;
  border-radius:8px;
  border:2px solid var(--crafting-border);
  background:rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.recipe-info{
  flex:1;
}

.recipe-name{
  font-size:18px;
  margin:0 0 8px 0;
  color: var(--crafting-text);
}

.recipe-description{
  font-size:11px;
  color:var(--crafting-text-secondary);
  line-height:1.5;
  margin-bottom: 8px;
}

.recipe-meta{
  display:flex;
  gap:12px;
}

.recipe-level,
.recipe-category{
  font-size:12px;
  color:var(--crafting-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Recursos */
.required-resources{
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 16px;
  border: var(--pixel-border) solid var(--crafting-border);
}

.required-resources h4{
  margin:0 0 12px 0;
  font-size:14px;
  color: var(--crafting-light);
}

.resources-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:10px;
}

.resource-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:rgba(0,0,0,0.2);
  border-radius:8px;
  transition: all 0.2s ease;
}

.resource-item.has-enough{
  box-shadow:0 4px 8px rgba(0,0,0,0.25);
  border-color:rgba(58,200,105,0.35);
  background: rgba(58,200,105,0.1);
}

.resource-item.not-enough{
  opacity:0.85;
  border-color:rgba(255,82,82,0.25);
  background: rgba(255,82,82,0.1);
}

.resource-img{
  width:44px;
  height:44px;
  object-fit:contain;
  image-rendering:pixelated;
  border-radius:6px;
  background:rgba(0,0,0,0.3);
  border: 1px solid var(--crafting-border);
}

.resource-info{
  flex: 1;
}

.resource-name{
  font-size:13px;
  margin:0 0 4px 0;
}

.resource-amount{
  font-size:12px;
  color:var(--crafting-text-secondary);
}

/* Recursos opcionales */
.optional-resources{
  margin-top:16px;
  padding-top:12px;
  border-top:1px dashed var(--crafting-border);
}

.optional-resources h4{
  margin:0 0 12px 0;
  font-size:14px;
  color: var(--crafting-light);
}

.optional-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:10px;
}

.optional-item{
  padding:10px;
  border:var(--pixel-border) solid var(--crafting-border);
  border-radius:8px;
  cursor:pointer;
  background:rgba(106,17,203,0.12);
  transition: all 0.2s ease;
}

.optional-item:hover{
  background:rgba(106,17,203,0.2);
}

.optional-item.selected{
  background:linear-gradient(90deg,var(--crafting-accent),var(--crafting-light));
  color:var(--crafting-dark);
  box-shadow: 0 4px 8px rgba(255,110,199,0.3);
}

/* Controles de cantidad */
.crafting-quantity{
  margin-top:16px;
  padding: 16px;
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  border: var(--pixel-border) solid var(--crafting-border);
}

.crafting-quantity h4{
  margin:0 0 12px 0;
  font-size:14px;
  color: var(--crafting-light);
}

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

.qty-btn{
  min-width:48px;
  height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  border-radius:8px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:linear-gradient(180deg,var(--crafting-secondary),var(--crafting-dark));
  cursor:pointer;
  user-select: none;
  color: var(--crafting-text);
}

.qty-btn:hover{
  background:linear-gradient(180deg,var(--crafting-light),var(--crafting-secondary));
}

.qty-input{
  width:80px;
  padding:12px;
  border-radius:8px;
  border:var(--pixel-border) solid var(--crafting-border);
  text-align:center;
  background:rgba(255,255,255,0.03);
  font-size:16px;
  color:var(--crafting-text);
  font-family: "Press Start 2P", monospace;
}

.max-possible{
  margin-left:auto;
  font-size:12px;
  color:var(--crafting-text-secondary);
}

/* Acciones de crafteo */
.crafting-actions{
  text-align:center;
  margin-top: 16px;
}

.craft-btn{
  width:100%;
  padding:16px 20px;
  font-size:16px;
  border-radius:10px;
  background:linear-gradient(180deg,var(--crafting-primary),var(--crafting-dark));
  border:var(--pixel-border) solid var(--crafting-border);
  cursor:pointer;
  color:var(--crafting-text);
  font-family: "Press Start 2P", monospace;
  transition: all 0.2s ease;
}

.craft-btn:hover:not(:disabled){
  background:linear-gradient(180deg,var(--crafting-light),var(--crafting-primary));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(106,17,203,0.4);
}

.craft-btn:disabled{
  opacity:0.55;
  cursor:not-allowed;
}

.crafting-feedback{
  min-height:24px;
  margin-top:12px;
  font-size:13px;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
}

.feedback-success{
  color: #4ade80;
  background: rgba(74,222,128,0.1);
}

.feedback-error{
  color: #f87171;
  background: rgba(248,113,113,0.1);
}

/* Vista previa del inventario */
.player-inventory-preview{
  margin-top:16px;
  padding:16px;
  border-radius:8px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:rgba(0,0,0,0.12);
}

.player-inventory-preview h4{
  margin:0 0 12px 0;
  font-size:14px;
  color: var(--crafting-light);
}

.inventory-items{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  max-height:140px;
  overflow:auto;
}

.inventory-item{
  width:64px;
  height:64px;
  border-radius:8px;
  border:var(--pixel-border) solid var(--crafting-border);
  background:rgba(0,0,0,0.18);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

.inventory-img{
  width:48px;
  height:48px;
  object-fit:contain;
  image-rendering:pixelated;
}

.inventory-count{
  position:absolute;
  right:4px;
  bottom:4px;
  background:var(--crafting-dark);
  color:#fff;
  padding:2px 6px;
  border-radius:6px;
  font-size:11px;
}

/* Pie de estado */
.crafting-status{
  display:flex;
  justify-content:space-between;
  padding:12px 16px;
  border-top:var(--pixel-border) solid var(--crafting-border);
  background:linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.12));
  gap:16px;
  flex-shrink: 0;
}

.status-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  flex: 1;
}

.status-label{
  font-size:11px;
  color:var(--crafting-text-secondary);
  margin-bottom: 4px;
}

.status-value{
  font-size:14px;
  font-weight:700;
  color: var(--crafting-text);
}

/* Estado vacío */
.empty-state{
  text-align:center;
  color:var(--crafting-text-secondary);
  padding:20px;
  border-radius:8px;
  background: rgba(0,0,0,0.1);
  margin: 20px;
}

.sr-only{
  position:absolute!important;
  height:1px;
  width:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}

/* ================================
   OVERLAY PARA MÓVIL
   ================================ */
.recipe-overlay{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:95%;
  max-width:500px;
  height:90%;
  background:linear-gradient(180deg, rgba(22,8,40,0.98), rgba(48,14,82,0.98));
  border:var(--pixel-border) solid var(--crafting-border);
  z-index:10001;
  display:none;
  flex-direction:column;
  border-radius:12px;
  box-shadow:0 12px 40px rgba(0,0,0,0.8);
  overflow:hidden;
}

.recipe-overlay.hidden{
  display:none !important;
}

.recipe-overlay.visible{
  display:flex !important;
}

.overlay-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:var(--pixel-border) solid var(--crafting-border);
  background:linear-gradient(90deg,var(--crafting-primary),var(--crafting-secondary));
  flex-shrink: 0;
}

.overlay-back-btn,
.overlay-close-btn{
  background:transparent;
  border:var(--pixel-border) solid var(--crafting-border);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  color:var(--crafting-text);
  user-select: none;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}

.overlay-back-btn:hover,
.overlay-close-btn:hover{
  background:rgba(255,255,255,0.1);
}

.overlay-content{
  flex: 1;
  padding:16px;
  overflow:auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ================================
   RESPONSIVE - DISEÑO ADAPTATIVO
   ================================ */

/* PC - Mostrar lista y detalles lado a lado */
@media (min-width: 901px){
  .crafting-sidebar{
    width: 40%;
    border-right: var(--pixel-border) solid var(--crafting-border);
  }
  
  .crafting-details{
    width: 60%;
    display: none; /* Se mostrará con JS al hacer doble click */
  }
  
  .crafting-details.visible{
    display: flex;
  }
  
  .recipe-overlay{
    display: none !important;
  }
  
  /* Ocultar botón de cerrar detalles en PC si se prefiere */
  .close-details-btn {
    display: none;
  }
}

/* TABLET - Diseño intermedio */
@media (max-width: 900px) and (min-width: 601px){
  .crafting-container{
    width: 95%;
    height: 95vh;
  }
  
  .crafting-sidebar{
    width: 50%;
  }
  
  .crafting-details{
    width: 50%;
    display: none;
  }
  
  .crafting-details.visible{
    display: flex;
  }
  
  .recipe-overlay{
    display: none !important;
  }
}

/* MÓVIL - Solo lista, detalles en overlay */
@media (max-width: 900px){
  .crafting-container{
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
    border-radius: 0;
  }
  
  .crafting-main{
    flex-direction: column;
  }
  
  .crafting-sidebar{
    width: 100%;
    flex: 1;
    min-height: 0;
  }
  
  .crafting-details{
    display: none !important;
  }
  
  .recipes-list{
    flex: 1;
    min-height: 300px;
  }
  
  .recipe-item{
    min-height: 80px;
    padding: 16px;
  }
  
  .recipe-item-img{
    width: 60px;
    height: 60px;
  }
  
  .recipe-item-name{
    font-size: 13px;
  }
  
  .recipe-overlay.visible{
    display: flex !important;
  }
}

/* MÓVILES MUY PEQUEÑOS */
@media (max-width: 480px){
  .crafting-container{
    padding: 0;
  }
  
  .crafting-header{
    padding: 10px 12px;
  }
  
  .crafting-title{
    font-size: 14px;
  }
  
  .recipes-list{
    padding: 10px 12px;
    gap: 8px;
  }
  
  .recipe-item{
    min-height: 70px;
    padding: 12px;
  }
  
  .recipe-item-img{
    width: 50px;
    height: 50px;
  }
  
  .recipe-item-name{
    font-size: 12px;
  }
  
  .recipe-item-meta{
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .recipe-overlay{
    width: 98%;
    height: 95%;
  }
}

/* ================================
   SCROLLBAR PERSONALIZADA
   ================================ */
.recipes-list::-webkit-scrollbar,
.overlay-content::-webkit-scrollbar,
.inventory-items::-webkit-scrollbar,
.recipe-details::-webkit-scrollbar {
  width: 10px;
}

.recipes-list::-webkit-scrollbar-track,
.overlay-content::-webkit-scrollbar-track,
.inventory-items::-webkit-scrollbar-track,
.recipe-details::-webkit-scrollbar-track {
  background: rgba(58,28,107,0.2);
  border-radius: 5px;
}

.recipes-list::-webkit-scrollbar-thumb,
.overlay-content::-webkit-scrollbar-thumb,
.inventory-items::-webkit-scrollbar-thumb,
.recipe-details::-webkit-scrollbar-thumb {
  background: var(--crafting-light);
  border-radius: 5px;
  border: 2px solid rgba(58,28,107,0.2);
}

.recipes-list::-webkit-scrollbar-thumb:hover,
.overlay-content::-webkit-scrollbar-thumb:hover,
.inventory-items::-webkit-scrollbar-thumb:hover,
.recipe-details::-webkit-scrollbar-thumb:hover {
  background: var(--crafting-accent);
}

/* ================================
   ANIMACIONES
   ================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.recipe-item {
  animation: fadeIn 0.3s ease-out;
}

.crafting-container {
  animation: fadeIn 0.4s ease-out;
}










.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Sin backdrop-filter: no pausa el juego en móvil/PC */
    background-color: rgba(0, 10, 30, 0.80);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dashboard-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dashboard-container {
    width: 95%;
    max-width: 500px;
    max-height: 85vh;
    background: linear-gradient(160deg, #0a1628 0%, #0d2040 40%, #0a2550 100%);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 0 0 1px rgba(64,160,255,0.25), 0 8px 32px rgba(0,80,180,0.45), inset 0 1px 0 rgba(100,180,255,0.15);
    overflow-y: auto;
    position: relative;
    border: 1.5px solid rgba(64,160,255,0.35);
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Quitar will-change/transform3d que causan compositing y congelan el juego */
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(64,160,255,0.25);
}

.dashboard-title {
    color: #a8d8ff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(64,160,255,0.6);
}

.close-btn {
    background: rgba(64,160,255,0.12);
    border: 1px solid rgba(64,160,255,0.3);
    color: #a8d8ff;
    font-size: 20px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

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

.section {
    background: rgba(30, 80, 140, 0.20);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(64,160,255,0.20);
}

.section-title {
    color: #7ec8ff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.section-title::before {
    content: "▸";
    color: #40a0ff;
    font-size: 14px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.nick-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid rgba(64,160,255,0.30);
    background: rgba(0, 20, 50, 0.60);
    border-radius: 8px;
    color: #d0eaff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nick-input:focus {
    outline: none;
    border-color: #40a0ff;
    box-shadow: 0 0 0 2px rgba(64,160,255,0.20);
}

.nick-input::placeholder {
    color: rgba(100,170,255,0.50);
}

.action-btn, .secondary-btn, .save-btn, .language-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn {
    background: linear-gradient(135deg, #1a6fd4, #0a4aaa);
    color: #d0eaff;
    border: 1px solid rgba(64,160,255,0.40);
    min-width: 90px;
}

.action-btn:hover {
    background: linear-gradient(135deg, #2280e8, #1060cc);
    box-shadow: 0 4px 12px rgba(30,100,220,0.40);
}

.secondary-btn {
    background: rgba(64,160,255,0.10);
    color: #a8d8ff;
    border: 1px solid rgba(64,160,255,0.25);
}

.secondary-btn:hover {
    background: rgba(64,160,255,0.20);
}

.info-text {
    color: rgba(140,200,255,0.75);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 6px;
}

.avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a3060, #0d4080);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(64,160,255,0.50);
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 16px rgba(30,100,220,0.35);
}

.avatar-text {
    color: #7ec8ff;
    font-size: 12px;
    font-weight: 600;
}

.avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 160px;
}

.skin-preview {
    width: 100%;
    height: 90px;
    background: rgba(0,20,50,0.50);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(100,180,255,0.60);
    font-size: 13px;
    margin-top: 8px;
    border: 1px solid rgba(64,160,255,0.15);
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.language-btn {
    background: rgba(30,70,130,0.30);
    color: #a8d8ff;
    padding: 11px;
    border: 1px solid rgba(64,160,255,0.20);
    text-align: center;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.language-btn:hover, .language-btn.active {
    background: linear-gradient(135deg, #1a6fd4, #0a4aaa);
    color: #d0eaff;
    border-color: rgba(64,160,255,0.60);
    box-shadow: 0 3px 10px rgba(30,100,220,0.35);
}

.save-btn {
    width: 100%;
    background: linear-gradient(135deg, #1a7fd4, #0a55b0);
    color: #d0eaff;
    padding: 13px;
    font-size: 14px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid rgba(64,160,255,0.40);
    border-radius: 8px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #2290e8, #1060cc);
    box-shadow: 0 6px 16px rgba(30,100,220,0.45);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 20px;
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 85vh;
    }
    
    .dashboard-title {
        font-size: 24px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-btn, .secondary-btn {
        width: 100%;
    }
    
    .avatar-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .avatar-controls {
        width: 100%;
    }
    
    .languages-grid {
        grid-template-columns: 1fr;
    }
    
    .language-btn {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .dashboard-title {
        font-size: 22px;
    }
    
    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Scrollbar personalizada */
.dashboard-container::-webkit-scrollbar {
    width: 8px;
}

.dashboard-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.dashboard-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.dashboard-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}





/* Estilos para la tienda RPG - VERSIÓN 6.3 CORREGIDA PARA PC */
:root {
  --color-primary: #6a11cb;
  --color-secondary: #2575fc;
  --color-accent: #9d4edd;
  --color-success: #00b09b;
  --color-warning: #ffd700;
  --color-danger: #ff4757;
  --color-text: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-bg-dark: #1a0b30;
  --color-bg-light: #2a1454;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

.tienda-hub-hidden {
  display: none !important;
}

.tienda-overlay-hidden {
  display: none !important;
}

#tienda-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  /*z-index: 900;*/
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pcModalSlide {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes itemPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Panel principal */
#tienda-hub {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  pointer-events: none;
}

.tienda-panel {
  width: 90%;
  max-width: 1000px;
  height: 75vh;
  max-height: 700px;
  background: linear-gradient(135deg, 
    #4a00e0 0%, 
    var(--color-primary) 30%, 
    #8a2be2 70%, 
    var(--color-secondary) 100%);
  border-radius: var(--border-radius);
  border: 3px solid var(--color-accent);
  box-shadow: 0 15px 40px rgba(106, 17, 203, 0.6),
              0 0 30px rgba(157, 78, 221, 0.4),
              inset 0 0 15px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0.95);
}

/* Header de la tienda */
.tienda-header {
  background: linear-gradient(to right, 
    #4a00e0 0%, 
    #6a11cb 50%, 
    var(--color-accent) 100%);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--color-accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10;
}

.tienda-title {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.tienda-title h2 {
  color: var(--color-text);
  margin: 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.tienda-icon {
  margin-right: 8px;
  font-size: 1.2rem;
}

.tienda-saldo {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-warning);
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.8rem;
  border: 2px solid rgba(255, 215, 0, 0.4);
  white-space: nowrap;
  backdrop-filter: blur(5px);
}

.moneda-icon {
  width: 16px;
  height: 16px;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
  object-fit: contain;
}

.cerrar-tienda {
  background: var(--color-danger);
  color: var(--color-text);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 3px 8px rgba(255, 71, 87, 0.5);
  flex-shrink: 0;
}

.cerrar-tienda:hover {
  background: #ff3838;
  transform: scale(1.05);
  box-shadow: 0 5px 12px rgba(255, 71, 87, 0.7);
}

/* Controles de la tienda */
.tienda-controls {
  background: linear-gradient(to bottom, 
    rgba(106, 17, 203, 0.9), 
    rgba(74, 0, 224, 0.9));
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 9;
}

.search-container {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.tienda-search {
  width: 100%;
  padding: 10px 15px 10px 40px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all var(--transition-speed) ease;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.tienda-search:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.tienda-search::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  pointer-events: none;
}

.tienda-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tienda-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 120px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all var(--transition-speed) ease;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.tienda-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
}

.tienda-select option {
  background: #4a00e0;
  color: var(--color-text);
}

/* Contenido principal */
.tienda-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 15px;
  gap: 15px;
  min-height: 0;
}

/* Panel de items */
.items-panel {
  flex: 1;
  background: linear-gradient(135deg, 
    rgba(42, 20, 84, 0.95) 0%, 
    rgba(74, 0, 224, 0.95) 100%);
  border-radius: var(--border-radius);
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  flex: 1;
  align-content: start;
}

.item-card {
  background: linear-gradient(135deg, 
    rgba(106, 17, 203, 0.6) 0%, 
    rgba(138, 43, 226, 0.6) 100%);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  user-select: none;
  min-height: 130px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.item-card:hover {
  background: linear-gradient(135deg, 
    rgba(106, 17, 203, 0.8) 0%, 
    rgba(138, 43, 226, 0.8) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.item-card.selected {
  background: linear-gradient(135deg, 
    rgba(157, 78, 221, 0.7) 0%, 
    rgba(180, 110, 255, 0.7) 100%);
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(157, 78, 221, 0.6),
              inset 0 0 8px rgba(255, 255, 255, 0.2);
}

.item-card.limited {
  border: 2px dashed var(--color-warning);
  position: relative;
}

.item-card.limited::after {
  content: "LIMITED";
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.95) 0%, 
    rgba(255, 200, 0, 0.95) 100%);
  color: #000;
  font-size: 0.5rem;
  padding: 2px 5px;
  border-radius: 8px;
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
}

.item-card.sold-out::before {
  content: "SOLD OUT";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-danger);
  font-weight: bold;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: '"PressStart2P"', monospace;
  z-index: 2;
}

.item-card.bought {
  animation: itemPulse 0.5s ease;
}

.item-image {
  width: 55px;
  height: 55px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.item-name {
  color: var(--color-text);
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 6px;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  pointer-events: none;
}

.item-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 0.8rem;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.item-limit {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  text-align: center;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Panel lateral para PC - SIMPLIFICADO */
.sidebar-panel {
  width: 280px;
  background: linear-gradient(135deg, 
    rgba(42, 20, 84, 0.95) 0%, 
    rgba(74, 0, 224, 0.95) 100%);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.sidebar-tabs {
  display: flex;
  background: linear-gradient(to right, 
    rgba(74, 0, 224, 0.8), 
    rgba(106, 17, 203, 0.8));
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  position: relative;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-tab.active {
  color: var(--color-text);
  background: linear-gradient(to bottom, 
    rgba(157, 78, 221, 0.5), 
    rgba(138, 43, 226, 0.5));
}

.sidebar-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

/* CONTENIDO DE PESTAÑAS - CON MEJOR SCROLL */
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
}

/* Detalles simplificados (PC) - SOLO IMAGEN, NOMBRE Y BOTÓN */
.item-detail-simple {
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 20px;
  justify-content: center;
  align-items: center;
}

.detail-content-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.detail-header-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
}

.detail-image-simple {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  flex-shrink: 0;
}

.detail-title-simple {
  flex: 1;
  min-width: 0;
}

.detail-title-simple h3 {
  margin: 0 0 12px 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  color: var(--color-warning);
  word-wrap: break-word;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
}

.detail-price-simple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: bold;
  color: var(--color-warning);
  flex-wrap: wrap;
}

/* Botón de interactuar en PC */
.detail-actions-simple {
  width: 100%;
  margin-top: 20px;
}

.interact-btn-pc {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--color-accent), #8a2be2);
  border: none;
  border-radius: 10px;
  color: var(--color-text);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 12px rgba(157, 78, 221, 0.4);
}

.interact-btn-pc:hover:not(:disabled) {
  background: linear-gradient(135deg, #8a2be2, var(--color-accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(157, 78, 221, 0.6);
}

.interact-btn-pc:active:not(:disabled) {
  transform: translateY(-1px);
}

.interact-btn-pc:disabled {
  background: linear-gradient(135deg, #666, #888);
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none !important;
}

/* Modal para PC - Detalles completos */
.pc-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1002;
  pointer-events: none;
}

.pc-modal.hidden {
  display: none;
}

.pc-modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: linear-gradient(135deg, 
    #4a00e0 0%, 
    var(--color-primary) 30%, 
    #8a2be2 70%, 
    var(--color-secondary) 100%);
  border-radius: var(--border-radius);
  border: 3px solid var(--color-accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  animation: pcModalSlide 0.3s ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pc-modal-header {
  background: linear-gradient(to right, #4a00e0, var(--color-accent));
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--color-accent);
  flex-shrink: 0;
}

.pc-modal-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.pc-modal-title h3 {
  color: var(--color-text);
  margin: 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 1.1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.3;
}

.pc-modal-price {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 1.2rem;
  font-family: '"PressStart2P"', monospace;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.pc-modal-close {
  background: var(--color-danger);
  color: var(--color-text);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 3px 8px rgba(255, 71, 87, 0.5);
  flex-shrink: 0;
  margin-left: 20px;
}

.pc-modal-close:hover {
  background: #ff3838;
  transform: scale(1.05);
  box-shadow: 0 5px 12px rgba(255, 71, 87, 0.7);
}

.pc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  display: flex;
  gap: 25px;
  min-height: 0;
}

.pc-modal-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.pc-item-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  flex-shrink: 0;
}

.pc-item-category {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.category-label {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.category-value {
  color: var(--color-text);
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.pc-modal-right {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pc-item-description {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-item-description h4 {
  color: var(--color-warning);
  margin: 0 0 15px 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.pc-item-description p {
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-size: 0.95rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.pc-item-stats {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-item-stats h4 {
  color: var(--color-warning);
  margin: 0 0 15px 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.pc-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.pc-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-stat-label {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-align: center;
}

.pc-stat-value {
  color: var(--color-text);
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.pc-quantity-controls {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pc-quantity-title {
  color: var(--color-text);
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
}

.pc-quantity-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.pc-quantity-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  user-select: none;
}

.pc-quantity-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--color-accent);
}

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

.pc-quantity-input {
  width: 80px;
  height: 50px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 1.5rem;
  font-family: '"PressStart2P"', monospace;
  box-sizing: border-box;
}

.pc-quantity-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.3);
}

.pc-max-available {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 5px;
}

.pc-max-available span {
  color: var(--color-warning);
  font-weight: bold;
}

.pc-action-section {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pc-action-total {
  text-align: center;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 10px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.pc-action-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--color-success), #96c93d);
  border: none;
  border-radius: 10px;
  color: var(--color-text);
  font-family: '"PressStart2P"', monospace;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 12px rgba(0, 176, 155, 0.4);
}

.pc-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 176, 155, 0.6);
}

.pc-action-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.pc-action-btn:disabled {
  background: linear-gradient(135deg, #666, #888);
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none !important;
}

.pc-action-icon {
  font-size: 1.2rem;
}

/* Historial en PC */
.historial-container-pc {
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.historial-container-pc h4 {
  margin: 15px 15px 12px 15px;
  color: var(--color-warning);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.8rem;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.historial-list-pc {
  flex: 1;
  overflow-y: auto;
  padding: 0 15px 15px 15px;
  min-height: 0;
}

.historial-item-pc {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid;
  transition: all var(--transition-speed) ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.historial-item-pc:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.historial-item-pc.compra {
  border-left-color: var(--color-success);
}

.historial-item-pc.venta {
  border-left-color: var(--color-warning);
}

.historial-header-pc {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  align-items: center;
}

.historial-type-pc {
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.historial-time-pc {
  color: var(--color-text-secondary);
  font-size: 0.7rem;
}

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

.historial-img-pc {
  width: 35px;
  height: 35px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  flex-shrink: 0;
}

.historial-details-pc {
  flex: 1;
  min-width: 0;
}

.historial-name-pc {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.historial-qty-pc {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.historial-price-pc {
  color: var(--color-warning);
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.historial-empty-pc {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 40px 20px;
  font-style: italic;
  font-size: 0.9rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.clear-btn-pc {
  width: calc(100% - 30px);
  margin: 0 15px 15px 15px;
  padding: 12px;
  background: rgba(255, 71, 87, 0.25);
  border: 2px solid var(--color-danger);
  border-radius: 8px;
  color: var(--color-danger);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  flex-shrink: 0;
}

.clear-btn-pc:hover {
  background: rgba(255, 71, 87, 0.35);
  transform: translateY(-2px);
}

.clear-btn-pc:active {
  transform: translateY(0);
}

/* Footer de la tienda */
.tienda-footer {
  background: linear-gradient(to right, 
    rgba(74, 0, 224, 0.9), 
    rgba(106, 17, 203, 0.9));
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 8;
  flex-shrink: 0;
}

.tienda-info {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.divider {
  color: rgba(255, 255, 255, 0.5);
}

.help-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  flex-shrink: 0;
}

.help-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--color-accent);
  transform: scale(1.05);
}

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

/* Modal para móvil */
.mobile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1001;
  pointer-events: none;
}

.mobile-modal.hidden {
  display: none;
}

.mobile-modal-content {
  width: 100%;
  max-height: 85vh;
  background: linear-gradient(135deg, 
    #4a00e0 0%, 
    var(--color-primary) 30%, 
    #8a2be2 70%, 
    var(--color-secondary) 100%);
  border-radius: 20px 20px 0 0;
  border: 3px solid var(--color-accent);
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  animation: modalSlide 0.3s ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-modal-header {
  background: linear-gradient(to right, #4a00e0, var(--color-accent));
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--color-accent);
  flex-shrink: 0;
}

.mobile-modal-header h3 {
  color: var(--color-text);
  margin: 0;
  font-family: '"PressStart2P"', monospace;
  font-size: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  flex: 1;
  text-align: center;
  padding-right: 25px;
  line-height: 1.3;
}

.mobile-modal-close {
  background: var(--color-danger);
  color: var(--color-text);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 3px 8px rgba(255, 71, 87, 0.5);
  flex-shrink: 0;
  z-index: 1;
}

.mobile-modal-close:hover {
  background: #ff3838;
  transform: scale(1.05);
}

.mobile-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.mobile-item-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.mobile-item-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
}

.mobile-item-price {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 1.3rem;
  font-family: '"PressStart2P"', monospace;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.mobile-item-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.mobile-item-desc {
  color: var(--color-text-secondary);
  line-height: 1.4;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.mobile-item-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-stat:last-child {
  border-bottom: none;
}

.mobile-stat-label {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.mobile-stat-value {
  color: var(--color-text);
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.85rem;
}

.mobile-quantity-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-quantity-title {
  color: var(--color-text);
  font-weight: bold;
  font-size: 1rem;
}

.mobile-quantity-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-quantity-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text);
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  user-select: none;
}

.mobile-quantity-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--color-accent);
}

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

.mobile-quantity-input {
  width: 70px;
  height: 50px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 1.5rem;
  font-family: '"PressStart2P"', monospace;
  box-sizing: border-box;
}

.mobile-quantity-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.3);
}

.mobile-action-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  flex-shrink: 0;
}

.mobile-action-total {
  text-align: center;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 10px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.mobile-action-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--color-success), #96c93d);
  border: none;
  border-radius: 12px;
  color: var(--color-text);
  font-family: '"PressStart2P"', monospace;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 12px rgba(0, 176, 155, 0.4);
}

.mobile-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 176, 155, 0.6);
}

.mobile-action-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.mobile-action-btn:disabled {
  background: linear-gradient(135deg, #666, #888);
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none !important;
}

.mobile-action-icon {
  font-size: 1.1rem;
}

/* Botón de historial en móvil */
.mobile-historial-btn-container {
  width: 100%;
  margin-top: 10px;
}

.mobile-historial-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  border: none;
  border-radius: 10px;
  color: var(--color-text);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(106, 17, 203, 0.4);
}

.mobile-historial-btn:hover {
  background: linear-gradient(135deg, #2575fc, #6a11cb);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(106, 17, 203, 0.6);
}

.mobile-historial-btn:active {
  transform: translateY(0);
}

/* Historial en móvil */
.historial-container-mobile {
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.historial-list-mobile {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  min-height: 0;
  max-height: 60vh;
}

.historial-item-mobile {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid;
  transition: all var(--transition-speed) ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.historial-item-mobile.compra {
  border-left-color: var(--color-success);
}

.historial-item-mobile.venta {
  border-left-color: var(--color-warning);
}

.historial-header-mobile {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  align-items: center;
}

.historial-type-mobile {
  font-weight: bold;
  font-family: '"PressStart2P"', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.historial-time-mobile {
  color: var(--color-text-secondary);
  font-size: 0.7rem;
}

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

.historial-img-mobile {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  flex-shrink: 0;
}

.historial-details-mobile {
  flex: 1;
  min-width: 0;
}

.historial-name-mobile {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.historial-qty-mobile {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.historial-price-mobile {
  color: var(--color-warning);
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.historial-empty-mobile {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 40px 20px;
  font-style: italic;
  font-size: 0.9rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.clear-btn-mobile {
  width: calc(100% - 20px);
  margin: 15px 10px 10px 10px;
  padding: 12px;
  background: rgba(255, 71, 87, 0.25);
  border: 2px solid var(--color-danger);
  border-radius: 8px;
  color: var(--color-danger);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  flex-shrink: 0;
}

.clear-btn-mobile:hover {
  background: rgba(255, 71, 87, 0.35);
  transform: translateY(-2px);
}

.clear-btn-mobile:active {
  transform: translateY(0);
}

/* Modal de ayuda */
.tienda-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1003;
  pointer-events: none;
}

.tienda-modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #4a00e0, var(--color-accent));
  border-radius: 15px;
  padding: 25px;
  max-width: 450px;
  width: 90%;
  color: var(--color-text);
  pointer-events: auto;
  border: 3px solid var(--color-accent);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  animation: modalSlide 0.3s ease;
  transform: scale(0.95);
}

.modal-content h3 {
  margin-top: 0;
  color: var(--color-warning);
  font-family: '"PressStart2P"', monospace;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.help-sections {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.help-section h4 {
  color: var(--color-warning);
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section ul {
  padding-left: 20px;
  margin: 0;
}

.help-section li {
  margin-bottom: 6px;
  line-height: 1.4;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.modal-close {
  width: 100%;
  padding: 12px;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  color: var(--color-text);
  font-family: '"PressStart2P"', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-close:hover {
  background: #8a2be2;
  transform: translateY(-2px);
}

.modal-close:active {
  transform: translateY(0);
}

/* Estados de carga y vacío */
.items-loading, .items-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-family: '"PressStart2P"', monospace;
  text-align: center;
  padding: 30px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Notificaciones de transacción */
.transaction-notification {
  position: fixed;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #4a00e0, var(--color-accent));
  color: var(--color-text);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1004;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--color-accent);
  max-width: 280px;
}

.transaction-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.transaction-notification.compra {
  border-color: var(--color-success);
}

.transaction-notification.venta {
  border-color: var(--color-warning);
}

.transaction-icon {
  font-size: 1.5rem;
}

.transaction-details {
  flex: 1;
}

.transaction-details strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.transaction-price {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-warning);
  font-weight: bold;
  font-size: 0.8rem;
}

.transaction-commission {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* RESPONSIVE DESIGN */
/* Pantallas pequeñas de PC (1024x800 y similares) */
@media (min-width: 769px) and (max-width: 1024px) {
  .tienda-panel {
    width: 95%;
    max-width: 900px;
    height: 85vh;
    max-height: 600px;
  }
  
  .sidebar-panel {
    width: 250px;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .tienda-title h2 {
    font-size: 0.9rem;
  }
  
  .tienda-saldo {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
  
  .pc-modal-content {
    max-width: 700px;
  }
  
  .pc-item-image {
    width: 180px;
    height: 180px;
  }
  
  .pc-stat-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* PC normal */
@media (min-width: 1025px) {
  .tienda-panel {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    max-height: 800px;
  }
  
  .tienda-content {
    flex-direction: row;
  }
  
  .items-panel {
    flex: 2;
  }
  
  .sidebar-panel {
    display: flex;
  }
  
  .mobile-modal {
    display: none !important;
  }
  
  .pc-modal {
    display: flex;
  }
  
  .pc-only {
    display: flex !important;
  }
  
  .mobile-only {
    display: none !important;
  }
}

/* MÓVIL - Vista única con modal */
@media (max-width: 768px) {
  .tienda-panel {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    transform: scale(1);
  }
  
  .tienda-content {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  
  .sidebar-panel {
    display: none !important;
  }
  
  .items-panel {
    flex: 1;
    padding: 10px;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .tienda-title h2 {
    font-size: 0.9rem;
    line-height: 1.2;
  }
  
  .tienda-saldo {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
  
  .tienda-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 15px;
    gap: 10px;
  }
  
  .search-container {
    min-width: auto;
  }
  
  .tienda-search {
    padding: 10px 15px 10px 40px;
    font-size: 16px;
  }
  
  .tienda-filters {
    width: 100%;
  }
  
  .tienda-select {
    flex: 1;
    min-width: auto;
    padding: 8px 12px;
    font-size: 16px;
  }
  
  .item-card {
    padding: 10px;
    min-height: 120px;
  }
  
  .item-image {
    width: 50px;
    height: 50px;
  }
  
  .item-name {
    font-size: 0.7rem;
    min-height: 1.8em;
  }
  
  .item-price {
    font-size: 0.7rem;
  }
  
  .tienda-footer {
    padding: 8px 15px;
  }
  
  .tienda-info {
    font-size: 0.7rem;
    gap: 10px;
  }
  
  .help-btn {
    width: 24px;
    height: 24px;
  }
  
  .mobile-modal {
    display: flex;
  }
  
  .pc-modal {
    display: none !important;
  }
  
  .pc-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  /* DOBLE TAP PARA MÓVIL */
  .item-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  .mobile-modal-body {
    padding: 15px;
    gap: 15px;
  }
  
  .mobile-item-image {
    width: 100px;
    height: 100px;
  }
  
  .mobile-item-price {
    font-size: 1.2rem;
  }
  
  /* Historial en móvil */
  .historial-list-mobile {
    max-height: 50vh;
  }
  
  .historial-item-mobile {
    padding: 10px;
  }
  
  .historial-img-mobile {
    width: 35px;
    height: 35px;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
  }
  
  .item-card {
    padding: 8px;
    min-height: 110px;
  }
  
  .item-image {
    width: 45px;
    height: 45px;
  }
  
  .item-name {
    font-size: 0.65rem;
  }
  
  .tienda-title h2 {
    font-size: 0.8rem;
  }
  
  .tienda-icon {
    font-size: 1rem;
  }
  
  .mobile-modal-header h3 {
    font-size: 0.9rem;
    padding-right: 20px;
  }
  
  .mobile-modal-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  
  .mobile-item-image {
    width: 85px;
    height: 85px;
  }
  
  .mobile-item-price {
    font-size: 1rem;
  }
  
  .mobile-quantity-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }
  
  .mobile-quantity-input {
    width: 60px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .historial-list-mobile {
    max-height: 45vh;
  }
}

/* Dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .tienda-search,
  .tienda-select,
  .mobile-quantity-btn,
  .mobile-quantity-input,
  .pc-quantity-btn,
  .pc-quantity-input {
    min-height: 44px;
  }
  
  .mobile-action-btn,
  .pc-action-btn,
  .interact-btn-pc {
    min-height: 50px;
  }
  
  .item-card {
    min-height: 130px;
  }
  
  .tienda-controls {
    gap: 10px;
  }
  
  .items-grid {
    gap: 10px;
  }
}

/* Scrollbar personalizada */
.items-panel::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.historial-list-pc::-webkit-scrollbar,
.mobile-modal-body::-webkit-scrollbar,
.historial-list-mobile::-webkit-scrollbar,
.pc-modal-body::-webkit-scrollbar {
  width: 8px;
}

.items-panel::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track,
.historial-list-pc::-webkit-scrollbar-track,
.mobile-modal-body::-webkit-scrollbar-track,
.historial-list-mobile::-webkit-scrollbar-track,
.pc-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.items-panel::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb,
.historial-list-pc::-webkit-scrollbar-thumb,
.mobile-modal-body::-webkit-scrollbar-thumb,
.historial-list-mobile::-webkit-scrollbar-thumb,
.pc-modal-body::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 4px;
}

.items-panel::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover,
.historial-list-pc::-webkit-scrollbar-thumb:hover,
.mobile-modal-body::-webkit-scrollbar-thumb:hover,
.historial-list-mobile::-webkit-scrollbar-thumb:hover,
.pc-modal-body::-webkit-scrollbar-thumb:hover {
  background: #8a2be2;
}







/* Hub de Basura - SIN FONDO NEGRO */
.trash-hub-hidden,
.trash-quantity-hidden {
  display: none !important;
}

.trash-hub-visible,
.trash-quantity-visible {
  display: flex !important;
}

#trash-hub,
#trash-quantity-selector {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

#trash-quantity-selector {
  z-index: 1001;
}

.trash-hub-content,
.trash-quantity-content {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  border-radius: 15px;
  padding: 25px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 3px solid #7f8c8d;
  position: relative;
  pointer-events: auto;
  animation: trashHubAppear 0.3s ease-out;
  z-index: 10002;
}

.trash-quantity-content {
  max-width: 400px;
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

@keyframes trashHubAppear {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.trash-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #7f8c8d;
  padding-bottom: 15px;
}

.trash-hub-title {
  color: #ecf0f1;
  font-family: 'PressStart2P', cursive;
  font-size: 1.4rem;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.trash-hub-close-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'PressStart2P', cursive;
}

.trash-hub-close-btn:hover {
  background: #c0392b;
  transform: scale(1.1);
}

.trash-hub-info {
  background-color: rgba(52, 73, 94, 0.7);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 25px;
  text-align: center;
}

.trash-hub-info p {
  color: #bdc3c7;
  font-family: Arial, sans-serif;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.trash-slots-container {
  margin-bottom: 25px;
}

.trash-slots-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.trash-slot {
  width: 80px;
  height: 80px;
  background-color: rgba(44, 62, 80, 0.8);
  border: 3px solid #7f8c8d;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trash-slot:hover {
  border-color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.1);
  transform: scale(1.05);
}

.trash-slot.has-item {
  border: 3px solid #e74c3c;
  background-color: rgba(231, 76, 60, 0.15);
}

.trash-slot-item {
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
  image-rendering: pixelated;
}

.trash-slot-quantity {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(231, 76, 60, 0.9);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'PressStart2P', cursive;
  font-size: 0.7rem;
  z-index: 3;
}

.trash-slot-item-name {
  position: absolute;
  top: -25px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  display: none;
  font-family: Arial, sans-serif;
  z-index: 4;
}

.trash-slot:hover .trash-slot-item-name {
  display: block;
}

.trash-slot-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.trash-slot.has-item .trash-slot-remove {
  display: flex;
}

.trash-slot-remove:hover {
  background: #c0392b;
  transform: scale(1.2);
}

.trash-hub-footer {
  display: flex;
  justify-content: center;
}

.trash-confirm-btn {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 15px 30px;
  font-family: 'PressStart2P', cursive;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.trash-confirm-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.trash-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Selector de cantidad */
#trash-quantity-title {
  color: #ecf0f1;
  font-family: 'PressStart2P', cursive;
  font-size: 1rem;
  margin: 0 0 20px 0;
  text-align: center;
}

.trash-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.trash-quantity-btn {
  width: 50px;
  height: 50px;
  background: #34495e;
  color: white;
  border: 2px solid #7f8c8d;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'PressStart2P', cursive;
}

.trash-quantity-btn:hover {
  background: #2c3e50;
  transform: scale(1.1);
}

.trash-quantity-btn.minus:hover {
  background: #e74c3c;
}

.trash-quantity-btn.plus:hover {
  background: #2ecc71;
}

.trash-quantity-display {
  font-size: 2rem;
  color: white;
  font-family: 'PressStart2P', cursive;
  min-width: 60px;
  text-align: center;
}

.trash-quantity-range {
  margin: 25px 0;
}

.trash-quantity-slider {
  width: 100%;
  height: 25px;
  background: #34495e;
  outline: none;
  border-radius: 15px;
  -webkit-appearance: none;
}

.trash-quantity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 35px;
  height: 35px;
  background: #e74c3c;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
}

.trash-quantity-slider::-moz-range-thumb {
  width: 35px;
  height: 35px;
  background: #e74c3c;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
}

.trash-quantity-max {
  display: block;
  text-align: center;
  color: #bdc3c7;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  margin-top: 5px;
}

.trash-quantity-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

.trash-quantity-action-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  font-family: 'PressStart2P', cursive;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.trash-quantity-action-btn.cancel {
  background: #95a5a6;
  color: white;
}

.trash-quantity-action-btn.cancel:hover {
  background: #7f8c8d;
  transform: translateY(-2px);
}

.trash-quantity-action-btn.confirm {
  background: #2ecc71;
  color: white;
}

.trash-quantity-action-btn.confirm:hover {
  background: #27ae60;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .trash-hub-content,
  .trash-quantity-content {
    width: 95%;
    padding: 20px;
  }
  
  .trash-slot {
    width: 70px;
    height: 70px;
  }
  
  .trash-hub-title {
    font-size: 1.1rem;
  }
  
  .trash-confirm-btn {
    padding: 12px 24px;
    font-size: 0.8rem;
  }
  
  .trash-quantity-controls {
    gap: 10px;
  }
  
  .trash-quantity-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .trash-quantity-display {
    font-size: 1.5rem;
  }
  
  .trash-quantity-action-btn {
    padding: 10px 20px;
    font-size: 0.7rem;
    min-width: 100px;
  }
}






/* Estilos para todos los paneles arrastrables */
[data-draggable="true"] {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.95);
  border: 2px solid #ffffff;
  border-radius: 8px;
  padding: 15px;
  pointer-events: auto;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  min-width: 200px;
  min-height: 150px;
  resize: both;
  overflow: auto;
}

/* Estilo para el panel activo (el que se está moviendo) */
[data-draggable="true"].active {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8) !important;
}

/* Asegurar que el contenido sea interactivo */
[data-draggable="true"] * {
  pointer-events: auto;
  user-select: none;
}

/* Evitar que los botones dentro del panel sean arrastrables */
[data-draggable="true"] button {
  /*cursor: pointer;*/
}
















html,body { 
  height:100%;
  width: 100%;
  margin:0;
  background:#071124;
  overflow:hidden;
  -webkit-tap-highlight-color:transparent; 
  
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}


/* tx-hub: contenedor lateral desplegable */
#tx-hub {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  background: linear-gradient(160deg,#0a1628 0%,#0d2040 50%,#0a2550 100%);
  border: 1.5px solid rgba(64,160,255,0.35);
  color: #d0eaff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.20), 0 12px 40px rgba(0,60,160,0.55);
  font-family: system-ui, Arial, sans-serif;
  z-index: 10000;
}

/* item */
.tx-item {
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

/* status indicators */
.tx-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tx-status.pending { background: #f59e0b; }
.tx-status.sent    { background: #3b82f6; }
.tx-status.confirmed{ background: #10b981; }
.tx-status.failed  { background: #ef4444; }

.tx-body { flex:1; }
.tx-hash { font-family: monospace; font-size: 12px; opacity: 0.9; }

/* Panel */
.hud-panel_1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: rgb(0 0 0 / 78%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  color: white;
  border: 2px solid white;
  border-radius: 10px;
  padding: 20px;
  z-index: 1000;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /*cursor: default;*/
  user-select: none;
}

/* oculto por defecto */
.hidden_1 { display: none !important; }

/* título */
.hud-panel_1 .hud-title_1 { text-align:center; margin:0; font-size:22px; }

/* search */
.hud-search_1 { display:flex; justify-content:center; }
.hud-search_1 input {
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #666;
  background: #111;
  color: #fff;
  outline: none;
}

/* lista */
.lista-estadisticas_1 {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
  gap: 10px;
  max-height: 260px;
  overflow:auto;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #333;
  background: rgba(255,255,255,0.02);
}

/* item */
.est-item_1 {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:8px;
  /*cursor: pointer;*/
  border-radius:6px;
  border:1px solid transparent;
}
.est-item_1:hover { border-color: #777; background: rgba(255,255,255,0.02); }
.est-item_1 img { width:64px; height:64px; object-fit:cover; border-radius:6px; }

/* detalle */
.detalle-estadistica_1 { padding: 8px; border-top: 1px dashed #444; margin-top:6px; }

/* Empujar la sección de detalle hacia la derecha y organizar imagen + título + descripción */
.detalle-contenido_1,
.detalle_contenido_1 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 90%;
  padding-right: 110px;
}

/* Imagen: tamaño fijo, mantiene proporción */
.detalle-contenido_1 img,
.detalle_contenido_1 img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 80px;
}

/* Forzar que título y lista formen una "columna" al lado de la imagen */
.detalle-contenido_1 > h3,
.detalle_contenido_1 > ul,
.detalle_contenido_1 > p,
.detalle_contenido_1 > div,
.detalle_contenido_1 > span,
.detalle_contenido_1 > ol,
.detalle_contenido_1 > li,
.detalle_contenido_1 > .texto_detalle_1,
.detalle-contenido_1 > h3,
.detalle-contenido_1 > ul,
.detalle-contenido_1 > p,
.detalle-contenido_1 > div,
.detalle-contenido_1 > span,
.detalle-contenido_1 > ol,
.detalle-contenido_1 > li,
.detalle-contenido_1 > .texto_detalle_1 {
  display: block;
  margin: 0;
  padding: 0;
}

/* Estilos útiles para título y lista */
.detalle-contenido_1 > h3,
.detalle_contenido_1 > h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: #fff;
}
.detalle-contenido_1 > ul,
.detalle_contenido_1 > ul {
  list-style: disc;
  padding-left: 18px;
  color: #ccc;
  margin: 0;
}

/* Si quieres que la lista ocupe menos ancho */
.detalle-contenido_1 > ul,
.detalle_contenido_1 > ul {
  max-width: 340px;
}

/* volver */
.volver-btn_1 { background:transparent; color:#fff; border:1px solid #444; padding:4px 8px; border-radius:6px; }

/* cerrar */
.cerrar-hud_1 { position:absolute; top:8px; right:10px; background:transparent; color:white; border:none; font-size:20px; z-index:1001; }
.cerrar-hud_1:hover { color:red; }

/* scroll styling pequeño */
.lista-estadisticas_1::-webkit-scrollbar { height:8px; width:8px; }
.lista-estadisticas_1::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius:4px; }

/* durante el arrastre mantener cursor flecha (default) */
.hud-dragging_1 { cursor: default !important; }

.hud-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: rgb(0 0 0 / 78%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  color: white;
  border: 2px solid white;
  border-radius: 10px;
  padding: 20px;
  z-index: 1000;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 15px;
  /*cursor: default;*/
}

.letrainv {
    font-family: Arial, sans-serif;
    font-size: 30px;
}

.hud-panel h2 {
  text-align: center;
  font-size: 24px;
  margin: 0 0 10px;
}

.hud-personaje {
  background-color: #222;
  padding: 10px;
  border: 1px solid #444;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 5px;
}

.hud-personaje img {
  width: 40px;
  height: 40px;
}

.hud-personaje span {
  display: block;
}

.hidden {
  display: none;
}

.yellow {
  color: yellow;
}
.cerrar-hud {
  position: absolute;
  top: 5px;
  right: 8px;
  background: transparent;
  color: white;
  border: none;
  font-size: 20px;
  /*cursor: pointer;*/
  z-index: 1001;
}

.cerrar-hud:hover {
  color: red;
}

.lista-reputacion {
  max-height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}

/* Opcional: scrollbar bonito */
.lista-reputacion::-webkit-scrollbar {
  width: 8px;
}
.lista-reputacion::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.lista-estadisticas {
  max-height: 390px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}

/* Scrollbar opcional */
.lista-estadisticas::-webkit-scrollbar {
  width: 8px;
}
.lista-estadisticas::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ───────────────────────────────────────────────────────── */
/* QUICK SLOTS: 7 casillas siempre visibles, bottom-center */
#quick-slots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  z-index: 100;
  pointer-events: none;
}
.quick-slot {
  display: none;
  width: 48px;
  height: 48px;
  background-color: #2a2a2ad1;
  border: 2px solid white;
  border-radius: 4px;
  box-sizing: border-box;
  pointer-events: auto;
  position: relative;
}
.quick-slot.highlight {
  border-color: red;
}
.quick-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.quick-slot .item-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 12px;
  color: yellow;
  pointer-events: none;
}

#hubdia-container {
  position: absolute;
  top: 10px;
  right: 230px;
  display: none;
  user-select: none;
  z-index: 999;
}

#hubdia {
  background: rgb(0 0 0 / 69%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  min-width: 5px;
  font-family: Arial, sans-serif;
  font-size: 16px;
}

/* ───────────────────────────────────────────────────────── */
/* PANEL DE INVENTARIO (oculto por defecto) */
#inventory-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 600px;
  background: rgb(0 0 0 / 78%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  border: 2px solid white;
  border-radius: 8px;
  padding: 20px;
  z-index: 200;
  display: none;
  box-sizing: border-box;
  /*cursor: default;*/
}
#inventory-panel h2 {
  margin: 0 0 10px;
  text-align: center;
  color: white;
  user-select: none;
}
#inventory-panel .cerrar-hud {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  /*cursor: pointer;*/
  user-select: none;
}
#inventory-panel .cerrar-hud:hover {
  color: red;
}

/* ───────────────────────────────────────────────────────── */
/* Contenedor de las 40 casillas dentro del panel */
#inventory-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 64px;
  gap: 2px;
  max-height: calc(64px * 5 + 10px * 4);
  overflow-y: auto;
  padding: 10px 5px;
  box-sizing: border-box;
}
.inv-slot {
  width: 100%;
  height: 100%;
  background-color: #3f3e88e0;
  border: 2px solid white;
  border-radius: 4px;
  box-sizing: border-box;
  position: relative;
  /*cursor: pointer;*/
  user-select: none;
}
.inv-slot.highlight {
  border-color: red;
}
.inv-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.inv-slot .item-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 12px;
  color: yellow;
  pointer-events: none;
}
/* Scrollbar opcional */
#inventory-grid::-webkit-scrollbar {
  width: 8px;
}
#inventory-grid::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ───────────────────────────────────────────────────────── */
/* Ítem "en mano" (drag) que sigue al cursor */
#drag-item {
  position: absolute;
  pointer-events: none;
  display: none;
  width: 48px;
  height: 48px;
  z-index: 1002;
  top: -100px;
  left: -100px;
}
#drag-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

#quest-button.Hud_quests__DaLW5 {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 2px;
  width: 50px;
  height: 50px;
  background-image: url('./Game/Source/bota.png');
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  background-size: contain;
  border: none;
  /*cursor: pointer;*/
  pointer-events: auto;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 1000;
}

/* Texto en la esquina inferior derecha */
#quest-button .quest-text {
  position: absolute;
  bottom: 2px;
  right: 4px;
  color: white;
  font-size: 10px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 1px 3px;
  border-radius: 3px;
  pointer-events: none;
}

#yellow-bar-container {
  display: none;
  position: fixed;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 10px;
  background-color: #777;
  border: 1px solid #000;
  border-radius: 5px;
  overflow: hidden;
  z-index: 1000;
}

#yellow-bar-fill {
  height: 100%;
  width: 100%;
  background-color: yellow;
  transition: width 0.3s ease;
}

.slot-locked {
    filter: brightness(0.7) sepia(1) hue-rotate(-50deg) saturate(5);
    border: 2px solid #ff0000 !important;
    box-shadow: 0 0 10px #ff0000;
    opacity: 0.8;
    pointer-events: none; /* opcional, pero ayuda a evitar interacción */
    transition: all 0.2s ease;
}





/* Panel de Sonido - Estilo Pixel Art Morado */
#sound-hub-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  transition: opacity 0.3s ease;
}

.sound-hub-hidden {
  opacity: 0;
  pointer-events: none;
}

.sound-hub-visible {
  opacity: 1;
  pointer-events: all;
}

.sound-hub-container {
  background: linear-gradient(160deg,#0a1628 0%,#0d2040 50%,#0a2550 100%);
  border: 1.5px solid rgba(64,160,255,0.35);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.20), 0 10px 36px rgba(0,60,160,0.50);
  width: 90%;
  max-width: 500px;
  padding: 20px;
  position: relative;
  animation: pixel-appear 0.3s ease-out;
}

@keyframes pixel-appear {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Cabecera */
.sound-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(64,160,255,0.22);
}

.sound-hub-title {
  color: #a8d8ff;
  font-size: 18px;
  margin: 0;
  text-shadow: 0 0 10px rgba(64,160,255,0.5);
  letter-spacing: 1px;
}

.sound-hub-close-btn {
  background: rgba(64,160,255,0.18);
  border: 1px solid rgba(64,160,255,0.35);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Press Start 2P', monospace;
  color: #a8d8ff;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.1s;
  box-shadow: 0 4px 0 #2d1b5e;
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
}

.sound-hub-close-btn:hover {
  background-color: #b794f4;
  transform: translateY(-2px);
}

.sound-hub-close-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2d1b5e;
}

.sound-hub-close-icon {
  display: block;
  margin-top: -2px;
}

/* Contenido */
.sound-hub-content {
  margin-bottom: 20px;
}

.sound-control-group {
  background: rgba(10,30,70,0.50);
  border: 1px solid rgba(64,160,255,0.18);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: none;
}

.sound-control-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.sound-control-icon {
  background: rgba(64,160,255,0.15);
  border: 1px solid rgba(64,160,255,0.25);
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 12px;
  font-size: 18px;
  color: #7ec8ff;
}

.sound-control-title {
  color: #7ec8ff;
  font-size: 14px;
  margin: 0;
  flex-grow: 1;
  text-shadow: none;
}

.sound-percent {
  background: rgba(0,20,50,0.70);
  border: 1px solid rgba(64,160,255,0.25);
  border-radius: 4px;
  padding: 5px 10px;
  color: #a8d8ff;
  font-size: 12px;
  min-width: 60px;
  text-align: center;
  box-shadow: inset 0 0 0 1px #9f7aea;
}

/* Sliders personalizados */
.sound-slider-container {
  position: relative;
  margin-bottom: 15px;
}

.sound-slider {
  width: 100%;
  height: 30px;
  opacity: 0;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.sound-slider-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background-color: #2d1b5e;
  border: 3px solid #553c9a;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #1a1038;
  z-index: 1;
}

.sound-slider-fill {
  position: absolute;
  top: 3px;
  left: 3px;
  height: 20px;
  background: linear-gradient(to right, #9f7aea, #6b46c1);
  border-radius: 3px;
  width: 97%;
  box-shadow: inset 0 0 0 1px #d6bcfa;
}

/* Botones de prueba y silencio */
.sound-buttons-row {
  display: flex;
  gap: 10px;
}

.sound-test-btn, .sound-mute-btn, .music-change-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.1s;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.sound-test-btn {
  background-color: #9f7aea;
  color: #2d1b5e;
  border: 2px solid #6b46c1;
}

.sound-test-btn:hover {
  background-color: #b794f4;
  transform: translateY(-2px);
}

.sound-test-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.sound-mute-btn {
  background-color: #553c9a;
  color: #e9d8fd;
  border: 2px solid #6b46c1;
}

.sound-mute-btn:hover {
  background-color: #6b46c1;
  transform: translateY(-2px);
}

.sound-mute-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Selector de música */
.music-selector {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.music-select {
  flex: 2;
  background-color: #2d1b5e;
  border: 3px solid #553c9a;
  border-radius: 4px;
  color: #e9d8fd;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px #9f7aea;
}

.music-change-btn {
  flex: 1;
  background-color: #9f7aea;
  color: #2d1b5e;
  border: 2px solid #6b46c1;
  font-size: 9px;
}

.music-change-btn:hover {
  background-color: #b794f4;
  transform: translateY(-2px);
}

.music-change-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Pie del panel */
.sound-hub-footer {
  display: flex;
  justify-content: center;
  padding-top: 15px;
  border-top: 3px solid #6b46c1;
}

.sound-save-btn {
  background-color: #805ad5;
  border: 3px solid #6b46c1;
  border-radius: 6px;
  color: #e9d8fd;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 0 6px 0 #2d1b5e;
  text-shadow: 1px 1px 0 #2d1b5e;
}

.sound-save-btn:hover {
  background-color: #9f7aea;
  transform: translateY(-2px);
}

.sound-save-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2d1b5e;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
  .sound-hub-container {
    width: 95%;
    padding: 15px;
  }
  
  .sound-hub-title {
    font-size: 14px;
  }
  
  .sound-control-title {
    font-size: 12px;
  }
  
  .sound-percent {
    font-size: 10px;
    min-width: 50px;
  }
  
  .sound-test-btn, .sound-mute-btn, .music-change-btn {
    font-size: 8px;
    padding: 8px;
  }
  
  .music-select {
    font-size: 8px;
  }
  
  .sound-save-btn {
    font-size: 12px;
    padding: 10px 20px;
  }
  
  .sound-hub-close-btn {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .sound-hub-title {
    font-size: 12px;
  }
  
  .sound-control-title {
    font-size: 10px;
  }
  
  .sound-buttons-row {
    flex-direction: column;
  }
  
  .music-selector {
    flex-direction: column;
  }
}







/* Hub container */
#cajahub {
  display: none;
}


/* Contenedor principal de la imagen y nivel */
#hub-image-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0px; /* Espacio entre el nivel y la imagen */
}

/* Contenedor de la imagen (sin cambios) */
#hub-image {
  display: inline-block;
}

/* Imagen del jugador */
#player-image {
  width: 100px;
  height: 100px;
  display: block;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Contenedor del nivel - ARRIBA de la imagen */
#player-level-container {
  /*background: linear-gradient(135deg, #2a8a2a 0%, #1a7a1a 100%);*/
  color: #ffffff;
  font-family: 'PressStart2P', monospace;
  font-size: 11px;
  /*padding: 6px 12px;*/
  border-radius: 20px;
  /*border: 2px solid #5aff5a;*/
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 1001 !important;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  user-select: none;
  pointer-events: none;
  margin-bottom: 8px; /* Espacio entre el nivel y la imagen */
  order: -1; /* Coloca el nivel antes (arriba) de la imagen */
}

/* Texto del nivel */
#player-level {
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  display: block;
}


#hub {
  position: fixed;
  top: 22px;
  left: 7px;
  display: inline-flex;
  align-items: center;
  background: rgb(0 0 0 / 78%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #eee;
  user-select: none;
  z-index: 1000;
  transition: all 0.5s ease;
}

/* Imagen perfil */
#hub-image img {
  width: 100px;
  height: 100px;
}

/* Info a la derecha */
#hub-info {
  overflow: hidden;
  transition: max-width 0.5s ease, opacity 0.5s ease, margin-left 0.5s ease;
  max-width: 220px;
  opacity: 1;
  margin-left: 12px;
}

#hub-info.collapsed {
  max-width: 0;
  max-height: 0;
  opacity: 0;
  margin-left: 0;
}

/* Nombre usuario */
#username {
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barras de estado */
.status-bar {
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
  height: 20px;
  position: relative; /* Añadido */
}

.status-fill {
  height: 100%;
  transition: width 0.3s ease;
  /* Eliminado: display, align-items, justify-content, color */
}

.status-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.85em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2; /* Asegura que esté por encima del relleno */
}

#hub, #hub, #hub-image, #hub-info, #hub-info.collapsed, #username {
  user-select: none !important;
  -webkit-user-drag: none !important;
  -webkit-touch-callout: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* General: evita selección y tab */
.corner-box,
.corner-box *,
.round-buttons,
.round-buttons * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
}

button:focus {
  outline: none;
}

/* Estilos existentes */
.corner-box {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgb(0 0 0 / 69%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  border-radius: 20px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.219);
  z-index: 1000;
}

.main-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

#info-text {
  color: white;
  font-size: 20px;
  flex-grow: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inner-btn {
  background: transparent;
  border: none;
  /*cursor: pointer;*/
  padding: 5px;
}

.inner-btn img {
  width: 32px;
  height: 32px;
}

.round-buttons {
  position: fixed;
  top: 130px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.round-btn {
  height: 40px;
  border-radius: 20%;
  background: rgb(0 0 0 / 69%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  border: 2px solid #000000b9;
  display: flex;
  align-items: center;
  justify-content: center;
  /*cursor: pointer;*/
  overflow: visible;
  transition: background 0.2s;
  position: relative;
}

.round-btn:hover {
  background: #555;
}

.round-btn img {
  width: 30px;
  height: 30px;
  z-index: 1;
}

/* Oculta por defecto */
.hud-hidden {
  display: none;
}

/* Para mostrarlo desde Phaser */
.hud-visible {
  display: block;
}

/* Botón en esquina inferior izquierda */

/* ============================================================
   CHAT BUBBLE SOBRE PERSONAJE — mensajes y puntos de escritura
   ============================================================ */

/* Contenedor de burbuja de chat sobre el sprite */
.player-chat-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

/* Burbuja de mensaje */
.chat-bubble-msg {
    background: rgba(10, 20, 50, 0.92);
    border: 1.5px solid rgba(64,160,255,0.55);
    border-radius: 10px 10px 10px 2px;
    color: #d0eaff;
    font-family: "PressStart2P", monospace;
    font-size: 9px;
    line-height: 1.4;
    max-width: 160px;
    padding: 6px 9px;
    word-break: break-word;
    white-space: normal;
    box-shadow: 0 2px 10px rgba(0,80,200,0.35);
    animation: bubblePop 0.18s ease-out;
}

.chat-bubble-msg.own {
    border-color: rgba(100,220,255,0.65);
    background: rgba(10, 30, 70, 0.92);
}

/* Puntos animados mientras escribe */
.chat-typing-dots {
    background: rgba(10, 20, 50, 0.85);
    border: 1.5px solid rgba(64,160,255,0.40);
    border-radius: 10px;
    padding: 5px 10px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-typing-dots span {
    width: 5px;
    height: 5px;
    background: #40a0ff;
    border-radius: 50%;
    display: inline-block;
    animation: typingDot 1.2s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes bubblePop {
    from { transform: translateX(-50%) scale(0.7); opacity: 0; }
    to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

.chat-open-btn {
  display: flex;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgb(0 0 0 / 78%);
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  border: 2px solid #00ff00;
  align-items: center;
  justify-content: center;
  /*cursor: pointer;*/
  z-index: 1000;
  transition: background 0.2s;
}
.chat-open-btn:hover { background: #003300; }
.chat-open-btn img { width: 24px; height: 24px; }

/* Panel del chat estilo hacker */
#chat-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 300px;
  max-height: 300px;
  background: rgba(0, 0, 0, 0.85);
  color: #00ff00;
  font-family: 'Courier New', monospace;
  border: 2px solid #00ff00;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  padding: 10px;
  box-shadow: 0 0 10px #00ff00;
  animation: fadeIn 0.3s ease-out;
}

#chat-panel.chat-hidden { display: none; }

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

/* estilos para cada mensaje */
.chat-line { padding: 6px 4px; border-bottom: 1px dashed rgba(0,255,0,0.06); }
.chat-line strong { color: #b3ffb3; }
.chat-time { font-size: 10px; color: #66ff66; margin-left: 8px; opacity: 0.8; }

/* input */
#chat-input {
  border: none;
  background: transparent;
  border-top: 1px solid #00ff00;
  color: #00ff00;
  padding: 5px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
#chat-input::placeholder { color: rgba(0,255,0,0.6); }

/* Fade-in */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Contenedor del HUD */
.hud-containerx2 {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(82%);
  width: 200px;
  height: auto;
  z-index: 100;
  pointer-events: none;
}

/* Imagen base */
.hud-basex2 {
  width: 35%;
  height: auto;
  display: block;
}

/* Imagen encima, en la esquina inferior derecha */
.hud-iconx2 {
  position: absolute;
  bottom: 5px;
  left: 45px;
  width: 25px;
  height: auto;
  /*cursor: pointer;*/
}

#game-ui-text {
  display: none;
  position: fixed;
  top: -6px;
  left: 1px;
  font-size: 14px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 6px 10px;
  border-radius: 5px;
  z-index: 1;
}


/* ============================= */
/* Panel base (note: hub-related selectors have _101 suffix to avoid conflicts) */
:root{
  --panel-bg_101: #000000;
  --panel-border_101: rgba(255,255,255,0.06);
  --panel-blur_101: 8px;
  --text-color_101: #ffffff;
  --muted-color_101: rgba(255,255,255,0.72);
  --input-bg_101: rgba(255,255,255,0.025);
  --input-border_101: rgba(255,255,255,0.08);
  --primary-start_101: #2563eb;
  --primary-end_101: #1e40af;
  --font-family_101: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius_101: 12px;
  --panel-width_101: 360px;
  --gap_101: 12px;
}
/* --- Centrado del panel y animación compatible --- */
#hub-panel_101 {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--panel-width_101);
  max-width: calc(100% - 32px);
  /* BLUE REDESIGN — sin backdrop-filter para no congelar el juego */
  background: linear-gradient(160deg, #0a1628 0%, #0d2040 50%, #0a2550 100%);
  color: #d0eaff;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.30), 0 12px 40px rgba(0,60,160,0.55), inset 0 1px 0 rgba(100,180,255,0.12);
  padding: 20px;
  font-family: var(--font-family_101);
  transform: translate(-50%, -52%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 9999;
  border: 1.5px solid rgba(64,160,255,0.35);
  /* NO backdrop-filter */
  box-sizing: border-box;
}

/* Visible: centrado exacto + escala al 100% */
#hub-panel_101.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

#hub-panel_101 .header_101 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap_101);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(64,160,255,0.22);
  user-select: none;
  padding-right: 48px;
}
#hub-panel_101 .title_101 { font-weight:700; font-size:16px; letter-spacing:1px; color:#a8d8ff; text-shadow:0 0 10px rgba(64,160,255,0.5); }
#hub-panel_101 .muted { color: rgba(140,200,255,0.60); font-size:12px; }

/* --- Reglas de formularios y botones (scopeado al panel) --- */
#hub-panel_101 .hub-row_101 { margin-bottom: 14px; display:block; }
#hub-panel_101 .hub-label_101 { display:block; font-size:13px; color:var(--muted-color_101); margin-bottom:8px; }

#hub-panel_101 input[type="text"],
#hub-panel_101 select {
  width:100%; box-sizing:border-box;
  padding:9px 12px;
  border-radius:8px;
  border:1.5px solid rgba(64,160,255,0.28);
  background: rgba(0,20,50,0.65);
  color: #d0eaff;
  font-size:13px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
}
#hub-panel_101 select:focus { color:#d0eaff; background:rgba(0,30,70,0.85); }
#hub-panel_101 select option { color:#000; background:#fff; }
#hub-panel_101 input::placeholder { color: rgba(100,180,255,0.45); }
#hub-panel_101 input:focus, #hub-panel_101 select:focus {
  border-color: rgba(64,160,255,0.60);
  box-shadow: 0 0 0 2px rgba(64,160,255,0.18);
  background: rgba(0,25,60,0.75);
}
#hub-panel_101 .hub-row_101 { margin-bottom:14px; }
#hub-panel_101 .hub-label_101 { display:block; font-size:12px; color:rgba(100,180,255,0.70); margin-bottom:6px; letter-spacing:0.3px; }
#hub-panel_101 .button-row { display:flex; gap:8px; margin-top:10px; align-items:center; }
#hub-panel_101 button {
  padding:9px 14px; border-radius:8px; border:1px solid rgba(64,160,255,0.30);
  font-weight:600; font-size:13px;
  background: rgba(64,160,255,0.12);
  color: #a8d8ff;
  cursor:pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

#hub-panel_101 .btn-primary {
  background: linear-gradient(135deg, #1a6fd4, #0a4aaa);
  border-color: rgba(64,160,255,0.50);
  color: #d0eaff;
  box-shadow: 0 4px 12px rgba(30,100,220,0.30);
  color: #fff;
  box-shadow: 0 8px 28px rgba(30,64,175,0.18);
  flex:1;
  border: 1px solid rgba(255,255,255,0.04);
}
#hub-panel_101 .btn-ghost {
  background: rgba(64,160,255,0.07);
  border: 1px solid rgba(64,160,255,0.22);
  color: rgba(140,200,255,0.80);
  flex: 0 0 auto;
}

/* Footer */
#hub-panel_101 .hub-footer_101 {
  margin-top:10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: var(--gap_101);
  border-top: 1px solid rgba(255,255,255,0.02);
  padding-top:10px;
  color: var(--muted-color_101);
  font-size:12px;
}

/* --- Posicionar el botón CERRAR en la esquina superior derecha del panel --- */
#close-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 10010;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted-color_101);
  /*cursor: pointer;*/
  box-shadow: none;
  height: auto;
  line-height: 1;
}

/* Si hay transiciones en hover/active para el botón */
#close-panel:hover { background: rgba(255,255,255,0.02); color: var(--text-color_101); }
#close-panel:active { transform: translateY(1px); }

/* Asegurarnos que el area donde estaba el botón no cambie layout si usabas display:flex en button-row */
#hub-panel_101 .button-row { min-height: 0; }

/* ============================= */
/* MEDIA QUERIES PARA MÓVILES */
/* ============================= */

/* Para pantallas menores a 768px (tablets y móviles) */
@media (max-width: 768px) {
  /* Ajustes generales */
  html, body {
    font-size: 14px;
  }
  
  /* Crafting hub responsive */
  .crafting-content {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
  
  .recipes-selector {
    width: 100%;
    max-height: 200px;
  }
  
  .recipes-list {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  
  .recipe-item {
    min-width: 120px;
  }
  
  /* Paneles HUD */
  .hud-panel, .hud-panel_1, #inventory-panel {
    width: 95%;
    max-width: 95%;
    padding: 15px;
  }
  
  /* Quick slots */
  #quick-slots {
    bottom: 10px;
    gap: 1px;
  }
  
  .quick-slot {
    width: 40x;
    height: 40px;
  }
  
  /* Hub de perfil */
  #hub {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 10px;
  }
  
  #hub-info {
    margin-left: 0;
    margin-top: 8px;
    max-width: 100%;
  }
  
  /* Corner box y botones redondos */
  .corner-box {
    top: 5px;
    right: 5px;
    padding: 10px;
    gap: 6px;
  }
  
  .round-buttons {
    top: 115px;
    right: 10px;
    gap: 10px;
  }
  
  .round-btn {
    width: 40px;
    height: 40px;
  }
  
  .round-btn img {
    width: 24px;
    height: 24px;
  }
  
  /* Chat */
  #chat-panel {
    width: 90%;
    max-width: 90%;
    left: 5%;
    bottom: 70px;
  }
  
  .chat-open-btn {
    bottom: 10px;
    left: 5px;
    width: 45px;
    height: 45px;
  }
  
  /* Tienda y subastas */
  .shop-container, .auction-panel {
    width: 95vw;
    height: 95vh;
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .shop-header, .auction-header {
    padding: 10px 12px;
  }
  
  .shop-header h2, .header-title {
    font-size: 16px;
  }
  
  .search-input, .search-field {
    margin: 8px 12px;
    padding: 6px 8px;
    font-size: 14px;
  }
  
  /* Panel de configuración */
  #hub-panel_101 {
    width: 90%;
    max-width: 90%;
    padding: 15px;
  }
  
  /* Inventario grid */
  #inventory-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 50px;
    gap: 1px;
  }
  
  /* Listas de estadísticas */
  .lista-estadisticas_1 {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .est-item_1 img {
    width: 48px;
    height: 48px;
  }
  
  /* Detalle de estadísticas */
  .detalle-contenido_1, .detalle_contenido_1 {
    flex-direction: column;
    align-items: center;
    padding-right: 0;
    margin-left: 0;
  }
  
  .detalle-contenido_1 > h3, .detalle_contenido_1 > h3,
  .detalle-contenido_1 > ul, .detalle_contenido_1 > ul {
    text-align: center;
  }
  
  /* Botón de quests */
  #quest-button.Hud_quests__DaLW5 {
    width: 45px;
    height: 45px;
    bottom: 10px;
    right: 5px;
  }
  
  /* Barra amarilla */
  #yellow-bar-container {
    width: 80%;
    bottom: 60px;
  }
  
  /* HUD de mochila */
  .hud-containerx2 {
    bottom: 5px;
    transform: translateX(81%);
  }
  
  .hud-basex2 {
    width: 30%;
  }
  
  .hud-iconx2 {
    width: 20px;
    left: 35px;
  }
  
  /* Texto de coordenadas */
  #game-ui-text {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  /* Overlays y modales */
  .overlay, .overlay-modal {
    padding: 10px;
  }
  
  .mini-menu, .modal-content {
    width: 95%;
    max-width: 95%;
  }
  
  /* Categorías en subastas */
  .category-selector {
    justify-content: center;
  }
  
  .category-btn {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* Para pantallas menores a 480px (móviles pequeños) */
@media (max-width: 480px) {
  /* Ajustes más específicos para móviles pequeños */
  .crafting-header {
    padding: 10px 15px;
  }
  
  .crafting-title {
    font-size: 18px;
  }
  
  .result-item {
    flex-direction: column;
    text-align: center;
  }
  
  .result-item img {
    width: 60px;
    height: 60px;
  }
  
  /* Inventario grid más pequeño */
  #inventory-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 45px;
  }
  
  /* Textos más pequeños */
  .loading-text {
    font-size: 24px;
  }
  
  .letrainv {
    font-size: 24px;
  }
  
  .hud-panel h2, .hud-panel_1 .hud-title_1 {
    font-size: 20px;
  }
  
  /* Diálogos */
  .dialog-hub {
    width: 90%;
    padding: 15px;
    flex-direction: column;
    align-items: center;
  }
  
  .avatar-container {
    width: 60px;
    height: 60px;
  }
  
  .dialog-text {
    font-size: 16px;
    min-height: 60px;
  }
  
  /* Quick slots más pequeños */
  .quick-slot {
    width: 40px;
    height: 40px;
  }
    /* HUD de mochila */
  .hud-containerx2 {
    bottom: 5px;
    transform: translateX(67%);
  }
  
  /* Botones más pequeños */
  .dialog-btn, .action-btn, .btn-post-item, .btn-view, .btn-buy {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  /* Inputs más pequeños */
  .search-input, .search-field, .recipe-search, #chat-input {
    padding: 6px 8px;
    font-size: 14px;
  }
  
  /* Hub panel más compacto */
  #hub-panel_101 {
    padding: 12px;
  }
  
  #hub-panel_101 input[type="text"],
  #hub-panel_101 select {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  #hub-panel_101 button {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  /* Items en listas más compactos */
  .shop-item, .auction-item {
    padding: 6px 10px;
  }
  
  .item-image, .item-thumb {
    width: 35px;
    height: 35px;
  }
  
  .item-name {
    font-size: 14px;
  }
  
  /* Ajustes de scroll para móviles */
  .items-list, .auction-list, #inventory-grid,
  .recipes-list, .ingredients-container {
    -webkit-overflow-scrolling: touch;
  }
}

/* Para pantallas menores a 480px (móviles pequeños) */
@media (max-width: 380px) {
  /* Ajustes más específicos para móviles pequeños */
  .crafting-header {
    padding: 10px 15px;
  }
  
  .crafting-title {
    font-size: 18px;
  }
  
  .result-item {
    flex-direction: column;
    text-align: center;
  }
  
  .result-item img {
    width: 60px;
    height: 60px;
  }
  
  /* Inventario grid más pequeño */
  #inventory-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 45px;
  }
  
  /* Textos más pequeños */
  .loading-text {
    font-size: 24px;
  }
  
  .letrainv {
    font-size: 24px;
  }
  
  .hud-panel h2, .hud-panel_1 .hud-title_1 {
    font-size: 20px;
  }
  
  /* Diálogos */
  .dialog-hub {
    width: 90%;
    padding: 15px;
    flex-direction: column;
    align-items: center;
  }
  
  .avatar-container {
    width: 60px;
    height: 60px;
  }
  
  .dialog-text {
    font-size: 16px;
    min-height: 60px;
  }
  
  /* Quick slots más pequeños */
  .quick-slot {
    width: 35px;
    height: 35px;
  }
    /* HUD de mochila */
  .hud-containerx2 {
    bottom: 5px;
    transform: translateX(58%);
  }
  
  /* Botones más pequeños */
  .dialog-btn, .action-btn, .btn-post-item, .btn-view, .btn-buy {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  /* Inputs más pequeños */
  .search-input, .search-field, .recipe-search, #chat-input {
    padding: 6px 8px;
    font-size: 14px;
  }
  
  /* Hub panel más compacto */
  #hub-panel_101 {
    padding: 12px;
  }
  
  #hub-panel_101 input[type="text"],
  #hub-panel_101 select {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  #hub-panel_101 button {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  /* Items en listas más compactos */
  .shop-item, .auction-item {
    padding: 6px 10px;
  }
  
  .item-image, .item-thumb {
    width: 35px;
    height: 35px;
  }
  
  .item-name {
    font-size: 14px;
  }
  
  /* Ajustes de scroll para móviles */
  .items-list, .auction-list, #inventory-grid,
  .recipes-list, .ingredients-container {
    -webkit-overflow-scrolling: touch;
  }
}

/* Ajustes específicos para orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  /* Ajustar alturas para landscape */
  .shop-container, .auction-panel {
    height: 90vh;
    max-height: 90vh;
  }
  
  .crafting-hub {
    height: 90vh;
    max-height: 90vh;
  }
  
  .hud-panel, .hud-panel_1, #inventory-panel {
    max-height: 90vh;
  }
  
  /* Quick slots en landscape */
  #quick-slots {
    bottom: 5px;
  }
  
  /* Chat en landscape */
  #chat-panel {
    bottom: 60px;
    max-height: 200px;
  }
  
  /* Hub de perfil más compacto en landscape */
  #hub {
    flex-direction: row;
  }
  
  #hub-info {
    margin-left: 8px;
    margin-top: 0;
  }
}

/* Ajustes de accesibilidad para móviles */
@media (max-width: 768px) {
  /* Botones más grandes para touch */
  button, .dialog-btn, .action-btn, .round-btn, .inner-btn,
  .category-btn, .btn-view, .btn-buy, .btn-post-item {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Inputs más grandes para touch */
  input, select, textarea {
    font-size: 16px; /* Evita zoom en iOS */
  }
  
  /* Mejorar contraste para exteriores */
  .hud-panel, .hud-panel_1, #inventory-panel,
  .shop-container, .auction-panel {
    background: rgb(0 0 0 / 90%);
  }
  
  /* Textos más legibles */
  .status-text, .item-count, .quest-text, #info-text {
    font-weight: bold;
  }
}

/* Hacemos que el corner-box use flex en fila y alinee los elementos */
#game-hud .corner-box {
  display: flex;
  align-items: center;  /* alinea verticalmente los stacks con el botón */
  padding: 10px;
  gap: 10px;
}

/* Los stacks se apilan en columna */
#game-hud .corner-box .coin-stack {
  display: flex;
  flex-direction: column;
  align-items: center;   /* centra la imagen y el número */
  text-align: center;
}

/* Estilo opcional para la etiqueta GL */
#game-hud .corner-box .gl-label {
  font-size: 12px;
  color: #ffd700;        /* dorado */
  margin-top: 2px;
}

/* Ajuste para mantener el botón a la derecha */
#game-hud .corner-box .inner-btn {
  margin-left: auto;      /* empuja el botón a la derecha si sobra espacio */
}











/* Transaction Hub - dark retro style matching other panels */
#tx-hub {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 480px;
  max-height: 80vh;
  background: linear-gradient(160deg,#0a1628 0%,#0d2040 50%,#0a2550 100%);
  border: 1.5px solid rgba(64,160,255,0.35);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.20), 0 12px 40px rgba(0,60,160,0.55);
  color: #d0eaff;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 280px;
  min-height: 200px;
  transition: opacity 0.2s;
}

.tx-hub-hidden {
  display: none !important;
}

.tx-hub-visible {
  display: flex !important;
}

.tx-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(90deg, #2a1a4a, #1a1035);
  border-bottom: 2px solid #5a4a8a;
  cursor: move;
}

.tx-hub-title {
  margin: 0;
  font-size: 14px;
  color: #ffd700;
  text-shadow: 2px 2px 0 #000;
}

.tx-hub-close-btn {
  background: #a44;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tx-hub-close-btn:hover {
  background: #c66;
}

.tx-hub-tabs {
  display: flex;
  border-bottom: 1px solid #3a3a6a;
}

.tx-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: #aaa;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tx-tab.active {
  background: #2a1a4a;
  color: #ffd700;
  border-bottom: 2px solid #ffd700;
}

.tx-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

.tx-tab-content.active {
  display: block;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Transaction item */
.tx-item {
  background: rgba(30, 20, 50, 0.7);
  border: 1px solid #5a4a8a;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  transition: background 0.2s;
}

.tx-item:hover {
  background: rgba(50, 30, 70, 0.9);
}

.tx-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tx-status.pending { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.tx-status.confirmed { background: #10b981; box-shadow: 0 0 8px #10b981; }
.tx-status.reverted { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.tx-content {
  flex: 1;
  min-width: 0;
}

.tx-name {
  font-weight: bold;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #ccc;
}

.tx-hash {
  font-family: monospace;
  background: #1a1a2e;
  padding: 2px 4px;
  border-radius: 4px;
  color: #8af;
}

.tx-quantity {
  color: #ffd700;
}

.tx-retry-btn {
  background: #ffaa00;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  color: #000;
  font-weight: bold;
}

.tx-retry-btn:hover {
  background: #ffcc00;
}

.tx-hub-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0a0a1a;
  border-top: 1px solid #3a3a6a;
  font-size: 10px;
  color: #8af;
}

.tx-refresh-btn {
  background: transparent;
  border: 1px solid #5a4a8a;
  color: #ffd700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-refresh-btn:hover {
  background: #2a1a4a;
}

/* Scrollbar */
.tx-tab-content::-webkit-scrollbar {
  width: 6px;
}

.tx-tab-content::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.tx-tab-content::-webkit-scrollbar-thumb {
  background: #5a4a8a;
  border-radius: 3px;
}

.tx-hash.clickable {
  cursor: pointer;
  text-decoration: underline dotted;
}

/* ==========================================================================
   HUB REDESIGN — Professional RPG Farming HUD
   Overrides only the elements specified by the developer.
   ========================================================================== */

/* ── Keyframe animations ─────────────────────────────────────────────────── */

/* Bar idle shimmer: gentle light sweep when full/not moving */
@keyframes bar-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Bar idle pulse: soft glow beat on the fill */
@keyframes bar-pulse {
  0%, 100% { filter: brightness(1)   drop-shadow(0 0 0px transparent); }
  50%       { filter: brightness(1.15) drop-shadow(0 0 4px currentColor); }
}

/* Bar drain flash: brief white flash when value drops */
@keyframes bar-drain {
  0%   { filter: brightness(2) saturate(0); }
  100% { filter: brightness(1) saturate(1); }
}

/* Notification badge pop */
@keyframes badge-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.25); }
  100% { transform: scale(1);   opacity: 1; }
}

/* Notification badge pulse when count > 0 */
@keyframes badge-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 80, 80, 0.7); }
  60%       { box-shadow: 0 0 0 5px rgba(255, 80, 80, 0); }
}

/* Chat button breathing pulse */
@keyframes chat-breath {
  0%, 100% { box-shadow: 0 0 0 0   rgba(0,255,100,0.5), 0 4px 16px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(0,255,100,0),   0 4px 16px rgba(0,0,0,0.5); }
}

/* Round button hover ripple */
@keyframes btn-glow {
  0%   { box-shadow: 0 0 0 0 rgba(100,180,255,0.5); }
  100% { box-shadow: 0 0 0 10px rgba(100,180,255,0); }
}

/* ── #cajahub / #hub — Player profile panel ──────────────────────────────── */

#cajahub {
  display: block; /* managed by Phaser via .hidden class on #hub */
}

#hub {
  position: fixed;
  top: 18px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg,
    rgba(12, 15, 30, 0.92) 0%,
    rgba(20, 26, 50, 0.92) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(100, 140, 255, 0.20);
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: #e8eaf0;
  user-select: none;
  z-index: 1000;
  transition: all 0.4s ease;
  min-width: 200px;
}

/* Avatar container */
#hub-image-container {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Level badge above avatar */
#player-level-container {
  background: linear-gradient(135deg, #2a6e2a 0%, #1a5c1a 100%);
  border: 1px solid rgba(90, 255, 90, 0.45);
  border-radius: 20px;
  padding: 3px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 6px rgba(90,255,90,0.2);
  order: -1;
  margin-bottom: 4px;
  z-index: 1;
}

#player-level {
  font-family: 'PressStart2P', monospace;
  font-size: 9px;
  color: #afffaf;
  text-shadow: 0 0 6px rgba(90,255,90,0.6);
  display: block;
  white-space: nowrap;
}

/* Avatar image */
#hub-image {
  position: relative;
}

#player-image {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 2px solid rgba(100,140,255,0.30);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

/* Info section (username + bars) */
#hub-info {
  margin-left: 12px;
  overflow: hidden;
  transition: max-width 0.45s ease, opacity 0.45s ease, margin-left 0.45s ease;
  max-width: 200px;
  opacity: 1;
  min-width: 150px;
}

#hub-info.collapsed {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  min-width: 0;
}

/* Username */
#username {
  font-weight: 700;
  font-size: 0.88em;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #dce4ff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ── Status bars ─────────────────────────────────────────────────────────── */

.status-bar {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 5px;
  height: 18px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.status-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background-size: 200% 100%;
}

/* Idle shimmer animation on status fills — plays when bar is NOT being drained */
.status-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.18) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: bar-shimmer 3.5s linear infinite;
  pointer-events: none;
}

/* Class to add when drain is happening (set/remove via Phaser) */
.status-fill.draining {
  animation: bar-drain 0.3s ease-out;
}

/* Health bar — red gradient with idle pulse */
#health-bar .status-fill {
  background: linear-gradient(90deg, #c0392b 0%, #e74c3c 60%, #ff6b5b 100%);
  animation: bar-pulse 3s ease-in-out infinite;
}

/* Water bar — blue gradient */
#water-bar .status-fill {
  background: linear-gradient(90deg, #1a6fa8 0%, #3498db 60%, #5dade2 100%);
  animation: bar-pulse 3.4s ease-in-out infinite;
}

/* Food bar — amber gradient */
#food-bar .status-fill {
  background: linear-gradient(90deg, #b7770d 0%, #f39c12 60%, #f5b942 100%);
  animation: bar-pulse 3.8s ease-in-out infinite;
}

/* Low threshold visual warning (add class 'low' via Phaser when < 25%) */
.status-fill.low {
  animation: bar-pulse 0.8s ease-in-out infinite !important;
  filter: saturate(1.4);
}

/* Bar label text */
.status-text {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.92);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  pointer-events: none;
  z-index: 2;
  font-family: 'Segoe UI', sans-serif;
  white-space: nowrap;
}

/* ── Quick Slots ──────────────────────────────────────────────────────────── */

#quick-slots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 100;
  pointer-events: none;
  /* pill background */
  background: rgba(8, 10, 22, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(100, 140, 255, 0.18);
  border-radius: 14px;
  padding: 5px 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}

.quick-slot {
  display: none; /* shown by Phaser JS */
  width: 50px;
  height: 50px;
  background: rgba(20, 24, 48, 0.7);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-sizing: border-box;
  pointer-events: auto;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.quick-slot:hover {
  background: rgba(40, 50, 90, 0.8);
  border-color: rgba(100, 160, 255, 0.45);
}

/* Selected / active slot */
.quick-slot.highlight {
  border-color: rgba(255, 80, 80, 0.9);
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.55), inset 0 0 6px rgba(255,80,80,0.12);
  background: rgba(60, 20, 20, 0.6);
}

.quick-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  image-rendering: pixelated;
  padding: 3px;
}

/* Slot number (keyboard key hint — add via JS if needed) */
.quick-slot::before {
  content: attr(data-slot-index);
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 8px;
  color: rgba(255,255,255,0.30);
  font-family: 'PressStart2P', monospace;
  pointer-events: none;
  line-height: 1;
}

.quick-slot .item-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #ffe066;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  pointer-events: none;
  font-family: 'Segoe UI', sans-serif;
}

/* ── Corner box (coins + hide button) ───────────────────────────────────── */

#game-hud .corner-box {
  background: linear-gradient(135deg,
    rgba(12, 15, 30, 0.90) 0%,
    rgba(20, 26, 50, 0.90) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(100, 140, 255, 0.18);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
  gap: 10px;
}

.coin-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.main-img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.info-text {
  color: #ffd700;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  white-space: nowrap;
}

/* Silver coin counter in a different tint */
.right-stack .info-text {
  color: #c8d8e8;
}

/* Hide/Show button */
.inner-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  margin-left: auto;
}

.inner-btn:hover {
  background: rgba(100,140,255,0.15);
  border-color: rgba(100,140,255,0.35);
}

.inner-btn img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* ── Round buttons ───────────────────────────────────────────────────────── */

.round-buttons {
  position: fixed;
  top: 130px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1),
              opacity  0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.round-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    rgba(15, 18, 35, 0.92) 0%,
    rgba(22, 28, 55, 0.92) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(100, 140, 255, 0.22);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative !important;
  overflow: visible !important;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.round-btn:hover {
  background: linear-gradient(135deg,
    rgba(35, 45, 90, 0.95) 0%,
    rgba(45, 60, 110, 0.95) 100%);
  border-color: rgba(120, 170, 255, 0.50);
  transform: scale(1.08);
  animation: btn-glow 0.5s ease-out forwards;
}

.round-btn:active {
  transform: scale(0.94);
}

.round-btn img {
  width: 26px;
  height: 26px;
  z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  image-rendering: pixelated;
}

/* Tooltip label (visible on hover) */
#game-hud .round-buttons .round-btn .label-badge {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%) translateX(4px);
  background: linear-gradient(135deg, rgba(12,16,32,0.97) 0%, rgba(20,26,55,0.97) 100%);
  border: 1px solid rgba(100,140,255,0.30);
  color: #c8d8ff;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

#game-hud .round-buttons .round-btn:hover .label-badge {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* ── Mail notification badge ─────────────────────────────────────────────── */

.notif-badge {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ff3b3b 0%, #cc1010 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
  border-radius: 9px;
  border: 2px solid rgba(12, 15, 30, 0.95);
  display: none; /* oculto por defecto; JS lo activa con display:flex inline */
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  z-index: 20 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  animation: badge-pop 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) both,
             badge-ring 2s ease-in-out 0.3s infinite;
  pointer-events: none;
  user-select: none;
}

/* ── Chat open button ────────────────────────────────────────────────────── */

.chat-open-btn {
  display: flex;
  position: fixed;
  bottom: 18px;
  left: 18px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    rgba(10, 22, 12, 0.92) 0%,
    rgba(15, 35, 18, 0.92) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(0, 200, 80, 0.45);
  box-shadow: 0 4px 16px rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  animation: chat-breath 3s ease-in-out infinite;
}

.chat-open-btn:hover {
  background: linear-gradient(135deg,
    rgba(10, 40, 15, 0.96) 0%,
    rgba(15, 60, 22, 0.96) 100%);
  border-color: rgba(0, 240, 100, 0.70);
  transform: scale(1.08);
  animation: none;
  box-shadow: 0 0 14px rgba(0,200,80,0.4), 0 4px 16px rgba(0,0,0,0.55);
}

.chat-open-btn:active {
  transform: scale(0.93);
}

.chat-open-btn img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  image-rendering: pixelated;
}

/* ── Responsive overrides ─────────────────────────────────────────────────── */

@media (max-width: 640px) {

  #hub {
    padding: 8px 10px 8px 8px;
    min-width: 0;
  }

  #player-image {
    width: 52px;
    height: 52px;
  }

  #player-level {
    font-size: 7px;
  }

  #hub-info {
    max-width: 160px;
    min-width: 120px;
    margin-left: 8px;
  }

  #username {
    font-size: 0.78em;
  }

  .status-bar {
    height: 15px;
    margin-bottom: 4px;
  }

  .status-text {
    font-size: 8px;
  }

  /* Quick slots smaller */
  #quick-slots {
    bottom: 10px;
    gap: 3px;
    padding: 4px 6px;
    border-radius: 10px;
  }

  .quick-slot {
    width: 42px;
    height: 42px;
    border-radius: 6px;
  }

  /* Round buttons smaller & closer */
  .round-buttons {
    top: 105px;
    right: 8px;
    gap: 8px;
  }

  .round-btn {
    width: 40px;
    height: 40px;
  }

  .round-btn img {
    width: 22px;
    height: 22px;
  }

  /* On mobile, tooltip goes above instead of left */
  #game-hud .round-buttons .round-btn .label-badge {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
  }

  #game-hud .round-buttons .round-btn:hover .label-badge {
    transform: translateX(-50%) translateY(0) !important;
  }

  /* Corner box */
  #game-hud .corner-box {
    top: 8px;
    right: 8px;
    padding: 6px 10px;
    gap: 8px;
  }

  .main-img {
    width: 22px;
    height: 22px;
  }

  .info-text {
    font-size: 11px;
  }

  /* Chat button */
  .chat-open-btn {
    width: 44px;
    height: 44px;
    bottom: 12px;
    left: 12px;
  }
}

/* ── Touch / high-DPI tweaks ─────────────────────────────────────────────── */

@media (hover: none) and (pointer: coarse) {
  /* Disable shimmer on mobile to save battery */
  .status-fill::after {
    animation: none;
  }

  /* Always show tooltip text slightly on mobile (no hover) */
  #game-hud .round-buttons .round-btn .label-badge {
    display: none; /* hide entirely on touch — use tooltip another way */
  }
}



/* ==========================================================================
   HUB FIXES v2 — Targeted corrections
   ========================================================================== */

/* ── FIX 1: #cajahub hidden by default (Phaser manages #hub visibility) ── */
#cajahub {
  display: none !important;
}
/* #hub visibility is controlled by Phaser adding/removing .hidden class */
#hub.hidden {
  display: none !important;
}

/* ── FIX 2: Chat button hidden by default + blue theme (not green) ──────── */

/* Hidden state — Phaser removes this class to show it */
#open-chat-btn.chat-open-btn.hidden,
.chat-open-btn.hidden {
  display: none !important;
}

/* Blue theme override */
.chat-open-btn {
  background: linear-gradient(135deg,
    rgba(12, 16, 40, 0.92) 0%,
    rgba(18, 28, 65, 0.92) 100%) !important;
  border: 1.5px solid rgba(80, 140, 255, 0.50) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55) !important;
  animation: chat-breath-blue 3s ease-in-out infinite !important;
}

.chat-open-btn:hover {
  background: linear-gradient(135deg,
    rgba(22, 40, 90, 0.96) 0%,
    rgba(30, 55, 120, 0.96) 100%) !important;
  border-color: rgba(100, 170, 255, 0.75) !important;
  transform: scale(1.08) !important;
  animation: none !important;
  box-shadow: 0 0 14px rgba(80,140,255,0.40), 0 4px 16px rgba(0,0,0,0.55) !important;
}

@keyframes chat-breath-blue {
  0%, 100% { box-shadow: 0 0 0 0   rgba(80,140,255,0.45), 0 4px 16px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(80,140,255,0),   0 4px 16px rgba(0,0,0,0.5); }
}

/* ── FIX 3: Quick slot numbers start at 1 ───────────────────────────────── */
/* The ::before uses attr(data-slot-index). To offset +1 in pure CSS is not
   possible, so we use a CSS counter instead. Phaser sets data-slot-index
   as 0-based; the counter below auto-increments from 1. */

#quick-slots {
  counter-reset: slot-counter;
}

.quick-slot::before {
  counter-increment: slot-counter;
  content: counter(slot-counter);  /* 1, 2, 3 … */
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 8px;
  color: rgba(255,255,255,0.35);
  font-family: 'PressStart2P', monospace;
  pointer-events: none;
  line-height: 1;
  z-index: 2;
}

/* ── FIX 4: Inventory panel — professional redesign ─────────────────────── */

#inventory-panel {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(560px, 92vw) !important;
  max-height: min(520px, 90vh) !important;
  /* glassmorphism dark */
  background: linear-gradient(160deg,
    rgba(10, 12, 28, 0.97) 0%,
    rgba(16, 20, 44, 0.97) 100%) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(100, 140, 255, 0.22) !important;
  border-radius: 18px !important;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.75),
    0  0  0 1px rgba(255,255,255,0.04) inset,
    0  1px 0 rgba(255,255,255,0.08) inset !important;
  padding: 0 !important;
  display: none;   /* Phaser shows it */
  flex-direction: column;
  overflow: hidden;
  z-index: 900 !important;
  box-sizing: border-box !important;
}

/* Show flex when active (Phaser removes display:none) */
#inventory-panel[style*="block"],
#inventory-panel[style*="flex"] {
  display: flex !important;
}

/* Header strip */
#inventory-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: linear-gradient(135deg,
    rgba(30, 40, 90, 0.85) 0%,
    rgba(20, 30, 70, 0.85) 100%);
  border-bottom: 1px solid rgba(100,140,255,0.18);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
  z-index: 0;
}

/* Title */
#inventory-panel h2,
#inventory-panel .letrainv {
  position: relative;
  z-index: 1;
  margin: 0 !important;
  padding: 14px 20px !important;
  font-family: 'PressStart2P', monospace !important;
  font-size: 12px !important;
  color: #c8d8ff !important;
  text-shadow: 0 0 10px rgba(100,140,255,0.5) !important;
  letter-spacing: 1px !important;
  text-align: left !important;
  /* add a small backpack emoji via content trick */
}

#inventory-panel h2::before,
#inventory-panel .letrainv::before {
  content: '🎒  ';
  font-size: 14px;
}

/* Close button */
#inventory-panel .cerrar-hud {
  position: absolute !important;
  top: 10px !important;
  right: 14px !important;
  width: 30px !important;
  height: 30px !important;
  background: rgba(255, 60, 60, 0.12) !important;
  border: 1px solid rgba(255, 60, 60, 0.30) !important;
  border-radius: 50% !important;
  color: rgba(255, 130, 130, 0.85) !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
  transition: background 0.15s, color 0.15s, transform 0.15s !important;
}

#inventory-panel .cerrar-hud:hover {
  background: rgba(255, 60, 60, 0.30) !important;
  color: #fff !important;
  transform: scale(1.15) rotate(90deg) !important;
}

/* Grid container */
#inventory-grid {
  display: grid !important;
  grid-template-columns: repeat(8, 1fr) !important;
  gap: 5px !important;
  padding: 14px 16px 16px !important;
  margin-top: 52px !important; /* push below header */
  max-height: calc(min(520px, 90vh) - 52px) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  /* custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(100,140,255,0.30) transparent;
}

#inventory-grid::-webkit-scrollbar {
  width: 5px !important;
}

#inventory-grid::-webkit-scrollbar-track {
  background: transparent !important;
}

#inventory-grid::-webkit-scrollbar-thumb {
  background: rgba(100,140,255,0.30) !important;
  border-radius: 3px !important;
}

/* Inventory slots */
.inv-slot {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  background: rgba(20, 26, 55, 0.70) !important;
  border: 1.5px solid rgba(100,140,255,0.15) !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  position: relative !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s !important;
  /* subtle inner top-light */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

.inv-slot:hover {
  background: rgba(40, 55, 110, 0.80) !important;
  border-color: rgba(100,160,255,0.40) !important;
  box-shadow:
    0 0 8px rgba(80,130,255,0.20),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

.inv-slot.highlight {
  border-color: rgba(255, 80, 80, 0.85) !important;
  box-shadow:
    0 0 10px rgba(255,80,80,0.35),
    inset 0 0 6px rgba(255,80,80,0.10) !important;
  background: rgba(55, 20, 20, 0.65) !important;
}

.inv-slot img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  pointer-events: none !important;
  user-select: none !important;
  image-rendering: pixelated !important;
  padding: 4px !important;
  box-sizing: border-box !important;
}

.inv-slot .item-count {
  position: absolute !important;
  bottom: 2px !important;
  right: 4px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #ffe066 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
  pointer-events: none !important;
  font-family: 'Segoe UI', sans-serif !important;
  line-height: 1 !important;
}

/* ── Inventory responsive ───────────────────────────────────────────────── */

@media (max-width: 480px) {
  #inventory-panel {
    width: 96vw !important;
    max-height: 85vh !important;
    border-radius: 14px !important;
  }

  #inventory-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 4px !important;
    padding: 10px 10px 12px !important;
  }

  #inventory-panel h2,
  #inventory-panel .letrainv {
    font-size: 9px !important;
    padding: 14px 14px !important;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  #inventory-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}



/* ==========================================================================
   HUB FIXES v3 — cajahub, inventory drag-handle, chat, quick-slot button
   ========================================================================== */

/* ── FIX 1: cajahub — remove the !important so Phaser can control #hub ───── */
/* #cajahub wraps #hub. cajahub should always be visible as a transparent
   wrapper. #hub.hidden is what Phaser toggles. */
#cajahub {
  display: block !important; /* always visible wrapper */
}
#hub.hidden {
  display: none !important;
}

/* ── FIX 2: Inventory panel — z-index 1001, draggable from header only ───── */

#inventory-panel {
  z-index: 1001 !important;
  cursor: default !important;     /* body of panel: normal cursor */
  user-select: none !important;
}

/* Drag handle = the header strip */
#inventory-panel .inv-drag-handle {
  cursor: grab !important;
  cursor: -webkit-grab !important;
}
#inventory-panel .inv-drag-handle:active {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
}

/* Grid and content areas: explicitly not draggable */
#inventory-grid {
  cursor: default !important;
  pointer-events: auto !important;
  touch-action: none;
}

/* ── FIX 3: Chat panel — white text, blue theme, hidden by default ────────── */

/* Default hidden state (Phaser removes chat-hidden to show) */
#chat-panel {
  background: linear-gradient(160deg,
    rgba(10, 14, 32, 0.95) 0%,
    rgba(16, 22, 50, 0.95) 100%) !important;
  color: #e8eeff !important;
  border: 1.5px solid rgba(80, 130, 255, 0.40) !important;
  border-radius: 14px !important;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  font-family: 'Segoe UI', Tahoma, sans-serif !important;
}

.chat-messages {
  color: #e8eeff !important;
}

.chat-line {
  border-bottom-color: rgba(80,130,255,0.10) !important;
  color: #e8eeff !important;
}

.chat-line strong {
  color: #a8c4ff !important;
}

.chat-time {
  color: rgba(160,190,255,0.60) !important;
}

#chat-input {
  border-top: 1px solid rgba(80,130,255,0.28) !important;
  background: rgba(255,255,255,0.04) !important;
  color: #e8eeff !important;
  border-radius: 0 0 12px 12px !important;
}

#chat-input::placeholder {
  color: rgba(160,190,255,0.45) !important;
}

/* ── FIX 4: Quick-slot inventory shortcut button (mobile-friendly) ────────── */

#inv-shortcut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 50px;            /* same height as slots */
  margin-left: 4px;
  background: linear-gradient(135deg,
    rgba(30, 40, 90, 0.82) 0%,
    rgba(20, 30, 70, 0.82) 100%);
  border: 1.5px solid rgba(100,150,255,0.35);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.40),
              inset 0 1px 0 rgba(255,255,255,0.06);
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  touch-action: manipulation; /* fast tap on iOS */
}

#inv-shortcut-btn:hover,
#inv-shortcut-btn:active {
  background: linear-gradient(135deg,
    rgba(50, 70, 140, 0.92) 0%,
    rgba(35, 55, 110, 0.92) 100%);
  border-color: rgba(120, 170, 255, 0.60);
  transform: scale(1.07);
}

#inv-shortcut-btn svg {
  width: 18px;
  height: 18px;
  fill: rgba(160,200,255,0.85);
  pointer-events: none;
}

/* Tooltip */
#inv-shortcut-btn::after {
  content: 'Inventory';
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,14,32,0.95);
  border: 1px solid rgba(100,140,255,0.28);
  color: #c8d8ff;
  font-size: 9px;
  font-family: 'PressStart2P', monospace;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

#inv-shortcut-btn:hover::after {
  opacity: 1;
  visibility: visible;
}


/* ── Inventory drag-handle strip (header) ────────────────────────────────── */

#inventory-panel .inv-drag-handle {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 50px 0 20px; /* right padding leaves room for ✕ */
  height: 52px;
  flex-shrink: 0;
  /* inherit the header gradient from the ::before pseudo — no extra bg needed */
  border-radius: 18px 18px 0 0;
  /* override any default cursor set on #inventory-panel */
  cursor: grab !important;
  cursor: -webkit-grab !important;
  user-select: none;
}

#inventory-panel .inv-drag-handle:active {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
}

/* Keep the title in the handle */
#inventory-panel .inv-drag-handle .letrainv,
#inventory-panel .inv-drag-handle h2 {
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none; /* clicks pass through to drag handle */
}

/* Keep close button accessible inside handle */
#inventory-panel .inv-drag-handle .cerrar-hud {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  cursor: pointer !important;
}

/* Prevent grid from initiating any drag — only handle moves panel */
#inventory-grid,
#inventory-grid * {
  cursor: default !important;
}

/* Shortcut btn positioning — appended right after #quick-slots in the DOM,
   so we position it anchored to the slots bar */
#inv-shortcut-btn {
  position: absolute;
  bottom: 18px;
  /* JS will set left dynamically OR we use CSS calc based on slot width.
     As a fallback, right side of center bar: */
  left: calc(50% + var(--slots-width, 200px) / 2 + 8px);
  transform: none;
  z-index: 101;
}

/* On very small screens, make it a bit more visible */
@media (max-width: 480px) {
  #inv-shortcut-btn {
    width: 42px;
    height: 42px;
    bottom: 10px;
  }
  #inv-shortcut-btn svg {
    width: 20px;
    height: 20px;
  }
}


/* ── Quick-slots bar wrapper override (now inside #quick-slots-bar flex) ──── */

/* Reset the old absolute positioning on #quick-slots — the parent bar handles it */
#quick-slots {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  /* slots still show as flex row */
  display: flex !important;
  gap: 4px !important;
}

/* The wrapper itself carries the pill style */
#quick-slots-bar {
  background: rgba(8, 10, 22, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(100, 140, 255, 0.18) !important;
  border-radius: 14px !important;
  padding: 5px 8px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55),
              inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* Shortcut button is now inline — no absolute positioning needed */
#inv-shortcut-btn {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  align-self: center;
}


/* ==========================================================================
   HUB FIXES v4 — hidden states for chat btn, quick-slots bar, cajahub
   ========================================================================== */

/* Chat button hidden */
.chat-open-btn.hidden {
  display: none !important;
}

/* Quick-slots bar hidden */
#quick-slots-bar.hidden {
  display: none !important;
}

/* cajahub / #hub hidden */
#hub.hidden {
  display: none !important;
}

/* Shortcut button image sizing */
#inv-shortcut-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}


/* ==========================================================================
   HUB FIX v5 — cajahub collapse correcto en PC + click en imagen
   ========================================================================== */

/* Cuando #hub-info está colapsado, ocultar completamente sin residuo visual */
#hub-info.collapsed {
  max-width: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  min-width: 0 !important;
  pointer-events: none !important;
}

/* En PC, el #hub también debe achicarse cuando info está colapsado */
#hub:has(#hub-info.collapsed) {
  min-width: 0 !important;
  padding-right: 10px !important;
}

/* Fallback sin :has() — si JS añade clase 'collapsed' al propio #hub */
#hub.info-collapsed {
  min-width: 0 !important;
  padding-right: 10px !important;
}

/* Imagen y contenedor siempre clickeables */
#hub-image-container,
#hub-image,
#player-image {
  pointer-events: auto !important;
  cursor: pointer !important;
  cursor: var(--cursor-value) !important;
}

/* Evitar que el resto del hub capture el click cuando está colapsado */
#hub-info.collapsed * {
  pointer-events: none !important;
}

/* En móvil no cambiar comportamiento */
@media (max-width: 640px) {
  #hub-info.collapsed {
    max-width: 0 !important;
    max-height: 0 !important;
  }
}


/* ==========================================================================
   HUB REDESIGN v6 — Professional cajahub bars, inventory padding fix,
   chat hover animation, shortcut button emoji
   ========================================================================== */

/* ── cajahub / #hub — full professional rework ───────────────────────────── */

#hub {
  padding: 10px 14px 12px 10px !important;
  border: 1px solid rgba(120, 150, 255, 0.22) !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg,
    rgba(14, 17, 38, 0.96) 0%,
    rgba(22, 28, 58, 0.96) 100%) !important;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 rgba(255,255,255,0.07) inset !important;
}

/* Level badge */
#player-level-container {
  background: linear-gradient(135deg, #1e6b20 0%, #2e8c30 50%, #1e6b20 100%) !important;
  border: 1px solid rgba(100, 255, 110, 0.50) !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.55),
    0 0 10px rgba(80,220,90,0.20) !important;
}

#player-level {
  font-size: 10px !important;
  color: #c8ffc8 !important;
  text-shadow: 0 0 8px rgba(100,255,100,0.70) !important;
  letter-spacing: 0.5px !important;
}

/* Avatar ring */
#player-image {
  border: 2px solid rgba(120, 150, 255, 0.45) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 4px 14px rgba(0,0,0,0.55) !important;
  border-radius: 12px !important;
}

/* Username */
#username {
  font-size: 0.82em !important;
  font-weight: 700 !important;
  color: #c8d4ff !important;
  letter-spacing: 0.4px !important;
  margin-bottom: 9px !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7) !important;
  /* truncate with ellipsis if long wallet address */
  max-width: 170px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-family: 'Segoe UI', monospace !important;
}

/* ── Status bars — full professional restyle ─────────────────────────────── */

.status-bar {
  height: 20px !important;
  border-radius: 10px !important;
  margin-bottom: 6px !important;
  background: rgba(0, 0, 0, 0.50) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.45) !important;
  overflow: hidden !important;
  position: relative !important;
  min-width: 160px !important;
}

/* Fills */
#health-bar .status-fill {
  background: linear-gradient(90deg,
    #8b1a1a 0%, #c0392b 35%, #e74c3c 65%, #ff6b5b 85%, #ff8a75 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20) !important;
}

#water-bar .status-fill {
  background: linear-gradient(90deg,
    #0d4a7a 0%, #1a6fa8 35%, #3498db 65%, #5dade2 85%, #7ec8f0 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20) !important;
}

#food-bar .status-fill {
  background: linear-gradient(90deg,
    #7a4a00 0%, #b7770d 35%, #e8940e 65%, #f5b942 85%, #ffd060 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20) !important;
}

/* Shimmer overlay */
.status-fill::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.22) 50%,
    transparent 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: bar-shimmer 3.5s linear infinite !important;
  pointer-events: none !important;
}

/* Bar label text */
.status-text {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: rgba(255,255,255,0.95) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,1), 0 0 6px rgba(0,0,0,0.8) !important;
  letter-spacing: 0.2px !important;
  font-family: 'Segoe UI', sans-serif !important;
  z-index: 3 !important;
}

/* Icons before each bar text */
#health-bar .status-text::before { content: '❤ '; font-size: 9px; }
#water-bar  .status-text::before { content: '💧 '; font-size: 9px; }
#food-bar   .status-text::before { content: '🍖 '; font-size: 9px; }

/* ── Inventory panel — fix top empty space ───────────────────────────────── */

/* The ::before header pseudo-element was causing extra space.
   Reattach grid margin to match exactly the handle height */
#inventory-panel::before {
  height: 50px !important;
  border-radius: 16px 16px 0 0 !important;
}

#inventory-grid {
  margin-top: 50px !important;
  padding: 10px 14px 14px !important;
  max-height: calc(min(520px, 90vh) - 50px) !important;
  grid-auto-rows: 60px !important;
}

/* ── Chat button hover — same animation as round buttons ─────────────────── */

.chat-open-btn {
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s !important;
}

.chat-open-btn:hover {
  transform: scale(1.08) !important;
  animation: btn-glow-blue 0.5s ease-out forwards !important;
}

.chat-open-btn:active {
  transform: scale(0.93) !important;
}

@keyframes btn-glow-blue {
  0%   { box-shadow: 0 0 0 0   rgba(80,140,255,0.55), 0 4px 16px rgba(0,0,0,0.55); }
  100% { box-shadow: 0 0 0 10px rgba(80,140,255,0),   0 4px 16px rgba(0,0,0,0.55); }
}

/* ── Inventory shortcut button — emoji large & centered ──────────────────── */

#inv-shortcut-btn {
  font-size: 22px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 50px !important;
  height: 50px !important;
  padding: 0 !important;
  /* remove old img rules */
}

#inv-shortcut-btn img {
  display: none !important;
}


/* ==========================================================================
   HUB REDESIGN v7 — mobile scale, avatar glow, chat hover, luggage emoji
   ========================================================================== */

/* ── Avatar hover glow animation ─────────────────────────────────────────── */

@keyframes avatar-glow-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(140,170,255,0.80),
                    0 0 12px 2px rgba(100,140,255,0.40),
                    0 4px 14px rgba(0,0,0,0.55); }
  50%  { box-shadow: 0 0 0 5px rgba(140,170,255,0.35),
                    0 0 20px 6px rgba(100,140,255,0.55),
                    0 4px 14px rgba(0,0,0,0.55); }
  100% { box-shadow: 0 0 0 0   rgba(140,170,255,0.0),
                    0 0 12px 2px rgba(100,140,255,0.20),
                    0 4px 14px rgba(0,0,0,0.55); }
}

#hub-image-container:hover #player-image,
#hub-image:hover #player-image {
  animation: avatar-glow-pulse 1.2s ease-in-out infinite !important;
  border-color: rgba(160,190,255,0.80) !important;
  filter: brightness(1.08) !important;
}

/* ── Chat button — EXACT same hover behavior as .round-btn ───────────────── */

/* Reset all previous conflicting chat hover rules */
.chat-open-btn:hover {
  background: linear-gradient(135deg,
    rgba(22, 40, 90, 0.96) 0%,
    rgba(30, 55, 120, 0.96) 100%) !important;
  border-color: rgba(120, 170, 255, 0.50) !important;
  transform: scale(1.08) !important;
  animation: btn-glow 0.5s ease-out forwards !important;
  box-shadow: none !important; /* let keyframe handle it */
}

.chat-open-btn:active {
  transform: scale(0.94) !important;
  animation: none !important;
}

/* ── Mobile: cajahub / #hub — scale down ────────────────────────────────── */

@media (max-width: 640px) {
  #hub {
    padding: 7px 10px 8px 8px !important;
    border-radius: 12px !important;
    min-width: 0 !important;
  }

  #player-image {
    width: 52px !important;
    height: 52px !important;
    border-radius: 9px !important;
  }

  #player-level-container {
    padding: 2px 8px !important;
    margin-bottom: 3px !important;
  }

  #player-level {
    font-size: 8px !important;
  }

  #hub-info {
    margin-left: 8px !important;
    max-width: 145px !important;
    min-width: 110px !important;
  }

  #username {
    font-size: 0.70em !important;
    margin-bottom: 6px !important;
    max-width: 140px !important;
  }

  .status-bar {
    height: 15px !important;
    margin-bottom: 4px !important;
    min-width: 110px !important;
    border-radius: 7px !important;
  }

  .status-text {
    font-size: 8px !important;
  }

  #health-bar .status-text::before,
  #water-bar  .status-text::before,
  #food-bar   .status-text::before {
    display: none; /* hide icons on small screens to save space */
  }
}

/* ── Mobile: quick-slots bar — scale down ────────────────────────────────── */

@media (max-width: 640px) {
  #quick-slots-bar {
    bottom: 8px !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    gap: 3px !important;
  }

  #quick-slots {
    gap: 3px !important;
  }

  .quick-slot {
    width: 38px !important;
    height: 38px !important;
    border-radius: 6px !important;
  }

  .quick-slot img {
    padding: 2px !important;
  }

  .quick-slot .item-count {
    font-size: 9px !important;
  }

  .quick-slot::before {
    font-size: 7px !important;
  }

  #inv-shortcut-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
  }
}

/* ── Luggage emoji shortcut button sizing ───────────────────────────────── */

#inv-shortcut-btn {
  font-size: 22px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 50px !important;
  height: 50px !important;
  padding: 0 !important;
}


/* ==========================================================================
   HUB REDESIGN v8 — Transparency + animations overhaul on all HUD elements
   ========================================================================== */

/* ── Global keyframes ────────────────────────────────────────────────────── */

@keyframes hub-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-2px); }
}

@keyframes slot-bar-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes hub-enter {
  from { opacity: 0; transform: translateX(-14px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0)     scale(1); }
}

@keyframes inventory-enter {
  from { opacity: 0; transform: translate(-50%,-46%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

@keyframes chat-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes btn-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes slot-pulse-active {
  0%,100% { box-shadow: 0 0 0 0   rgba(255,80,80,0.6), inset 0 0 4px rgba(255,80,80,0.10); }
  50%      { box-shadow: 0 0 8px 3px rgba(255,80,80,0.35), inset 0 0 8px rgba(255,80,80,0.15); }
}

/* ── #hub / cajahub ─────────────────────────────────────────────────────── */

#hub {
  background: linear-gradient(145deg,
    rgba(10, 13, 30, 0.72) 0%,
    rgba(16, 22, 50, 0.72) 100%) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
  border: 1px solid rgba(140, 170, 255, 0.18) !important;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.45),
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(255,255,255,0.03) inset !important;
  animation: hub-enter 0.5s cubic-bezier(0.2,0.9,0.2,1) both !important;
}

/* Avatar frame glow (idle) */
#player-image {
  border: 1.5px solid rgba(140,170,255,0.35) !important;
  box-shadow:
    0 0 0 3px rgba(100,140,255,0.10),
    0 4px 14px rgba(0,0,0,0.45) !important;
  transition: border-color 0.25s, box-shadow 0.25s, filter 0.25s !important;
}

/* Level pill */
#player-level-container {
  background: linear-gradient(135deg,
    rgba(20,80,22,0.80) 0%,
    rgba(35,110,38,0.80) 100%) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  border: 1px solid rgba(100,240,110,0.40) !important;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.40),
    0 0 8px rgba(80,200,90,0.15) !important;
}

/* Bars */
.status-bar {
  background: rgba(0,0,0,0.38) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.50),
    inset 0 -1px 0 rgba(255,255,255,0.04) !important;
}

/* ── Round buttons ──────────────────────────────────────────────────────── */

.round-btn {
  background: linear-gradient(145deg,
    rgba(12, 16, 38, 0.68) 0%,
    rgba(20, 28, 58, 0.68) 100%) !important;
  backdrop-filter: blur(16px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
  border: 1px solid rgba(120,160,255,0.18) !important;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.40),
    0 1px 0 rgba(255,255,255,0.07) inset !important;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Shimmer sweep on each button */
.round-btn::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.10) 50%,
    transparent 70%
  ) !important;
  background-size: 200% 100% !important;
  animation: btn-shimmer 4s linear infinite !important;
  pointer-events: none !important;
}

.round-btn:hover {
  background: linear-gradient(145deg,
    rgba(30, 45, 100, 0.82) 0%,
    rgba(42, 62, 130, 0.82) 100%) !important;
  border-color: rgba(140,185,255,0.55) !important;
  transform: scale(1.10) !important;
  box-shadow:
    0 6px 22px rgba(0,0,0,0.50),
    0 0 0 0 rgba(100,180,255,0.55),
    0 1px 0 rgba(255,255,255,0.10) inset !important;
  animation: btn-glow 0.5s ease-out forwards !important;
}

.round-btn:active {
  transform: scale(0.92) !important;
  animation: none !important;
}

/* ── Quick-slots bar ────────────────────────────────────────────────────── */

#quick-slots-bar {
  background: rgba(8, 10, 22, 0.62) !important;
  backdrop-filter: blur(18px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
  border: 1px solid rgba(120,160,255,0.16) !important;
  box-shadow:
    0 6px 24px rgba(0,0,0,0.45),
    0 1px 0 rgba(255,255,255,0.07) inset !important;
  animation: slot-bar-enter 0.55s cubic-bezier(0.2,0.9,0.2,1) both !important;
}

.quick-slot {
  background: rgba(16, 20, 46, 0.60) !important;
  border: 1px solid rgba(120,160,255,0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 2px 6px rgba(0,0,0,0.30) !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Slot hover shimmer */
.quick-slot::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 7px !important;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.0) 40%,
    rgba(255,255,255,0.07) 55%,
    rgba(255,255,255,0.0) 70%
  ) !important;
  opacity: 0 !important;
  transition: opacity 0.2s !important;
  pointer-events: none !important;
}

.quick-slot:hover::after { opacity: 1 !important; }

.quick-slot:hover {
  background: rgba(35, 48, 100, 0.72) !important;
  border-color: rgba(140,185,255,0.40) !important;
  box-shadow:
    0 0 10px rgba(80,130,255,0.22),
    inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

.quick-slot.highlight {
  background: rgba(55,16,16,0.60) !important;
  border-color: rgba(255,80,80,0.85) !important;
  animation: slot-pulse-active 1.5s ease-in-out infinite !important;
}

/* Inventory shortcut button */
#inv-shortcut-btn {
  background: linear-gradient(145deg,
    rgba(22, 30, 72, 0.72) 0%,
    rgba(30, 40, 90, 0.72) 100%) !important;
  border: 1px solid rgba(140,180,255,0.30) !important;
  box-shadow:
    0 2px 10px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.07) !important;
  transition: background 0.18s, border-color 0.18s, transform 0.14s, box-shadow 0.18s !important;
  position: relative !important;
  overflow: hidden !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

#inv-shortcut-btn svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  transition: filter 0.2s !important;
}

#inv-shortcut-btn:hover {
  background: linear-gradient(145deg,
    rgba(40, 60, 130, 0.85) 0%,
    rgba(52, 78, 160, 0.85) 100%) !important;
  border-color: rgba(160,200,255,0.60) !important;
  transform: scale(1.10) !important;
  box-shadow:
    0 0 14px rgba(100,160,255,0.35),
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 4px 12px rgba(0,0,0,0.40) !important;
  animation: btn-glow 0.5s ease-out forwards !important;
}

#inv-shortcut-btn:active {
  transform: scale(0.92) !important;
  animation: none !important;
}

/* Tooltip */
#inv-shortcut-btn::after {
  content: 'Inventory' !important;
  position: absolute !important;
  bottom: calc(100% + 8px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(10,14,32,0.95) !important;
  border: 1px solid rgba(120,160,255,0.30) !important;
  color: #c8d8ff !important;
  font-size: 9px !important;
  font-family: 'PressStart2P', monospace !important;
  padding: 4px 9px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.15s, visibility 0.15s !important;
  z-index: 200 !important;
}

#inv-shortcut-btn:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ── Inventory panel ─────────────────────────────────────────────────────── */

#inventory-panel {
  background: linear-gradient(160deg,
    rgba(8, 10, 24, 0.82) 0%,
    rgba(14, 18, 40, 0.82) 100%) !important;
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border: 1px solid rgba(120,160,255,0.18) !important;
  box-shadow:
    0 28px 70px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 rgba(255,255,255,0.07) inset !important;
  animation: inventory-enter 0.35s cubic-bezier(0.2,0.9,0.2,1) both !important;
}

#inventory-panel::before {
  background: linear-gradient(135deg,
    rgba(24, 32, 75, 0.75) 0%,
    rgba(18, 24, 58, 0.75) 100%) !important;
  border-bottom: 1px solid rgba(120,160,255,0.14) !important;
}

.inv-slot {
  background: rgba(14, 18, 42, 0.55) !important;
  border: 1px solid rgba(100,140,255,0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04) !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s !important;
}

.inv-slot:hover {
  background: rgba(30, 42, 95, 0.70) !important;
  border-color: rgba(140,185,255,0.42) !important;
  box-shadow:
    0 0 10px rgba(80,130,255,0.20),
    inset 0 1px 0 rgba(255,255,255,0.07) !important;
  transform: scale(1.04) !important;
}

/* ── Chat button ─────────────────────────────────────────────────────────── */

.chat-open-btn {
  background: linear-gradient(145deg,
    rgba(10, 14, 36, 0.68) 0%,
    rgba(16, 24, 60, 0.68) 100%) !important;
  backdrop-filter: blur(18px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.3) !important;
  border: 1px solid rgba(100,155,255,0.28) !important;
  box-shadow:
    0 4px 18px rgba(0,0,0,0.42),
    0 1px 0 rgba(255,255,255,0.07) inset !important;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s !important;
  animation: chat-breath-blue 3.5s ease-in-out infinite !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Shimmer on chat button */
.chat-open-btn::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.10) 50%,
    transparent 70%
  ) !important;
  background-size: 200% 100% !important;
  animation: btn-shimmer 4s linear infinite !important;
  pointer-events: none !important;
}

.chat-open-btn:hover {
  background: linear-gradient(145deg,
    rgba(30, 45, 100, 0.82) 0%,
    rgba(42, 62, 130, 0.82) 100%) !important;
  border-color: rgba(140,185,255,0.58) !important;
  transform: scale(1.10) !important;
  animation: btn-glow 0.5s ease-out forwards !important;
}

.chat-open-btn:active {
  transform: scale(0.92) !important;
  animation: none !important;
}

/* ── Chat panel interior ────────────────────────────────────────────────── */

#chat-panel {
  background: linear-gradient(160deg,
    rgba(8, 12, 30, 0.78) 0%,
    rgba(12, 18, 45, 0.78) 100%) !important;
  backdrop-filter: blur(22px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.4) !important;
  border: 1px solid rgba(100,150,255,0.20) !important;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.55),
    0 1px 0 rgba(255,255,255,0.07) inset !important;
  border-radius: 16px !important;
  animation: chat-enter 0.3s cubic-bezier(0.2,0.9,0.2,1) both !important;
}

.chat-messages {
  color: rgba(220,232,255,0.92) !important;
  font-family: 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 13px !important;
}

.chat-line {
  padding: 5px 4px !important;
  border-bottom: 1px solid rgba(100,140,255,0.08) !important;
  color: rgba(220,232,255,0.90) !important;
  transition: background 0.12s !important;
}

.chat-line:hover {
  background: rgba(80,120,255,0.07) !important;
  border-radius: 4px !important;
}

.chat-line strong {
  color: rgba(160,200,255,0.95) !important;
  font-weight: 600 !important;
}

.chat-time {
  color: rgba(140,170,255,0.55) !important;
  font-size: 10px !important;
}

#chat-input {
  background: rgba(255,255,255,0.05) !important;
  border-top: 1px solid rgba(100,150,255,0.18) !important;
  color: rgba(220,232,255,0.95) !important;
  border-radius: 0 0 14px 14px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  transition: background 0.15s !important;
}

#chat-input:focus {
  background: rgba(100,140,255,0.08) !important;
  outline: none !important;
}

#chat-input::placeholder {
  color: rgba(140,175,255,0.40) !important;
}

/* ── Mobile adjustments for v8 ──────────────────────────────────────────── */

@media (max-width: 640px) {
  #inv-shortcut-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
  }

  #inv-shortcut-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
}


/* ==========================================================================
   HUB FIXES FINAL — layout correcciones definitivas
   ========================================================================== */

/* ── FIX 1: #hub no debe animar posición (causa el bounce arriba/abajo) ─── */
#hub {
  transition:
    background 0.4s ease,
    opacity 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease !important;
  /* sin transition en top/left/transform para que no se mueva */
}

/* ── FIX 2: quick-slots-bar siempre centrado en bottom con position:fixed ── */
#quick-slots-bar {
  position: fixed !important;
  bottom: 18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  z-index: 100 !important;
}

#quick-slots-bar.hidden {
  display: none !important;
}

/* ── FIX 3: hud-containerx2 (la "barra azul inferior") — oculta siempre ─── */
.hud-containerx2,
#hud-containerx2 {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── FIX 4: chat-open-btn y chat-panel fijados en esquina inferior izquierda */
.chat-open-btn {
  position: fixed !important;
  bottom: 20px !important;
  left: 20px !important;
  top: auto !important;
}

#chat-panel {
  position: fixed !important;
  bottom: 80px !important;
  left: 20px !important;
  top: auto !important;
  width: 280px !important;
}

/* ── FIX 5: game-ui-text (barra coordenadas) — oculta siempre ──────────── */
#game-ui-text {
  display: none !important;
}


/* ================================================================
   FIXES DEFINITIVOS — al final para máxima prioridad en cascada
   ================================================================ */

/* 1) label-badge: siempre oculto excepto al hacer hover */
#game-hud .round-buttons .round-btn .label-badge {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s !important;
}
#game-hud .round-buttons .round-btn:hover .label-badge {
  opacity: 1 !important;
  visibility: visible !important;
}

/* 2) notif-badge: siempre en la esquina superior-derecha del botón */
.notif-badge {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  z-index: 20 !important;
}

/* 3) round-btn: overflow visible obligatorio para que el badge salga */
.round-btn,
#game-hud .round-buttons .round-btn {
  overflow: visible !important;
  position: relative !important;
}
/* ==========================================================================
   FIX: Inventory grid — remove duplicate top space
   The .inv-drag-handle (52px) already separates header from grid in flex flow.
   The margin-top on #inventory-grid was adding a second gap on top of that.
   ========================================================================== */
#inventory-grid {
  margin-top: 0 !important;
}


.battle-hub-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 8, 18, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}

.hidden {
  display: none !important;
}

.battle-hub-card {
  position: relative;
  width: min(92vw, 440px);
  border-radius: 24px;
  padding: 28px 22px 22px;
  background:
    radial-gradient(circle at top, rgba(62, 111, 214, 0.28), transparent 35%),
    linear-gradient(180deg, rgba(12, 24, 43, 0.98), rgba(7, 16, 31, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  overflow: hidden;
}

.battle-hub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.battle-hub-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.battle-hub-close:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,0.09);
}

.battle-hub-header {
  text-align: center;
  margin-bottom: 22px;
}

.battle-hub-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(28,95,212,0.28), rgba(13,43,82,0.9));
  border: 1px solid rgba(130, 180, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  font-size: 34px;
  color: #dce9ff;
}

.battle-hub-header h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.4px;
}

.battle-hub-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.battle-hub-actions {
  display: grid;
  gap: 14px;
}

.battle-btn {
  width: 100%;
  min-height: 74px;
  border: 1px solid rgba(120, 170, 255, 0.16);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(180deg, rgba(18, 33, 58, 0.98), rgba(10, 20, 36, 0.98));
  box-shadow: 0 10px 20px rgba(0,0,0,0.28);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.battle-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 170, 255, 0.35);
  background: linear-gradient(180deg, rgba(25, 45, 78, 0.98), rgba(12, 24, 44, 0.98));
}

.battle-btn:active {
  transform: translateY(0);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(28,95,212,0.35), rgba(13,43,82,0.95));
  border: 1px solid rgba(144, 188, 255, 0.16);
}

.btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.btn-text strong {
  font-size: 18px;
  margin-bottom: 4px;
}

.btn-text small {
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 480px) {
  .battle-hub-card {
    width: min(94vw, 420px);
    padding: 24px 16px 16px;
    border-radius: 22px;
  }

  .battle-hub-header h2 {
    font-size: 24px;
  }

  .battle-btn {
    min-height: 68px;
    padding: 12px 14px;
  }

  .btn-text strong {
    font-size: 16px;
  }
}
/* ============================================================
   FURNACE PANEL
   ============================================================ */
.furnace-hidden { display: none !important; }
.furnace-visible { display: flex !important; }

#furnace-panel {
  position: fixed; top:0; left:0; width:100vw; height:100vh;
  background: rgba(0,10,30,0.78);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}
#furnace-panel.furnace-visible { display: flex; }

.furnace-container {
  background: linear-gradient(160deg, #0a1628 0%, #0d2040 40%, #0a2550 100%);
  border: 1.5px solid rgba(64,160,255,0.35);
  border-radius: 16px;
  width: 95%; max-width: 420px;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.20), 0 8px 32px rgba(0,80,180,0.40);
  overflow: hidden;
}

.furnace-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(64,160,255,0.20);
}
.furnace-title { color:#a8d8ff; font-size:15px; font-weight:700; letter-spacing:1px; text-shadow:0 0 10px rgba(64,160,255,0.5); }
.furnace-close-btn {
  background: rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.30);
  color:#a8d8ff; font-size:16px; cursor:pointer;
  width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
}

.furnace-body { padding: 16px 18px; }

.furnace-slots-row {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px;
}
.furnace-slot-box { display:flex; flex-direction:column; gap:8px; }
.furnace-slot {
  width: 72px; height: 72px;
  background: rgba(0,20,50,0.60);
  border: 1.5px dashed rgba(64,160,255,0.35);
  border-radius: 10px;
  display: flex; flex-direction:column; align-items:center; justify-content:center;
  cursor: pointer; position: relative; transition: border-color 0.2s;
}
.furnace-slot:hover { border-color: rgba(64,160,255,0.65); }
.furnace-slot.has-item { border-style: solid; border-color: rgba(64,160,255,0.55); }
.furnace-slot.result { background: rgba(0,30,70,0.60); border-color: rgba(100,220,255,0.30); }
.furnace-slot-label { font-size:9px; color:rgba(100,180,255,0.60); margin-top:4px; }
.furnace-arrow { font-size: 22px; color: rgba(64,160,255,0.55); }
.furnace-result-box { display:flex; flex-direction:column; align-items:center; gap:6px; }
.furnace-timer { font-size:11px; color:#7ec8ff; }
.furnace-status {
  text-align:center; font-size:11px; color:rgba(140,200,255,0.70); margin-bottom:12px; min-height:16px;
}

.furnace-recipes { background: rgba(0,20,50,0.40); border-radius:10px; padding:10px 12px; margin-bottom:14px; border:1px solid rgba(64,160,255,0.15); }
.furnace-recipes-title { font-size:11px; color:#7ec8ff; margin-bottom:8px; letter-spacing:0.5px; }
.furnace-recipe-row { display:flex; gap:6px; align-items:center; font-size:10px; color:rgba(180,220,255,0.75); padding:4px 0; border-bottom:1px solid rgba(64,160,255,0.08); }
.furnace-recipe-row:last-child { border-bottom:none; }

.furnace-footer { display:flex; justify-content:center; }
.furnace-btn-smelt {
  background: linear-gradient(135deg,#1a6fd4,#0a4aaa);
  color:#d0eaff; border:1px solid rgba(64,160,255,0.40);
  border-radius:8px; padding:10px 28px; font-size:13px; font-weight:600;
  cursor:pointer; transition:all 0.2s; letter-spacing:0.5px;
}
.furnace-btn-smelt:disabled { opacity:0.4; cursor:not-allowed; }
.furnace-btn-smelt:not(:disabled):hover { background:linear-gradient(135deg,#2290e8,#1060cc); box-shadow:0 4px 12px rgba(30,100,220,0.40); }

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-panel-hidden { display:none !important; }
.notif-panel-visible { display:flex !important; }

#notif-panel {
  position: fixed; top:0; left:0; width:100vw; height:100vh;
  background: rgba(0,10,30,0.75);
  display:none; justify-content:center; align-items:center;
  z-index: 10002;
}
#notif-panel.notif-panel-visible { display:flex; }

.notif-container {
  background: linear-gradient(160deg,#0a1628 0%,#0d2040 40%,#0a2550 100%);
  border:1.5px solid rgba(64,160,255,0.35);
  border-radius:16px;
  width:95%; max-width:400px; max-height:75vh;
  display:flex; flex-direction:column;
  box-shadow: 0 0 0 1px rgba(64,160,255,0.18), 0 8px 32px rgba(0,80,180,0.40);
  overflow:hidden;
}

.notif-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
  border-bottom:1px solid rgba(64,160,255,0.20);
  flex-shrink:0;
}
.notif-title { color:#a8d8ff; font-size:14px; font-weight:700; letter-spacing:1px; text-shadow:0 0 10px rgba(64,160,255,0.5); }
.notif-header-actions { display:flex; gap:8px; align-items:center; }
.notif-mark-btn { background:rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.25); color:#7ec8ff; border-radius:6px; padding:5px 10px; font-size:10px; cursor:pointer; }
.notif-close-btn { background:rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.30); color:#a8d8ff; font-size:15px; cursor:pointer; width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; }

.notif-list { overflow-y:auto; padding:10px 12px; flex:1; display:flex; flex-direction:column; gap:8px; }
.notif-empty { text-align:center; color:rgba(100,180,255,0.45); font-size:12px; padding:24px 0; }

.notif-item {
  background:rgba(20,50,100,0.35);
  border:1px solid rgba(64,160,255,0.18);
  border-radius:10px; padding:10px 12px;
  display:flex; gap:10px; align-items:flex-start;
  transition: background 0.2s;
}
.notif-item.unread { border-color:rgba(64,160,255,0.40); background:rgba(20,60,120,0.45); }
.notif-item.unread::before { content:''; width:8px; height:8px; background:#40a0ff; border-radius:50%; flex-shrink:0; margin-top:4px; }
.notif-icon { font-size:18px; flex-shrink:0; }
.notif-body { flex:1; }
.notif-msg { font-size:11px; color:#c8e8ff; line-height:1.4; margin-bottom:3px; }
.notif-time { font-size:9px; color:rgba(100,180,255,0.50); }

/* ============================================================
   TRASH QUANTITY — Select All button
   ============================================================ */
.trash-quantity-action-btn.all {
  width:100%; margin:6px 0;
  background:rgba(64,160,255,0.15);
  border:1px solid rgba(64,160,255,0.35);
  color:#a8d8ff; border-radius:7px; padding:7px;
  font-size:12px; cursor:pointer; transition:all 0.2s;
}
.trash-quantity-action-btn.all:hover { background:rgba(64,160,255,0.28); }

/* Close button for hub-panel_101 */
#hub-panel_101 .close-btn_101 {
  position:absolute; top:14px; right:14px;
  background:rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.30);
  color:#a8d8ff; font-size:16px; cursor:pointer;
  width:30px; height:30px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  transition: background 150ms;
}
#hub-panel_101 .close-btn_101:hover { background:rgba(64,160,255,0.25); }

/* ============================================================
   NFT + PET PANEL
   ============================================================ */
.nft-panel-hidden { display:none !important; }
.nft-panel-visible { display:flex !important; }

#nft-panel {
  position:fixed; top:0; left:0; width:100vw; height:100vh;
  background:rgba(0,10,30,0.78);
  display:none; justify-content:center; align-items:center;
  z-index:10003;
}
#nft-panel.nft-panel-visible { display:flex; }

.nft-container {
  background:linear-gradient(160deg,#0a1628 0%,#0d2040 50%,#0a2550 100%);
  border:1.5px solid rgba(64,160,255,0.35);
  border-radius:16px;
  width:95%; max-width:440px; max-height:80vh;
  display:flex; flex-direction:column;
  box-shadow:0 0 0 1px rgba(64,160,255,0.18),0 10px 36px rgba(0,60,160,0.50);
  overflow:hidden;
}
.nft-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px; border-bottom:1px solid rgba(64,160,255,0.20); flex-shrink:0;
}
.nft-title { color:#a8d8ff; font-size:15px; font-weight:700; letter-spacing:1px; text-shadow:0 0 10px rgba(64,160,255,0.5); }
.nft-close-btn {
  background:rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.30);
  color:#a8d8ff; font-size:16px; cursor:pointer;
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}
.nft-body { overflow-y:auto; padding:14px 18px; display:flex; flex-direction:column; gap:14px; }
.nft-section { background:rgba(20,50,100,0.25); border:1px solid rgba(64,160,255,0.15); border-radius:12px; padding:14px; }
.nft-section-title { font-size:12px; color:#7ec8ff; font-weight:600; letter-spacing:0.5px; margin-bottom:12px; }

.nft-pet-area { display:flex; gap:14px; align-items:flex-start; margin-bottom:12px; }
.nft-pet-display {
  width:100px; height:100px; border-radius:12px;
  background:rgba(0,20,50,0.60); border:1.5px solid rgba(64,160,255,0.25);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden;
}
.nft-pet-empty { font-size:10px; color:rgba(100,180,255,0.45); text-align:center; padding:8px; }
.nft-pet-controls { display:flex; flex-direction:column; gap:8px; flex:1; }
.nft-pet-name { font-size:13px; color:#c8e8ff; font-weight:600; }
.nft-btn {
  padding:8px 12px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; transition:all 0.2s;
}
.nft-btn.secondary { background:linear-gradient(135deg,#1a6fd4,#0a4aaa); border:1px solid rgba(64,160,255,0.40); color:#d0eaff; }
.nft-btn.ghost { background:rgba(64,160,255,0.08); border:1px solid rgba(64,160,255,0.22); color:#a8d8ff; }
.nft-btn:hover { opacity:0.85; }

.nft-pet-list { display:flex; flex-wrap:wrap; gap:8px; }
.nft-pet-card {
  width:64px; height:64px; border-radius:10px;
  background:rgba(0,20,50,0.65); border:1.5px solid rgba(64,160,255,0.20);
  cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center;
  transition:border-color 0.2s, box-shadow 0.2s; overflow:hidden;
}
.nft-pet-card:hover, .nft-pet-card.active {
  border-color:rgba(64,160,255,0.65); box-shadow:0 0 10px rgba(30,100,220,0.35);
}
.nft-empty-state { font-size:11px; color:rgba(100,180,255,0.45); text-align:center; padding:20px 0; }

/* NFT round button */
.round-btn--nft { position:relative; }

/* ============================================================
   NPC NAMES — always on top (depth fix via CSS z-index on canvas layers)
   ============================================================ */

/* ============================================================
   SKILLS PANEL
   ============================================================ */
.skills-panel-hidden { display:none !important; }
#skills-panel {
  position:fixed; top:0; left:0; width:100vw; height:100vh;
  background:rgba(0,10,30,0.78);
  display:none; justify-content:center; align-items:center;
  z-index:10004;
}
#skills-panel.skills-panel-visible { display:flex; }

.skills-container {
  background:linear-gradient(160deg,#0a1628 0%,#0d2040 50%,#0a2550 100%);
  border:1.5px solid rgba(64,160,255,0.35);
  border-radius:16px;
  width:95%; max-width:440px; max-height:85vh;
  display:flex; flex-direction:column;
  box-shadow:0 0 0 1px rgba(64,160,255,0.18),0 10px 36px rgba(0,60,160,0.50);
  overflow:hidden;
}
.skills-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px; border-bottom:1px solid rgba(64,160,255,0.20); flex-shrink:0;
}
.skills-title { color:#a8d8ff; font-size:14px; font-weight:700; letter-spacing:1px; text-shadow:0 0 10px rgba(64,160,255,0.5); }
.skills-close-btn {
  background:rgba(64,160,255,0.12); border:1px solid rgba(64,160,255,0.30);
  color:#a8d8ff; font-size:16px; cursor:pointer;
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}
.skills-body { overflow-y:auto; padding:14px 18px; display:flex; flex-direction:column; gap:12px; flex:1; }
.skills-section { background:rgba(20,50,100,0.25); border:1px solid rgba(64,160,255,0.15); border-radius:12px; padding:12px 14px; }
.skills-section-title { font-size:11px; color:#7ec8ff; font-weight:600; letter-spacing:0.5px; margin-bottom:10px; }
.skills-stats-grid { display:flex; flex-direction:column; gap:6px; }
.skill-stat-row {
  display:flex; align-items:center; gap:10px;
  background:rgba(0,20,50,0.40); border-radius:8px; padding:6px 10px;
  border:1px solid rgba(64,160,255,0.10);
}
.skill-stat-icon { font-size:16px; flex-shrink:0; }
.skill-stat-name { flex:1; font-size:10px; color:#c8e8ff; }
.skill-stat-val {
  font-size:11px; font-weight:700; color:#40a0ff;
  background:rgba(30,80,160,0.40); border-radius:5px;
  padding:2px 8px; min-width:30px; text-align:center;
}
.skills-upgrade-list { display:flex; flex-direction:column; gap:6px; }
.skill-upgrade-row {
  display:flex; align-items:center; gap:8px;
  background:rgba(0,20,50,0.35); border-radius:8px; padding:6px 10px;
}
.skill-upgrade-btn {
  background:linear-gradient(135deg,#1a6fd4,#0a4aaa);
  border:1px solid rgba(64,160,255,0.40); color:#d0eaff;
  border-radius:6px; padding:4px 10px; font-size:11px; cursor:pointer; flex-shrink:0;
}
.skill-upgrade-btn:disabled { opacity:0.35; cursor:not-allowed; }
.skills-footer { padding:12px 18px; border-top:1px solid rgba(64,160,255,0.15); flex-shrink:0; }
.skills-save-btn {
  width:100%; background:linear-gradient(135deg,#1a7fd4,#0a55b0);
  border:1px solid rgba(64,160,255,0.40); color:#d0eaff;
  border-radius:8px; padding:10px; font-size:12px; font-weight:600; cursor:pointer;
  letter-spacing:1px;
}
.skills-save-btn:hover { background:linear-gradient(135deg,#2290e8,#1060cc); }
