/* ==========================================================================
   ATLAS MMORPG • SISTEMA DE HUD Y PAPERDOLL (game/css/hud.css)
   - Ventana de Equipamiento (Paperdoll 3x3)
   - Slots de equipo con bordes nítidos de rareza y resplandor glow
   - Interacción Mochila <-> Paperdoll (clic y doble toque ergonómico)
   ========================================================================== */

/* Contenedor del Paperdoll (Muñeco de papel 3x3) */
.atlas-equip-paperdoll {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  justify-items: center;
  align-items: center;
  padding: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Slot base del muñeco */
.atlas-equip-slot {
  width: 62px;
  height: 62px;
  background: #181c24;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.15), inset -1px -1px 0 rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
}

.atlas-equip-slot:active {
  transform: scale(0.96);
}

/* Ranura vacía (Placeholder) */
.atlas-equip-slot.empty {
  cursor: default;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.atlas-equip-slot.empty:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.6);
  transform: none;
}

.atlas-equip-slot .equip-ph-icon {
  font-size: 20px;
  opacity: 0.4;
  filter: grayscale(0.6);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.atlas-equip-slot .equip-slot-lbl {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.4px;
  pointer-events: none;
}

/* Ranura equipada (Filled) */
.atlas-equip-slot.filled {
  background: rgba(30, 41, 59, 0.95);
  border: 2px solid var(--slot-rarity-color, #94a3b8);
  box-shadow: 0 0 10px var(--slot-rarity-glow, rgba(148, 163, 184, 0.35));
}

.atlas-equip-slot.filled:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 16px var(--slot-rarity-glow, rgba(148, 163, 184, 0.6));
  filter: brightness(1.15);
}

.atlas-equip-slot.filled img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  transition: transform 0.15s ease;
}

.atlas-equip-slot.filled:hover img {
  transform: scale(1.08);
}

.atlas-equip-slot.filled .equip-item-emoji {
  font-size: 26px;
  pointer-events: none;
}

/* Borde y glow específico por clases de rareza */
.atlas-equip-slot.rarity-common {
  --slot-rarity-color: #94a3b8;
  --slot-rarity-glow: rgba(148, 163, 184, 0.4);
  border-color: #94a3b8;
}

.atlas-equip-slot.rarity-uncommon {
  --slot-rarity-color: #22c55e;
  --slot-rarity-glow: rgba(34, 197, 94, 0.45);
  border-color: #22c55e;
}

.atlas-equip-slot.rarity-rare {
  --slot-rarity-color: #38bdf8;
  --slot-rarity-glow: rgba(56, 189, 248, 0.55);
  border-color: #38bdf8;
}

.atlas-equip-slot.rarity-epic {
  --slot-rarity-color: #c084fc;
  --slot-rarity-glow: rgba(192, 132, 252, 0.6);
  border-color: #c084fc;
}

.atlas-equip-slot.rarity-legendary {
  --slot-rarity-color: #f59e0b;
  --slot-rarity-glow: rgba(245, 158, 11, 0.7);
  border-color: #f59e0b;
}

/* Slot especial de Mochila (Backpack) */
.atlas-equip-slot.backpack-slot.filled {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Indicador de clic para desequipar al pasar el ratón */
.atlas-equip-slot.filled::after {
  content: '✕';
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 800;
  color: #ef4444;
  background: rgba(0, 0, 0, 0.65);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.atlas-equip-slot.filled:not(.backpack-slot):not(.dual-backpack-slot):hover::after {
  opacity: 1;
  transform: scale(1.1);
}

/* ==========================================================================
   SLOT DUAL DE MOCHILAS (CANÓNICO: PRINCIPAL GRANDE & BOTÍN INSET PEQUEÑO)
   ========================================================================== */
.atlas-equip-slot.dual-backpack-slot {
  position: relative !important;
  display: block !important;
  padding: 0 !important;
  background: #12161f !important;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  box-sizing: border-box;
  cursor: default !important;
  overflow: visible !important;
}

.atlas-equip-slot.dual-backpack-slot:hover {
  transform: none !important;
  filter: none !important;
}

.atlas-equip-slot.dual-backpack-slot::after,
.atlas-equip-slot.spacer::after {
  display: none !important;
}

/* Mochila Principal (GRANDE: ocupa el 100% del slot base) */
.dual-bp-subslot.main-bp {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(24, 28, 36, 0.95);
  border: none !important;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  box-sizing: border-box;
  z-index: 1;
}

.dual-bp-subslot.main-bp:hover {
  background: rgba(56, 189, 248, 0.18) !important;
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.3);
}

.dual-bp-subslot.main-bp.selected {
  background: rgba(245, 158, 11, 0.2) !important;
  box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.6) !important;
}

.dual-bp-subslot.main-bp img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
  pointer-events: none;
}

.dual-bp-subslot.main-bp .dual-bp-emoji {
  font-size: 22px !important;
  line-height: 1;
  pointer-events: none;
}

/* Tag discreto de Mochila Principal (esquina superior izquierda) */
.dual-bp-subslot.main-bp .dual-bp-tag {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 7px;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 1px 2px #000;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  pointer-events: none;
  line-height: 1;
  opacity: 0.9;
}

/* Mochila de Botín (PEQUEÑA: ranura secundaria/bolsillo en la esquina inferior derecha) */
.dual-bp-subslot.loot-bp {
  position: absolute !important;
  bottom: 2px !important;
  right: 2px !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #0d121c !important;
  border: 1.5px solid #f59e0b !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.95), 0 0 4px rgba(245, 158, 11, 0.45) !important;
  cursor: pointer;
  z-index: 5 !important;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}

.dual-bp-subslot.loot-bp:hover {
  transform: scale(1.3) !important;
  border-color: #fde047 !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.95), 0 0 10px rgba(250, 204, 21, 0.9) !important;
  background: #1e293b !important;
  z-index: 10 !important;
}

.dual-bp-subslot.loot-bp.empty {
  border-style: dashed !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  background: rgba(15, 23, 42, 0.85) !important;
  opacity: 0.8;
}

.dual-bp-subslot.loot-bp.empty:hover {
  opacity: 1;
  border-color: #fde047 !important;
}

.dual-bp-subslot.loot-bp.selected {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9) !important;
  background: rgba(56, 189, 248, 0.25) !important;
}

.dual-bp-subslot.loot-bp img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
  pointer-events: none;
}

.dual-bp-subslot.loot-bp .dual-bp-emoji {
  font-size: 11px !important;
  line-height: 1;
  pointer-events: none;
}

/* Ocultar texto "BOT" dentro del mini-pocket para no saturar 19px */
.dual-bp-subslot.loot-bp .dual-bp-tag {
  display: none !important;
}

/* Adaptación para la cuadrícula compacta de 44px (Paperdoll del inventario canónico) */
.inv-paperdoll-grid-3x4 .atlas-equip-slot.dual-backpack-slot {
  width: 44px;
  height: 44px;
}

.inv-paperdoll-grid-3x4 .dual-bp-subslot.main-bp img {
  width: 25px !important;
  height: 25px !important;
}

.inv-paperdoll-grid-3x4 .dual-bp-subslot.main-bp .dual-bp-emoji {
  font-size: 20px !important;
}

.inv-paperdoll-grid-3x4 .dual-bp-subslot.loot-bp {
  width: 20px !important;
  height: 20px !important;
  bottom: 2px !important;
  right: 2px !important;
}

.inv-paperdoll-grid-3x4 .dual-bp-subslot.loot-bp img {
  width: 16px !important;
  height: 16px !important;
}

.inv-paperdoll-grid-3x4 .dual-bp-subslot.loot-bp .dual-bp-emoji {
  font-size: 10px !important;
}

/* Para slots estándar más grandes (62px en vistas expandidas) */
.atlas-equip-slot:not(.inv-paperdoll-grid-3x4 *) .dual-bp-subslot.main-bp img {
  width: 36px !important;
  height: 36px !important;
}

.atlas-equip-slot:not(.inv-paperdoll-grid-3x4 *) .dual-bp-subslot.loot-bp {
  width: 24px !important;
  height: 24px !important;
  bottom: 3px !important;
  right: 3px !important;
}

.atlas-equip-slot:not(.inv-paperdoll-grid-3x4 *) .dual-bp-subslot.loot-bp img {
  width: 16px !important;
  height: 16px !important;
}

/* Espaciadores invisibles para el centrado canónico de botas en fila 4 */
.atlas-equip-slot.spacer {
  visibility: hidden !important;
  pointer-events: none !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Animación sutil al equipar */
@keyframes equipPopIn {
  0% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.atlas-equip-slot.equip-pop {
  animation: equipPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   ATLAS MMORPG • MENÚ PRINCIPAL (#modal-main-menu)
   - Pestaña de Tareas Activas (#menu-view-task)
   - Pestaña de Tienda del Reino / Support Store (#menu-view-shops)
   ========================================================================== */

/* 1. PESTAÑA: TAREAS ACTIVAS (TASKS REGISTRY) */
.main-menu-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.active-task-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.active-task-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.85);
}

.active-task-card.completed {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(6, 78, 59, 0.25);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.task-card-monster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-monster-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.task-monster-emoji {
  font-size: 26px;
  line-height: 1;
}

.task-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-name {
  font-family: var(--font-serif, Georgia);
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.task-target-species {
  font-size: 11px;
  color: #94a3b8;
}

.task-target-species strong {
  color: #e2e8f0;
}

.task-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.task-status-badge.badge-progress {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.task-status-badge.badge-completed {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #4ade80;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.task-progress-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}

.task-progress-counter {
  color: #f1f5f9;
  font-weight: 600;
}

.task-progress-counter strong {
  color: #38bdf8;
}

.task-progress-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.task-progress-fill.fill-done {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}

.task-rewards-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.task-rewards-label {
  color: #94a3b8;
}

.task-rewards-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reward-chip {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.reward-chip.reward-exp {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.reward-chip.reward-gold {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fde047;
}

.reward-chip.reward-points {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

/* Estado Vacío de Tareas */
.menu-empty-state {
  text-align: center;
  padding: 44px 20px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.menu-empty-state .empty-icon {
  font-size: 42px;
  opacity: 0.6;
}

.menu-empty-state .empty-title {
  font-family: var(--font-serif, Georgia);
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary, #f59e0b);
}

.menu-empty-state .empty-desc {
  font-size: 12px;
  color: #94a3b8;
  max-width: 440px;
  line-height: 1.5;
}

/* 2. PESTAÑA: TIENDA DEL REINO (SUPPORT STORE) */
.store-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 8px;
  margin-bottom: 12px;
}

.store-top-title {
  font-family: var(--font-serif, Georgia);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-primary, #f59e0b);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.4px;
}

.store-balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.15);
}

.store-balance-chip strong {
  color: #fff;
  font-size: 13px;
}

.store-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.store-cat-btn {
  padding: 8px 6px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.store-cat-btn:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: #f8fafc;
}

.store-cat-btn.active {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.25), rgba(180, 83, 9, 0.45));
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.store-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 640px) {
  .store-items-grid {
    grid-template-columns: 1fr;
  }
}

.store-item-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  background: rgba(15, 23, 42, 0.95);
}

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

.store-item-icon-box {
  width: 40px;
  height: 40px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.store-item-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.store-item-name {
  font-family: var(--font-serif, Georgia);
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.store-item-price {
  font-size: 11.5px;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

.store-item-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  flex-grow: 1;
}

.btn-store-buy {
  width: 100%;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border: 1px solid #b45309;
  border-radius: 6px;
  color: #0b0f19;
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.btn-store-buy:hover {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.btn-store-buy:active {
  transform: translateY(1px);
}

/* ==========================================================================
   PANTALLA GÓTICA DE MUERTE ("YOU ARE DEAD") Y RESPAWN EN TEMPLO
   ========================================================================== */
.modal-player-death,
.modal-death,
#modal-death {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-player-death.active,
.modal-death.active,
#modal-death.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Viñeta roja oscura desaturada que oscurece el mundo del juego */
.death-vignette-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(20, 8, 10, 0.78) 0%, rgba(45, 10, 14, 0.90) 50%, rgba(68, 8, 12, 0.98) 100%);
  backdrop-filter: blur(6px) grayscale(75%) contrast(110%);
  -webkit-backdrop-filter: blur(6px) grayscale(75%) contrast(110%);
  z-index: 1;
  animation: deathVignettePulse 6s ease-in-out infinite alternate;
}

@keyframes deathVignettePulse {
  0% {
    opacity: 0.92;
    filter: brightness(0.95);
  }
  100% {
    opacity: 1;
    filter: brightness(0.85);
  }
}

/* Tarjeta gótica con marco ornamental sobrio */
.death-gothic-card {
  position: relative;
  z-index: 2;
  width: 480px;
  max-width: 94vw;
  background: linear-gradient(180deg, rgba(22, 14, 18, 0.98) 0%, rgba(13, 9, 12, 0.99) 100%);
  border: 2px solid #991b1b;
  outline: 1px solid rgba(220, 38, 38, 0.35);
  outline-offset: -5px;
  border-radius: 12px;
  padding: 24px 22px;
  box-sizing: border-box;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(185, 28, 28, 0.35),
    inset 0 1px 0 rgba(254, 202, 202, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: deathCardEnter 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  color: #f1f5f9;
}

@keyframes deathCardEnter {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Ornamento superior gótico (Cruz sagrada / Símbolo de penitencia) */
.death-gothic-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 28, 28, 0.25) 0%, rgba(0, 0, 0, 0.6) 80%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.4);
  margin-top: -4px;
}

.death-gothic-cross {
  font-size: 20px;
  color: #f87171;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.8);
  line-height: 1;
}

/* Banner de Calavera / Estatus Tibiano */
.death-skull-banner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 14px;
}

.death-skull-icon {
  font-size: 15px;
  line-height: 1;
}

.death-skull-title {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* Encabezado Gótico */
.death-header-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.death-gothic-title {
  font-family: 'Cinzel', 'Trajan Pro', 'Georgia', 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fee2e2 0%, #ef4444 55%, #991b1b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(220, 38, 38, 0.6));
  line-height: 1.15;
}

.death-gothic-subtitle {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Divisor ornamental */
.death-gothic-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 80%;
  margin: 2px 0 4px 0;
}

.death-gothic-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.5), transparent);
}

.death-gothic-divider .divider-gem {
  color: #ef4444;
  font-size: 12px;
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* Cuerpo del Modal */
.death-gothic-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.death-gothic-msg {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0;
  text-align: center;
  padding: 0 8px;
}

/* Caja de penalizaciones */
.death-penalties-box {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.death-penalty-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.death-penalty-item .d-label {
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.death-penalty-item .d-val {
  font-weight: 800;
}

.death-penalty-item .exp-lost {
  color: #f87171;
}

.death-penalty-item .coins-lost {
  color: #fbbf24;
}

.death-penalty-item .loot-status.text-green {
  color: #34d399;
}

.death-penalty-item .loot-status.text-amber {
  color: #fbbf24;
}

.death-penalty-item .loot-status.text-red {
  color: #ef4444;
}

/* Lista de objetos caídos */
.death-dropped-items-box {
  width: 100%;
  background: rgba(220, 38, 38, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  box-sizing: border-box;
}

.death-dropped-items-box .dropped-items-header {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 800;
  color: #fca5a5;
  margin-bottom: 6px;
  letter-spacing: 0.8px;
}

.death-dropped-items-box .dropped-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
}

.death-item-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #e2e8f0;
}

.death-item-chip .chip-img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

/* Banner de Templo y Coordenadas */
.death-temple-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #bae6fd;
}

.death-temple-banner .temple-icon {
  font-size: 16px;
}

.death-temple-banner .temple-text strong {
  color: #38bdf8;
  font-weight: 700;
}

/* Footer y Botón Destacado de Respawn */
.death-gothic-footer {
  width: 100%;
  margin-top: 4px;
}

.btn-gothic-respawn {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #d97706 0%, #b45309 50%, #78350f 100%);
  border: 1px solid #fbbf24;
  border-radius: 8px;
  color: #fffbeb;
  font-family: var(--font-mono, monospace);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 
    0 4px 20px rgba(217, 119, 6, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

.btn-gothic-respawn .btn-respawn-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 6px #fde68a);
}

.btn-gothic-respawn:hover {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #92400e 100%);
  border-color: #fde68a;
  transform: translateY(-2px);
  box-shadow: 
    0 8px 28px rgba(245, 158, 11, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-gothic-respawn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}

/* ==========================================================================
   RESPONSIVE DESIGN (PC Y DISPOSITIVOS MÓVILES)
   ========================================================================== */
@media screen and (max-height: 540px), screen and (max-width: 768px) {
  .modal-player-death,
  .modal-death,
  #modal-death {
    padding: 6px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .death-gothic-card {
    width: min(520px, 96vw) !important;
    max-height: 96dvh !important;
    padding: 8px 14px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .death-gothic-ornament {
    display: none !important;
  }

  .death-skull-banner {
    display: none !important;
  }

  .death-header-block {
    gap: 1px !important;
  }

  .death-gothic-title {
    font-size: clamp(16px, 3vh, 18px) !important;
    letter-spacing: 1.5px !important;
    line-height: 1.15 !important;
  }

  .death-gothic-subtitle {
    font-size: 9.5px !important;
    letter-spacing: 1.5px !important;
  }

  .death-gothic-divider {
    margin: 1px 0 2px 0 !important;
    width: 90% !important;
  }

  .death-gothic-body {
    gap: 4px !important;
  }

  .death-gothic-msg {
    display: none !important;
  }

  .death-penalties-box {
    padding: 5px 10px !important;
    gap: 3px !important;
    border-radius: 6px !important;
  }

  .death-penalty-item {
    font-size: 10px !important;
  }

  .death-temple-banner {
    padding: 4px 8px !important;
    font-size: 10px !important;
    gap: 5px !important;
    border-radius: 6px !important;
  }

  .death-temple-banner .temple-icon {
    font-size: 13px !important;
  }

  .death-gothic-footer {
    margin-top: 3px !important;
    width: 100% !important;
  }

  .btn-gothic-respawn {
    min-height: 38px !important;
    height: 38px !important;
    padding: 6px 14px !important;
    font-size: 11.5px !important;
    letter-spacing: 1.2px !important;
    border-radius: 6px !important;
  }
}

body.mobile-touch-mode .modal-player-death,
body.mobile-touch-mode .modal-death,
body.mobile-touch-mode #modal-death {
  padding: 6px !important;
}

body.mobile-touch-mode .death-gothic-card {
  width: min(520px, 96vw) !important;
  max-height: 96dvh !important;
  padding: 8px 14px !important;
  gap: 4px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.mobile-touch-mode .death-gothic-ornament {
  display: none !important;
}

body.mobile-touch-mode .death-skull-banner {
  display: none !important;
}

body.mobile-touch-mode .death-header-block {
  gap: 1px !important;
}

body.mobile-touch-mode .death-gothic-title {
  font-size: clamp(16px, 3vh, 18px) !important;
  letter-spacing: 1.5px !important;
  line-height: 1.15 !important;
}

body.mobile-touch-mode .death-gothic-subtitle {
  font-size: 9.5px !important;
  letter-spacing: 1.5px !important;
}

body.mobile-touch-mode .death-gothic-divider {
  margin: 1px 0 2px 0 !important;
  width: 90% !important;
}

body.mobile-touch-mode .death-gothic-body {
  gap: 4px !important;
}

body.mobile-touch-mode .death-gothic-msg {
  display: none !important;
}

body.mobile-touch-mode .death-penalties-box {
  padding: 5px 10px !important;
  gap: 3px !important;
  border-radius: 6px !important;
}

body.mobile-touch-mode .death-penalty-item {
  font-size: 10px !important;
}

body.mobile-touch-mode .death-temple-banner {
  padding: 4px 8px !important;
  font-size: 10px !important;
  gap: 5px !important;
  border-radius: 6px !important;
}

body.mobile-touch-mode .death-temple-banner .temple-icon {
  font-size: 13px !important;
}

body.mobile-touch-mode .death-gothic-footer {
  margin-top: 3px !important;
  width: 100% !important;
}

body.mobile-touch-mode .btn-gothic-respawn {
  min-height: 38px !important;
  height: 38px !important;
  padding: 6px 14px !important;
  font-size: 11.5px !important;
  letter-spacing: 1.2px !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   DIRECT PLAYER-TO-PLAYER TRADE WINDOW (#modal-player-trade)
   Tibia-style atomic anti-scam safe exchange
   ========================================================================== */
.modal-player-trade {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(6px);
  padding: 8px;
  box-sizing: border-box;
  animation: fadeInModal 0.25s ease-out;
  overflow: hidden;
}

.modal-player-trade.hidden {
  display: none !important;
}

.player-trade-card {
  width: 100%;
  max-width: 760px;
  max-height: min(96vh, 660px);
  background: linear-gradient(165deg, #161b26 0%, #0d111a 60%, #090c13 100%);
  border: 2px solid #3b4252;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #e5e9f0;
  font-family: inherit;
  box-sizing: border-box;
}

.player-trade-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, #1e2535 0%, #161c28 100%);
  border-bottom: 1px solid #2e3440;
}

.player-trade-title {
  font-size: 15px;
  font-weight: 700;
  color: #f7d794;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.player-trade-subtitle {
  font-size: 11px;
  color: #8892b0;
  margin-top: 2px;
}

.trade-close-x-btn,
.btn-trade-close {
  background: transparent;
  border: 1px solid #434c5e;
  color: #d8dee9;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.trade-close-x-btn:hover,
.btn-trade-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  transform: scale(1.08);
}

.trade-security-ribbon {
  flex-shrink: 0;
  background: rgba(46, 52, 64, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px 14px;
  font-size: 11px;
  color: #a3be8c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-trade-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(10, 14, 22, 0.4);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.trade-column {
  background: rgba(22, 28, 41, 0.7);
  border: 1px solid #2e3646;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.trade-col-header,
.trade-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2e3440;
  padding-bottom: 6px;
}

.trade-col-name,
.trade-column-title {
  font-size: 12px;
  font-weight: 700;
  color: #eceff4;
  letter-spacing: 0.5px;
}

.trade-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.trade-status-badge.status-editing {
  background: rgba(235, 203, 139, 0.2);
  color: #ebcb8b;
  border: 1px solid rgba(235, 203, 139, 0.5);
}

.trade-status-badge.status-locked {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.trade-status-badge.status-accepted {
  background: rgba(163, 190, 140, 0.25);
  color: #a3be8c;
  border: 1px solid #a3be8c;
  box-shadow: 0 0 8px rgba(163, 190, 140, 0.4);
}

.trade-status-badge.status-confirmed {
  background: rgba(136, 192, 208, 0.3);
  color: #88c0d0;
  border: 1px solid #88c0d0;
  box-shadow: 0 0 10px rgba(136, 192, 208, 0.5);
}

.trade-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.trade-slot {
  width: 100%;
  aspect-ratio: 1;
  background: #181c24;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.15), inset -1px -1px 0 rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.trade-slot.empty {
  border-style: solid;
  border-top-color: #333947;
  border-left-color: #333947;
  border-right-color: #0b0d12;
  border-bottom-color: #0b0d12;
  background: #12151c;
  color: #4c566a;
}

.trade-slot.filled {
  border-top-color: #88c0d0;
  border-left-color: #88c0d0;
  border-right-color: #1a2332;
  border-bottom-color: #1a2332;
  background: #182030;
  cursor: pointer;
}

.trade-slot.filled:hover {
  border-top-color: #bf616a;
  border-left-color: #bf616a;
}

.trade-slot img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.trade-slot-badge {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

.trade-slot-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bf616a;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  display: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.trade-slot.filled:hover .trade-slot-remove {
  display: block;
}

.trade-gold-control,
.trade-gold-box {
  background: rgba(16, 20, 31, 0.6);
  border: 1px solid #2e3440;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-gold-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trade-gold-label,
.gold-label {
  font-size: 11px;
  color: #d8dee9;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.trade-coins-available {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.trade-gold-input-row,
.gold-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-gold-input {
  width: 100px;
  background: #0d111a;
  border: 1px solid #434c5e;
  border-radius: 4px;
  color: #f7d794;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 8px;
  text-align: right;
  font-family: inherit;
}

.trade-gold-input:focus {
  border-color: #ebcb8b;
  outline: none;
}

.btn-trade-gold-apply,
.btn-trade-gold-set {
  background: #2e3440;
  border: 1px solid #4c566a;
  color: #eceff4;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-trade-gold-apply:hover,
.btn-trade-gold-set:hover {
  background: #3b4252;
  border-color: #88c0d0;
  color: #fff;
}

.trade-target-gold-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.target-gold-val,
.gold-display-val {
  font-size: 15px;
  font-weight: 700;
  color: #f7d794;
}

.target-gold-unit {
  font-size: 14px;
}

.trade-target-summary-box {
  background: rgba(13, 17, 26, 0.7);
  border: 1px solid #232a3b;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.target-summary-header {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.target-summary-text {
  font-size: 12px;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.4;
}

.trade-backpack-drawer {
  padding: 10px 14px;
  background: #111622;
  border: 1px solid #232a3b;
  border-radius: 6px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8892b0;
  margin-bottom: 6px;
  font-weight: 600;
}

.trade-backpack-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
}

.trade-backpack-item {
  width: 100%;
  aspect-ratio: 1;
  background: #182030;
  border: 1px solid #2e3440;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trade-backpack-item:hover {
  border-color: #88c0d0;
  transform: translateY(-1px);
  background: #232d42;
}

.trade-backpack-item.offered {
  opacity: 0.4;
  border-color: #ebcb8b;
  cursor: not-allowed;
}

.trade-backpack-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Pie de Comercio y Botones de Acción (#PLAYER-TRADE-FOOTER-01) */
.player-trade-footer,
.trade-actions-footer {
  padding: 10px 18px;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: #0b0f17;
  border-top: 1px solid #232a3b;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.trade-footer-actions,
.trade-actions-right {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
}

.btn-trade-cancel {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
  padding: 9px 18px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

.btn-trade-cancel:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45) !important;
  transform: translateY(-1px);
}

/* Fase 1: Botón Listo / Bloquear Oferta */
.btn-trade-lock {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border: 1px solid #38bdf8 !important;
  color: #38bdf8 !important;
  padding: 9px 20px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
  font-family: inherit !important;
}

.btn-trade-lock:hover {
  background: #38bdf8 !important;
  color: #0f172a !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6) !important;
  transform: translateY(-1px);
}

.btn-trade-lock.is-locked {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%) !important;
  border-color: #7dd3fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5) !important;
}

/* Fase 2: Botón Aceptar Oferta */
.btn-trade-accept {
  background: #1e2533 !important;
  border: 1px solid #3b4252 !important;
  color: #64748b !important;
  padding: 9px 22px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: not-allowed !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

.btn-trade-accept:not([disabled]) {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
  border-color: #4ade80 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.4) !important;
}

.btn-trade-accept:not([disabled]):hover {
  background: #16a34a !important;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.7) !important;
  transform: translateY(-1px);
}

/* Estado Aceptado Definitivo: Verde esmeralda con animación */
.btn-trade-accept.accepted {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.75) !important;
  animation: pulseGlowGreen 2s infinite ease-in-out;
}

@keyframes pulseGlowGreen {
  0%, 100% { box-shadow: 0 0 8px rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 18px rgba(76, 175, 80, 0.9); }
}

/* Selector Rápido de Oro (Chips) */
.trade-gold-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.trade-coins-available {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.trade-gold-chips {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-gold-chip {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(247, 215, 148, 0.35);
  color: #f7d794;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-gold-chip:hover {
  background: rgba(247, 215, 148, 0.25);
  border-color: #f7d794;
  color: #fff;
  transform: translateY(-1px);
}

.btn-gold-chip.chip-max {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.btn-gold-chip.chip-zero {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* Sub-Modal Modal de Confirmación Definitiva Anti-Scam */
.trade-confirm-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.trade-confirm-dialog {
  background: linear-gradient(165deg, #1e2535 0%, #111622 100%);
  border: 2px solid #eab308;
  border-radius: 8px;
  padding: 22px 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 25px rgba(234, 179, 8, 0.35);
  text-align: center;
  color: #f8fafc;
}

.trade-confirm-icon {
  font-size: 38px;
  margin-bottom: 8px;
}

.trade-confirm-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: #fde047;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.trade-confirm-desc {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 16px;
  line-height: 1.45;
}

.trade-confirm-summary-boxes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.summary-box {
  flex: 1;
  text-align: center;
}

.summary-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.give-box .summary-box-title { color: #f87171; }
.receive-box .summary-box-title { color: #4ade80; }

.summary-box-items {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  min-height: 18px;
}

.summary-box-gold {
  font-size: 12px;
  font-weight: 700;
  color: #facc15;
  margin-top: 3px;
}

.summary-arrow-divider {
  font-size: 20px;
  color: #94a3b8;
  font-weight: 700;
}

.trade-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.btn-trade-confirm-yes {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  border: 1px solid #4ade80;
  color: #fff;
  padding: 10px 26px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.4);
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-trade-confirm-yes:hover {
  background: #16a34a;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.75);
  transform: translateY(-1px);
}

.btn-trade-confirm-no {
  background: #334155;
  border: 1px solid #64748b;
  color: #e2e8f0;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-trade-confirm-no:hover {
  background: #475569;
  color: #fff;
}

/* Sub-Modal: Selector de Cantidad de Objeto a Ofrecer (#PLAYER-TRADE-QTY) */
.trade-quantity-dialog {
  max-width: 400px;
}

.trade-qty-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(10, 14, 22, 0.85);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.trade-qty-slider-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn-qty-step {
  width: 38px;
  height: 38px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-qty-step:hover {
  background: #334155;
  border-color: #fde047;
  color: #fde047;
}

.trade-qty-input {
  width: 110px;
  height: 38px;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #fde047;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  outline: none;
}

.trade-qty-input:focus {
  border-color: #fde047;
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.4);
}

.trade-qty-presets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-qty-preset {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #475569;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-qty-preset:hover {
  background: #334155;
  color: #fde047;
  border-color: #eab308;
}

@media (max-width: 600px) {
  .player-trade-columns {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .trade-backpack-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .trade-actions-footer {
    flex-direction: column-reverse;
  }
  .trade-actions-right {
    width: 100%;
    justify-content: space-between;
  }
  .btn-trade-cancel {
    width: 100%;
  }
}

/* Responsividad Altura: Laptops y Pantallas Bajas (<= 660px de altura de ventana) */
@media screen and (max-height: 660px) {
  .modal-player-trade {
    padding: 4px !important;
  }
  .player-trade-card {
    max-height: 98vh !important;
  }
  .player-trade-header {
    padding: 6px 14px !important;
  }
  .player-trade-title {
    font-size: 13.5px !important;
  }
  .player-trade-subtitle {
    font-size: 10px !important;
  }
  .trade-security-ribbon {
    padding: 3px 10px !important;
    font-size: 10px !important;
  }
  .player-trade-columns {
    gap: 8px !important;
    padding: 8px 10px !important;
  }
  .trade-column {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .trade-slots-grid {
    gap: 5px !important;
  }
  .trade-slot {
    min-height: 38px !important;
  }
  .trade-slot img {
    width: 26px !important;
    height: 26px !important;
  }
  .trade-gold-control,
  .trade-gold-box {
    padding: 5px 8px !important;
    gap: 4px !important;
  }
  .trade-gold-chips {
    gap: 4px !important;
  }
  .btn-gold-chip {
    padding: 2px 6px !important;
    font-size: 10px !important;
  }
  .trade-backpack-drawer {
    padding: 6px 8px !important;
  }
  .trade-backpack-grid {
    max-height: 56px !important;
    gap: 4px !important;
  }
  .trade-backpack-item {
    min-height: 30px !important;
  }
  .trade-backpack-item img {
    width: 20px !important;
    height: 20px !important;
  }
  .player-trade-footer {
    padding: 6px 14px !important;
  }
  .btn-trade-cancel,
  .btn-trade-lock,
  .btn-trade-accept {
    padding: 6px 14px !important;
    font-size: 11.5px !important;
  }
}

/* Responsividad Altura Reducida Extrema: Pantallas bajas como 473px */
@media screen and (max-height: 520px) {
  .modal-player-trade {
    padding: 2px !important;
  }
  .trade-security-ribbon {
    display: none !important; /* Oculta banner para ahorrar 26px vitales en pantallas ultra-bajas */
  }
  .player-trade-header {
    padding: 4px 10px !important;
  }
  .player-trade-title {
    font-size: 12.5px !important;
  }
  .player-trade-subtitle {
    display: none !important;
  }
  .trade-slots-wrapper .trade-slots-label {
    font-size: 9.5px !important;
  }
  .trade-slot {
    min-height: 30px !important;
  }
  .trade-slot img {
    width: 20px !important;
    height: 20px !important;
  }
  .trade-backpack-grid {
    max-height: 44px !important;
  }
  .player-trade-footer {
    padding: 4px 10px !important;
  }
  .btn-trade-cancel,
  .btn-trade-lock,
  .btn-trade-accept {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
}

/* ==========================================================================
   MODALES RESPONSIVOS Y SCROLLBARS TIBIA (#RESPONSIVE-MODALS-FIX-01)
   Contención de Viewport, centrado y adaptaciones para Mercado y Vocaciones
   ========================================================================== */
#modal-market,
.market-modal,
#modal-change-vocation,
#modal-vocation,
.modal-vocation-change {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  box-sizing: border-box !important;
  padding: 2vh 2vw !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000 !important;
}

#modal-market.active,
#modal-market[style*="display: flex"],
.market-modal.active,
.market-modal[style*="display: flex"],
#modal-change-vocation.active,
#modal-change-vocation[style*="display: flex"],
#modal-vocation.active,
#modal-vocation[style*="display: flex"],
.modal-vocation-change.active,
.modal-vocation-change[style*="display: flex"] {
  display: flex !important;
}

/* 1. Contención en Viewport: Market 1180px x 820px, Vocation 580px x 90vh */
.market-card,
.market-card.tibia-layout {
  width: 94vw !important;
  max-width: 1180px !important;
  height: 90vh !important;
  max-height: 820px !important;
  min-height: 480px !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
  padding: 12px 16px !important;
}

.vocation-modal-card {
  width: 92vw !important;
  max-width: 580px !important;
  height: auto !important;
  max-height: 90vh !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
  padding: 16px 20px !important;
}

.vocation-badge-current.hidden,
.vocation-badge-current[style*="display: none"] {
  display: none !important;
}

.vocation-level-status {
  margin: 4px 0 8px 0;
  width: 100%;
  flex-shrink: 0;
}

.voc-status-banner {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  box-sizing: border-box;
}

.voc-status-allowed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.voc-status-locked {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* 2. Cabeceras y Pies Fijos (flex-shrink: 0) y Header Flexible */
.market-header {
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding-bottom: 8px !important;
  flex-shrink: 0 !important;
}

.market-footer,
.vocation-modal-header,
.vocation-modal-subtitle,
.vocation-confirm-panel {
  flex-shrink: 0 !important;
}

/* 3. Contenedores Internos con Scrollbars Estilo Tibia */
.market-orders-list,
.vocation-grid-list,
.vocation-selection-list,
.market-order-table-wrap,
.market-items-scroll,
.market-categories-tree,
.market-right-pane,
.overlay-table-scroll {
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #78350f #0f172a !important;
}

.market-orders-list::-webkit-scrollbar,
.vocation-grid-list::-webkit-scrollbar,
.vocation-selection-list::-webkit-scrollbar,
.market-order-table-wrap::-webkit-scrollbar,
.market-items-scroll::-webkit-scrollbar,
.market-categories-tree::-webkit-scrollbar,
.market-right-pane::-webkit-scrollbar,
.overlay-table-scroll::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

.market-orders-list::-webkit-scrollbar-track,
.vocation-grid-list::-webkit-scrollbar-track,
.vocation-selection-list::-webkit-scrollbar-track,
.market-order-table-wrap::-webkit-scrollbar-track,
.market-items-scroll::-webkit-scrollbar-track,
.market-categories-tree::-webkit-scrollbar-track,
.market-right-pane::-webkit-scrollbar-track,
.overlay-table-scroll::-webkit-scrollbar-track {
  background: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.6) !important;
  border-radius: 4px !important;
}

.market-orders-list::-webkit-scrollbar-thumb,
.vocation-grid-list::-webkit-scrollbar-thumb,
.vocation-selection-list::-webkit-scrollbar-thumb,
.market-order-table-wrap::-webkit-scrollbar-thumb,
.market-items-scroll::-webkit-scrollbar-thumb,
.market-categories-tree::-webkit-scrollbar-thumb,
.market-right-pane::-webkit-scrollbar-thumb,
.overlay-table-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%) !important;
  border: 1px solid #d97706 !important;
  border-radius: 4px !important;
  box-shadow: inset 1px 1px 0 rgba(251, 191, 36, 0.35), inset -1px -1px 0 rgba(0, 0, 0, 0.7) !important;
}

.market-orders-list::-webkit-scrollbar-thumb:hover,
.vocation-grid-list::-webkit-scrollbar-thumb:hover,
.vocation-selection-list::-webkit-scrollbar-thumb:hover,
.market-order-table-wrap::-webkit-scrollbar-thumb:hover,
.market-items-scroll::-webkit-scrollbar-thumb:hover,
.market-categories-tree::-webkit-scrollbar-thumb:hover,
.market-right-pane::-webkit-scrollbar-thumb:hover,
.overlay-table-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #b45309 0%, #92400e 100%) !important;
  border-color: #f59e0b !important;
}

/* Reglas Específicas de Scroll y Contenedores (#RESPONSIVE-MODALS-FIX-01) */
.market-order-table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: 180px !important;
}

.vocation-selection-list {
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  padding-right: 6px !important;
  margin-bottom: 10px !important;
}

.vocation-selection-list::-webkit-scrollbar {
  width: 6px !important;
}

.vocation-selection-list::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4) !important;
  border-radius: 4px !important;
}

/* 4. Adaptaciones para Laptops y Monitores Compactos (<= 800px alto / <= 1366px ancho) */
@media (max-height: 800px) {
  .market-card,
  .market-card.tibia-layout {
    padding: 10px 14px !important;
  }
  .market-orders-split {
    height: 160px !important;
    min-height: 120px !important;
  }
  .market-selected-slot {
    width: 42px !important;
    height: 42px !important;
  }
  .market-selected-slot img {
    width: 34px !important;
    height: 34px !important;
  }
  .market-create-body {
    padding: 6px !important;
    gap: 8px !important;
  }
  .vocation-card {
    padding: 8px 12px !important;
  }
  .vocation-icon-box {
    width: 38px !important;
    height: 38px !important;
    font-size: 20px !important;
  }
  .vocation-desc {
    margin: 2px 0 4px 0 !important;
    font-size: 11px !important;
  }
}

@media (max-height: 720px) {
  .market-orders-split {
    height: 140px !important;
  }
  .market-categories-tree {
    max-height: 110px !important;
  }
  .vocation-modal-card {
    padding: 12px 16px !important;
  }
  .vocation-selection-list,
  .vocation-grid-list {
    gap: 6px !important;
  }
}

/* Adaptaciones Responsivas Directivas (#RESPONSIVE-MODALS-FIX-01) */
@media (max-width: 600px), (max-height: 700px) {
  .vocation-modal-card {
    padding: 12px 14px !important;
  }
  .vocation-card {
    padding: 8px 10px !important;
  }
  .vocation-icon-box {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  .vocation-desc,
  .vocation-card-body,
  .vocation-name,
  .vocation-tags {
    font-size: 12px !important;
  }
}

@media (max-width: 920px) {
  .market-main-split {
    flex-direction: column;
  }
  .market-left-sidebar {
    width: 100%;
    max-height: 220px;
  }
  .market-header-sub,
  .order-subtitle,
  .create-module-sub {
    display: none;
  }
}

@media (max-height: 650px) {
  .market-table,
  .market-table th,
  .market-table td {
    font-size: 10.5px !important;
  }
  .market-order-table-wrap {
    max-height: 120px !important;
  }
}

/* ==========================================================================
   MERCADO GLOBAL (#modal-market) - AJUSTE ULTRA-COMPACTO MÓVIL LANDSCAPE
   ========================================================================== */
@media screen and (max-height: 600px), screen and (max-width: 1024px) {
  .market-card,
  .market-card.tibia-layout {
    width: 97vw !important;
    max-width: 97vw !important;
    height: 95vh !important;
    max-height: 95vh !important;
    min-height: 0 !important;
    padding: 6px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-radius: 10px !important;
  }

  /* 1. Barra Superior en UNA SOLA LÍNEA ULTRA-COMPACTA (h=26px) */
  .market-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Prohibido saltar a 2 líneas */
    align-items: center !important;
    justify-content: space-between !important;
    padding: 2px 4px !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
    flex-shrink: 0 !important;
    gap: 6px !important;
  }

  .market-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }

  .market-header-icon {
    font-size: 13px !important;
  }

  .market-header-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .market-header-sub {
    display: none !important;
  }

  .market-header-center {
    display: flex !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .btn-market-top {
    font-size: 8.5px !important;
    padding: 1px 5px !important;
    height: 20px !important;
    min-height: 20px !important;
    border-radius: 4px !important;
  }

  .market-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .market-wallet-badges {
    display: flex !important;
    gap: 4px !important;
  }

  .market-gold-badge {
    padding: 1px 4px !important;
    font-size: 8.5px !important;
    height: 20px !important;
    border-radius: 4px !important;
  }

  .market-close-x {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
    padding: 0 !important;
  }

  /* 2. Disposición Dividida Horizontal (Catálogo 30% / Panel de Operaciones 70%) */
  .market-main-split {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  /* COLUMNA IZQUIERDA: Buscador + Categorías Chips + Catálogo con Máxima Altura */
  .market-left-sidebar {
    width: 30% !important;
    min-width: 170px !important;
    max-width: 220px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 2px !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .market-search-box input {
    height: 20px !important;
    font-size: 9px !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
  }

  .market-categories-tree {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    gap: 3px !important;
    padding: 1px 0 !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .market-category-btn {
    padding: 1px 6px !important;
    font-size: 8.5px !important;
    height: 22px !important;
    min-height: 22px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .market-items-list-header {
    font-size: 8.5px !important;
    padding: 1px 3px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .market-items-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 2px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .market-item-row {
    padding: 2px 4px !important;
    min-height: 26px !important;
    height: 26px !important;
    gap: 4px !important;
    border-radius: 4px !important;
  }

  .market-item-mini-slot {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 3px !important;
  }

  .market-item-mini-slot img {
    width: 16px !important;
    height: 16px !important;
  }

  .market-item-row-name {
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  .market-item-row-offers {
    font-size: 7.5px !important;
  }

  /* COLUMNA DERECHA: Operaciones y Acciones Micro-Ajustadas */
  .market-right-pane {
    width: 70% !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 4px !important;
    gap: 4px !important;
  }

  /* Ficha del Ítem: Barra Horizontal Delgada */
  .market-selected-card {
    padding: 3px 6px !important;
    min-height: 28px !important;
    margin-bottom: 2px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .market-selected-slot {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-radius: 4px !important;
  }

  .market-selected-slot img {
    width: 20px !important;
    height: 20px !important;
  }

  .market-selected-name {
    font-size: 10.5px !important;
    font-weight: 700 !important;
  }

  .market-selected-tag,
  .market-selected-stock-tag {
    font-size: 8px !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
  }

  .market-selected-desc {
    display: none !important; /* Oculta párrafo largo para ahorrar 40px */
  }

  .market-selected-stats {
    font-size: 8px !important;
    gap: 4px !important;
    margin-top: 0 !important;
  }

  /* Cajas de Órdenes (Compra y Venta) */
  .market-orders-split {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .market-order-box {
    padding: 3px 6px !important;
    border-radius: 6px !important;
  }

  .market-order-box-title {
    font-size: 9.5px !important;
    margin-bottom: 2px !important;
  }

  .order-subtitle {
    display: none !important;
  }

  .market-order-table-wrap {
    max-height: 52px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .market-table th,
  .market-table td {
    padding: 1px 3px !important;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
  }

  /* Barras de Acción y Sliders Compactos */
  .market-quick-action-bar {
    padding: 2px 4px !important;
    gap: 4px !important;
    align-items: center !important;
  }

  .action-slider-row {
    font-size: 8.5px !important;
    gap: 3px !important;
  }

  .action-slider-row input[type="range"] {
    width: 44px !important;
    height: 12px !important;
  }

  .action-slider-row input[type="number"] {
    width: 32px !important;
    height: 18px !important;
    font-size: 8.5px !important;
    padding: 0 2px !important;
    border-radius: 3px !important;
  }

  .action-total-row {
    font-size: 8.5px !important;
    gap: 4px !important;
  }

  .btn-market-action {
    padding: 2px 6px !important;
    font-size: 9px !important;
    min-height: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
  }

  /* Módulo Crear Oferta */
  .market-create-module {
    padding: 3px 6px !important;
    gap: 3px !important;
    border-radius: 6px !important;
  }

  .create-module-title {
    font-size: 9.5px !important;
  }

  .create-module-sub {
    display: none !important;
  }

  .market-create-slot-box {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }

  .market-create-slot-box img {
    width: 20px !important;
    height: 20px !important;
  }

  .market-create-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px 6px !important;
  }

  .btn-toggle-type {
    padding: 1px 5px !important;
    font-size: 8.5px !important;
    height: 18px !important;
    border-radius: 3px !important;
  }

  .create-control-group {
    gap: 1px !important;
  }

  .control-label-row {
    font-size: 8px !important;
  }

  .qty-slider-composite input[type="range"] {
    width: 36px !important;
    height: 12px !important;
  }

  .qty-slider-composite input[type="number"] {
    width: 28px !important;
    height: 18px !important;
    font-size: 8.5px !important;
    padding: 0 2px !important;
  }

  .btn-step {
    width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
  }

  .btn-max {
    height: 18px !important;
    font-size: 7.5px !important;
    padding: 0 3px !important;
  }

  .price-input-row input {
    width: 42px !important;
    height: 18px !important;
    font-size: 8.5px !important;
    padding: 0 2px !important;
  }

  .btn-ref-price {
    font-size: 7.5px !important;
    padding: 1px 3px !important;
  }

  .btn-create-offer-action {
    font-size: 9px !important;
    padding: 2px 6px !important;
    height: 22px !important;
    border-radius: 4px !important;
  }
}


/* ==========================================================================
   SELECTOR RÁPIDO FLOTANTE DE HABILIDADES (#PIXEL-ART-HUD-ASSETS-02)
   Menú contextual que reemplaza el modal tosco del libro de hechizos.
   Se activa al mantener presionado cualquier slot del HUD (400ms)
   o mediante clic derecho (contextmenu).
   ========================================================================== */
.skill-quick-picker {
  position: fixed;
  z-index: 9999;
  width: 310px;
  max-width: 92vw;
  background: rgba(12, 18, 30, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(245, 158, 11, 0.65);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.92), 0 0 24px rgba(245, 158, 11, 0.28);
  padding: 10px 12px;
  box-sizing: border-box;
  animation: skill-picker-pop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-family: var(--font-sans, system-ui, sans-serif);
}

@keyframes skill-picker-pop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.skill-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.skill-picker-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-picker-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.skill-picker-title {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.8px;
}

.skill-picker-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.1s ease;
}

.skill-picker-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.skill-picker-body {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.skill-picker-body::-webkit-scrollbar {
  width: 5px;
}
.skill-picker-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.skill-picker-body::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.45);
  border-radius: 4px;
}

.skill-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.skill-picker-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #181c24;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12), inset -1px -1px 0 rgba(0, 0, 0, 0.75), 0 2px 4px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.skill-picker-item:hover {
  transform: scale(1.08);
  border-top-color: #8b99ad;
  border-left-color: #8b99ad;
  border-right-color: #1e2430;
  border-bottom-color: #1e2430;
  background: #222733;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25), inset -1px -1px 0 rgba(0, 0, 0, 0.9), 0 0 12px rgba(56, 189, 248, 0.55);
  z-index: 10;
}

.skill-picker-item:active {
  transform: scale(0.96);
}

.skill-picker-item.equipped-here {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.15);
}

.skill-picker-item.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.skill-picker-icon {
  width: 72%;
  height: 72%;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.skill-item-mana {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 1px 3px #000, 1px 0 2px #000;
  pointer-events: none;
}

.skill-item-eq-badge {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  font-weight: 900;
  color: #34d399;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

/* Tooltip emergente contextual */
.skill-picker-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 26, 0.98);
  border: 1px solid rgba(245, 158, 11, 0.65);
  border-radius: 6px;
  padding: 6px 10px;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 100;
  text-align: left;
}

.skill-picker-item:hover .skill-picker-tooltip {
  opacity: 1;
  visibility: visible;
}

.tooltip-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2px;
}

.tooltip-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
}

.tooltip-mana {
  color: #38bdf8;
}

.tooltip-cd {
  color: #94a3b8;
}

.tooltip-damage {
  font-size: 10px;
  color: #f87171;
  font-weight: 600;
  margin-bottom: 2px;
  word-break: break-word;
}

.tooltip-level {
  font-size: 9.5px;
}
.tooltip-level.unlocked {
  color: #34d399;
}
.tooltip-level.locked {
  color: #f87171;
}

/* Barra informativa inferior */
.skill-picker-info-bar {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(8, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-bar-name {
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
}

.info-bar-details {
  font-size: 10px;
  color: #94a3b8;
}

/* Efecto visual de mantener presionado el slot (Hold 400ms) */
.hud-slot.holding {
  border-color: #f59e0b !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.8), inset 0 0 14px rgba(245, 158, 11, 0.45) !important;
  transform: scale(0.94) !important;
  transition: transform 0.4s ease-out, border-color 0.4s ease, box-shadow 0.4s ease !important;
}

.hud-slot.is-locked-skill img.slot-icon {
  filter: grayscale(0.9) brightness(0.4) !important;
  opacity: 0.55 !important;
}

.hud-slot .slot-locked-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(15, 23, 42, 0.92);
  color: #ef4444;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.6);
  pointer-events: none;
  z-index: 6;
  font-family: var(--font-mono, monospace);
  line-height: 1.1;
}

/* ==========================================================================
   CONTROLES TÁCTILES LIMPIOS (PALANCA Y SALTO)
   ========================================================================== */
#touch-dpad,
.touch-control-container,
#btn-touch-jump,
#hud-jump-btn {
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
}

#touch-dpad.active-glow {
  filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.45));
}

#btn-touch-jump:active,
#btn-touch-jump.pressed,
#btn-touch-jump.active-glow,
#hud-jump-btn:active,
#hud-jump-btn.pressed {
  transform: scale(0.92);
  border-color: #fbbf24 !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), inset 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA #MOBILE-HUD-RESPONSIVE-03: HUD MÓVIL, MODALES Y ORIENTACIÓN
   ========================================================================== */

/* 1. HUD Compacto: Barras de Vida/Maná/Experiencia superiores y tarjeta de perfil compacta */
body.mobile-touch-mode .hud-player-badge {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: clamp(160px, 19vw, 190px) !important;
  max-width: 195px !important;
  min-width: 155px !important;
  height: auto !important;
  /* #MOBILE-TOUCH-CONTROLS-01: max-height: 65px !important; Erradicado por #FRONTEND-MOBILE-HUD-ERGONOMICS-02 para evitar corte de MP y EXP */
  max-height: none !important;
  padding: 5px 8px 7px 8px !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--border-gold, #f59e0b) !important;
  background: rgba(13, 19, 33, 0.92) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 158, 11, 0.2) !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .hud-bars-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
}

body.mobile-touch-mode .hud-player-name-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 10.5px !important;
  line-height: 1.1 !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .hud-name-guild-group {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

body.mobile-touch-mode .hud-guild-crest {
  width: 17px !important;
  height: 17px !important;
  border-radius: 50% !important;
  border: 1px solid #ffffff !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  background: #0a0d14 !important;
  flex-shrink: 0 !important;
}
.hud-guild-crest[style*="display: none"],
.hud-guild-crest:not(.has-guild) {
  display: none !important;
}
body.mobile-touch-mode .hud-guild-crest .crest-shield { font-size: 8px !important; }
body.mobile-touch-mode .hud-guild-crest .crest-tag { font-size: 7px !important; line-height: 1 !important; font-weight: 900 !important; }

body.mobile-touch-mode #hud-vocation-name {
  font-family: var(--font-serif, 'Cinzel', serif) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: var(--gold-primary, #fbbf24) !important;
}

body.mobile-touch-mode .hud-player-level {
  font-family: var(--font-mono, monospace) !important;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  color: var(--cyan-primary, #38bdf8) !important;
  background: rgba(56, 189, 248, 0.18) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 6px !important;
  padding: 1px 5px !important;
  line-height: 13px !important;
}

body.mobile-touch-mode .hud-bar {
  height: 12px !important; /* Compatible con suites de test oficiales */
  min-height: 12px !important;
  width: 100% !important;
  position: relative !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .hud-bar-hp,
body.mobile-touch-mode .hud-bar-mp,
body.mobile-touch-mode .hud-bar-exp {
  /* Compatible canónico #MOBILE-TOUCH-CONTROLS-01: clamp(8px, 1.2vh, 10px) !important */
  height: 13px !important;
  min-height: 12px !important;
  max-height: 14px !important;
  border-radius: 6px !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .hud-bar-hp {
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  background: rgba(45, 10, 10, 0.85) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

body.mobile-touch-mode .hud-bar-hp .hud-bar-fill {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 60%, #f87171 100%) !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.65) !important;
}

body.mobile-touch-mode .hud-bar-mp {
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  background: rgba(8, 25, 45, 0.85) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

body.mobile-touch-mode .hud-bar-mp .hud-bar-fill {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 60%, #7dd3fc 100%) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65) !important;
}

body.mobile-touch-mode .hud-bar-exp {
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  background: rgba(6, 26, 18, 0.88) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

body.mobile-touch-mode .hud-bar-exp .hud-bar-fill {
  background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%) !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65) !important;
}

body.mobile-touch-mode .hud-bar-text,
body.mobile-touch-mode .hud-bar-exp .hud-bar-text {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: auto !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--font-mono, 'JetBrains Mono', monospace) !important;
  font-size: 8px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 3px rgba(0, 0, 0, 0.95) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

body.mobile-touch-mode .hud-player-badge #hud-zone-badge,
body.mobile-touch-mode #hud-zone-badge {
  display: none !important;
}

@media screen and (max-height: 650px), screen and (max-width: 1024px) {
  .hud-player-badge {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    width: clamp(160px, 19vw, 190px) !important;
    max-width: 195px !important;
    min-width: 155px !important;
    height: auto !important;
    /* #MOBILE-TOUCH-CONTROLS-01: max-height: 65px !important; Erradicado por #FRONTEND-MOBILE-HUD-ERGONOMICS-02 para evitar corte de MP y EXP */
    max-height: none !important;
    padding: 5px 8px 7px 8px !important;
    border-radius: 10px !important;
    border: 1.5px solid var(--border-gold, #f59e0b) !important;
    background: rgba(13, 19, 33, 0.92) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 158, 11, 0.2) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .hud-bars-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100% !important;
  }

  .hud-player-name-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 10.5px !important;
    line-height: 1.1 !important;
    margin-bottom: 2px !important;
  }

  .hud-name-guild-group {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .hud-guild-crest {
    width: 17px !important;
    height: 17px !important;
    border-radius: 50% !important;
    border: 1px solid #ffffff !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    background: #0a0d14 !important;
    flex-shrink: 0 !important;
  }
  .hud-guild-crest .crest-shield { font-size: 8px !important; }
  .hud-guild-crest .crest-tag { font-size: 7px !important; line-height: 1 !important; font-weight: 900 !important; }

  #hud-vocation-name {
    font-family: var(--font-serif, 'Cinzel', serif) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: var(--gold-primary, #fbbf24) !important;
  }

  .hud-player-level {
    font-family: var(--font-mono, monospace) !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    color: var(--cyan-primary, #38bdf8) !important;
    background: rgba(56, 189, 248, 0.18) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 6px !important;
    padding: 1px 5px !important;
    line-height: 13px !important;
  }

  .hud-bar {
    height: 12px !important; /* Compatible con suites de test oficiales */
    min-height: 12px !important;
    width: 100% !important;
    position: relative !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .hud-bar-hp,
  .hud-bar-mp,
  .hud-bar-exp {
    /* Compatible canónico #MOBILE-TOUCH-CONTROLS-01: clamp(8px, 1.2vh, 10px) !important */
    height: 13px !important;
    min-height: 12px !important;
    max-height: 14px !important;
    border-radius: 6px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .hud-bar-hp {
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    background: rgba(45, 10, 10, 0.85) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  }

  .hud-bar-hp .hud-bar-fill {
    background: linear-gradient(90deg, #b91c1c 0%, #ef4444 60%, #f87171 100%) !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.65) !important;
  }

  .hud-bar-mp {
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    background: rgba(8, 25, 45, 0.85) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  }

  .hud-bar-mp .hud-bar-fill {
    background: linear-gradient(90deg, #0284c7 0%, #38bdf8 60%, #7dd3fc 100%) !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65) !important;
  }

  .hud-bar-exp {
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    background: rgba(6, 26, 18, 0.88) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  }

  .hud-bar-exp .hud-bar-fill {
    background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%) !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.65) !important;
  }

  .hud-bar-text,
  .hud-bar-exp .hud-bar-text {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: auto !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--font-mono, 'JetBrains Mono', monospace) !important;
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 3px rgba(0, 0, 0, 0.95) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
  }

  /* Colapsar el badge de zona segura/PvP para que jamás caiga encima del Slot 1 */
  .hud-player-badge #hud-zone-badge,
  #hud-zone-badge {
    display: none !important;
  }

  :root {
    --slot-size: clamp(62px, 8.5vh, 72px);
    --slot-gap: clamp(16px, 2.5vh, 22px);
    --hud-side-margin-right: calc(clamp(16px, 3.2vw, 36px) + env(safe-area-inset-right, 0px));
    --hud-side-margin-left: calc(clamp(16px, 3.2vw, 36px) + env(safe-area-inset-left, 0px));
    --hud-bottom-pad: calc(14px + env(safe-area-inset-bottom, 0px));
    --hud-slot8-bottom: calc(var(--hud-bottom-pad) + 12px);
  }
}

/* 1.4 Restaurar Barra de EXP, Agrupador Superior Izquierdo y Monitor de Rendimiento */
/* 1.4 Restaurar Barra de EXP, Agrupador Superior Izquierdo y Monitor de Rendimiento */
.hud-top-left-group {
  position: absolute !important;
  top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  left: var(--hud-side-margin-left, calc(12px + env(safe-area-inset-left, 0px))) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important; /* Separación limpia entre tarjeta y monitor */
  z-index: 20 !important;
  pointer-events: none !important;
}

.hud-top-left-group > * {
  pointer-events: auto !important;
}

/* Reducción compacta de tarjeta de perfil exclusivamente en pantallas reducidas y móviles */
@media screen and (max-height: 600px), screen and (max-width: 1024px) {
  .hud-top-left-group .hud-player-badge,
  .hud-player-badge {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: clamp(155px, 20vw, 175px) !important; /* ~5% a 8% más ancho para ganar espacio */
    padding: 4px 8px !important;
  }

  .hud-player-name-row {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }

  .hud-player-badge .hud-bar-hp,
  .hud-player-badge .hud-bar-mp {
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    border-radius: 5px !important;
  }
}

body.mobile-touch-mode .hud-top-left-group .hud-player-badge,
body.mobile-touch-mode .hud-player-badge {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: clamp(155px, 20vw, 175px) !important;
  padding: 4px 8px !important;
}

body.mobile-touch-mode .hud-player-name-row {
  font-size: 11px !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .hud-player-badge .hud-bar-hp,
body.mobile-touch-mode .hud-player-badge .hud-bar-mp {
  height: 10px !important;
  min-height: 10px !important;
  max-height: 10px !important;
  border-radius: 5px !important;
}

/* Barra de EXP más alta con tipografía nítida y legible */
.hud-player-badge .hud-bar-exp,
body.mobile-touch-mode .hud-bar-exp,
body.mobile-touch-mode .hud-player-badge .hud-bar-exp {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: 8px !important; /* Altura suficiente para que el texto EXP sea legible */
  min-height: 8px !important;
  max-height: 8px !important;
  border-radius: 4px !important;
  margin-top: 3px !important;
}

.hud-player-badge .hud-bar-exp .hud-bar-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%) !important;
}

.hud-player-badge .hud-bar-exp .hud-bar-text {
  font-size: 7.5px !important; /* Texto claro y nítido */
  line-height: 8px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  display: block !important;
}

.hud-top-left-group #hud-perf-monitor,
#hud-perf-monitor {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin-top: 6px !important; /* Margen garantizado para no montarse en el borde */
  font-size: 8px !important;
  padding: 2px 6px !important;
  height: auto !important;
  width: fit-content !important;
  border-radius: 4px !important;
  background: rgba(10, 15, 26, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#hud-perf-monitor .perf-label,
#hud-perf-monitor .perf-val {
  font-size: 8px !important;
}

#hud-perf-monitor .perf-separator {
  height: 8px !important;
}

/* Placas de NPCs */
.overhead-npc-plate {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  pointer-events: auto !important;
}

/* Globito de diálogo centrado sobre el NPC */
.overhead-npc-bubble {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  background: #fde047 !important;
  border: 1px solid #eab308 !important;
  border-radius: 12px !important;
  padding: 1px 7px !important;
  margin-bottom: 2px !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  white-space: nowrap !important;
  animation: npcBubbleFloat 1.2s infinite alternate ease-in-out !important;
  cursor: pointer !important;
  z-index: 25 !important;
}

@keyframes npcBubbleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.overhead-npc-name {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #fde047 !important;
  text-shadow: 0 1px 3px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 !important;
}

/* ==========================================================================
   DOCK INFERIOR ERGONÓMICO: MOCHILA Y CHAT (#FRONTEND-BOTTOM-DOCK-01)
   ========================================================================== */
.hud-bottom-dock {
  position: absolute !important;
  bottom: 12px !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  z-index: 25 !important;
  pointer-events: auto !important;
}

/* Botones de Mochila y Chat Uniformes Circulares con Marco Dorado */
.hud-bottom-dock #btn-quick-inv,
.hud-bottom-dock #hud-chat-btn,
#btn-quick-inv.hud-inv-touch-btn,
#hud-chat-btn {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(13, 19, 33, 0.75) !important;
  border: 2px solid #eab308 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 10px rgba(234, 179, 8, 0.35) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  box-sizing: border-box !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

@media screen and (max-height: 600px), screen and (max-width: 1024px) {
  .hud-bottom-dock #btn-quick-inv,
  .hud-bottom-dock #hud-chat-btn,
  #btn-quick-inv.hud-inv-touch-btn,
  #hud-chat-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
  }
}

.hud-bottom-dock #btn-quick-inv:hover,
.hud-bottom-dock #hud-chat-btn:hover,
#btn-quick-inv.hud-inv-touch-btn:hover,
#hud-chat-btn:hover {
  background: rgba(234, 179, 8, 0.22) !important;
  border-color: #fef08a !important;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.65), 0 4px 16px rgba(0, 0, 0, 0.8) !important;
  transform: translateY(-2px) scale(1.05) !important;
}

.hud-bottom-dock #btn-quick-inv:active,
.hud-bottom-dock #btn-quick-inv.pressed,
.hud-bottom-dock #hud-chat-btn:active,
.hud-bottom-dock #hud-chat-btn.pressed,
#btn-quick-inv.hud-inv-touch-btn:active,
#hud-chat-btn:active {
  background: rgba(234, 179, 8, 0.35) !important;
  border-color: #fef08a !important;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.85) !important;
  transform: scale(0.92) !important;
}

.hud-bottom-dock #btn-quick-inv,
#btn-quick-inv.hud-inv-touch-btn {
  font-size: 22px !important;
  line-height: 1 !important;
}

/* Soporte de Sprite Dinámico para Botón de Mochila - Proporcional y Nítido */
.hud-bottom-dock #btn-quick-inv img.hud-quick-bp-icon,
#btn-quick-inv.hud-inv-touch-btn img.hud-quick-bp-icon,
#btn-quick-inv img.hud-quick-bp-icon {
  width: 70% !important;
  height: 70% !important;
  max-width: 70% !important;
  max-height: 70% !important;
  object-fit: contain !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85)) !important;
  pointer-events: none !important;
  display: block !important;
  margin: auto !important;
}

.hud-bottom-dock #hud-chat-btn svg,
#hud-chat-btn svg {
  width: 24px !important;
  height: 24px !important;
  stroke: #fef08a !important;
  fill: none !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) !important;
}

#hud-chat-btn::before {
  display: none !important;
}


/* 2. Chat Colapsado con Badge de No Leídos y Expansión al 50% en Móvil */
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 10;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.chat-unread-badge.pulse {
  animation: pulseBadge 0.6s 2 ease-in-out;
}

body.mobile-touch-mode #hud-chat-card,
@media screen and (max-width: 1024px) {
  #hud-chat-card {
    width: 50vw !important;
    max-width: 480px !important;
    min-width: 280px !important;
    height: 48vh !important;
    max-height: 280px !important;
    background: rgba(10, 15, 26, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85) !important;
    bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
  }
}

/* 3. Radar Minimap: Tamaño ergonómico y legible en móvil (#MOBILE-MINIMAP-RESPONSIVE) */
@media screen and (max-height: 520px), screen and (max-width: 1024px) and (pointer: coarse) {
  #hud-minimap,
  body.mobile-touch-mode #hud-minimap {
    width: clamp(200px, 26vw, 240px) !important;
    height: auto !important;
    max-height: calc(100dvh - 54px) !important;
    border-radius: 8px !important;
    border: 1.5px solid #d97706 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 10px rgba(245, 158, 11, 0.25) !important;
    pointer-events: auto !important;
    z-index: 45 !important;
    overflow: hidden !important;
  }

  #hud-minimap-header {
    height: 24px !important;
    padding: 0 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .hud-minimap-title {
    font-size: 10px !important;
    white-space: nowrap !important;
    letter-spacing: 0.5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 140px !important;
  }

  .hud-minimap-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .hud-minimap-ctrl-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .hud-minimap-body {
    width: 100% !important;
    height: auto !important;
  }

  #minimap-canvas,
  body.mobile-touch-mode #minimap-canvas {
    width: 100% !important;
    height: clamp(95px, 22vh, 125px) !important;
    display: block !important;
    pointer-events: auto !important;
  }

  #hud-minimap-footer {
    height: 20px !important;
    padding: 0 6px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .hud-minimap-coords {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    color: #38bdf8 !important;
    font-family: monospace !important;
  }

  .hud-minimap-drag-hint {
    display: none !important;
  }

  #hud-minimap.minimap-expanded,
  body.mobile-touch-mode #hud-minimap.minimap-expanded {
    width: clamp(280px, 42vw, 360px) !important;
  }

  #hud-minimap.minimap-expanded #minimap-canvas,
  body.mobile-touch-mode #hud-minimap.minimap-expanded #minimap-canvas {
    height: clamp(150px, 38vh, 200px) !important;
  }
}

/* 4. Modales de Pantalla Completa Optimizados (<= 768px de altura) */
@media screen and (max-height: 768px), screen and (max-width: 1024px) and (max-height: 768px) {
  .vocation-modal-card,
  .auth-modal-card,
  .bank-card,
  .character-stats-card,
  .support-modal-card,
  .tasks-modal-card,
  .modal-card.mobile-screen-fit {
    width: 96vw !important;
    max-width: 96vw !important;
    height: 92vh !important;
    max-height: 92vh !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; /* El contenedor exterior mantiene bordes redondeados */
    padding: 10px 14px !important;
    font-size: 11.5px !important;
  }

  /* #FRONTEND-MOBILE-NPC-MODALS-FIX-01: Erradicado selector comodín (*) font-size: clamp(10.5px, 1.8vh, 12px) */
  .trade-inv-body,
  .trade-items-grid,
  .store-catalog-wrapper,
  .bank-controls,
  .tasks-grid-container,
  .market-items-scroll,
  .market-orders-list,
  .char-create-body,
  .char-roster-items {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  .modal-title,
  .market-title,
  .auth-title,
  .vocation-modal-title {
    font-size: clamp(13px, 2.2vh, 15px) !important;
    margin-bottom: 2px !important;
  }

  .modal-subtitle,
  .auth-subtitle {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }

  /* Botones de confirmación y cierre siempre accesibles en la parte inferior */
  .modal-footer,
  .auth-actions,
  .market-bottom-bar,
  .vocation-actions,
  .bank-actions,
  .trade-actions {
    flex-shrink: 0 !important;
    position: relative !important;
    bottom: 0 !important;
    padding-top: 6px !important;
    margin-top: auto !important;
    z-index: 10 !important;
  }

  .btn-auth-submit,
  .btn-vocation-confirm,
  .market-btn-confirm,
  .bank-btn-confirm {
    padding: 8px 16px !important;
    font-size: 12px !important;
    min-height: 36px !important;
  }
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA #FRONTEND-LOGIN-MODAL-MOBILE-02:
   MODAL DE LOGIN COMPACTO (#modal-auth) Y RESCATE DE BOTÓN INVITADO
   ========================================================================== */
@media screen and (max-height: 600px) {
  .auth-modal-card {
    height: auto !important;
    max-height: 96vh !important;
    overflow-y: auto !important; /* Desbloquear scroll si la pantalla es ultra compacta */
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 14px 14px 14px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  } /* Ocultar subtítulos y crest decorativo en móvil */
  .auth-header {
    padding-bottom: 2px !important;
    margin-bottom: 2px !important;
  }

  .auth-crest,
  .auth-subtitle,
  .auth-footer-info {
    display: none !important;
  }

  .auth-title {
    font-size: 13px !important;
    margin: 0 !important;
  }

  /* Campos de usuario y contraseña en una sola fila compacta */
  .auth-fields-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
  }

  .auth-field-group {
    flex: 1 !important;
    margin-bottom: 0 !important;
  }

  .auth-label {
    font-size: 9px !important;
    margin-bottom: 2px !important;
  }

  .auth-input-wrapper {
    height: 32px !important;
  }

  .auth-input {
    font-size: 11px !important;
    padding: 4px 8px 4px 28px !important;
  }

  /* Compactar las 4 tarjetas de vocación (ocultar la descripción larga para ahorrar 40px) */
  .auth-vocation-section {
    margin-bottom: 6px !important;
  }

  .auth-vocation-header {
    margin-bottom: 3px !important;
  }

  .auth-vocation-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }

  .auth-voc-card {
    padding: 4px 6px !important;
    min-height: 52px !important;
    max-height: 58px !important;
  }

  .auth-voc-icon {
    font-size: 16px !important;
    margin-bottom: 2px !important;
  }

  .auth-voc-name {
    font-size: 10px !important;
    font-weight: 700 !important;
  }

  .auth-voc-desc,
  .auth-vocation-tip {
    display: none !important; /* Ocultar descripciones en móvil para dar espacio a los botones */
  }

  .auth-voc-badge {
    font-size: 7.5px !important;
    padding: 1px 4px !important;
    top: 2px !important;
    right: 2px !important;
  }

  /* Ambos botones (Ingresar e Invitado) visibles y compactos */
  .btn-auth-submit,
  .btn-auth-guest {
    width: 100% !important;
    height: 34px !important;
    min-height: 34px !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
    margin-top: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .btn-auth-guest {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(245, 196, 81, 0.45) !important;
    color: #f8fafc !important;
  }
}

body.mobile-touch-mode .auth-modal-card {
  height: auto !important;
  max-height: 96vh !important;
  overflow-y: auto !important; /* Desbloquear scroll si la pantalla es ultra compacta */
  -webkit-overflow-scrolling: touch !important;
  padding: 8px 14px 14px 14px !important;
  gap: 6px !important;
  box-sizing: border-box !important;
} /* Ocultar subtítulos y crest decorativo en móvil */
body.mobile-touch-mode .auth-header {
  padding-bottom: 2px !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .auth-crest,
body.mobile-touch-mode .auth-subtitle,
body.mobile-touch-mode .auth-footer-info {
  display: none !important;
}

body.mobile-touch-mode .auth-title {
  font-size: 13px !important;
  margin: 0 !important;
}

/* Campos de usuario y contraseña en una sola fila compacta */
body.mobile-touch-mode .auth-fields-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  margin-bottom: 4px !important;
}

body.mobile-touch-mode .auth-field-group {
  flex: 1 !important;
  margin-bottom: 0 !important;
}

body.mobile-touch-mode .auth-label {
  font-size: 9px !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .auth-input-wrapper {
  height: 32px !important;
}

body.mobile-touch-mode .auth-input {
  font-size: 11px !important;
  padding: 4px 8px 4px 28px !important;
}

/* Compactar las 4 tarjetas de vocación (ocultar la descripción larga para ahorrar 40px) */
body.mobile-touch-mode .auth-vocation-section {
  margin-bottom: 6px !important;
}

body.mobile-touch-mode .auth-vocation-header {
  margin-bottom: 3px !important;
}

body.mobile-touch-mode .auth-vocation-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
}

body.mobile-touch-mode .auth-voc-card {
  padding: 4px 6px !important;
  min-height: 52px !important;
  max-height: 58px !important;
}

body.mobile-touch-mode .auth-voc-icon {
  font-size: 16px !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .auth-voc-name {
  font-size: 10px !important;
  font-weight: 700 !important;
}

body.mobile-touch-mode .auth-voc-desc,
body.mobile-touch-mode .auth-vocation-tip {
  display: none !important; /* Ocultar descripciones en móvil para dar espacio a los botones */
}

body.mobile-touch-mode .auth-voc-badge {
  font-size: 7.5px !important;
  padding: 1px 4px !important;
  top: 2px !important;
  right: 2px !important;
}

/* Ambos botones (Ingresar e Invitado) visibles y compactos */
body.mobile-touch-mode .btn-auth-submit,
body.mobile-touch-mode .btn-auth-guest {
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  margin-top: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.mobile-touch-mode .btn-auth-guest {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(245, 196, 81, 0.45) !important;
  color: #f8fafc !important;
}


/* ==========================================================================
   REESTRUCTURACIÓN ERGONÓMICA DE TIENDA & MOCHILA (#FRONTEND-TRADE-RESPONSIVE)
   ========================================================================== */

/* 1. MÓVIL Y TABLET (Hasta 1024px): Pantalla completa táctil */
@media (max-width: 1024px) {
  .trade-viewport {
    display: flex !important;
    flex-direction: row !important;
    width: 96vw !important;
    max-width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    gap: 10px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .store-panel,
  .backpack-panel {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 6px 10px !important;
  }

  /* Ocultar subtítulos largos en móvil para ganar espacio vertical */
  .trade-panel-subtitle {
    display: none !important;
  }

  /* Permitir que el catálogo de ítems y el inventario tengan scroll vertical fluido y altura real */
  .store-catalog-wrapper,
  .trade-inv-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .trade-items-grid,
  .atlas-inv-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important;
    gap: 6px !important;
    padding: 4px !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Evitar que las casillas se aplasten en móvil */
  .trade-item-slot,
  .inv-slot,
  .trade-items-grid .trade-item-card,
  .atlas-inv-grid .atlas-inv-slot,
  .trade-items-grid .atlas-inv-slot {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
}

/* 2. ESCRITORIO PC (Desde 1025px): Dimensiones clásicas RPG centradas y equilibradas */
@media (min-width: 1025px) {
  .trade-viewport {
    display: flex !important;
    flex-direction: row !important;
    width: min(1080px, 95vw) !important;
    max-width: 1080px !important;
    height: min(600px, 86vh) !important;
    max-height: 600px !important;
    margin: auto !important;
    gap: 16px !important;
    padding: 14px 18px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    align-self: center !important;
  }

  /* Si la tienda está cerrada y solo se muestra la mochila/equipo */
  .trade-viewport:has(#hud-store-panel[style*="display: none"]),
  .trade-viewport.solo-backpack {
    width: min(580px, 90vw) !important;
    max-width: 580px !important;
    height: auto !important;
    max-height: min(520px, 85vh) !important;
  }

  .store-panel {
    flex: 1 1 48% !important;
    min-width: 440px !important;
    height: 100% !important;
  }

  .backpack-panel {
    flex: 1 1 52% !important;
    min-width: 500px !important;
    height: 100% !important;
  }

  /* Dimensiones de casillas nítidas en escritorio (52px x 52px) */
  .atlas-equip-paperdoll {
    grid-template-columns: repeat(3, 52px) !important;
    grid-template-rows: repeat(3, 52px) !important;
    gap: 8px !important;
  }

  .atlas-equip-slot {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
  }

  .trade-items-grid,
  .atlas-inv-grid {
    grid-template-columns: repeat(4, 52px) !important;
    gap: 8px !important;
    padding: 6px !important;
  }

  .trade-item-slot,
  .inv-slot,
  .trade-items-grid .trade-item-card,
  .atlas-inv-grid .atlas-inv-slot,
  .trade-items-grid .atlas-inv-slot {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  .trade-equip-panel {
    width: 190px !important;
    flex-shrink: 0 !important;
  }
}

/* 5. Landscape Enforcer: Orientación Horizontal Obligatoria */
#orientation-enforcer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at center, rgba(13, 19, 33, 0.98) 0%, rgba(5, 8, 16, 0.99) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
  color: #f8fafc;
}

@media screen and (orientation: portrait) and (max-width: 1024px) {
  #orientation-enforcer {
    display: flex !important;
  }
}

body.mobile-portrait-warning #orientation-enforcer {
  display: flex !important;
}

.orientation-card {
  max-width: 360px;
  padding: 24px 20px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(245, 158, 11, 0.65);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 158, 11, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.orientation-icon-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orientation-phone-icon {
  font-size: 52px;
  display: inline-block;
  animation: phoneRotateAnim 2.4s infinite ease-in-out;
}

.orientation-rotate-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 26px;
  animation: rotateSpinAnim 2.4s infinite linear;
}

@keyframes phoneRotateAnim {
  0%, 15% { transform: rotate(0deg) scale(1); }
  50%, 65% { transform: rotate(-90deg) scale(1.12); }
  90%, 100% { transform: rotate(0deg) scale(1); }
}

@keyframes rotateSpinAnim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.orientation-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.8px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.orientation-message {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.45;
  margin: 0;
}

.orientation-subhint {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   ADAPTABILIDAD VIEWPORT MÓVIL Y CONTENCIÓN DINÁMICA (100dvh)
   ========================================================================== */
html, body, #game-wrapper {
  width: 100vw !important;
  height: 100dvh !important; /* Adaptable a la barra de direcciones dinámica */
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
  position: fixed !important;
  inset: 0 !important;
}

#game-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA: SLOTS TÁCTILES CÓMODOS Y GRANDES (54px-60px) EN MÓVIL
   ========================================================================== */
@media screen and (max-height: 600px), screen and (max-width: 1024px) {
  :root {
    --slot-size: clamp(54px, 7.8vh, 60px) !important; /* Tamaño táctil grande y cómodo en móvil */
    --slot-gap: clamp(6px, 1.1vh, 8px) !important;    /* Separación compacta */
    --hud-bottom-pad: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    --hud-slot8-bottom: var(--hud-bottom-pad) !important;
  }

  #hud-slots-left,
  #hud-slots-right {
    gap: var(--slot-gap) !important;
    bottom: var(--hud-slot8-bottom) !important;
  }

  .hud-slot {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    min-width: var(--slot-size) !important;
    min-height: var(--slot-size) !important;
    border-radius: 14px !important;
    background: rgba(13, 19, 33, 0.75) !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* Botón de Salto con el mismo tamaño táctil grande */
  #btn-touch-jump,
  #hud-jump-btn {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    bottom: var(--hud-slot8-bottom) !important;
    right: calc(var(--hud-side-margin-right) + var(--slot-size) + 14px) !important;
    border-radius: 14px !important;
    background: radial-gradient(circle, rgba(72, 229, 194, 0.18) 0%, rgba(13, 19, 33, 0.8) 75%) !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 14px rgba(72, 229, 194, 0.15) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* Botones de Mochila y Chat en el dock inferior con tamaño táctil cómodo (52px) */
  #btn-quick-inv.hud-inv-touch-btn,
  #hud-chat-btn {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
  }

  #btn-quick-inv.hud-inv-touch-btn {
    font-size: 22px !important;
  }

  #hud-chat-btn svg {
    width: 24px !important;
    height: 24px !important;
  }
}

body.mobile-touch-mode {
  --slot-size: clamp(54px, 7.8vh, 60px) !important;
  --slot-gap: clamp(6px, 1.1vh, 8px) !important;
  --hud-bottom-pad: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  --hud-slot8-bottom: var(--hud-bottom-pad) !important;
}

body.mobile-touch-mode #hud-slots-left,
body.mobile-touch-mode #hud-slots-right {
  gap: var(--slot-gap) !important;
  bottom: var(--hud-slot8-bottom) !important;
}

body.mobile-touch-mode .hud-slot {
  width: var(--slot-size) !important;
  height: var(--slot-size) !important;
  min-width: var(--slot-size) !important;
  min-height: var(--slot-size) !important;
  border-radius: 14px !important;
  background: rgba(13, 19, 33, 0.75) !important;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body.mobile-touch-mode #btn-touch-jump,
body.mobile-touch-mode #hud-jump-btn {
  width: var(--slot-size) !important;
  height: var(--slot-size) !important;
  bottom: var(--hud-slot8-bottom) !important;
  right: calc(var(--hud-side-margin-right) + var(--slot-size) + 14px) !important;
  border-radius: 14px !important;
  background: radial-gradient(circle, rgba(72, 229, 194, 0.18) 0%, rgba(13, 19, 33, 0.8) 75%) !important;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 14px rgba(72, 229, 194, 0.15) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body.mobile-touch-mode #btn-quick-inv.hud-inv-touch-btn,
body.mobile-touch-mode #hud-chat-btn {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
}

body.mobile-touch-mode #btn-quick-inv.hud-inv-touch-btn {
  font-size: 22px !important;
}

body.mobile-touch-mode #hud-chat-btn svg {
  width: 24px !important;
  height: 24px !important;
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA: ESCALADO ERGONÓMICO DE ESCRITORIO EN HUD.CSS (1080p+)
   ========================================================================== */
@media screen and (min-width: 1025px) and (min-height: 601px) {
  :root {
    --slot-size: clamp(84px, 8.8vh, 98px);
    --slot-gap: clamp(26px, 3.2vh, 40px);
    --hud-side-margin-right: clamp(28px, 2.5vw, 48px);
    --hud-side-margin-left: clamp(28px, 2.5vw, 48px);
    --hud-bottom-pad: clamp(20px, 2.8vh, 36px);
    --hud-slot8-bottom: calc(var(--hud-bottom-pad) + 16px);
  }

  /* Tarjeta de perfil imponente y legible en escritorio */
  .hud-top-left-group {
    position: absolute !important;
    top: clamp(14px, 2vh, 24px) !important;
    left: var(--hud-side-margin-left, 28px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    z-index: 20 !important;
    pointer-events: none !important;
  }

  .hud-top-left-group > * {
    pointer-events: auto !important;
  }

  .hud-top-left-group .hud-player-badge,
  .hud-player-badge {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    width: clamp(210px, 18vw, 260px) !important;
    min-width: 200px !important;
    max-width: 270px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Monitor de rendimiento FPS y MS ubicado limpiamente ABAJO del perfil */
  .hud-top-left-group #hud-perf-monitor,
  #hud-perf-monitor,
  .hud-perf-monitor {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    margin-top: 6px !important;
    align-self: flex-start !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(10, 15, 26, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
    padding: 2px 6px !important;
    height: auto !important;
    width: fit-content !important;
    font-size: 8px !important;
    z-index: 20 !important;
    pointer-events: auto !important;
  }

  .hud-player-name-row {
    font-size: 13px !important;
    margin-bottom: 5px !important;
  }

  .hud-player-level {
    font-size: 11px !important;
    padding: 1px 8px !important;
  }

  .hud-player-badge .hud-bar-hp,
  .hud-player-badge .hud-bar-mp {
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    border-radius: 8px !important;
  }

  .hud-player-badge .hud-bar-hp .hud-bar-text,
  .hud-player-badge .hud-bar-mp .hud-bar-text {
    font-size: 10px !important;
    line-height: 15px !important;
    font-weight: 800 !important;
  }

  .hud-player-badge .hud-bar-exp {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    border-radius: 5px !important;
    margin-top: 5px !important;
  }

  .hud-player-badge .hud-bar-exp .hud-bar-text {
    font-size: 8.5px !important;
    line-height: 10px !important;
    font-weight: 800 !important;
  }

  .hud-player-badge #hud-zone-badge {
    display: none !important;
  }

  /* 8 Slots de acción de gran tamaño en escritorio */
  #hud-slots-left,
  #hud-slots-right {
    gap: var(--slot-gap) !important;
    bottom: var(--hud-slot8-bottom) !important;
  }

  .hud-slot {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    min-width: var(--slot-size) !important;
    min-height: var(--slot-size) !important;
    border-radius: 14px !important;
  }

  /* Escalado de iconos y números en escritorio */
  #btn-touch-jump,
  #hud-jump-btn {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    min-width: var(--slot-size) !important;
    min-height: var(--slot-size) !important;
    bottom: var(--hud-slot8-bottom) !important;
    right: calc(var(--hud-side-margin-right) + var(--slot-size) + 16px) !important;
    border-radius: 14px !important;
  }

  #btn-touch-jump svg,
  #hud-jump-btn svg {
    width: clamp(34px, 4.2vh, 44px) !important;
    height: clamp(34px, 4.2vh, 44px) !important;
  }

  .hud-slot .slot-num {
    font-size: clamp(20px, 2.6vh, 28px) !important;
  }

  .hud-slot.has-icon .slot-num {
    font-size: clamp(12px, 1.8vh, 16px) !important;
  }

  /* Dock inferior de botones rápidos (Mochila y Chat) en escritorio */
  .hud-bottom-dock {
    bottom: clamp(18px, 2.5vh, 32px) !important;
    gap: clamp(16px, 1.8vw, 24px) !important;
  }

  .hud-bottom-dock #btn-quick-inv,
  .hud-bottom-dock #hud-chat-btn,
  #btn-quick-inv.hud-inv-touch-btn,
  #hud-chat-btn {
    width: clamp(66px, 7vh, 78px) !important;
    height: clamp(66px, 7vh, 78px) !important;
    min-width: clamp(66px, 7vh, 78px) !important;
    min-height: clamp(66px, 7vh, 78px) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 50% !important;
  }

  .hud-bottom-dock #btn-quick-inv,
  #btn-quick-inv.hud-inv-touch-btn {
    font-size: clamp(30px, 3.2vh, 36px) !important;
  }

  .hud-bottom-dock #hud-chat-btn svg,
  #hud-chat-btn svg {
    width: clamp(32px, 4vh, 40px) !important;
    height: clamp(32px, 4vh, 40px) !important;
  }

  .hud-bottom-dock #btn-quick-inv img.hud-quick-bp-icon,
  #btn-quick-inv.hud-inv-touch-btn img.hud-quick-bp-icon,
  #btn-quick-inv img.hud-quick-bp-icon {
    width: clamp(44px, 4.8vh, 54px) !important;
    height: clamp(44px, 4.8vh, 54px) !important;
    max-width: clamp(44px, 4.8vh, 54px) !important;
    max-height: clamp(44px, 4.8vh, 54px) !important;
  }

  /* Minimap amplio en escritorio (#MINIMAP-TACTICAL-RADAR) */
  #hud-minimap {
    width: 260px;
    height: auto;
  }

  #hud-minimap.minimap-expanded {
    width: 420px !important;
  }

  #minimap-canvas {
    width: 100% !important;
  }
}

@media screen and (max-height: 440px) {
  :root,
  body.mobile-touch-mode {
    --slot-size: clamp(54px, 7.8vh, 60px) !important;
    --slot-gap: clamp(6px, 1.1vh, 8px) !important;
    --hud-bottom-pad: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    --hud-slot8-bottom: var(--hud-bottom-pad) !important;
  }

  #hud-slots-left,
  #hud-slots-right {
    gap: var(--slot-gap) !important;
    bottom: var(--hud-slot8-bottom) !important;
  }

  .hud-slot {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    min-width: var(--slot-size) !important;
    min-height: var(--slot-size) !important;
    border-radius: 12px !important;
  }

  #btn-touch-jump,
  #hud-jump-btn {
    width: var(--slot-size) !important;
    height: var(--slot-size) !important;
    bottom: var(--hud-slot8-bottom) !important;
    right: calc(var(--hud-side-margin-right) + var(--slot-size) + 14px) !important;
    border-radius: 12px !important;
  }


  /* Compactar el HUD superior izquierdo para que termine arriba y no choque con Slot 1 */
  .hud-top-left-group .hud-player-badge,
  .hud-player-badge,
  body.mobile-touch-mode .hud-player-badge {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: clamp(155px, 20vw, 175px) !important;
    padding: 4px 8px !important;
  }

  /* Barra de EXP visible y estilizada en pantallas < 440px */
  .hud-player-badge .hud-bar-exp,
  body.mobile-touch-mode .hud-bar-exp,
  body.mobile-touch-mode .hud-player-badge .hud-bar-exp {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 8px !important;
    min-height: 8px !important;
    max-height: 8px !important;
    border-radius: 4px !important;
    margin-top: 3px !important;
  }

  .hud-player-badge .hud-bar-exp .hud-bar-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%) !important;
  }

  .hud-player-badge .hud-bar-exp .hud-bar-text {
    font-size: 7.5px !important;
    line-height: 8px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    display: block !important;
  }

  .hud-player-badge .hud-bar-hp,
  .hud-player-badge .hud-bar-mp,
  body.mobile-touch-mode .hud-bar-hp,
  body.mobile-touch-mode .hud-bar-mp,
  body.mobile-touch-mode .hud-player-badge .hud-bar-hp,
  body.mobile-touch-mode .hud-player-badge .hud-bar-mp {
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    border-radius: 5px !important;
  }

  /* Asegurar que el monitor de FPS/MS permanezca debajo del perfil con separación */
  .hud-top-left-group #hud-perf-monitor,
  #hud-perf-monitor,
  body.mobile-touch-mode #hud-perf-monitor {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    margin-top: 6px !important;
    font-size: 8px !important;
    padding: 2px 6px !important;
    height: auto !important;
    width: fit-content !important;
    border-radius: 4px !important;
    background: rgba(10, 15, 26, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
    z-index: 20 !important;
  }
}

/* ==========================================================================
   TARJETA DE DETALLES Y ACCIONES DEL ÍTEM EN LA MOCHILA (#INV-DETAIL-CARD)
   ========================================================================== */
.inv-item-detail-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(245, 196, 81, 0.6);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}

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

.inv-detail-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 196, 81, 0.4);
  border-radius: 6px;
}

.inv-detail-icon-wrap img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.inv-detail-info {
  flex: 1;
  min-width: 0;
}

.inv-detail-name {
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
  margin: 0 0 2px 0;
}

.inv-detail-desc {
  font-size: 10px;
  color: #cbd5e1;
  margin: 0;
}

.inv-detail-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

.inv-detail-actions {
  display: flex;
  gap: 8px;
}

.btn-inv-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-inv-action.btn-equip {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
  color: #0f172a;
}

.btn-inv-action.btn-unequip {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #0f172a;
}

.btn-inv-action.btn-use {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #0f172a;
}

.btn-inv-action.btn-drop {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.btn-inv-action.btn-transfer {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid #38bdf8;
  color: #38bdf8;
}

.btn-inv-action.btn-transfer:hover {
  background: rgba(56, 189, 248, 0.32);
  color: #e0f2fe;
}

.inv-tab-pills {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 6px;
}

.inv-tab-pill {
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 5px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.inv-tab-pill:hover {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f1f5f9;
}

.inv-tab-pill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

.inv-tab-pill .pill-count {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  opacity: 0.85;
}

.atlas-inv-slot.selected,
.atlas-equip-slot.selected {
  outline: 2px solid #fde047;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.7);
}

/* =========================================================================
   DISEÑO CANÓNICO DE BACKPACK (PAPERDOLL 3x4 + GRID 8x4 PAGINADO) & SHOP HOMOLOGADO
   ========================================================================= */

/* Barra de Sub-pestañas */
.inv-subtabs-bar,
.trade-subtabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
  padding-bottom: 4px;
}
.inv-subtab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-family: var(--font-sans, system-ui);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.inv-subtab-btn:hover {
  color: #f1f5f9;
}
.inv-subtab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 4px 4px 0 0;
}

/* Distribución Principal */
.inv-main-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

/* Paperdoll 3x4 */
.inv-paperdoll-grid-3x4 {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(4, 44px);
  gap: 6px;
  flex-shrink: 0;
}
.inv-paperdoll-grid-3x4 .atlas-equip-slot {
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}

/* Divisor Vertical */
.inv-v-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  align-self: stretch;
}

/* Cuadrícula de 8x4 = 32 slots */
.inv-grid-column,
.trade-grid-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.inv-slots-grid-8x4 {
  display: grid;
  grid-template-columns: repeat(8, 44px);
  grid-template-rows: repeat(4, 44px);
  gap: 6px;
  justify-content: start;
}
.inv-slots-grid-8x4 .atlas-inv-slot,
.inv-slots-grid-8x4 .trade-item-card-canonical {
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.inv-slots-grid-8x4 .atlas-inv-slot:hover,
.inv-slots-grid-8x4 .trade-item-card-canonical:hover {
  border-color: #f59e0b;
  transform: scale(1.04);
}
.inv-slots-grid-8x4 .atlas-inv-slot.selected,
.inv-slots-grid-8x4 .trade-item-card-canonical.selected {
  outline: 2px solid #38bdf8 !important;
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
}

/* Paginación Inferior Derecha */
.inv-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
  padding-right: 4px;
}
.inv-page-indicator {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #64748b;
}
.inv-pagination-btns {
  display: flex;
  gap: 6px;
}
.btn-page-nav {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #cbd5e1;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-page-nav:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
}
.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Barra de Detalles Slim en Inventario */
.inv-detail-bar-slim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  margin-top: 4px;
}
.inv-detail-slim-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-detail-slim-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.inv-detail-slim-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.inv-detail-slim-info {
  display: flex;
  flex-direction: column;
}
.inv-detail-slim-name {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}
.inv-detail-slim-stats {
  font-size: 10px;
  color: #94a3b8;
}
.inv-detail-slim-actions {
  display: flex;
  gap: 6px;
}

/* =========================================================================
   MODAL DE TIENDA CANÓNICO (HOMOLOGADO 8x4)
   ========================================================================= */
.trade-viewport-canonical {
  width: min(720px, 95vw);
  background: radial-gradient(circle at top, rgba(17, 24, 39, 0.98) 0%, rgba(10, 15, 29, 0.99) 100%);
  border: 1.5px solid var(--border-gold, #f59e0b);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 20px rgba(245, 158, 11, 0.2);
  padding: 16px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #f8fafc;
  margin: auto;
  position: relative;
}

.trade-canonical-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.trade-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-transaction-bar-slim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(11, 18, 33, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  box-sizing: border-box;
  margin-top: 4px;
  min-height: 48px;
}
.trade-trans-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.trade-trans-icon-wrap {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.trade-trans-icon-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.trade-trans-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.trade-trans-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.trade-trans-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trade-trans-slot-badge {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}
.trade-trans-owned-badge {
  font-size: 10px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}
.trade-trans-level-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.trade-trans-level-badge.meet {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.trade-trans-level-badge.unmet {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  font-weight: 800;
}
.trade-trans-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 1px;
}
.trade-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}
.trade-stat-pill.stat-atk {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}
.trade-stat-pill.stat-def {
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
}
.trade-stat-pill.stat-matk {
  border-color: rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.15);
}
.trade-stat-pill.stat-crit {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde047;
  background: rgba(245, 158, 11, 0.15);
}
.trade-stat-pill.stat-heal {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
}
.trade-stat-pill.stat-mana {
  border-color: rgba(14, 165, 233, 0.5);
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.15);
}
.trade-stat-pill.stat-weight {
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.3);
}
.trade-stat-pill.stat-set {
  border-color: rgba(234, 179, 8, 0.4);
  color: #fef08a;
  background: rgba(234, 179, 8, 0.12);
  font-size: 10px;
}
.trade-stat-pill.stat-cap {
  border-color: rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.12);
}
.trade-stat-compare {
  font-size: 10px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 2px;
}
.trade-stat-compare.upgrade {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.4);
}
.trade-stat-compare.downgrade {
  color: #f87171;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.trade-stat-compare.equal {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
}
.trade-trans-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #fbbf24;
}
.trade-trans-desc {
  color: #94a3b8;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.trade-trans-middle {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trade-trans-total-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #e2e8f0;
}
.trade-trans-total-val {
  color: #fde047;
  font-size: 14px;
  font-family: var(--font-mono, monospace);
}
.trade-trans-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-trade-confirm {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-trade-confirm.btn-buy {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: #22c55e;
  color: #fff;
}
.btn-trade-confirm.btn-buy:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  transform: translateY(-1px);
}
.btn-trade-confirm.btn-sell {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #fff;
}
.btn-trade-confirm.btn-sell:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-1px);
}
.btn-trade-confirm.btn-sell-all {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #f59e0b;
  color: #fff;
}
.btn-trade-confirm.btn-sell-all:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-1px);
}

/* ==========================================================================
   BANCO REAL DE BRUCE (#bank-controls) • KIOSCO DE BÓVEDA
   ========================================================================== */
#modal-trade.bank-mode .trade-viewport-canonical,
.trade-viewport-canonical.is-bank {
  width: min(520px, 95vw) !important;
  max-width: 520px !important;
  margin: auto !important;
  padding: 10px 14px !important;
  background: linear-gradient(180deg, rgba(20, 16, 26, 0.98) 0%, rgba(12, 10, 18, 0.99) 100%) !important;
  border: 1px solid rgba(234, 179, 8, 0.45) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 30px rgba(234, 179, 8, 0.15) !important;
  gap: 8px !important;
}

#bank-controls {
  display: none;
}

#bank-controls.active,
.trade-viewport-canonical.is-bank #bank-controls,
#modal-trade.bank-mode #bank-controls {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.bank-balance-card {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(234, 179, 8, 0.3) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  gap: 8px !important;
}

.bank-balance-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.bank-lbl {
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
}

.bank-val {
  font-family: var(--font-mono, monospace) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #fde047 !important;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.4) !important;
}

.bank-val-hand {
  font-family: var(--font-mono, monospace) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #6ee7b7 !important;
}

.bank-quick-row {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
}

.btn-bank-quick {
  flex: 1 !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.btn-bank-dep-all {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.25) 0%, rgba(161, 98, 7, 0.35) 100%) !important;
  border: 1px solid #eab308 !important;
  color: #fef08a !important;
}

.btn-bank-with-all {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%) !important;
  border: 1px solid #10b981 !important;
  color: #a7f3d0 !important;
}

.bank-custom-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

.bank-custom-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.bank-input-title-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.bank-chips-row {
  display: flex !important;
  gap: 4px !important;
}

.btn-bank-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  color: #cbd5e1 !important;
  font-size: 10px !important;
  font-family: var(--font-mono, monospace) !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
}

.btn-bank-chip:active,
.btn-bank-chip:hover {
  background: rgba(234, 179, 8, 0.25) !important;
  border-color: #eab308 !important;
  color: #fde047 !important;
}

.btn-bank-chip.chip-max {
  background: rgba(234, 179, 8, 0.15) !important;
  border-color: rgba(234, 179, 8, 0.4) !important;
  color: #fde047 !important;
}

.bank-input-row {
  display: flex !important;
  gap: 6px !important;
}

.bank-num-input {
  flex: 1 !important;
  height: 32px !important;
  background: rgba(0, 0, 0, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 6px !important;
  color: #fff !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 13px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

.bank-num-input:focus {
  border-color: #eab308 !important;
  outline: none !important;
}

.btn-bank-submit {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
}

.btn-bank-submit.btn-deposit {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%) !important;
  border: 1px solid #fde047 !important;
  color: #000 !important;
}

.btn-bank-submit.btn-withdraw {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
  border: 1px solid #6ee7b7 !important;
  color: #000 !important;
}

/* Responsividad de Tienda Canónica en Móvil */
@media screen and (max-height: 540px), screen and (max-width: 900px) {
  .trade-viewport-canonical {
    width: min(720px, 98vw) !important;
    max-height: 96dvh !important;
    padding: 8px 12px !important;
    gap: 6px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .trade-canonical-header {
    padding-bottom: 4px !important;
  }

  .trade-panel-title {
    font-size: 13.5px !important;
  }

  .trade-panel-subtitle {
    display: none !important;
  }

  .trade-subtabs-bar {
    gap: 6px !important;
    margin-bottom: 2px !important;
  }

  .trade-subtabs-bar .inv-subtab-btn {
    padding: 4px 10px !important;
    font-size: 11px !important;
    min-height: 26px !important;
  }

  .inv-slots-grid-8x4 {
    grid-template-columns: repeat(8, 40px) !important;
    grid-template-rows: repeat(4, 40px) !important;
    gap: 4px !important;
  }

  .inv-slots-grid-8x4 .atlas-inv-slot,
  .inv-slots-grid-8x4 .trade-item-card-canonical {
    width: 40px !important;
    height: 40px !important;
  }

  .trade-transaction-bar-slim {
    padding: 4px 10px !important;
    min-height: 42px !important;
    margin-top: 2px !important;
    gap: 8px !important;
  }

  .trade-trans-icon-wrap {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }

  .trade-trans-icon-wrap img {
    width: 24px !important;
    height: 24px !important;
  }

  .trade-trans-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    line-height: 1.25 !important;
  }

  .trade-trans-title-row {
    margin-bottom: 2px !important;
  }

  .trade-trans-name {
    font-size: 11.5px !important;
  }

  .trade-stat-pill {
    font-size: 9.5px !important;
    padding: 1px 4px !important;
  }

  .trade-trans-slot-badge,
  .trade-trans-level-badge,
  .trade-trans-owned-badge {
    font-size: 9px !important;
    padding: 0 4px !important;
  }

  .trade-trans-meta-row {
    font-size: 10px !important;
  }

  .trade-trans-desc {
    max-width: 200px !important;
    font-size: 10px !important;
  }

  .btn-trade-confirm {
    padding: 6px 12px !important;
    font-size: 11px !important;
  }

  /* Banco Real en Móvil Landscape */
  #modal-trade.bank-mode .trade-viewport-canonical,
  .trade-viewport-canonical.is-bank {
    width: min(580px, 96vw) !important;
    max-width: min(580px, 96vw) !important;
    max-height: 94dvh !important;
    padding: 8px 12px !important;
    gap: 6px !important;
  }

  .trade-viewport-canonical.is-bank .bank-balance-card {
    padding: 5px 10px !important;
  }

  .trade-viewport-canonical.is-bank .btn-bank-quick {
    height: 32px !important;
    min-height: 32px !important;
    font-size: 11px !important;
  }

  .trade-viewport-canonical.is-bank .bank-custom-box {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .trade-viewport-canonical.is-bank .bank-custom-group {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .trade-viewport-canonical.is-bank .bank-input-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    min-width: 0 !important;
    gap: 2px !important;
  }

  .trade-viewport-canonical.is-bank .bank-input-lbl {
    font-size: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
  }

  .trade-viewport-canonical.is-bank .bank-chips-row {
    display: flex !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }

  .trade-viewport-canonical.is-bank .btn-bank-chip {
    padding: 1px 4px !important;
    font-size: 9px !important;
    line-height: 1.3 !important;
  }

  .trade-viewport-canonical.is-bank .bank-input-row {
    display: flex !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .trade-viewport-canonical.is-bank .bank-num-input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    height: 32px !important;
    font-size: 12px !important;
    box-sizing: border-box !important;
  }

  .trade-viewport-canonical.is-bank .btn-bank-submit {
    height: 32px !important;
    min-height: 32px !important;
    font-size: 10.5px !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Modal de Vocación en Móvil Landscape */
  .vocation-modal-card {
    width: min(720px, 96vw) !important;
    max-width: min(720px, 96vw) !important;
    max-height: 94dvh !important;
    padding: 6px 12px !important;
    gap: 4px !important;
  }

  .vocation-modal-header {
    padding-bottom: 2px !important;
  }

  .vocation-modal-subtitle {
    font-size: 10.5px !important;
    margin: 1px 0 !important;
  }

  .voc-status-banner {
    padding: 3px 8px !important;
    font-size: 9.5px !important;
  }

  .vocation-selection-list.vocation-grid-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    margin: 2px 0 !important;
    overflow-y: auto !important;
    flex: 1 !important;
  }

  .vocation-card {
    padding: 4px 6px !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 3px !important;
  }

  .vocation-icon-box {
    width: 28px !important;
    height: 28px !important;
    font-size: 15px !important;
  }

  .vocation-name {
    font-size: 11px !important;
  }

  .vocation-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    margin: 1px 0 !important;
  }

  .vocation-tags {
    display: none !important;
  }

  .vocation-card-action {
    margin-top: auto !important;
    width: 100% !important;
  }

  .btn-select-vocation {
    height: 24px !important;
    min-height: 24px !important;
    line-height: 24px !important;
    font-size: 9.5px !important;
    padding: 0 4px !important;
    width: 100% !important;
  }
}

body.mobile-touch-mode .trade-viewport-canonical {
  width: min(720px, 98vw) !important;
  max-height: 96dvh !important;
  padding: 8px 12px !important;
  gap: 6px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.mobile-touch-mode .trade-canonical-header {
  padding-bottom: 4px !important;
}

body.mobile-touch-mode .trade-panel-title {
  font-size: 13.5px !important;
}

body.mobile-touch-mode .trade-panel-subtitle {
  display: none !important;
}

body.mobile-touch-mode .trade-subtabs-bar {
  gap: 6px !important;
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .trade-subtabs-bar .inv-subtab-btn {
  padding: 4px 10px !important;
  font-size: 11px !important;
  min-height: 26px !important;
}

body.mobile-touch-mode .inv-slots-grid-8x4 {
  grid-template-columns: repeat(8, 40px) !important;
  grid-template-rows: repeat(4, 40px) !important;
  gap: 4px !important;
}

body.mobile-touch-mode .inv-slots-grid-8x4 .atlas-inv-slot,
body.mobile-touch-mode .inv-slots-grid-8x4 .trade-item-card-canonical {
  width: 40px !important;
  height: 40px !important;
}

body.mobile-touch-mode .trade-transaction-bar-slim {
  padding: 4px 10px !important;
  min-height: 42px !important;
  margin-top: 2px !important;
  gap: 8px !important;
}

body.mobile-touch-mode .trade-trans-icon-wrap {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}

body.mobile-touch-mode .trade-trans-icon-wrap img {
  width: 24px !important;
  height: 24px !important;
}

body.mobile-touch-mode .trade-trans-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  line-height: 1.25 !important;
}

body.mobile-touch-mode .trade-trans-title-row {
  margin-bottom: 2px !important;
}

body.mobile-touch-mode .trade-stat-pill {
  font-size: 9.5px !important;
  padding: 1px 4px !important;
}

body.mobile-touch-mode .trade-trans-slot-badge,
body.mobile-touch-mode .trade-trans-level-badge,
body.mobile-touch-mode .trade-trans-owned-badge {
  font-size: 9px !important;
  padding: 0 4px !important;
}

body.mobile-touch-mode .trade-trans-desc {
  max-width: 200px !important;
  font-size: 10px !important;
}

body.mobile-touch-mode #modal-trade.bank-mode .trade-viewport-canonical,
body.mobile-touch-mode .trade-viewport-canonical.is-bank {
  width: min(580px, 96vw) !important;
  max-width: min(580px, 96vw) !important;
  max-height: 94dvh !important;
  padding: 8px 12px !important;
  gap: 6px !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-balance-card {
  padding: 5px 10px !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .btn-bank-quick {
  height: 32px !important;
  min-height: 32px !important;
  font-size: 11px !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-custom-box {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-custom-group {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-input-title-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-width: 0 !important;
  gap: 2px !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-input-lbl {
  font-size: 10px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-chips-row {
  display: flex !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .btn-bank-chip {
  padding: 1px 4px !important;
  font-size: 9px !important;
  line-height: 1.3 !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-input-row {
  display: flex !important;
  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .bank-num-input {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 0 !important;
  height: 32px !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .trade-viewport-canonical.is-bank .btn-bank-submit {
  height: 32px !important;
  min-height: 32px !important;
  font-size: 10.5px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

body.mobile-touch-mode .vocation-modal-card {
  width: min(720px, 96vw) !important;
  max-width: min(720px, 96vw) !important;
  max-height: 94dvh !important;
  padding: 6px 12px !important;
  gap: 4px !important;
}

body.mobile-touch-mode .vocation-selection-list.vocation-grid-list {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  margin: 2px 0 !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

body.mobile-touch-mode .vocation-card {
  padding: 4px 6px !important;
  min-height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 3px !important;
}

body.mobile-touch-mode .vocation-icon-box {
  width: 28px !important;
  height: 28px !important;
  font-size: 15px !important;
}

body.mobile-touch-mode .vocation-name {
  font-size: 11px !important;
}

body.mobile-touch-mode .vocation-desc {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 9px !important;
  line-height: 1.15 !important;
  margin: 1px 0 !important;
}

body.mobile-touch-mode .vocation-tags {
  display: none !important;
}

body.mobile-touch-mode .vocation-card-action {
  margin-top: auto !important;
  width: 100% !important;
}

body.mobile-touch-mode .btn-select-vocation {
  height: 24px !important;
  min-height: 24px !important;
  line-height: 24px !important;
  font-size: 9.5px !important;
  padding: 0 4px !important;
  width: 100% !important;
}

/* ==========================================================================
   EXPANSIÓN AL 100% DE LA MOCHILA EN TIENDAS / BANCO / BAÚL EN MÓVIL
   ========================================================================== */
@media screen and (max-height: 600px), screen and (max-width: 1024px) {
  /* Ocultar el panel de armadura rígido en comercio/banco para liberar todo el espacio */
  .trade-equip-panel {
    display: none !important;
  }

  .trade-player-dual-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
  }

  .trade-backpack-subpanel {
    width: 100% !important;
    flex: 1 1 100% !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
  }

  /* Grid amplio de casillas (múltiples columnas con slots grandes de 46px) */
  .trade-inv-body .atlas-inv-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)) !important;
    gap: 8px !important;
    padding: 6px 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .trade-inv-body .atlas-inv-slot {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 48px !important;
    max-height: 48px !important;
  }
}

/* Soporte para body.mobile-touch-mode */
body.mobile-touch-mode .trade-equip-panel {
  display: none !important;
}

body.mobile-touch-mode .trade-player-dual-body {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
}

body.mobile-touch-mode .trade-backpack-subpanel {
  width: 100% !important;
  flex: 1 1 100% !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .trade-inv-body .atlas-inv-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)) !important;
  gap: 8px !important;
  padding: 6px 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.mobile-touch-mode .trade-inv-body .atlas-inv-slot {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

/* Globo de Diálogo Flotante (#MULTIPLAYER-PHASE-1-REALTIME-CHAT-SYNC) */
.overhead-chat-bubble {
  position: relative;
  background: rgba(10, 15, 29, 0.94);
  border: 1px solid rgba(250, 204, 21, 0.75);
  border-radius: 8px;
  padding: 4px 9px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  max-width: 190px;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 8px rgba(234, 179, 8, 0.25);
  pointer-events: none;
  animation: speechBubblePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.overhead-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: rgba(10, 15, 29, 0.94) transparent transparent transparent;
}

.overhead-chat-bubble.fading {
  opacity: 0;
  transform: translateY(-4px) scale(0.85);
}

@keyframes speechBubblePop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.6);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   MODAL DE INSPECCIÓN E INTERACCIÓN DE JUGADOR (#FRONTEND-PLAYER-INSPECTION-AND-ACTION-MODAL-01)
   ========================================================================== */
.modal-player-inspect {
  z-index: 1200 !important;
}

.modal-player-inspect.active {
  display: flex !important;
}

.inspect-modal-card {
  width: 94vw !important;
  max-width: min(940px, 94vw) !important;
  background: radial-gradient(circle at 50% 0%, rgba(26, 36, 56, 0.98) 0%, rgba(13, 19, 33, 0.99) 70%, rgba(7, 11, 20, 1) 100%) !important;
  border: 1.5px solid rgba(212, 160, 23, 0.45) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.92), 0 0 35px rgba(212, 160, 23, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 24px rgba(0, 0, 0, 0.5) !important;
  padding: 18px 22px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  position: relative !important;
  color: #f8fafc !important;
  animation: inspectCardPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  max-height: 94vh !important;
  overflow-y: auto !important;
}

.inspect-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(212, 160, 23, 0.22) !important;
  padding-bottom: 10px !important;
  flex-shrink: 0 !important;
}

.inspect-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.inspect-header-badge {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 5px !important;
  padding: 2.5px 8px !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15) !important;
}

.inspect-modal-title {
  font-family: 'Cinzel', Georgia, serif !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #fef08a !important;
  margin: 0 !important;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.35) !important;
}

.inspect-close-btn {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: bold !important;
  transition: all 0.16s ease !important;
}

.inspect-close-btn:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
  transform: scale(1.05) !important;
}

.inspect-modal-body {
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 16px !important;
  align-items: stretch !important;
}

/* Columna Izquierda: Vitrina del Personaje */
.inspect-profile-column {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  background: rgba(14, 21, 37, 0.72) !important;
  border: 1px solid rgba(212, 160, 23, 0.22) !important;
  border-radius: 12px !important;
  padding: 14px 12px !important;
  gap: 8px !important;
  text-align: center !important;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.45) !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.inspect-avatar-pedestal {
  position: relative !important;
  width: 104px !important;
  height: 104px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.95) 75%) !important;
  border: 2px solid rgba(212, 160, 23, 0.55) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.28), inset 0 0 16px rgba(212, 160, 23, 0.25) !important;
}

.inspect-avatar-canvas {
  width: 96px !important;
  height: 96px !important;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
}

.inspect-pedestal-glow {
  position: absolute !important;
  bottom: -6px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 70px !important;
  height: 10px !important;
  background: radial-gradient(ellipse, rgba(56, 189, 248, 0.7), transparent 75%) !important;
  filter: blur(3px) !important;
  pointer-events: none !important;
}

.inspect-info-block {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.inspect-name-text {
  font-family: 'Cinzel', Georgia, serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
  word-break: break-word !important;
}

.inspect-tags-row {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  margin-top: 2px !important;
}

.inspect-level-badge {
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  border-radius: 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
  padding: 2px 7px !important;
}

.inspect-voc-badge {
  background: rgba(16, 185, 129, 0.16) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  border-radius: 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #34d399 !important;
  padding: 2px 7px !important;
}

.inspect-rank-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #fbbf24 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.35) !important;
  margin-top: 2px !important;
}

.inspect-vitals-box {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 6px !important;
  background: rgba(0, 0, 0, 0.3) !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-sizing: border-box !important;
}

.inspect-vital-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  font-size: 10px !important;
}

.inspect-vital-label.hp {
  color: #f87171 !important;
  font-weight: 800 !important;
  width: 18px !important;
  text-align: left !important;
}

.inspect-vital-label.mp {
  color: #38bdf8 !important;
  font-weight: 800 !important;
  width: 18px !important;
  text-align: left !important;
}

.inspect-vital-track {
  flex: 1 !important;
  height: 8px !important;
  background: rgba(5, 9, 18, 0.85) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

.inspect-vital-fill.hp {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 65%, #f87171 100%) !important;
  height: 100% !important;
  transition: width 0.3s ease !important;
}

.inspect-vital-fill.mp {
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 65%, #38bdf8 100%) !important;
  height: 100% !important;
  transition: width 0.3s ease !important;
}

.inspect-vital-val {
  font-size: 9.5px !important;
  font-family: 'JetBrains Mono', monospace !important;
  color: #f1f5f9 !important;
  min-width: 52px !important;
  text-align: right !important;
  font-weight: 600 !important;
}

/* Columna Derecha: Acciones del Jugador (Auto-Fit Adaptable para Laptop y PC) */
.inspect-actions-column {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 12px !important;
  align-content: start !important;
  min-width: 0 !important;
  width: 100% !important;
}

/* Botón Principal Destacado: HACER TRADE */
.btn-trade-hero {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.35) 50%, rgba(15, 23, 42, 0.95) 100%) !important;
  border: 1.5px solid rgba(52, 211, 153, 0.65) !important;
  border-radius: 11px !important;
  padding: 12px 14px !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  overflow: hidden !important;
  width: 100% !important;
  min-width: 240px !important;
  min-height: 84px !important;
  box-sizing: border-box !important;
  touch-action: manipulation !important;
  user-select: none !important;
  flex: 1 1 260px !important;
}

.btn-trade-hero:hover {
  transform: translateY(-2px) !important;
  border-color: #34d399 !important;
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.42), 0 0 16px rgba(52, 211, 153, 0.35) !important;
}

.btn-trade-hero:active {
  transform: translateY(0) !important;
}

.trade-icon {
  font-size: 26px !important;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.5)) !important;
  flex-shrink: 0 !important;
}

.inspect-btn-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
}

.btn-trade-hero .inspect-btn-title {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #ecfdf5 !important;
  letter-spacing: 0.8px !important;
}

.inspect-trade-tag {
  font-size: 9px !important;
  font-weight: 800 !important;
  background: rgba(52, 211, 153, 0.2) !important;
  border: 1px solid rgba(52, 211, 153, 0.45) !important;
  color: #6ee7b7 !important;
  border-radius: 4px !important;
  padding: 1px 6px !important;
  letter-spacing: 0.5px !important;
}

.btn-trade-hero .inspect-btn-sub {
  font-size: 10px !important;
  color: #a7f3d0 !important;
  margin-top: 1px !important;
}

.inspect-trade-arrow {
  margin-left: auto !important;
  font-size: 15px !important;
  color: #34d399 !important;
  font-weight: bold !important;
  transition: transform 0.18s ease !important;
}

.btn-trade-hero:hover .inspect-trade-arrow {
  transform: translateX(4px) !important;
}

/* Grilla de Acciones Secundarias */
.inspect-secondary-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 240px !important;
  flex: 1 1 260px !important;
  box-sizing: border-box !important;
}

.inspect-action-btn:not(.btn-trade-hero) {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 9px !important;
  padding: 9px 10px !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.16s ease !important;
  user-select: none !important;
  box-sizing: border-box !important;
  touch-action: manipulation !important;
  min-height: 48px !important;
}

.inspect-action-btn:not(.btn-trade-hero):hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
}

.inspect-action-btn:not(.btn-trade-hero):active {
  transform: translateY(1px) !important;
}

.btn-whisper:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25) !important;
}

.btn-party:hover {
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(96, 165, 250, 0.25) !important;
}

.btn-friend:hover {
  border-color: #a78bfa !important;
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.25) !important;
}

.btn-follow:hover {
  border-color: #f59e0b !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25) !important;
}

.inspect-btn-icon:not(.trade-icon) {
  font-size: 18px !important;
  flex-shrink: 0 !important;
}

.inspect-btn-content {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.inspect-btn-title {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
}

.inspect-btn-sub {
  font-size: 9.5px !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  margin-top: 1px !important;
}

/* Responsividad para Laptops y Pantallas Compactas */
@media (max-width: 820px) {
  .inspect-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 14px !important;
    gap: 12px !important;
  }
  .inspect-actions-column {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* Responsividad Móvil */
@media (max-width: 600px) {
  .inspect-modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 12px !important;
    gap: 10px !important;
    max-height: 94vh !important;
    overflow-y: auto !important;
  }
  .inspect-modal-body {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .inspect-profile-column {
    padding: 10px !important;
  }
  .inspect-actions-column {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .btn-trade-hero {
    min-height: 64px !important;
    padding: 10px 12px !important;
  }
  .inspect-secondary-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .inspect-action-btn:not(.btn-trade-hero) {
    padding: 7px 8px !important;
    min-height: 44px !important;
  }
}

/* Responsividad Altura Reducida (Laptops de 768px de alto o menos) */
@media screen and (max-height: 700px) {
  .inspect-modal-card {
    padding: 12px 16px !important;
    gap: 10px !important;
    max-height: 96vh !important;
    overflow-y: auto !important;
  }
  .inspect-modal-header {
    padding-bottom: 6px !important;
  }
  .inspect-avatar-pedestal {
    width: 80px !important;
    height: 80px !important;
  }
  .inspect-avatar-canvas {
    width: 76px !important;
    height: 76px !important;
  }
  .inspect-profile-column {
    padding: 10px 8px !important;
    gap: 6px !important;
  }
  .btn-trade-hero {
    min-height: 68px !important;
    padding: 8px 12px !important;
  }
}

/* ==============================================================================
   DIRECTRIZ #ONBOARDING-REFACTOR-GOOGLE-CHAR-SELECT-AND-KINA-DEFAULT-01
   Estilos de Acceso Limpio, Selección de Personajes y Creación
   ============================================================================== */

/* Modales Base */
.char-select-modal,
.char-list-modal,
.char-create-modal,
#modal-character-list,
#modal-character-create {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100dvw;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  box-sizing: border-box;
  z-index: 10000 !important;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.char-select-modal.active,
.char-list-modal.active,
.char-create-modal.active,
#modal-character-list.active,
#modal-character-create.active {
  display: flex !important;
}

/* Tarjeta Limpia de Inicio de Sesión */
.auth-modal-card-clean,
.auth-modal-card-clean.mobile-screen-fit {
  width: 92% !important;
  max-width: 440px !important;
  height: auto !important;
  max-height: calc(100dvh - 20px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  background: rgba(10, 15, 26, 0.95) !important;
  border: 2px solid #f59e0b !important;
  border-radius: 14px !important;
  padding: 28px 24px !important;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(245, 158, 11, 0.2) !important;
  text-align: center !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.auth-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 16px 0;
}

.btn-auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  background: #ffffff;
  color: #1f2937;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-auth-google:hover {
  background: #f8fafc;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-auth-google .google-icon {
  flex-shrink: 0;
}

.auth-divider {
  display: none !important;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.auth-divider-text {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-auth-guest-clean {
  display: none !important;
}

/* Acceso Directo con Gmail (Único y visible de inmediato) */
.auth-direct-gmail-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  width: 100%;
}

.auth-direct-gmail-form {
  width: 100%;
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

#auth-direct-gmail-container .auth-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  height: 48px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(59, 130, 246, 0.6);
  border-radius: 12px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

#auth-direct-gmail-container .auth-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.96);
}

#auth-direct-gmail-container .auth-input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#auth-direct-gmail-container .auth-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  padding: 0 16px 0 44px;
  box-sizing: border-box;
}

#auth-direct-gmail-container .auth-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-weight: 400;
}

.btn-gmail-submit {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1.5px solid #60a5fa;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-gmail-submit:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
}

.btn-gmail-submit:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-gmail-submit .btn-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.btn-gmail-submit:hover .btn-arrow {
  transform: translateX(4px);
}

/* Lista de Personajes (Estilo Tibia / Lawl) */
.char-list-card {
  width: 100%;
  max-width: 580px;
  max-height: calc(100dvh - 16px);
  display: flex;
  flex-direction: column;
  background: rgba(9, 13, 22, 0.96);
  border: 2px solid #0284c7;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.char-list-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 12px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.char-list-title {
  font-family: 'Cinzel', serif;
  color: #f59e0b;
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.5px;
}

.char-list-account {
  font-size: 13px;
  color: #38bdf8;
  font-weight: 600;
}

.char-roster-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 70px;
  max-height: clamp(110px, 34vh, 260px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin-bottom: 16px;
  padding-right: 4px;
}

.char-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.char-roster-row:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38bdf8;
}

.char-roster-row.selected {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.char-roster-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.char-roster-avatar {
  font-size: 24px;
  line-height: 1;
}

.char-roster-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 15px;
}

.char-roster-meta {
  font-size: 12px;
  color: #94a3b8;
}

.char-roster-server {
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
}

.btn-create-char-trigger {
  flex-shrink: 0;
  width: 100%;
  padding: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1.5px dashed rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-create-char-trigger:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.char-list-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-play-highlight {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0b0f19 !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
  border: none !important;
}

.btn-play-highlight:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.6) !important;
  transform: translateY(-1px);
}

/* Reingeniería de Creación de Personaje */
.char-create-card {
  width: 100%;
  max-width: 680px !important;
  max-height: calc(100dvh - 16px) !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(9, 13, 22, 0.96);
  border: 2px solid #0284c7;
  border-radius: 12px;
  padding: 16px 18px !important;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  position: relative;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.char-create-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0 !important;
}

.char-create-title {
  font-family: 'Cinzel', serif;
  color: #f59e0b;
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.5px;
}

.char-create-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 4px 0 0 0;
}

.char-create-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding-right: 4px !important;
}

.char-create-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.char-create-stage-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 16px 8px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.char-pedestal-container {
  position: relative;
  width: 160px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-pedestal-light {
  position: absolute;
  width: 110px;
  height: 30px;
  bottom: 12px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.45) 0%, rgba(245, 158, 11, 0) 70%);
  filter: blur(4px);
  pointer-events: none;
}

.char-pedestal-base {
  position: absolute;
  width: 120px;
  height: 14px;
  bottom: 4px;
  background: #1e293b;
  border: 1.5px solid #f59e0b;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

#char-create-preview-canvas {
  position: relative;
  z-index: 2;
  image-rendering: pixelated;
}

.char-preview-summary {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.char-preview-voc-tag {
  background: #f59e0b;
  color: #020617;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.char-preview-gender-tag {
  background: #334155;
  color: #f8fafc;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}

.char-create-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}

.char-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.char-server-badge-selected {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #6ee7b7;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}

.server-status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
}

.char-voc-selector-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.char-voc-mini-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.char-voc-mini-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: #38bdf8;
}

.char-voc-mini-card.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.voc-mini-icon {
  font-size: 20px;
  line-height: 1;
}

.voc-mini-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
}

.voc-mini-badge {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
}

.char-create-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  background: rgba(9, 13, 22, 0.98) !important;
  z-index: 15 !important;
  margin-top: auto !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(56, 189, 248, 0.2) !important;
}

/* ==============================================================================
   OPTIMIZACIONES ERGONÓMICAS MÓVILES (#MOBILE-RESPONSIVE-ONBOARDING-NON-FULLSCREEN-01)
   ============================================================================== */

@media (max-width: 640px) {
  .char-list-card, .char-create-card, .auth-modal-card-clean {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 12px 12px !important;
  }
  .char-create-layout {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  /* Pedestal horizontal compacto con tags al lado para ahorrar 130px vertical */
  .char-create-stage-column {
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 8px 12px !important;
  }
  .char-pedestal-container {
    width: 100px !important;
    height: 110px !important;
  }
  .char-pedestal-light {
    width: 80px !important;
    height: 20px !important;
    bottom: 8px !important;
  }
  .char-pedestal-base {
    width: 85px !important;
    height: 10px !important;
    bottom: 4px !important;
  }
  #char-create-preview-canvas {
    width: 96px !important;
    height: 120px !important;
  }
  .char-preview-summary {
    margin-top: 0 !important;
    flex-direction: column !important;
    gap: 6px !important;
  }
  .char-voc-selector-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .char-create-section {
    gap: 4px !important;
    margin-bottom: 8px !important;
  }
  .char-server-badge-selected {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .btn-secondary, .btn-primary {
    min-height: 40px !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
}

@media screen and (max-height: 520px) {
  .char-create-card {
    width: 98vw !important;
    max-width: 98vw !important;
    height: calc(100dvh - 8px) !important;
    padding: 8px 12px !important;
  }
  .char-create-header {
    padding-bottom: 4px !important;
    margin-bottom: 6px !important;
  }
  .char-create-title {
    font-size: 15px !important;
  }
  .char-create-subtitle {
    display: none !important;
  }
  .char-create-layout {
    grid-template-columns: 130px 1fr !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  .char-create-stage-column {
    padding: 6px 4px !important;
  }
  .char-pedestal-container {
    width: 100px !important;
    height: 110px !important;
  }
  .char-pedestal-light {
    width: 75px !important;
    height: 18px !important;
  }
  .char-pedestal-base {
    width: 80px !important;
    height: 9px !important;
  }
  #char-create-preview-canvas {
    width: 96px !important;
    height: 120px !important;
  }
  .char-preview-summary {
    margin-top: 4px !important;
  }
  .char-preview-voc-tag, .char-preview-gender-tag {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  .char-create-section {
    gap: 2px !important;
    margin-bottom: 5px !important;
  }
  .char-section-label {
    font-size: 10px !important;
  }
  .char-server-badge-selected {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  .char-voc-selector-row {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
  }
  .char-voc-mini-card {
    padding: 4px 2px !important;
    gap: 2px !important;
  }
  .voc-mini-icon {
    font-size: 15px !important;
  }
  .voc-mini-name {
    font-size: 9px !important;
  }
  .voc-mini-badge {
    display: none !important;
  }
  .auth-input-wrapper {
    height: 32px !important;
  }
  .auth-input {
    font-size: 12px !important;
    padding: 4px 8px 4px 28px !important;
  }
  .auth-gender-btn {
    height: 32px !important;
    font-size: 11.5px !important;
    padding: 0 10px !important;
  }
  .char-create-actions {
    margin-top: 6px !important;
    padding-top: 6px !important;
  }
  .char-create-actions button {
    min-height: 34px !important;
    font-size: 12px !important;
    padding: 4px 12px !important;
  }
  /* Auth Modal Compacto en Landscape */
  .auth-modal-card-clean {
    width: 90% !important;
    max-width: 380px !important;
    height: auto !important;
    padding: 12px 14px !important;
  }
  .auth-crest {
    font-size: 20px !important;
  }
  .auth-title {
    font-size: 16px !important;
  }
  .auth-subtitle {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }
  .auth-buttons-group {
    margin: 8px 0 6px 0 !important;
    gap: 6px !important;
  }
  .btn-auth-google {
    height: 40px !important;
    font-size: 13px !important;
  }
}

/* Portada a pantalla completa sin franjas laterales */
.title-splash-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background-image: url('../background/image.webp') !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;
  image-rendering: auto !important;
  z-index: 1 !important;
}

.title-splash-ambient {
  display: none !important;
}


