/* ==========================================================================
   ATLAS MMORPG • HOJA DE ESTILOS DEL CLIENTE EXPORTABLE (game/css/game.css)
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-panel: rgba(13, 19, 33, 0.88);
  --bg-panel-solid: #0d1321;
  --bg-panel-hover: rgba(26, 38, 64, 0.95);
  
  --gold-primary: #f5c451;
  --gold-glow: rgba(245, 196, 81, 0.4);
  --gold-dim: #997825;
  
  --cyan-primary: #48e5c2;
  --cyan-glow: rgba(72, 229, 194, 0.45);
  
  --red-health: #ef4444;
  --red-health-bg: #450a0a;
  --blue-mana: #3b82f6;
  --blue-mana-bg: #172554;
  --green-stamina: #10b981;
  
  --border-gold: rgba(245, 196, 81, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-cyan: rgba(72, 229, 194, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-touch-callout: none;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL DEL JUEGO (VIEWPORT COVER Y ADAPTABILIDAD DINÁMICA 100dvh)
   ========================================================================== */
html, body, #game-wrapper {
  width: 100vw !important;
  height: 100dvh !important; /* Ajuste dinámico exacto al alto disponible del navegador */
  max-height: 100dvh !important;
  position: fixed !important;
  inset: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

#game-wrapper {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  box-shadow: none;
}

#game-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
  object-fit: contain !important;
  background-color: #040608;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ==========================================================================
   CAPA DE INTERFAZ DE USUARIO (HUD)
   ========================================================================== */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ==========================================================================
   PLACAS OVERHEAD NATIVAS (NAMEPLATES LAYER - RESOLUCIÓN NATIVA Y NÍTIDA)
   ========================================================================== */
.hud-nameplates-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.overhead-plate {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  will-change: transform;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* 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);
  }
}

/* Placa del Jugador */
.overhead-player-plate {
  gap: 3px;
  align-items: center;
}

.overhead-title-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.overhead-guild-badge {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #090d16;
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 8px;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 1;
  flex-shrink: 0;
}

.overhead-player-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 3px #000, 0 0 4px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  color: #ffffff;
}

.overhead-player-name.gold,
.overhead-player-name.yellow,
.overhead-player-name.premmy {
  color: #fde047 !important;
}

.overhead-player-name.party {
  color: #38bdf8 !important;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.75), 0 1px 3px #000, 0 0 4px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 !important;
}

.overhead-player-name.white,
.overhead-player-name.admin,
.overhead-player-name.green {
  color: #ffffff !important;
}

/* Indicadores de Flecha y Distintivos de Miembros de Party (#PARTY-OVERHEAD-ARROWS) */
.overhead-party-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  margin-bottom: 2px;
  animation: partyArrowBob 0.8s ease-in-out infinite alternate;
}

@keyframes partyArrowBob {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-5px);
  }
}

.overhead-party-arrow {
  color: #38bdf8;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.95)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9));
  transform: scaleY(0.9);
}

.overhead-party-arrow-side {
  color: #38bdf8;
  font-size: 11px;
  font-weight: 900;
  margin-right: 3px;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.85));
  animation: partySidePulse 1.2s ease-in-out infinite alternate;
}

@keyframes partySidePulse {
  0% {
    opacity: 0.75;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(2px);
  }
}

.overhead-player-plate.is-party-member .overhead-bar-fill-hp {
  background: linear-gradient(90deg, #0284c7, #38bdf8, #7dd3fc) !important;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.overhead-combat-icons {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
  vertical-align: middle;
}

.overhead-combat-icons:empty {
  display: none;
}

/* Barras Overhead del Jugador */
.overhead-bars-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 62px;
  padding: 1.5px;
  background: rgba(5, 7, 12, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.95);
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
}

.overhead-bar-track {
  width: 100%;
  height: 4px;
  background: #111827;
  overflow: hidden;
  border-radius: 1px;
}

.overhead-bar-fill-hp {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #dc2626);
  transition: width 0.08s linear;
}

.overhead-bar-fill-mp {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  transition: width 0.08s linear;
}

/* 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;
}

.overhead-npc-prompt {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #fef08a;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 5px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: promptPulse 1.1s infinite alternate ease-in-out;
}

@keyframes promptPulse {
  from { transform: scale(0.96); opacity: 0.92; }
  to { transform: scale(1.04); opacity: 1; }
}

.nearby-npc-active {
  filter: drop-shadow(0 0 6px rgba(245, 196, 81, 0.8));
}

/* Placas de Monstruos */
.overhead-monster-plate {
  gap: 2px;
}

.overhead-monster-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px #000, 0 0 4px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.overhead-monster-name.normal {
  color: #fb923c;
}

.overhead-monster-name.boss {
  color: #f87171;
  font-size: 12px;
}

.overhead-monster-hp-bar {
  width: 34px;
  height: 3px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #000;
  border-radius: 1px;
  overflow: hidden;
}

.overhead-monster-hp-fill {
  height: 100%;
  background: #ef4444;
}

/* Perfil del jugador (Esquina Superior Izquierda) */
.hud-player-badge {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: clamp(280px, 24vw, 360px);
  min-width: 260px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: rgba(13, 19, 33, 0.88);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 16px var(--gold-glow);
  z-index: 15;
}

.hud-avatar {
  display: none;
}

.hud-bars-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.hud-player-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--gold-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

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

.hud-guild-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0a0d14;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 6px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.hud-guild-crest:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
}

.crest-shield {
  display: none;
}

.crest-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1;
}

.hud-player-level {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(72, 229, 194, 0.2);
  border: 1px solid rgba(72, 229, 194, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Barras de Estado */
.hud-bar {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hud-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
}

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

.hud-bar-mp .hud-bar-fill {
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 60%, #60a5fa 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.65);
}

.hud-bar-exp {
  height: 14px;
}

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

.hud-bar-exp .hud-bar-text {
  font-size: 9.5px;
  letter-spacing: 0.4px;
}

.hud-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 1), 0 0 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  white-space: nowrap;
}



/* Esquina Superior Derecha: Monedas, Inventario y Configuración (.hud-menu-bar) */
.hud-top-right,
.hud-menu-bar {
  position: absolute;
  top: 16px;
  right: 20px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  z-index: 15;
}

.hud-coins-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-primary);
}

.hud-top-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   MINIMAPA / RADAR DE ORIENTACIÓN TÁCTICO CON DETECCIÓN DE CUEVAS Y DRAG & DROP
   ========================================================================== */
#hud-minimap {
  position: absolute;
  top: 60px;
  right: 18px;
  width: 260px;
  height: auto;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid #d97706;
  border-top-color: #fcd34d;
  border-left-color: #f59e0b;
  border-right-color: #b45309;
  border-bottom-color: #78350f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 12px rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  overflow: hidden;
  z-index: 45;
  user-select: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), height 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

#hud-minimap.hidden {
  display: none !important;
}

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

#hud-minimap-header {
  height: 28px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  cursor: grab;
  touch-action: none;
}

#hud-minimap-header:active {
  cursor: grabbing;
}

.hud-minimap-title {
  font-family: 'Cinzel', serif, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

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

.hud-minimap-ctrl-btn {
  width: 20px;
  height: 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 4px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.hud-minimap-ctrl-btn:hover {
  background: rgba(245, 158, 11, 0.35);
  color: #fef08a;
  border-color: #fcd34d;
  transform: scale(1.08);
}

.hud-minimap-body {
  position: relative;
  width: 100%;
  background: #040812;
  overflow: hidden;
  line-height: 0;
}

#minimap-canvas {
  width: 100%;
  height: 160px;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background: #060913;
}

#hud-minimap.minimap-expanded #minimap-canvas {
  height: 240px;
}

#hud-minimap-footer {
  height: 22px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  color: #94a3b8;
}

.hud-minimap-coords {
  color: #38bdf8;
  font-weight: 700;
}

.hud-minimap-drag-hint {
  font-size: 8.5px;
  color: #64748b;
  font-style: italic;
}


/* ==========================================================================
   BARRA DE VIDA DE MINI-JEFE (SUPERIOR CENTRADA)
   ========================================================================== */
#boss-hud {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  max-width: 90vw;
  background: var(--bg-panel);
  border: 2px solid var(--red-health);
  border-radius: 12px;
  padding: 8px 16px 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.4);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 15;
  transition: opacity 0.3s ease;
}

#boss-hud.active {
  display: flex;
}

.boss-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 1px;
}

.boss-hp-bar {
  height: 14px;
  background: var(--red-health-bg);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.6);
  position: relative;
}

.boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

/* ==========================================================================
   NOTIFICACIÓN DE INTERACCIÓN ([E] Hablar)
   ========================================================================== */
#interact-prompt {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--cyan-primary);
  border-radius: 20px;
  padding: 6px 16px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px var(--cyan-glow);
  animation: promptPulse 1.8s infinite ease-in-out;
}

#interact-prompt.active {
  display: flex;
}

.key-badge {
  background: var(--cyan-primary);
  color: #07090e;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

@keyframes promptPulse {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* ==========================================================================
   MODAL DE DIÁLOGOS
   ========================================================================== */
#dialogue-modal {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: 92vw;
  background: rgba(10, 16, 28, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.9), 0 0 24px rgba(251, 191, 36, 0.18);
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  z-index: 130;
  pointer-events: auto;
  animation: fadeIn 0.18s ease-out;
}

#dialogue-modal.active {
  display: flex;
}

.dialogue-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dialogue-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

.dialogue-portrait {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  border: 1.5px solid var(--border-gold);
  background: radial-gradient(circle, rgba(234, 179, 8, 0.15) 0%, rgba(5, 7, 12, 0.9) 75%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.dialogue-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  image-rendering: pixelated;
  transform: scale(1.35) translateY(4px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.dialogue-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.dialogue-speaker {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.dialogue-role-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  padding: 1.5px 7px;
  text-transform: uppercase;
}

.dialogue-text {
  font-size: 14px;
  line-height: 1.5;
  color: #f1f5f9;
  min-height: 38px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.dialogue-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.dialogue-custom-actions {
  display: flex;
  gap: 8px;
}

.dialogue-continue {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* ==========================================================================
   PANTALLAS MODALES: INICIO, PAUSA, INVENTARIO
   ========================================================================== */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.game-modal.active {
  display: flex;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.9), 0 0 24px var(--gold-glow);
  text-align: center;
  max-width: 580px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 2px;
  text-shadow: 0 2px 8px var(--gold-glow);
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Selector de Vocación en Pantalla de Inicio */
.vocation-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.vocation-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.vocation-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
}

.vocation-card.selected {
  background: rgba(72, 229, 194, 0.15);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.vocation-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.vocation-card span {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

/* Botones Estilizados */
.btn-primary {
  background: linear-gradient(135deg, #f5c451 0%, #d4af37 100%);
  color: #07090e;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 196, 81, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 196, 81, 0.6);
  background: linear-gradient(135deg, #ffd978 0%, #f5c451 100%);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Botón Rápido de Inventario */

.btn-quick {
  background: rgba(13, 19, 33, 0.88);
  border: 1.5px solid var(--border-gold);
  border-radius: 12px;
  color: var(--gold-primary);
  width: clamp(44px, 5.5vh, 52px);
  height: clamp(44px, 5.5vh, 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: clamp(20px, 2.6vh, 25px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), 0 0 10px rgba(251, 191, 36, 0.15);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .btn-quick:hover {
    color: #ffffff;
    border-color: #fef08a;
    box-shadow: 0 0 16px var(--gold-glow);
    transform: scale(1.08) translateY(-1px);
  }

  .btn-quick:hover .hud-quick-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 0 4px currentColor);
  }
}

.btn-quick:active {
  transform: scale(0.92);
  filter: brightness(1.2);
}

.hud-quick-icon {
  width: clamp(20px, 2.5vh, 26px);
  height: clamp(20px, 2.5vh, 26px);
  display: block;
  pointer-events: none;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), filter 0.15s ease;
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA #FRONTEND-MOBILE-FULLSCREEN-ACTION
   Estilos de Pantalla Completa y Botón de Alternancia (#btn-toggle-fullscreen)
   ========================================================================== */
#btn-toggle-fullscreen {
  font-size: clamp(18px, 2.4vh, 23px);
  color: var(--cyan-primary, #48e5c2);
  border-color: rgba(72, 229, 194, 0.45);
}

#btn-toggle-fullscreen:hover {
  border-color: var(--cyan-primary, #48e5c2);
  box-shadow: 0 0 16px rgba(72, 229, 194, 0.55);
}

#btn-toggle-fullscreen.active,
body.is-fullscreen #btn-toggle-fullscreen {
  background: radial-gradient(circle, rgba(72, 229, 194, 0.28) 0%, rgba(13, 19, 33, 0.9) 75%);
  border-color: var(--cyan-primary, #48e5c2);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(72, 229, 194, 0.65), inset 0 0 10px rgba(72, 229, 194, 0.2);
}

/* Reglas estrictas para pseudoclases :fullscreen y :-webkit-full-screen (100vw x 100vh sin desbordamiento) */
:fullscreen,
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:fullscreen #game-wrapper,
body:-webkit-full-screen #game-wrapper,
#game-wrapper:fullscreen,
#game-wrapper:-webkit-full-screen,
body.is-fullscreen #game-wrapper {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
}

body.is-fullscreen {
  overflow: hidden !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* =========================================================================
   MOCHILA / INVENTARIO CLÁSICO RPG (ATLAS BACKPACK MODAL)
   ========================================================================= */
#modal-inventory.game-modal {
  background: rgba(4, 7, 13, 0.65);
  backdrop-filter: blur(8px);
}

.atlas-backpack-modal {
  position: relative;
  background: rgba(10, 16, 28, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(72, 229, 194, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 24px rgba(72, 229, 194, 0.12);
  display: flex;
  flex-direction: column;
  width: 304px;
  user-select: none;
  color: #ffffff;
  animation: backpackPopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.atlas-backpack-modal.atlas-bp-expanded {
  width: 580px;
  max-width: 95vw;
}

@keyframes backpackPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.atlas-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atlas-modal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atlas-backpack-gold-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.12) inset;
  border-radius: 8px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.atlas-backpack-gold-chip .gold-icon {
  font-size: 13px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.atlas-modal-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  color: #f5c451;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.atlas-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.atlas-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* LAYOUT DUAL: EQUIPO A LA IZQUIERDA Y MOCHILA A LA DERECHA */
.atlas-bp-content-dual {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atlas-equip-panel {
  width: 250px;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atlas-backpack-panel {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.atlas-panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.atlas-panel-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}

.atlas-slots-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

/* MUÑECO DE SLOTS DE EQUIPAMIENTO (PAPERDOLL CLÁSICO) */
.atlas-equip-paperdoll {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  justify-items: center;
  align-items: center;
}

.atlas-equip-slot {
  width: 60px;
  height: 60px;
  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;
  transition: all 0.15s ease;
  user-select: none;
}

.atlas-equip-slot:hover {
  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 10px rgba(245, 196, 81, 0.4);
  transform: translateY(-1px);
}

.atlas-equip-slot.empty {
  cursor: default;
  background: #12151c;
  border-top: 2px solid #333947;
  border-left: 2px solid #333947;
  border-right: 2px solid #0b0d12;
  border-bottom: 2px solid #0b0d12;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.8);
  border-style: solid;
}

.atlas-equip-slot.empty:hover {
  border-top-color: #424a5c;
  border-left-color: #424a5c;
  border-right-color: #0e1117;
  border-bottom-color: #0e1117;
  background: #141720;
  transform: none;
}

.atlas-equip-slot .equip-ph-icon {
  font-size: 20px;
  opacity: 0.45;
  filter: grayscale(0.5);
  pointer-events: none;
}

.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;
}

.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.8));
  pointer-events: none;
}

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

.atlas-equip-slot.backpack-slot {
  border-color: rgba(56, 189, 248, 0.4);
}

.atlas-equip-info-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
}

.atlas-equip-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.atlas-equip-info-row .lbl {
  color: #94a3b8;
  font-weight: 600;
}

.atlas-equip-info-row .val {
  color: #fde047;
  font-weight: 700;
}

/* ==========================================================================
   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;
}

.atlas-inv-body {
  padding: 0;
  max-height: 270px;
  overflow-y: auto;
}

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

.atlas-inv-slot {
  width: 60px;
  height: 60px;
  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;
  cursor: pointer;
  transition: all 0.15s ease;
}

.atlas-inv-slot:hover {
  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 10px rgba(72, 229, 194, 0.4);
  transform: translateY(-1px);
}

.atlas-inv-slot.empty {
  cursor: default;
  background: #12151c;
  border-top: 2px solid #333947;
  border-left: 2px solid #333947;
  border-right: 2px solid #0b0d12;
  border-bottom: 2px solid #0b0d12;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 0.8;
}

.atlas-inv-slot.empty:hover {
  border-top-color: #424a5c;
  border-left-color: #424a5c;
  border-right-color: #0e1117;
  border-bottom-color: #0e1117;
  background: #141720;
  transform: none;
}

.atlas-inv-slot img,
.inv-item-sprite {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
  pointer-events: none;
}

.atlas-inv-slot .slot-emoji {
  font-size: 24px;
  pointer-events: none;
}

.atlas-inv-slot .slot-qty {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px #000, -1px -1px 0 #000, 1px -1px 0 #000;
  pointer-events: none;
}

.atlas-inv-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 4px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.atlas-inv-gold-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.atlas-inv-gold-box strong {
  color: #fde047;
  font-weight: 800;
}

.atlas-inv-cap-box strong {
  font-weight: 700;
}

.atlas-inv-cap-box .cap-num {
  color: #2dd4bf;
  font-weight: 800;
}

.atlas-inv-cap-box .cap-num.overweight {
  color: #ef4444;
}

.atlas-inv-hint {
  text-align: center;
  font-size: 10.5px;
  color: #64748b;
  padding: 6px 14px 11px;
  background: rgba(0, 0, 0, 0.35);
}

/* Modal de Configuración */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  width: 100%;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-label {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

.settings-slider {
  accent-color: var(--cyan-primary);
  cursor: pointer;
  width: 130px;
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  transition: 0.2s ease;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: 0.2s ease;
}

.settings-toggle input:checked + .toggle-slider {
  background-color: rgba(72, 229, 194, 0.3);
  border-color: var(--cyan-primary);
}

.settings-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background-color: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
}

.modal-controls-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.4;
}

/* Modal de Amigos */
.friends-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 6px;
}

.friends-input-wrapper {
  display: flex;
  gap: 8px;
  width: 100%;
}

.friends-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 8px 12px;
  color: #f1f5f9;
  font-size: 13px;
  font-family: var(--font-sans, sans-serif);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.friends-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.btn-add-friend-action {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.friend-add-feedback {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.friend-add-feedback.error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.friend-add-feedback.success {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  min-height: 110px;
  overflow-y: auto;
  margin: 10px 0;
  width: 100%;
  padding-right: 4px;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 14px;
  transition: all 0.15s ease;
}

.friend-item:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.friend-name {
  font-family: var(--font-sans, sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-friend-action {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-friend-action:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-friend-msg:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-friend-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #f87171;
}

.friends-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.friends-empty-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.friends-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

/* ==========================================================================
   D-PAD / JOYSTICK VIRTUAL IZQUIERDO (#touch-dpad) (#MOBILE-TOUCH-CONTROLS-01)
   ========================================================================== */
/* ==========================================================================
   PALANCA VIRTUAL DINÁMICA FLOTANTE BAJO DEMANDA (SIN AROS GIGANTES)
   ========================================================================== */
#touch-dpad {
  position: absolute;
  bottom: 0;
  left: 0;
  width: clamp(200px, 32vw, 360px);
  height: clamp(180px, 44vh, 320px);
  pointer-events: none; /* Permite que los slots superiores reciban toques limpios */
  z-index: 15;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  display: block;
  transition: filter 0.2s ease;
}

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

#virtual-joystick-zone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto; /* Zona táctil libre en la esquina inferior izquierda */
  touch-action: none;
  z-index: 1;
}

#virtual-joystick-base {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 229, 194, 0.12) 0%, rgba(13, 19, 33, 0.5) 75%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 0 12px rgba(72, 229, 194, 0.1);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  display: none; /* 100% invisible en reposo */
  transform: translate(-50%, -50%);
  z-index: 2;
  box-sizing: border-box;
}

/* Erradicación total de aros estáticos exteriores y pseudo-elemento punteado */
#virtual-joystick-base::before {
  content: none !important;
  display: none !important;
}

#virtual-joystick-base.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45), inset 0 0 14px rgba(245, 158, 11, 0.25) !important;
}

#virtual-joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5eead4 0%, #0d9488 65%, #115e59 100%);
  border: 2px solid #ccfbf1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.7), 0 0 14px rgba(72, 229, 194, 0.65);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  z-index: 3;
  transition: transform 0.03s linear;
  box-sizing: border-box;
}

#virtual-joystick-knob::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
}


/* ==========================================================================
   8 SLOTS LIBRES ADAPTATIVOS (ALINEADOS VERTICALMENTE EN COLUMNAS SIMÉTRICAS)
   ========================================================================== */
.hud-slot {
  width: clamp(62px, 8.5vh, 80px);
  height: clamp(62px, 8.5vh, 80px);
  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 16px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  position: relative;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}

/* Hitbox virtual extendido de pulsar sin fallar */
.hud-slot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 16px !important;
  pointer-events: auto;
}

.hud-slot:active, .hud-slot.pressed {
  transform: scale(0.92);
  background: rgba(72, 229, 194, 0.25);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px rgba(72, 229, 194, 0.55);
}

/* Número de ranura siempre visible en la capa superior absoluta */
.hud-slot .slot-num,
.hud-slot.has-icon .slot-num {
  position: absolute !important;
  top: 3px !important;
  left: 6px !important;
  z-index: 30 !important;
  pointer-events: none !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: clamp(12px, 1.8vh, 16px) !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px #000, 0 0 4px #000, 1px 1px 0 #000, -1px -1px 0 #000 !important;
  line-height: 1 !important;
  display: block !important;
}

.hud-slot:active .slot-num, .hud-slot.pressed .slot-num {
  color: #ffffff !important;
}

/* Icono de Habilidad / Objeto dentro del Slot - Sin marco interno */
.hud-slot img.slot-icon {
  width: 86% !important;
  height: 86% !important;
  max-width: 86% !important;
  max-height: 86% !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  clip-path: inset(7% round 6px) !important;
  -webkit-clip-path: inset(7% round 6px) !important;
  image-rendering: -moz-crisp-edges !important;
  image-rendering: crisp-edges !important;
  image-rendering: pixelated !important;
  pointer-events: none !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85)) !important;
  transform: translateZ(0);
  z-index: 1 !important;
  position: relative !important;
}

.hud-slot .slot-item-qty {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-family: var(--font-mono, monospace);
  font-size: clamp(10px, 1.4vh, 13px);
  font-weight: 800;
  color: #fde047;
  text-shadow: 0 1px 3px #000, 1px 1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
  z-index: 25;
}

.hud-slot.has-icon {
  background: rgba(13, 19, 33, 0.75);
}

/* ==========================================================================
   VARIABLES DE DIMENSIONES Y ERGONOMÍA DE SLOTS TÁCTILES (#FRONTEND-MOBILE-ERGONOMICS-V3)
   ========================================================================== */
: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.1 Columnas de Slots (1-4 izquierda y 5-8 derecha): Espaciado vertical holgado */
#hud-slots-left,
#hud-slots-right {
  position: absolute;
  bottom: var(--hud-slot8-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--slot-gap, 18px) !important;
  pointer-events: auto;
  z-index: 20;
}

#hud-slots-left {
  left: var(--hud-side-margin-left);
}

#hud-slots-right {
  right: var(--hud-side-margin-right);
}

.hud-slot {
  width: var(--slot-size, clamp(62px, 8.5vh, 72px)) !important;
  height: var(--slot-size, clamp(62px, 8.5vh, 72px)) !important;
}

/* 1.2 Botón de Salto: Mismo tamaño del Slot 8, a su izquierda con 16px de separación limpia (CERO solapamiento) */
#btn-touch-jump,
#hud-jump-btn {
  position: absolute !important;
  bottom: var(--hud-slot8-bottom) !important;
  right: calc(var(--hud-side-margin-right) + var(--slot-size) + 16px) !important;
  width: var(--slot-size, clamp(62px, 8.5vh, 72px)) !important;
  height: var(--slot-size, clamp(62px, 8.5vh, 72px)) !important;
  border-radius: 14px !important;
  z-index: 22 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
  touch-action: none;
  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 16px 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;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
  box-sizing: border-box;
}

#btn-touch-jump::before,
#hud-jump-btn::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 16px !important;
  pointer-events: auto;
}

#btn-touch-jump svg,
#hud-jump-btn svg {
  width: clamp(28px, 4vh, 34px);
  height: clamp(28px, 4vh, 34px);
  fill: none;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

#btn-touch-jump:hover,
#hud-jump-btn:hover {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 18px rgba(72, 229, 194, 0.5);
  background: radial-gradient(circle, rgba(72, 229, 194, 0.25) 0%, rgba(13, 19, 33, 0.85) 75%);
}

#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;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.32) 0%, rgba(13, 19, 33, 0.9) 75%) !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.75), inset 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

#hud-jump-btn.hud-jump-legacy {
  display: none !important;
}
/* #MOBILE-TOUCH-CONTROLS-01: calc(var(--hud-side-margin-right) + (var(--slot-size) * 2) + 32px) calc(var(--hud-slot8-bottom) - 10px) reubicado a #hud-bottom-dock */
/* ==========================================================================
   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 (48x48px) 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 !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  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;
}

.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;
}

/* ==========================================================================
   ESCALADO ERGONÓMICO PROPORCIONAL PARA ESCRITORIO (#FRONTEND-DESKTOP-SCALE-SYNC)
   Aplica a pantallas de escritorio (> 1024px y altura > 600px).
   Eleva el tamaño de los slots (85px a 98px) y amplía el espaciado vertical
   para mantener la misma estética y visibilidad imponente que en móvil.
   ========================================================================== */
@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;
  }
  /* #FRONTEND-DESKTOP-SCALE-SYNC: width: clamp(32px, 4vh, 40px) !important; height: clamp(32px, 4vh, 40px) !important; reubicado en #hud-bottom-dock */

  .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 */
  #hud-minimap {
    width: clamp(200px, 18vw, 260px) !important;
    height: auto !important;
  }

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

/* ==========================================================================
   DESPLEGABLE CARD TEXT DE CHAT (TRASLÚCIDO CON TEXTO SÓLIDO)
   ========================================================================== */
.hud-chat-card {
  position: absolute;
  bottom: clamp(12px, 2vh, 24px);
  left: 50%;
  transform: translateX(-50%) translateY(14px) scale(0.97);
  width: clamp(540px, 56vw, 860px);
  max-width: 92vw;
  background: rgba(10, 16, 28, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1.5px solid rgba(72, 229, 194, 0.38);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 18px rgba(72, 229, 194, 0.15);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-chat-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.chat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.chat-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-channel-badge {
  background: rgba(72, 229, 194, 0.22);
  border: 1px solid rgba(72, 229, 194, 0.5);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #48e5c2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: all 0.2s ease;
}

.chat-channel-badge.badge-local {
  background: rgba(240, 244, 252, 0.15);
  border-color: rgba(240, 244, 252, 0.5);
  color: #f0f4fc;
}

.chat-channel-badge.badge-public {
  background: rgba(72, 229, 194, 0.2);
  border-color: rgba(72, 229, 194, 0.5);
  color: #48e5c2;
}

.chat-channel-badge.badge-trade {
  background: rgba(245, 196, 81, 0.2);
  border-color: rgba(245, 196, 81, 0.5);
  color: #f5c451;
}

.chat-channel-badge.badge-private {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

.chat-hint {
  font-family: var(--font-sans);
  font-size: 10px;
  color: #d1d5db;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.chat-card-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.chat-card-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: #ef4444;
  color: #ffffff;
}

/* ==========================================================================
   BARRA DE PESTAÑAS DE CANALES (#chat-channel-tabs)
   ========================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.chat-channel-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-channel-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 3px 10px;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  user-select: none;
}

.chat-channel-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.chat-channel-tab[data-channel="local"]:hover {
  border-color: rgba(240, 244, 252, 0.6);
  color: #f0f4fc;
}

.chat-channel-tab[data-channel="public"]:hover {
  border-color: rgba(72, 229, 194, 0.6);
  color: #48e5c2;
}

.chat-channel-tab[data-channel="trade"]:hover {
  border-color: rgba(245, 196, 81, 0.6);
  color: #f5c451;
}

.chat-channel-tab[data-channel="private"]:hover {
  border-color: rgba(192, 132, 252, 0.6);
  color: #c084fc;
}

/* Pestaña activa resaltada con borde brillante e indicador */
.chat-channel-tab.active {
  transform: translateY(-1px);
}

.chat-channel-tab[data-channel="local"].active {
  background: rgba(240, 244, 252, 0.18);
  border: 1.5px solid #f0f4fc;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(240, 244, 252, 0.4), inset 0 0 6px rgba(240, 244, 252, 0.15);
}

.chat-channel-tab[data-channel="public"].active {
  background: rgba(72, 229, 194, 0.2);
  border: 1.5px solid #48e5c2;
  color: #48e5c2;
  box-shadow: 0 0 14px rgba(72, 229, 194, 0.45), inset 0 0 6px rgba(72, 229, 194, 0.2);
}

.chat-channel-tab[data-channel="trade"].active {
  background: rgba(245, 196, 81, 0.2);
  border: 1.5px solid #f5c451;
  color: #f5c451;
  box-shadow: 0 0 14px rgba(245, 196, 81, 0.45), inset 0 0 6px rgba(245, 196, 81, 0.2);
}

.chat-channel-tab[data-channel="private"].active {
  background: rgba(168, 85, 247, 0.25);
  border: 1.5px solid #c084fc;
  color: #e9d5ff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5), inset 0 0 6px rgba(168, 85, 247, 0.25);
}

/* Punto indicador de no leídos en pestañas */
.chat-unread-dot {
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 9999px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
  line-height: 1;
  margin-left: 2px;
}

.chat-unread-dot.pulse {
  animation: chatPrivatePulse 1.2s infinite ease-in-out;
}

@keyframes chatPrivatePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.18); box-shadow: 0 0 10px 3px rgba(239, 68, 68, 0.9); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.chat-channel-tab.has-unread {
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
  animation: chatTabAttention 1.4s infinite ease-in-out;
}

@keyframes chatTabAttention {
  0%, 100% { border-color: rgba(239, 68, 68, 0.6); }
  50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.7); }
}

/* Banner reactivo de notificación de susurro privado */
.chat-private-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.85), rgba(126, 34, 206, 0.75));
  border: 1px solid rgba(192, 132, 252, 0.55);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #f3e8ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  animation: privateNotifSlide 0.2s ease-out;
}

@keyframes privateNotifSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-private-notif-content {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-private-notif-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-chat-private-open {
  background: #a855f7;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chat-private-open:hover {
  background: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}

.btn-chat-private-dismiss {
  background: transparent;
  color: #d8b4fe;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}

.btn-chat-private-dismiss:hover {
  color: #ffffff;
}

.chat-tab-icon {
  font-size: 12px;
}

.chat-tab-label {
  letter-spacing: 0.5px;
}

.chat-messages-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(4, 8, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  height: clamp(100px, 14vh, 145px);
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-align: left;
}

.chat-msg {
  line-height: 1.45;
  word-break: break-word;
  color: #f0f4fc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  font-weight: 500;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
  animation: chatMsgFadeIn 0.15s ease-out;
}

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

.chat-time {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  margin-right: 2px;
  opacity: 0.85;
}

.chat-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 3px;
  letter-spacing: 0.3px;
  display: inline-block;
  line-height: 1.2;
}

/* Colores de tags por canal */
.tag-local {
  background: rgba(240, 244, 252, 0.12);
  border: 1px solid rgba(240, 244, 252, 0.35);
  color: #f0f4fc;
}

.tag-public {
  background: rgba(72, 229, 194, 0.15);
  border: 1px solid rgba(72, 229, 194, 0.45);
  color: #48e5c2;
}

.tag-trade {
  background: rgba(245, 196, 81, 0.16);
  border: 1px solid rgba(245, 196, 81, 0.5);
  color: #f5c451;
}

.tag-private {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.6);
  color: #e9d5ff;
}

.tag-system {
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #fde047;
}

/* Colores de texto según el canal */
.chat-msg.channel-local,
.chat-msg.channel-local .chat-text {
  color: #f0f4fc;
}

.chat-msg.channel-public,
.chat-msg.channel-public .chat-text {
  color: #48e5c2;
}

.chat-msg.channel-trade,
.chat-msg.channel-trade .chat-text {
  color: #f5c451;
}

.chat-msg.channel-private,
.chat-msg.channel-private .chat-text {
  color: #e9d5ff;
}

.chat-msg.channel-private .chat-user.is-self {
  color: #c084fc;
}

.chat-msg.channel-private .chat-user.is-other {
  color: #f472b6;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-msg.channel-private .chat-user.is-other:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.8);
}

.chat-msg.system,
.chat-msg.system .chat-text {
  color: #fde047;
  font-weight: 600;
}

.chat-msg .chat-user {
  font-weight: 800;
  margin-right: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.chat-msg .chat-user.is-self {
  color: #ffd700;
}

.chat-msg .chat-user.is-other {
  color: #38bdf8;
}

.chat-quick-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.quick-phrase-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 2px 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  transition: all 0.15s ease;
}

.quick-phrase-chip:hover {
  background: rgba(72, 229, 194, 0.25);
  border-color: #48e5c2;
  color: #ffffff;
}

.chat-input-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.chat-input-row input {
  flex: 1;
  background: rgba(4, 8, 16, 0.65);
  border: 1.5px solid rgba(72, 229, 194, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-input-row input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.chat-input-row input:focus {
  background: rgba(4, 8, 16, 0.85);
  border-color: #48e5c2;
  box-shadow: 0 0 12px rgba(72, 229, 194, 0.45);
  color: #ffffff;
}

/* Variantes dinámicas de input y botón por canal */
.chat-container.channel-local .chat-input-row input {
  border-color: rgba(240, 244, 252, 0.35);
}
.chat-container.channel-local .chat-input-row input:focus {
  border-color: #f0f4fc;
  box-shadow: 0 0 12px rgba(240, 244, 252, 0.35);
}
.chat-container.channel-local .btn-chat-send {
  background: linear-gradient(135deg, rgba(240, 244, 252, 0.25), rgba(148, 163, 184, 0.5));
  border-color: #f0f4fc;
}

.chat-container.channel-public .chat-input-row input {
  border-color: rgba(72, 229, 194, 0.35);
}
.chat-container.channel-public .chat-input-row input:focus {
  border-color: #48e5c2;
  box-shadow: 0 0 12px rgba(72, 229, 194, 0.45);
}
.chat-container.channel-public .btn-chat-send {
  background: linear-gradient(135deg, rgba(72, 229, 194, 0.35), rgba(46, 175, 148, 0.6));
  border-color: #48e5c2;
}

.chat-container.channel-trade .chat-input-row input {
  border-color: rgba(245, 196, 81, 0.35);
}
.chat-container.channel-trade .chat-input-row input:focus {
  border-color: #f5c451;
  box-shadow: 0 0 12px rgba(245, 196, 81, 0.45);
}
.chat-container.channel-trade .btn-chat-send {
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.35), rgba(217, 119, 6, 0.65));
  border-color: #f5c451;
}

.btn-chat-send {
  background: linear-gradient(135deg, rgba(72, 229, 194, 0.35), rgba(46, 175, 148, 0.6));
  border: 1px solid #48e5c2;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-chat-send:hover {
  background: linear-gradient(135deg, rgba(72, 229, 194, 0.6), rgba(46, 175, 148, 0.85));
  box-shadow: 0 0 12px rgba(72, 229, 194, 0.5);
  transform: translateY(-1px);
}

.btn-chat-send:active {
  transform: translateY(0);
}

/* ==========================================================================
   BOTONES DE MODO DE JUEGO (TOP-RIGHT ACTIONS: MAPA, FOLLOW, POSTURA, PVP)
   ========================================================================== */
.btn-quick.active-mode {
  border-color: var(--cyan-primary) !important;
  box-shadow: 0 0 16px rgba(72, 229, 194, 0.6) !important;
  background: rgba(72, 229, 194, 0.22) !important;
}

.btn-quick.stance-attack {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
}

.btn-quick.stance-defense {
  border-color: #3b82f6 !important;
  color: #3b82f6 !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.5) !important;
}

.btn-quick.stance-balanced {
  border-color: var(--border-gold) !important;
  color: var(--gold-primary) !important;
}

.btn-quick.pvp-all {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important;
}

.btn-quick.pvp-hunt {
  border-color: #f97316 !important;
  color: #f97316 !important;
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.5) !important;
}

.btn-quick.pvp-defend {
  border-color: #facc15 !important;
  color: #facc15 !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.5) !important;
}

.btn-quick.pvp-none {
  border-color: #10b981 !important;
  color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4) !important;
}

.btn-quick.pvp-ignore {
  border-color: #94a3b8 !important;
  color: #94a3b8 !important;
  opacity: 0.85;
}

/* Toast flotante de notificación rápida de cambios de modo */
.hud-mode-toast {
  position: absolute;
  top: 76px;
  right: 20px;
  background: rgba(13, 19, 33, 0.94);
  border: 1.5px solid var(--border-gold);
  border-radius: 10px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px var(--gold-glow);
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.hud-mode-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal del Mapa del Mundo y Brújula Continua */
/* Modal del Mapa del Mundo y Brújula Continua (Tibia-Style Interactive Map) */
.atlas-map-modal-card {
  max-width: 920px !important;
  width: 95vw !important;
  max-height: 92vh;
  overflow-y: auto;
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 0 36px rgba(251, 191, 36, 0.25), 0 20px 50px rgba(0, 0, 0, 0.88);
  background: linear-gradient(180deg, rgba(14, 22, 36, 0.98) 0%, rgba(7, 12, 20, 0.99) 100%);
  padding: 16px 20px;
  position: relative;
  transition: all 0.2s ease;
}

/* Modo ventana flotante fijada */
#modal-map.pinned-mode {
  background: transparent !important;
  pointer-events: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
}

#modal-map.pinned-mode .atlas-map-modal-card {
  pointer-events: auto;
  max-width: 520px !important;
  max-height: 85vh;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.95), 0 0 20px rgba(56, 189, 248, 0.35);
  background: rgba(8, 14, 24, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid #38bdf8;
}

#modal-map.pinned-mode .map-zones-grid {
  display: none;
}

/* Barra superior de herramientas */
.atlas-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.atlas-map-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atlas-map-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: #facc15;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.atlas-map-current-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.atlas-map-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-map-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-map-tool:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

.btn-map-tool.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.btn-map-tool.btn-highlight {
  background: rgba(234, 179, 8, 0.18);
  border-color: #facc15;
  color: #fde047;
}

.btn-map-tool.btn-highlight:hover {
  background: rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.map-zoom-controls {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  overflow: hidden;
}

.btn-zoom {
  border: none;
  border-radius: 0;
  padding: 5px 8px;
  font-weight: 900;
  font-size: 12px;
}

.map-zoom-indicator {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  padding: 0 6px;
  min-width: 36px;
  text-align: center;
}

.btn-map-close {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 800;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-map-close:hover {
  background: rgba(239, 68, 68, 0.45);
  color: #fff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Contenedor del canvas interactivo */
.atlas-interactive-map-wrapper {
  background: #020610;
  border: 2px solid #1e293b;
  border-radius: 10px;
  padding: 0;
  margin-bottom: 10px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.95), 0 8px 24px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.atlas-pixel-map-viewport {
  position: relative;
  width: 100%;
  height: 310px;
  overflow: hidden;
  border-radius: 8px;
  background: #030712;
  cursor: grab;
  user-select: none;
}

.atlas-pixel-map-viewport:active {
  cursor: grabbing;
}

#atlas-world-pixel-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.map-compass-rose {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 24px;
  opacity: 0.8;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.9));
  user-select: none;
}

.atlas-map-tooltip {
  position: absolute;
  pointer-events: none;
  display: none;
  background: rgba(8, 14, 24, 0.96);
  border: 1.5px solid #38bdf8;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-sans);
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 12px rgba(56, 189, 248, 0.3);
  min-width: 180px;
  max-width: 260px;
  line-height: 1.35;
}

/* Barra de estado y coordenadas GPS en vivo */
.atlas-map-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.map-coords-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #38bdf8;
  font-weight: 700;
}

.gps-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: gpsPulse 1.2s infinite ease-in-out;
}

@keyframes gpsPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #38bdf8; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

.map-poi-legend-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.legend-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.legend-badge:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.legend-badge.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

/* Cuadrícula de Zonas y Viaje Rápido */
.map-zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.map-zone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-zone-card:hover {
  background: rgba(72, 229, 194, 0.08);
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.map-zone-card.selected {
  background: rgba(251, 191, 36, 0.12);
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}

.map-zone-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.map-zone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.map-zone-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-zone-status {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.map-zone-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(72, 229, 194, 0.16);
  border: 1px solid rgba(72, 229, 194, 0.35);
  color: var(--cyan-primary);
  flex-shrink: 0;
}

.map-zone-badge.active {
  background: rgba(251, 191, 36, 0.22);
  border-color: var(--gold-primary);
  color: #fde047;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* ==========================================================================
   RESTAURACIÓN DE BARRA DE EXP, AGRUPADOR Y MONITOR DE RENDIMIENTO (FPS & MS)
   ========================================================================== */
.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,
.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 */
  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;
  letter-spacing: 0.2px !important;
  backdrop-filter: blur(8px);
  z-index: 20 !important;
  pointer-events: auto !important;
  user-select: none !important;
}

.perf-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.perf-label {
  font-family: var(--font-mono);
  font-size: 8px !important;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.2px !important;
}

.perf-val {
  font-family: var(--font-mono);
  font-size: 8px !important;
  font-weight: 800;
  color: #34d399; /* Verde por defecto para 60fps */
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.perf-separator {
  width: 1px;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   BOTÓN Y MODAL DE MENÚ SUPPORT (PASE DE FUNDADORES)
   ========================================================================== */
.btn-support {
  border-color: #f59e0b !important;
  color: #fbbf24 !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(13, 19, 33, 0.9) 100%) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
}

.btn-support:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.8) !important;
  border-color: #fde047 !important;
}

.btn-support .hud-btn-soon-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  padding: 1.5px 3px;
  border-radius: 3px;
  border: 1px solid #78350f;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.support-status-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fde047;
  letter-spacing: 0.5px;
}

.support-perks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.support-perk-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.support-perk-card:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}

.perk-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.perk-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.perk-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #fde047;
}

.perk-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn-perk {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
}

.btn-perk.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #05070a;
  border-color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.btn-perk.inactive {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-muted);
  box-shadow: none;
}

/* ==========================================================================
   MODAL DE MENÚ PRINCIPAL - LAYOUT TIBIA / KAKELE CON ESTÉTICA ATLAS
   ========================================================================== */
.main-menu-card.tibia-layout {
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.96) 0%, rgba(7, 10, 19, 0.98) 100%);
  border: 2px solid var(--border-gold, #ca8a04);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(234, 179, 8, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  width: 95vw;
  max-height: 92vh;
  box-sizing: border-box;
}

/* Header */
.main-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
  padding-bottom: 8px;
  flex-shrink: 0;
}

.menu-title-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gold-icon {
  color: var(--gold-primary, #eab308);
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.5));
}

.menu-version-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(234, 179, 8, 0.15);
  color: var(--gold-primary, #eab308);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
}

.menu-close-x-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.menu-close-x-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

/* Desacoplamiento y Aislamiento Visual de Mochila / Inventario (#INVENTORY-ISOLATION-01) */
#modal-main-menu.inventory-isolated .main-menu-tabs-container,
.main-menu-card.inventory-isolated .main-menu-tabs-container {
  display: none !important;
}

#modal-main-menu.inventory-isolated .main-menu-card {
  max-width: 710px;
}

/* Barra de Pestañas Multisección en 2 Filas Compactas */
.main-menu-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(4, 7, 14, 0.6);
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.main-menu-tabs-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.main-menu-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 4px;
  color: #94a3b8;
  font-family: var(--font-sans, system-ui);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.main-menu-tab-btn .tab-icon {
  font-size: 13px;
}

.main-menu-tab-btn:hover {
  background: rgba(30, 58, 138, 0.3);
  border-color: var(--cyan-primary, #38bdf8);
  color: #ffffff;
}

.main-menu-tab-btn.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.8) 0%, rgba(14, 165, 233, 0.35) 100%);
  border: 1px solid var(--gold-primary, #f59e0b);
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.main-menu-tab-btn .tab-badge-soon {
  font-size: 8px;
  background: rgba(234, 179, 8, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fde047;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-left: 2px;
}

/* Cuerpo y Vistas con Scroll Robusto para Móvil y Desktop */
.main-menu-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.main-menu-body::-webkit-scrollbar {
  width: 6px;
}

.main-menu-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
}

.main-menu-body::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.35);
  border: 1px solid rgba(234, 179, 8, 0.5);
  border-radius: 4px;
}

.main-menu-body::-webkit-scrollbar-thumb:hover {
  background: rgba(234, 179, 8, 0.7);
}

.menu-tab-view {
  display: none;
  animation: fadeIn 0.18s ease-out;
}

.menu-tab-view.active {
  display: block;
}

/* Grilla de 2 Columnas para Ficha de Estadísticas (Stats) */
.stats-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .main-menu-card.tibia-layout {
    padding: 12px 10px;
    width: 96vw;
    max-height: 94vh;
    gap: 8px;
    border-radius: 10px;
  }
  .main-menu-header {
    padding-bottom: 6px;
  }
  .main-menu-modal-title,
  #main-menu-modal-title {
    font-size: 16px !important;
  }
  .menu-version-badge {
    display: none;
  }
  .main-menu-tabs-container {
    padding: 4px;
    gap: 4px;
  }
  .main-menu-tabs-row {
    gap: 4px;
  }
  .main-menu-tab-btn {
    padding: 5px 2px;
    font-size: 10px;
    gap: 3px;
  }
  .main-menu-tab-btn .tab-badge-soon {
    display: none;
  }
  .stats-two-columns {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats-col {
    padding: 10px;
    gap: 6px;
  }
  .stat-entry {
    padding: 5px 8px;
    font-size: 11px;
  }
  .skill-bar-item {
    padding: 4px 6px;
    gap: 3px;
  }
  .skill-bar-header {
    font-size: 10px;
  }
  .skill-progress-track {
    height: 6px;
  }
}

.stats-col {
  background: rgba(9, 14, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-card-section-title {
  font-family: var(--font-serif, Georgia);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--gold-primary, #f59e0b);
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
  padding-bottom: 4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Entradas de Estadísticas (stat-entry) */
.stat-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12px;
}

.stat-entry-highlight {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-entry-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-weight: 600;
}

.stat-icon {
  font-size: 13px;
}

.stat-entry-value {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #ffffff;
}

.stat-entry-value.gold-text {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

.stat-entry-value.gold-subtext {
  color: #d97706;
  font-size: 11px;
}

.stat-entry-value.gems-text {
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.stat-entry-value.hp-text {
  color: #f87171;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.stat-entry-value.mp-text {
  color: #38bdf8;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.stat-entry-value.speed-text {
  color: #a7f3d0;
}

/* Badges de Estado PZ / Combate */
.pz-safe-badge {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.pz-battle-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.pz-danger-badge {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  animation: pulsePz 1.5s infinite;
}

@keyframes pulsePz {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Stamina con barra horizontal */
.stat-entry-stamina {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stamina-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.stamina-title {
  color: #94a3b8;
  font-weight: 600;
}

.stamina-timer {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #4ade80;
}

.stamina-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stamina-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  transition: width 0.3s ease;
}

/* Columna Derecha: Bendición y Exp Dual */
.blessing-none {
  color: #94a3b8;
  font-size: 11px;
}

.blessing-active {
  color: #facc15;
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.5);
}

.stat-entry-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-subcell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-mini-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-mini-val {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.stat-mini-val.gold-accent {
  color: #fbbf24;
}

/* Barras de Progreso Segmentadas de Skills */
.skills-bars-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.skill-bar-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.skill-name {
  color: #e2e8f0;
  font-weight: 600;
}

.skill-badge-level {
  font-family: var(--font-mono, monospace);
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  margin-left: auto;
  margin-right: 8px;
}

.skill-percent {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  min-width: 32px;
  text-align: right;
}

/* Pista de progreso segmentada */
.skill-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(3, 7, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ca8a04 0%, #facc15 100%);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-progress-fill.fill-level {
  background: linear-gradient(90deg, #ca8a04 0%, #facc15 100%);
}

.skill-progress-fill.fill-melee {
  background: linear-gradient(90deg, #dc2626 0%, #f87171 100%);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.skill-progress-fill.fill-distance {
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.skill-progress-fill.fill-magic {
  background: linear-gradient(90deg, #7c3aed 0%, #c084fc 100%);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

.skill-progress-fill.fill-shielding {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.skill-segment-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
}

.skill-segment-markers span {
  width: 1px;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* Vistas Adicionales del Menú: Opciones, Ranking, Servidor, Créditos */
.ranking-table-container {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.ranking-table th {
  background: rgba(234, 179, 8, 0.12);
  color: var(--gold-primary, #f59e0b);
  padding: 8px 12px;
  font-family: var(--font-serif, Georgia);
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
}

.ranking-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ranking-table tr.rank-top1 {
  background: rgba(234, 179, 8, 0.08);
}

.ranking-table tr.rank-top2 {
  background: rgba(148, 163, 184, 0.06);
}

.ranking-table tr.rank-top3 {
  background: rgba(217, 119, 6, 0.06);
}

.server-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.server-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.server-stat-label {
  font-size: 11px;
  color: #94a3b8;
}

.server-stat-val {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.server-stat-val.text-green {
  color: #34d399;
}

.credits-card-content {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
}

.credits-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbd5e1;
}

/* Footer */
.main-menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 4px;
}

.menu-footer-hint {
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   MODAL DE COMERCIO DUAL: TIENDA A LA IZQUIERDA Y BACKPACK A LA DERECHA
   ========================================================================== */
.trade-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  animation: fadeIn 0.18s ease-out;
}

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

.trade-viewport {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
  justify-content: center;
  width: 96vw;
  max-width: 1240px;
  height: 88vh;
  max-height: 600px;
}

/* Paneles individuales (Izquierda = Tienda, Derecha = Mochila + Equipamiento) */
.trade-panel {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(234, 179, 8, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.store-panel {
  flex: 1;
  min-width: 380px;
}

.backpack-panel {
  flex: 1.25;
  border-color: rgba(72, 229, 194, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(72, 229, 194, 0.12);
}

.trade-player-dual-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-player-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-player-tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-player-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.trade-player-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.trade-player-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.trade-equip-panel {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  padding: 14px;
  gap: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow-y: auto;
}

.trade-backpack-subpanel {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.trade-backpack-wrapper {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.trade-inv-body {
  flex: 1;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 2px;
  min-width: 0;
}

/* Encabezados de paneles */
.trade-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.trade-npc-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-avatar-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.18) 0%, rgba(5, 7, 12, 0.95) 75%);
  border: 1.5px solid var(--border-gold);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.trade-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  image-rendering: pixelated;
  transform: scale(1.4) translateY(4px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.trade-panel-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-primary);
  margin: 0;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.backpack-panel .trade-panel-title {
  color: var(--gold-primary);
}

.trade-panel-subtitle {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.trade-player-gold {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trade-backpack-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pestañas de la tienda */
.trade-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.trade-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.trade-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.trade-tab.active {
  background: rgba(234, 179, 8, 0.18);
  border-color: var(--border-gold);
  color: #fde047;
}

/* Controles de Bóveda del Banco Real */
.bank-controls {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.bank-balance-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
}

.bank-lbl {
  color: var(--text-muted);
}

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

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

.bank-quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-bank-quick {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid var(--border-gold);
}

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

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

.bank-input-lbl {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.bank-input-row {
  display: flex;
  gap: 8px;
}

.bank-num-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.bank-num-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.btn-bank-submit {
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.btn-bank-submit.btn-deposit {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #000000;
}

.btn-bank-submit.btn-deposit:hover {
  background: linear-gradient(135deg, #facc15, #eab308);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.btn-bank-submit.btn-withdraw {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-bank-submit.btn-withdraw:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-trade-act {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  color: #fef08a;
  padding: 6px 4px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-trade-act:hover {
  background: rgba(234, 179, 8, 0.28);
  transform: translateY(-1px);
}

/* Catálogo de ítems en venta / baúl en cuadrícula limpia de slots */
.store-catalog-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.trade-items-grid {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 10px 4px;
}

.trade-items-grid.grid-3-cols {
  grid-template-columns: repeat(3, minmax(56px, 76px)) !important;
  gap: 10px;
  justify-content: start;
}

/* =========================================================================
   TARJETA FLOTANTE / LATERAL DE DETALLES DE COMPRA (.store-item-detail-card)
   ========================================================================= */
.store-item-detail-card {
  width: 224px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(9, 14, 26, 0.98) 100%);
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 18px rgba(234, 179, 8, 0.15);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  overflow: hidden;
  animation: storeCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 5;
}

@keyframes storeCardFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes storeShakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.store-item-detail-card.shake-error {
  animation: storeShakeError 0.36s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4) !important;
}

/* Header de la tarjeta */
.store-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.store-detail-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.2) 0%, rgba(5, 7, 12, 0.95) 75%);
  border: 1.5px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.store-detail-sprite {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.store-detail-emoji {
  font-size: 26px;
}

.store-detail-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-detail-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.store-detail-level-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  width: fit-content;
  transition: all 0.15s ease;
}

.store-detail-level-badge.level-met {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.store-detail-level-badge.level-unmet {
  color: #f87171;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.store-detail-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  position: absolute;
  top: -2px;
  right: -2px;
  transition: color 0.15s, background 0.15s;
}

.store-detail-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Cuerpo de la tarjeta con descripción y atributos */
.store-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.store-detail-desc {
  font-family: var(--font-sans);
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.store-detail-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.store-badge-stat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.store-badge-stat.stat-atk {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.store-badge-stat.stat-def {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.store-badge-stat.stat-spd {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.store-badge-stat.stat-hp {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.store-badge-stat.stat-mp {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}

.store-badge-stat.stat-cure {
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(20, 184, 166, 0.45);
  color: #5eead4;
}

.store-badge-stat.stat-voc {
  background: rgba(234, 179, 8, 0.18);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fde047;
}

.store-badge-stat.stat-weight {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

/* Pie de la tarjeta: selector de cantidad, total dinámico y botón de compra */
.store-detail-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.store-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.store-qty-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.store-qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-store-qty {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-store-qty:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: var(--border-gold);
  color: #fde047;
  transform: translateY(-1px);
}

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

.store-buy-qty-input {
  width: 44px;
  height: 26px;
  text-align: center;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #fde047;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.store-buy-qty-input::-webkit-outer-spin-button,
.store-buy-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.store-buy-qty-input:focus {
  border-color: #fde047;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

.store-buy-qty-input.qty-fixed {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: not-allowed;
  user-select: none;
}

.btn-store-qty-max {
  height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
  letter-spacing: 0.3px;
}

.btn-store-qty-max:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.32);
  border-color: var(--border-gold);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-store-qty-max:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-store-qty-max:disabled,
.btn-store-qty:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.store-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.store-total-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.store-total-val-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.store-total-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.store-total-price.price-unaffordable {
  color: #f87171;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.store-gold-coin {
  font-size: 14px;
}

/* Botón prominente de compra: COMPRAR (BUY) */
.btn-store-buy {
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  border: none;
  background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
  color: #1a0f00;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-store-buy:hover {
  background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.6);
}

.btn-store-buy:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.3);
}

.btn-store-buy.btn-disabled-warn {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

/* =========================================================================
   TARJETA DE DETALLES Y CONFIRMACIÓN DE VENTA EN TIENDA (.store-sell-detail-card)
   ========================================================================= */
.atlas-inv-slot.selected-sell {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.75), inset 0 0 8px rgba(56, 189, 248, 0.3) !important;
  transform: translateY(-2px) scale(1.05);
}

.store-sell-detail-card {
  width: 236px !important;
  max-width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(14, 25, 44, 0.98) 0%, rgba(8, 15, 28, 0.99) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  animation: storeCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 5;
  overflow-y: auto;
  max-height: 100%;
}

.sell-icon-wrap {
  border-color: rgba(56, 189, 248, 0.6) !important;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(0, 0, 0, 0.8) 80%) !important;
}

.sell-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.sell-detail-owned-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.2px;
}

.sell-detail-unit-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #fde047;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.2px;
}

.sell-detail-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sell-price-row {
  border-color: rgba(56, 189, 248, 0.25) !important;
}

.sell-total-price {
  color: #38bdf8 !important;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
}

.store-sell-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.btn-store-sell {
  width: 100%;
  padding: 9px 8px;
  border-radius: 7px;
  border: 1px solid #38bdf8;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-store-sell:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.5);
}

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

.btn-store-sell-all {
  width: 100%;
  padding: 9px 8px;
  border-radius: 7px;
  border: 1px solid #fbbf24;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-store-sell-all:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

.btn-store-sell-all:active:not(:disabled) {
  transform: translateY(1px);
}

@keyframes goldPulseAnim {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.18); filter: brightness(1.6); color: #fde047; }
  100% { transform: scale(1); filter: brightness(1); }
}

.gold-pulse-anim {
  animation: goldPulseAnim 0.38s ease-out;
}

@media (max-width: 680px) {
  .store-catalog-wrapper {
    flex-direction: column;
  }
  .store-item-detail-card {
    width: 100%;
    max-height: 220px;
  }
}

.trade-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.15s ease;
}

.trade-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(234, 179, 8, 0.4);
}

.trade-item-card.disabled {
  opacity: 0.6;
}

.trade-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.trade-item-icon-box {
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trade-item-icon-box.small {
  width: 30px;
  height: 30px;
}

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

.trade-item-emoji {
  font-size: 18px;
}

.trade-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trade-item-name {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-item-qty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38bdf8;
  margin-left: 4px;
}

.trade-item-desc {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-item-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.trade-price-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #fde047;
}

.btn-trade-action {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.btn-trade-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-trade-action.btn-withdraw {
  background: linear-gradient(135deg, #a855f7, #9333ea);
}

.btn-trade-action.btn-withdraw:hover {
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.btn-trade-action:disabled,
.btn-trade-action.btn-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Grid de la mochila en comercio (panel derecho) - Idéntico a .atlas-inv-grid */
.trade-inventory-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 8px;
  justify-content: center;
  align-content: start;
  padding: 10px 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-slot-interactive {
  cursor: pointer;
  position: relative;
  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;
}

.trade-slot-interactive:hover {
  border-top-color: #8b99ad !important;
  border-left-color: #8b99ad !important;
  border-right-color: #1e2430 !important;
  border-bottom-color: #1e2430 !important;
  background: #222733 !important;
  transform: translateY(-2px) scale(1.04);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25), inset -1px -1px 0 rgba(0, 0, 0, 0.9), 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Slot seleccionado en tienda (borde dorado brillante y resplandor) */
.atlas-inv-slot.selected,
.trade-slot-interactive.selected {
  border-color: #fde047 !important;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.35) 0%, rgba(202, 138, 4, 0.22) 100%) !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.85), inset 0 0 12px rgba(250, 204, 21, 0.45) !important;
  transform: translateY(-2px) scale(1.06);
  z-index: 4;
}

.trade-slot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.trade-slot-badge.sell {
  background: #0284c7;
  color: #f0fdf4;
  border: 1px solid #38bdf8;
}

.trade-slot-badge.deposit {
  background: #7e22ce;
  color: #faf5ff;
  border: 1px solid #c084fc;
}

.trade-inv-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.trade-inv-card:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.5);
}

.trade-inv-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-inv-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trade-inv-name {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-inv-qty {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.trade-inv-item-bot {
  display: flex;
  justify-content: flex-end;
}

.btn-inv-action {
  width: 100%;
  border: none;
  border-radius: 5px;
  padding: 4px 6px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: all 0.15s ease;
}

.btn-sell {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-sell:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #ffffff;
}

.btn-deposit {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.btn-deposit:hover {
  background: rgba(168, 85, 247, 0.35);
  color: #ffffff;
}

/* Pie de panel y avisos */
.trade-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.trade-tip {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-muted);
}

.trade-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
  gap: 8px;
}

/* ==========================================================================
   TABLÓN DE TASKS & CAZA DE DEAN (TIBIA STYLE)
   ========================================================================== */
/* ==========================================================================
   TABLÓN DE TASKS & CAZA DE DEAN (TIBIA STYLE) - REDISEÑO PREMIUM
   ========================================================================== */
/* ==========================================================================
   TABLÓN DE TAREAS & CAZA (TASK BOARD ESTILO TIBIA / GRIZZLY ADAMS)
   ========================================================================== */
.modal-tasks-card,
.modal-task-board-card {
  max-width: 1040px !important;
  width: 95vw !important;
  height: 86vh !important;
  max-height: 86vh !important;
  padding: 18px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  background: linear-gradient(180deg, rgba(13, 19, 35, 0.98) 0%, rgba(7, 10, 20, 0.99) 100%) !important;
  border: 1.5px solid var(--border-gold) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 35px rgba(245, 196, 81, 0.22) !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Header */
.tasks-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.tasks-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tasks-header-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(245, 196, 81, 0.25) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 14px rgba(245, 196, 81, 0.3);
  flex-shrink: 0;
}

.tasks-header-titles {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}

.tasks-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.8px;
  margin: 0;
  text-shadow: 0 2px 10px rgba(245, 196, 81, 0.3);
}

.tasks-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-sans);
}

.tasks-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-rank-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-gold);
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.task-rank-badge-icon {
  font-size: 20px;
}

.task-rank-text {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.task-rank-level {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: var(--font-serif);
}

.task-rank-pts {
  font-size: 10.5px;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.tasks-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.tasks-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
  transform: scale(1.05);
}

/* Tabs de Tiers de Dificultad */
.task-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.btn-task-tab {
  background: rgba(18, 25, 42, 0.85);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 11.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-task-tab .tier-dot {
  font-size: 10px;
  line-height: 1;
}

.btn-task-tab:hover {
  background: rgba(30, 42, 68, 0.95);
  color: #fff;
  border-color: rgba(245, 196, 81, 0.4);
}

.btn-task-tab.active {
  background: rgba(245, 196, 81, 0.16);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(245, 196, 81, 0.3);
}

.tier-beginner-tab.active {
  border-color: #22c55e !important;
  color: #4ade80 !important;
  background: rgba(34, 197, 94, 0.15) !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3) !important;
}

.tier-amateur-tab.active {
  border-color: #eab308 !important;
  color: #facc15 !important;
  background: rgba(234, 179, 8, 0.15) !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.3) !important;
}

.tier-intermediate-tab.active {
  border-color: #f97316 !important;
  color: #fb923c !important;
  background: rgba(249, 115, 22, 0.15) !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.3) !important;
}

.tier-expert-tab.active {
  border-color: #ef4444 !important;
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.16) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35) !important;
}

/* Cuerpo del Tablón: Grid + Panel de Detalles */
.task-board-body {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Cuadrícula Visual de Tareas */
.task-grid-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: min-content;
  gap: 12px;
  overflow-y: auto !important;
  max-height: 100%;
  padding-right: 6px;
  align-content: flex-start;
  box-sizing: border-box;
}

/* Tarjeta en Cuadrícula con Altura Firme y Cómoda */
.task-grid-card {
  min-height: 84px !important;
  flex-shrink: 0;
  box-sizing: border-box;
  background: linear-gradient(145deg, rgba(18, 25, 42, 0.85), rgba(11, 15, 27, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.task-grid-card:hover {
  background: linear-gradient(145deg, rgba(26, 36, 62, 0.95), rgba(14, 20, 36, 0.98));
  border-color: rgba(72, 229, 194, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

/* Selección con Borde Dorado Brillante */
.task-grid-card.selected {
  border: 2px solid var(--gold-primary) !important;
  background: linear-gradient(145deg, rgba(38, 30, 15, 0.92), rgba(18, 14, 10, 0.97)) !important;
  box-shadow: 0 0 20px rgba(245, 196, 81, 0.4), inset 0 0 14px rgba(245, 196, 81, 0.12) !important;
  transform: translateY(-1px);
}

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

.task-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.task-card-header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.task-rec-level-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}

.task-status-tag {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  white-space: nowrap;
}

.tag-available {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tag-active {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.tag-claimable {
  background: rgba(245, 196, 81, 0.25);
  color: #facc15;
  border: 1px solid var(--gold-primary);
  animation: pulse-claim-tag 1.6s infinite ease-in-out;
}

@keyframes pulse-claim-tag {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 196, 81, 0.3); }
  50% { box-shadow: 0 0 14px rgba(245, 196, 81, 0.6); }
}

.tag-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag-locked {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.task-card-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-card-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #48e5c2);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.task-grid-card.status-active .task-card-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #f5c451);
}

.task-grid-card.status-claimable .task-card-progress-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.task-card-progress-ratio {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
}

/* =========================================================================
   PANEL FLOTANTE / LATERAL DE DETALLES DE LA TAREA (#task-detail-panel)
   ========================================================================= */
.task-detail-panel {
  width: 370px;
  background: rgba(10, 15, 29, 0.95);
  border: 1px solid rgba(245, 196, 81, 0.35);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  box-sizing: border-box;
}

.task-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.task-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.task-detail-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.task-detail-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.6));
  border: 1.5px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(245, 196, 81, 0.2);
}

.task-detail-icon-wrap img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.task-detail-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.task-detail-tier-badge {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

.task-detail-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 0;
  line-height: 1.25;
}

.task-detail-zone {
  font-size: 10.5px;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
}

.task-detail-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.task-detail-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

.task-detail-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold-primary);
}

/* Secciones de Ficha Técnica */
.task-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-detail-sec-title {
  font-size: 10.5px;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Objetivos */
.task-targets-box {
  background: rgba(18, 25, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task-targets-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.35;
}

.task-targets-progress {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-targets-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.task-targets-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f5c451);
  border-radius: 5px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(245, 196, 81, 0.4);
}

.task-targets-count {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
}

.task-targets-pct {
  color: var(--cyan-primary);
}

/* Requisitos */
.task-requirements-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-req-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 25, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 6px 10px;
}

.task-req-pill.req-met {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.task-req-pill.req-unmet {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.09);
}

.req-icon {
  font-size: 12px;
  font-weight: 800;
}

.req-met .req-icon { color: #4ade80; }
.req-unmet .req-icon { color: #f87171; }

.req-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 11px;
}

.req-label {
  color: var(--text-dim);
}

.req-val {
  font-family: var(--font-mono);
  color: #fff;
}

.req-unmet .req-val {
  color: #fca5a5;
}

/* Recompensas */
.task-rewards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.reward-card-pill {
  background: rgba(18, 25, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.rew-icon {
  font-size: 16px;
}

.rew-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rew-type {
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.rew-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-gold .rew-val { color: #facc15; }
.pill-exp .rew-val { color: #38bdf8; }
.pill-pts .rew-val { color: #c084fc; }
.pill-unlock {
  grid-column: 1 / -1;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.pill-unlock .rew-val { color: #f87171; }

/* Botones de Acción Anclados al Pie */
.task-detail-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(10, 15, 29, 0.85) 0%, rgba(10, 15, 29, 0.98) 100%);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

/* Scrollbar estilizado para Cuadrícula y Panel de Detalles */
.task-grid-container::-webkit-scrollbar,
.task-detail-panel::-webkit-scrollbar {
  width: 6px;
}

.task-grid-container::-webkit-scrollbar-track,
.task-detail-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}

.task-grid-container::-webkit-scrollbar-thumb,
.task-detail-panel::-webkit-scrollbar-thumb {
  background: rgba(245, 196, 81, 0.35);
  border-radius: 4px;
}

.task-grid-container::-webkit-scrollbar-thumb:hover,
.task-detail-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 196, 81, 0.65);
}

.btn-task-action {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.4px;
}

.btn-task-start {
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.25), rgba(217, 119, 6, 0.35));
  border-color: var(--gold-primary);
  color: #fde047;
  box-shadow: 0 4px 14px rgba(245, 196, 81, 0.25);
}

.btn-task-start:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  box-shadow: 0 0 18px rgba(245, 196, 81, 0.55);
  transform: translateY(-1px);
}

.btn-task-claim {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.5);
  animation: pulse-claim-btn 1.5s infinite ease-in-out;
}

@keyframes pulse-claim-btn {
  0%, 100% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 24px rgba(16, 185, 129, 0.7); transform: scale(1.02); }
}

.btn-task-abandon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-task-abandon:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
  border-color: #ef4444;
}

.btn-task-disabled {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #64748b;
  cursor: not-allowed;
}

/* Footer */
.tasks-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 10px;
  flex-shrink: 0;
}

.tasks-footer-tip {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  line-height: 1.4;
  max-width: 75%;
  text-align: left;
}

/* Responsive */
@media (max-width: 920px), (max-height: 600px) {
  .modal-tasks-card,
  .modal-task-board-card {
    padding: 8px 12px !important;
    width: 96vw !important;
    max-width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  /* 1. Header y Subtítulos Compactos */
  .tasks-modal-header {
    padding-bottom: 4px !important;
    margin-bottom: 4px !important;
    flex-shrink: 0 !important;
  }
  .tasks-title {
    font-size: 13px !important;
  }
  .tasks-subtitle {
    display: none !important; /* Ahorra 18px de altura crítica */
  }
  .task-rank-pill {
    padding: 2px 8px !important;
    font-size: 10px !important;
  }

  /* 2. Tabs de Tiers en Fila Horizontal Compacta */
  .task-tabs-row {
    margin-bottom: 6px !important;
    gap: 6px !important;
    padding-bottom: 2px !important;
    flex-shrink: 0 !important;
  }
  .btn-task-tab {
    padding: 4px 8px !important;
    font-size: 10px !important;
    border-radius: 6px !important;
  }

  /* 3. Disposición Dividida Lado a Lado (Row, CERO Column) */
  .task-board-body {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  /* Columna Izquierda: Cuadrícula de Tareas con Scroll Vertical Completo */
  .task-grid-container {
    width: 56% !important;
    flex: 1 1 56% !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 8px !important;
    padding-right: 4px !important;
  }

  .task-grid-card {
    min-height: 72px !important;
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .task-monster-icon {
    width: 32px !important;
    height: 32px !important;
  }
  .task-card-title {
    font-size: 11.5px !important;
  }

  /* Columna Derecha: Ficha Técnica y Botón de Inicio con Scroll */
  .task-detail-panel {
    width: 44% !important;
    flex: 0 0 44% !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 10px !important;
    gap: 8px !important;
  }

  .task-detail-icon-wrap {
    width: 40px !important;
    height: 40px !important;
  }
  .task-detail-desc {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }
  .reward-card-pill {
    padding: 4px 6px !important;
  }
  .btn-task-action {
    padding: 8px !important;
    font-size: 11px !important;
  }

  /* 4. Footer innecesario oculto en móviles */
  .tasks-modal-footer {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .task-grid-container {
    grid-template-columns: 1fr;
  }
}

.btn-tasks-close-footer {
  font-size: 12px;
  padding: 8px 22px;
  font-weight: 700;
}



.timer-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.timer-label {
  color: var(--text-dim);
  font-weight: 700;
}

.timer-val {
  font-weight: 700;
}

.timer-skull .timer-val {
  color: #ef4444;
}

.timer-battle .timer-val {
  color: #f59e0b;
}

/* ==========================================================================
   PANTALLA DE MUERTE Y PENALIZACIÓN POR CALAVERAS (TIBIA STYLE)
   ========================================================================== */
.death-modal-card {
  width: 440px;
  max-width: 92vw;
  background: rgba(13, 19, 33, 0.96);
  border: 2px solid #ef4444 !important;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(239, 68, 68, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.death-skull-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 14px;
}

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

.death-skull-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.death-main-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: #ef4444;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
  letter-spacing: 2px;
  margin: 0;
}

.death-main-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.death-penalties-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

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

.death-penalty-item .d-label {
  color: var(--text-dim);
  font-weight: 700;
}

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

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

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

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

.death-penalty-item .text-amber {
  color: #f59e0b;
}

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

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

.dropped-items-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

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

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

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

.death-spawn-info {
  font-size: 11.5px;
  color: var(--text-dim);
}

.death-spawn-info strong {
  color: #38bdf8;
}

.death-retry-btn {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #f87171;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.5);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.death-retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7);
}

/* ==========================================================================
   SELECTOR RÁPIDO FLOTANTE DE HABILIDADES (#SKILL-QUICK-PICKER)
   Apertura fluida 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;
  font-family: 'Cinzel', serif;
}

.info-bar-details {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Efecto visual de mantener presionado el slot (Hold) */
.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;
}

/* ==========================================================================
   COOLDOWNS VISUALES EN LOS SLOTS DEL HUD (SWIPE RADIAL / RELOJ DE RECARGA)
   ========================================================================== */
.hud-slot {
  overflow: hidden; /* Asegura recorte circular del swipe */
}

.hud-slot .slot-cooldown-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit !important;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.1s ease;
}

.hud-slot .slot-cooldown-timer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: clamp(14px, 2.2vh, 20px);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 5px #000, 1.5px 1.5px 0 #000, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000;
  pointer-events: none;
  z-index: 4;
}

.hud-slot.on-cooldown img.slot-icon {
  filter: grayscale(0.5) brightness(0.6) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.hud-slot.ready-flash {
  animation: slot-flash-anim 0.35s ease-out;
}

/* Indicador de costo de Maná en el Slot */
.hud-slot .slot-mana-chip {
  position: absolute;
  bottom: 5px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.5vh, 13px);
  font-weight: 800;
  color: #38bdf8;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1;
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hud-slot.no-mana img.slot-icon {
  filter: saturate(0.2) brightness(0.55);
}

.hud-slot.no-mana .slot-mana-chip {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(30, 10, 15, 0.9);
}

.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;
}

@keyframes slot-flash-anim {
  0% {
    box-shadow: 0 0 28px rgba(254, 240, 138, 0.95);
    border-color: #fef08a;
    transform: scale(1.06);
  }
  100% {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.42);
    transform: scale(1.0);
  }
}

/* ==========================================================================
   BOTÓN DE MANO / RECOGIDA MANUAL DE BOTÍN (PICK UP)
   ========================================================================== */
.hud-slot.slot-pickup-hand {
  border-color: rgba(245, 158, 11, 0.75);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(13, 19, 33, 0.88) 85%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25), inset 0 0 8px rgba(245, 158, 11, 0.15);
}

.hud-slot.slot-pickup-hand:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.55), inset 0 0 10px rgba(251, 191, 36, 0.25);
}

.hud-slot.slot-pickup-hand:active,
.hud-slot.slot-pickup-hand.pressed {
  border-color: #fef08a;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(13, 19, 33, 0.95) 80%);
  box-shadow: 0 0 20px rgba(254, 240, 138, 0.7);
  transform: scale(0.92);
}

.hud-slot.slot-pickup-hand img.slot-icon {
  width: 84% !important;
  height: 84% !important;
  max-width: 84% !important;
  max-height: 84% !important;
  object-fit: contain !important;
  clip-path: none !important;
  -webkit-clip-path: none !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.9)) drop-shadow(0 0 3px rgba(245, 158, 11, 0.45)) !important;
}

/* Pulso exitoso de recogida (Loot recogido con éxito) */
.hud-slot.pickup-success-flash {
  animation: pickup-success-anim 0.35s ease-out;
}

@keyframes pickup-success-anim {
  0% {
    box-shadow: 0 0 30px rgba(254, 240, 138, 0.98), inset 0 0 15px rgba(245, 158, 11, 0.8);
    border-color: #fef08a;
    transform: scale(1.12);
  }
  50% {
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.75);
    border-color: #fbbf24;
  }
  100% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.75);
    transform: scale(1.0);
  }
}

/* Feedback sutil de intento fallido (No hay loot al alcance) */
.hud-slot.pickup-empty-feedback {
  animation: pickup-empty-shake 0.25s ease-in-out;
  border-color: rgba(239, 68, 68, 0.65) !important;
}

@keyframes pickup-empty-shake {
  0% { transform: scale(0.95) translateX(0); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
  25% { transform: scale(0.95) translateX(-3px); }
  50% { transform: scale(0.95) translateX(3px); }
  75% { transform: scale(0.95) translateX(-2px); }
  100% { transform: scale(1.0) translateX(0); box-shadow: none; }
}

/* ==========================================================================
   SISTEMA DE PARTY / GRUPO CON EXP COMPARTIDA (WIDGET DE HUD)
   ========================================================================== */
.hud-party-widget,
#party-hud-panel,
.party-hud-panel {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(245, 158, 11, 0.2);
  z-index: 44;
  pointer-events: auto;
  min-width: 210px;
  max-width: 270px;
  box-sizing: border-box;
  user-select: none;
  transition: box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.party-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.party-widget-header:active {
  cursor: grabbing;
}

.party-drag-grip {
  display: inline-block;
  opacity: 0.55;
  font-size: 11px;
  color: var(--gold-light, #fbbf24);
  letter-spacing: -1px;
  margin-right: 3px;
  cursor: grab;
  transition: opacity 0.15s ease;
}

.party-widget-header:hover .party-drag-grip {
  opacity: 0.95;
}

.party-widget-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  cursor: pointer;
}

.party-btn-shared-exp {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s ease;
}

.party-btn-shared-exp.active {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border-color: #f59e0b;
}

.party-btn-shared-exp.inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border-color: #64748b;
}

.party-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.party-member-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  transition: all 0.15s ease;
}

.party-member-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(245, 158, 11, 0.4);
}

.party-member-avatar {
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.party-member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.party-member-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.party-member-name {
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}

.party-member-crown {
  font-size: 12px;
  filter: drop-shadow(0 0 4px #eab308);
}

.party-member-lvl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #38bdf8;
}

.party-member-bar {
  height: 5px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.party-member-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.2s ease;
}

.party-member-mp-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  transition: width 0.2s ease;
}

.party-leave-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}

.party-leave-btn:hover {
  color: #ef4444;
}

.party-kick-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 10px;
  padding: 1px 3px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.party-kick-btn:hover {
  opacity: 1;
}

.btn-invite-party {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.15s ease;
}

.btn-invite-party:hover {
  background: rgba(34, 197, 94, 0.4);
  color: #ffffff;
  border-color: #22c55e;
}

/* Notificación Flotante de Invitación a Grupo (#PARTY-SYSTEM-01) */
.party-invite-prompt {
  position: fixed;
  top: 160px;
  left: 20px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid #eab308;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(234, 179, 8, 0.35);
  z-index: 99999 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  min-width: 250px;
  max-width: 300px;
  animation: partyPromptSlideIn 0.25s ease-out;
}

@keyframes partyPromptSlideIn {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.party-invite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.party-invite-icon {
  font-size: 14px;
}

.party-invite-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #facc15;
  letter-spacing: 0.5px;
}

.party-invite-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px;
  touch-action: manipulation;
}

.party-invite-close:hover {
  color: #ef4444;
}

.party-invite-text {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.party-invite-text strong {
  color: #38bdf8;
}

.party-invite-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.btn-party-accept {
  flex: 1;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: 1px solid #22c55e;
  border-radius: 4px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-party-accept:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.45);
}

.btn-party-decline {
  flex: 1;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-party-decline:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Modal de Gestión de Party (Hasta 100 Miembros) */
.party-manager-members-list {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.party-manager-members-list::-webkit-scrollbar {
  width: 6px;
}

.party-manager-members-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 3px;
}

.party-manager-members-list::-webkit-scrollbar-thumb {
  background: #f59e0b;
  border-radius: 3px;
}

.party-modal-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  transition: background 0.15s ease;
}

.party-modal-member-row:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(245, 158, 11, 0.3);
}

@media (max-width: 768px), (pointer: coarse) {
  .party-invite-prompt {
    top: 70px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 32px) !important;
    max-width: 340px !important;
    z-index: 99999 !important;
  }

  .party-invite-actions {
    gap: 10px !important;
  }

  .btn-party-accept,
  .btn-party-decline {
    padding: 10px 12px !important;
    font-size: 12px !important;
    min-height: 42px !important;
  }
}

/* ==========================================================================
   BADGE DE ZONA SEGURA / PROTECCIÓN & DUELOS (#SAFEZONE-DUEL-04)
   ========================================================================== */
.hud-zone-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 4px;
  width: fit-content;
  transition: all 0.25s ease;
  user-select: none;
}

.hud-zone-badge.safe-zone {
  background: rgba(22, 101, 52, 0.3);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.hud-zone-badge.hostile-zone {
  background: rgba(185, 28, 28, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.zone-badge-icon {
  font-size: 11px;
}

/* Notificación Flotante de Reto a Duelo (#SAFEZONE-DUEL-04) */
.duel-invite-prompt {
  position: fixed !important;
  top: 180px;
  left: 20px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  border: 1.5px solid #eab308;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 16px rgba(234, 179, 8, 0.3);
  z-index: 99999 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  min-width: 240px;
  max-width: 280px;
  animation: partyPromptSlideIn 0.25s ease-out;
}

.duel-invite-prompt * {
  pointer-events: auto !important;
}

.duel-invite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.duel-invite-icon {
  font-size: 14px;
}

.duel-invite-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #facc15;
  letter-spacing: 0.5px;
}

.duel-invite-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.duel-invite-close:hover {
  color: #ef4444;
}

.duel-invite-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.duel-invite-text strong {
  color: #38bdf8;
}

.duel-invite-actions {
  display: flex;
  gap: 8px;
}

.btn-duel-accept {
  flex: 1;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: 1px solid #22c55e;
  border-radius: 4px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

.btn-duel-accept:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.45);
}

.btn-duel-decline {
  flex: 1;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  color: #fca5a5;
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-duel-decline:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Notificación Flotante de Solicitud de Trade (#PLAYER-TRADE-PROMPT-01) */
.trade-invite-prompt {
  position: fixed !important;
  top: 180px;
  left: 20px;
  display: flex;
  flex-direction: column;
  background: rgba(13, 20, 36, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid #34d399;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(52, 211, 153, 0.35);
  z-index: 99999 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  min-width: 250px;
  max-width: 300px;
  animation: partyPromptSlideIn 0.25s ease-out;
}

.trade-invite-prompt * {
  pointer-events: auto !important;
}

.trade-invite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(52, 211, 153, 0.3);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.trade-invite-icon {
  font-size: 16px;
}

.trade-invite-title {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.5px;
}

.trade-invite-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer !important;
  pointer-events: auto !important;
  font-size: 12px;
  line-height: 1;
}

.trade-invite-close:hover {
  color: #ef4444;
}

.trade-invite-text {
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.trade-invite-text strong {
  color: #6ee7b7;
}

.trade-invite-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto !important;
}

.btn-trade-accept-prompt {
  flex: 1;
  background: linear-gradient(135deg, #059669, #10b981);
  border: 1px solid #34d399;
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-trade-accept-prompt:hover {
  background: linear-gradient(135deg, #10b981, #34d399);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.5);
}

.btn-trade-decline-prompt {
  flex: 1;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-trade-decline-prompt:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Menú Contextual de Interacción (#SAFEZONE-TRADE-04) */
.player-context-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: 6px;
  padding: 5px;
  min-width: 140px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 12px rgba(245, 158, 11, 0.2);
  pointer-events: auto;
  user-select: none;
}

.player-context-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #facc15;
}

.player-context-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-context-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.player-context-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #ffffff;
}

.player-context-btn.ctx-duel:hover {
  background: rgba(234, 179, 8, 0.25);
  color: #facc15;
}

.player-context-btn.ctx-party:hover {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.player-context-btn.ctx-close {
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
}

/* ==========================================================================
   MODAL DE MERCADO GLOBAL ESTILO TIBIA (game/css/game.css)
   Browse, Buy/Sell Offers, Create Offer, My Offers, Escrow & Fees
   ========================================================================== */
.market-modal,
#modal-market {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  animation: fadeIn 0.18s ease-out;
  padding: 2vh 2vw;
  box-sizing: border-box;
}

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

.market-card,
.market-card.tibia-layout {
  width: 94vw;
  max-width: 1180px;
  height: 90vh;
  max-height: 820px;
  min-height: 480px;
  margin: auto;
  background: linear-gradient(180deg, #0b1120 0%, #070b14 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.15);
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

/* 1. Barra Superior (Header) */
.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

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

.market-header-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.market-header-title {
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--gold-primary, #f59e0b);
  margin: 0;
  line-height: 1.2;
}

.market-header-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin: 1px 0 0 0;
}

.market-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-market-top {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  font-family: var(--font-sans, sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-market-top:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: #d4af37;
  color: #f8fafc;
}

.market-badge-pill {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 8px;
}

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

.market-wallet-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-gold-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
}

.market-gold-badge.bank-gold {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(8, 20, 36, 0.6);
}

.market-gold-badge.bank-gold .market-gold-label {
  color: #38bdf8;
}

.market-gold-badge.bank-gold .market-bank-val {
  color: #7dd3fc;
}

.market-gold-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

.market-gold-val,
.market-bank-val {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 700;
  color: #f59e0b;
}

.market-close-x {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.market-close-x:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* 2. Cuerpo Principal de Dos Columnas (Split Layout) */
.market-main-split {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* COLUMNA IZQUIERDA */
.market-left-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(13, 21, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
}

.market-search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 7px 10px;
  color: #f8fafc;
  font-size: 11.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.market-search-box input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
}

/* Árbol Vertical de Categorías */
.market-categories-tree {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 175px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
}

.market-category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-category-btn:hover {
  background: rgba(51, 65, 85, 0.6);
  color: #fff;
  border-left-color: rgba(212, 175, 55, 0.4);
}

.market-category-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-left-color: #d4af37;
  color: #fcd34d;
  font-weight: 700;
}

.market-category-btn .cat-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.market-category-btn .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-items-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-counter-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0px 5px;
  border-radius: 4px;
}

/* Lista Vertical de Ítems */
.market-items-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
  min-height: 0;
}

.market-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.market-item-row:hover {
  background: rgba(51, 65, 85, 0.65);
  border-color: rgba(212, 175, 55, 0.3);
}

.market-item-row.selected {
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.market-item-mini-slot {
  width: 30px;
  height: 30px;
  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);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.market-item-mini-slot img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.market-item-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.market-item-row-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-item-row-offers {
  font-size: 9.5px;
  color: #94a3b8;
}

/* COLUMNA DERECHA */
.market-right-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

/* Ficha Resumen del Ítem Seleccionado */
.market-selected-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.market-selected-slot {
  width: 50px;
  height: 50px;
  background: #181c24;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.15), inset -1px -1px 0 rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5);
}

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

.market-selected-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-selected-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.market-selected-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #fcd34d;
}

.market-selected-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.market-selected-stock-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.market-selected-desc {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-selected-stats {
  display: flex;
  gap: 10px;
  margin-top: 1px;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
  color: #cbd5e1;
}

/* Panel Superior Derecho: Órdenes Activas */
.market-orders-split {
  display: flex;
  gap: 10px;
  height: 180px;
  min-height: 140px;
  flex-shrink: 0;
}

.market-order-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(13, 21, 38, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.market-order-box.sell-box {
  border-color: rgba(239, 68, 68, 0.25);
}

.market-order-box.buy-box {
  border-color: rgba(34, 197, 94, 0.25);
}

.market-order-box-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.market-order-box-title.sell-title {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}

.market-order-box-title.buy-title {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border-bottom: 1px solid rgba(34, 197, 94, 0.25);
}

.order-subtitle {
  font-size: 9.5px;
  font-weight: 400;
  opacity: 0.85;
}

.market-order-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 180px;
  min-height: 0;
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.market-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 8px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 9.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 2;
}

.market-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.market-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.seller-name {
  font-weight: 600;
  color: #f1f5f9;
}

.tag-mine {
  color: #f59e0b;
  font-size: 9px;
  margin-left: 4px;
  font-weight: 700;
}

.col-qty {
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
}

.col-price,
.col-total {
  color: #f59e0b;
  font-family: var(--font-mono, monospace);
}

.market-empty-td {
  text-align: center;
  color: #64748b;
  padding: 24px 10px !important;
  font-style: italic;
  font-size: 11px;
}

/* Barra de Acción Directa Inferior */
.market-quick-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  gap: 8px;
}

.action-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
}

.action-slider-row input[type="range"] {
  width: 90px;
  accent-color: #d4af37;
  cursor: pointer;
}

.action-slider-row input[type="number"] {
  width: 44px;
  height: 24px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
}

.action-total-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.gold-text {
  color: #f59e0b;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.btn-market-action {
  font-family: var(--font-sans, sans-serif);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
}

.btn-confirm-buy {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-confirm-buy:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-confirm-sell {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-confirm-sell:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-market-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

/* Panel Inferior: Módulo Crear Oferta */
.market-create-module {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.market-create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

.create-module-title {
  font-size: 12px;
  font-weight: 800;
  color: #fcd34d;
}

.create-module-sub {
  font-size: 9.5px;
  color: #94a3b8;
}

.market-create-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-create-slot-box {
  width: 54px;
  height: 54px;
  background: #181c24;
  border-top: 2px solid #5a6376;
  border-left: 2px solid #5a6376;
  border-right: 2px solid #10131a;
  border-bottom: 2px solid #10131a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.15), inset -1px -1px 0 rgba(0, 0, 0, 0.8), 0 0 10px rgba(212, 175, 55, 0.2);
}

.market-create-slot-box img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.market-create-controls {
  flex: 1;
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.market-type-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-toggle-type {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-toggle-type:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
}

.btn-toggle-type.active#btn-market-toggle-sell {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  font-weight: 800;
}

.btn-toggle-type.active#btn-market-toggle-buy {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #86efac;
  font-weight: 800;
}

.create-control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 600;
}

.stock-hint {
  font-size: 9px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.qty-slider-composite {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-step {
  width: 26px;
  height: 26px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-slider-composite input[type="range"] {
  width: 75px;
  accent-color: #d4af37;
  cursor: pointer;
}

.qty-slider-composite input[type="number"] {
  width: 44px;
  height: 26px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
}

.btn-max {
  padding: 0 6px;
  height: 26px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
}

.btn-ref-price {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #fcd34d;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ref-price:hover {
  background: rgba(212, 175, 55, 0.3);
  color: #fff;
}

.price-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0 6px;
  height: 26px;
}

.price-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fef08a;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  outline: none;
  width: 50px;
}

.currency-tag {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
}

/* Resumen Financiero y Botón de Publicación */
.market-create-summary-pane {
  width: 175px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: #94a3b8;
}

.summary-line.sub-line {
  font-size: 9.5px;
  color: #64748b;
}

.fee-text {
  color: #f59e0b;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.btn-submit-offer {
  background: linear-gradient(180deg, #d4af37 0%, #b48a1d 100%);
  color: #0f172a;
  font-family: var(--font-sans, sans-serif);
  font-size: 11px;
  font-weight: 800;
  border: none;
  border-radius: 5px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 3px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.btn-submit-offer:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Footer del Módulo Crear */
.market-create-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

.market-network-tip {
  font-size: 9.5px;
  color: #64748b;
}

.market-bank-indicator {
  font-size: 10px;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
}

.market-bank-indicator strong {
  color: #7dd3fc;
}

/* 3. Subvistas / Overlays Superpuestos (Mis Ofertas & Historial) */
.market-overlay-panel {
  position: absolute;
  top: 60px;
  left: 18px;
  right: 18px;
  bottom: 46px;
  background: rgba(8, 14, 26, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  z-index: 10;
  backdrop-filter: blur(8px);
}

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

.overlay-header h3 {
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 15px;
  color: #f59e0b;
  margin: 0;
}

.btn-close-overlay {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-overlay:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
  border-color: #d4af37;
}

.overlay-table-scroll {
  flex: 1;
  overflow-y: auto;
}

.offer-type-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.offer-type-tag.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.offer-type-tag.buy {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.btn-market-cancel {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-market-cancel:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
  border-color: #ef4444;
}

/* Footer del Market */
.market-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  margin-top: 8px;
  flex-shrink: 0;
}

.market-tip-text {
  font-size: 10.5px;
  color: #64748b;
}

/* ==========================================================================
   SCROLLBARS ESTILO TIBIA (#RESPONSIVE-MODALS-FIX-01)
   Track oscuro #0f172a, thumb con borde biselado bronce/dorado #78350f / #d97706
   ========================================================================== */
.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 {
  scrollbar-width: thin;
  scrollbar-color: #78350f #0f172a;
}

.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;
  height: 8px;
}

.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;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

.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%);
  border: 1px solid #d97706;
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 rgba(251, 191, 36, 0.35), inset -1px -1px 0 rgba(0, 0, 0, 0.7);
}

.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%);
  border-color: #f59e0b;
}

/* ==========================================================================
   ADAPTACIONES RESPONSIVAS PARA PANTALLAS COMPACTAS Y TABLETS
   ========================================================================== */
@media (max-height: 600px) {
  .hud-player-badge {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    padding: 5px 8px 7px 8px;
    gap: 3px;
    width: clamp(160px, 19vw, 190px);
    max-width: 195px;
    min-width: 155px;
    height: auto;
    /* #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;
    overflow: visible;
  }
  .hud-top-right,
  .hud-menu-bar {
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    gap: clamp(3px, 0.9vw, 6px);
    max-width: calc(100vw - 200px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hud-menu-bar::-webkit-scrollbar {
    display: none;
  }
  .btn-quick {
    width: clamp(36px, 5vh, 42px);
    height: clamp(36px, 5vh, 42px);
    font-size: clamp(16px, 2vh, 19px);
    border-radius: 9px;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-quick .hud-quick-icon {
    width: clamp(18px, 2.4vh, 22px);
    height: clamp(18px, 2.4vh, 22px);
  }
  .modal-card {
    padding: 14px 18px !important;
    gap: 10px !important;
    max-height: 94vh !important;
    max-height: 94dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !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);
  }
}

/* ==========================================================================
   MODAL DE CAMBIO DE VOCACIÓN / PROFESIÓN (TIBIA-STYLE)
   ========================================================================== */
.modal-vocation-change,
#modal-change-vocation,
#modal-vocation {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 2vh 2vw;
  box-sizing: border-box;
}

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

.vocation-modal-card {
  width: 92vw;
  max-width: 580px;
  height: auto;
  max-height: 90vh;
  margin: auto;
  background: linear-gradient(180deg, #111827 0%, #080c14 100%);
  border: 2px solid var(--border-gold, #f59e0b);
  border-radius: 14px;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.32), 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  padding: 16px 20px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.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;
}

.vocation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  padding-bottom: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.vocation-npc-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vocation-npc-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.vocation-npc-info {
  display: flex;
  flex-direction: column;
}

.vocation-title {
  font-size: 19px;
  font-weight: 800;
  color: #fde047;
  margin: 0;
  font-family: var(--font-cinzel, serif);
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.3);
}

.vocation-npc-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.vocation-close-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vocation-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  transform: scale(1.06);
}

.vocation-modal-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0 0 16px 0;
  line-height: 1.4;
  font-style: italic;
  opacity: 0.92;
}

.vocation-selection-list,
.vocation-grid-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  margin-bottom: 10px;
}

/* Scrollbar dorada estilizada */
.vocation-selection-list::-webkit-scrollbar,
.vocation-grid-list::-webkit-scrollbar {
  width: 6px;
}

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

.vocation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.vocation-card:hover {
  border-color: #f59e0b;
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.vocation-card.selected {
  border-color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.12) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35) !important;
}

.vocation-card.is-current {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08) !important;
  cursor: default;
  transform: none !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.18) !important;
}

.vocation-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.vocation-icon-box {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.vocation-icon-box.voc-knight {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
}

.vocation-icon-box.voc-paladin {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.4);
}

.vocation-icon-box.voc-mage {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.4);
}

.vocation-icon-box.voc-healer {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.4);
}

.vocation-card-body {
  flex: 1;
}

.vocation-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.vocation-name {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-cinzel, serif);
}

.vocation-subname {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.vocation-badge-current {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid #10b981;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vocation-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  margin: 3px 0 6px 0;
  line-height: 1.35;
}

.vocation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.voc-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  font-weight: 600;
}

.vocation-card-action {
  margin-left: 14px;
}

.btn-select-vocation {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid #f59e0b;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f19;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-cinzel, serif);
  letter-spacing: 0.5px;
}

.btn-select-vocation:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  transform: scale(1.04);
}

.vocation-card.is-current .btn-select-vocation {
  background: #1e293b;
  color: #64748b;
  border-color: #334155;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.vocation-confirm-panel {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  animation: slideUp 0.22s ease-out;
}

.vocation-confirm-panel.hidden {
  display: none !important;
}

.confirm-details {
  flex: 1;
}

.confirm-question {
  font-size: 13.5px;
  color: #f8fafc;
  margin-bottom: 4px;
}

.confirm-question strong {
  color: #38bdf8;
  font-size: 14px;
}

.confirm-cost-row {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cost-value {
  color: #fde047;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
}

.free-tag {
  color: #34d399;
  font-weight: 700;
  font-size: 11px;
}

.free-tag.hidden {
  display: none !important;
}

.confirm-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-vocation-cancel {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-vocation-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-vocation-confirm {
  padding: 8px 18px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border: 1.5px solid #34d399;
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-cinzel, serif);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.btn-vocation-confirm:hover {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  transform: scale(1.03);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@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;
  }
  .market-order-table-wrap {
    max-height: 120px;
  }
}

/* ==========================================================================
   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;
  }
}


/* ==========================================================================
   MODAL DE ACCESO Y CREACIÓN DE PERSONAJE (#FRONTEND-LOGIN-02)
   Glassmorphism oscuro, borde dorado (#eab308), 4 vocaciones y animaciones
   ========================================================================== */
#modal-auth {
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100dvw;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: radial-gradient(circle at center, rgba(12, 16, 28, 0.65) 0%, rgba(4, 7, 13, 0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000 !important;
  display: none;
  justify-content: center;
  align-items: center;
  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;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#modal-auth.active {
  display: flex !important;
}

#modal-auth.auth-fade-out {
  opacity: 0 !important;
  transform: scale(1.03) !important;
  pointer-events: none !important;
}

/* ==========================================================================
   DIRECTRIZ TÉCNICA #FRONTEND-TITLE-SCREEN-AND-CHAR-SELECT-01:
   PANTALLA DE TÍTULO INMERSIVA (SPLASH SCREEN MMORPG)
   ========================================================================== */
#screen-title-splash {
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100dvw;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  background: #04060a;
  overflow: hidden;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#screen-title-splash.active {
  display: flex;
}

#screen-title-splash.splash-dimmed {
  cursor: default;
  pointer-events: none;
}

#screen-title-splash.splash-dimmed .title-splash-backdrop {
  filter: brightness(0.35) contrast(1.1);
  transition: filter 0.45s ease;
}

#screen-title-splash.splash-dimmed .title-splash-content {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#screen-title-splash.splash-fade-out {
  opacity: 0 !important;
  transform: scale(1.05) !important;
  pointer-events: none !important;
}

/* Portada de inicio a pantalla completa: cover directo sin franjas laterales */
.title-splash-backdrop {
  position: absolute;
  inset: 0;
  background-image: url('../background/image.webp');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  image-rendering: auto;
  z-index: 1;
}

.title-splash-ambient {
  display: none !important;
}

.title-splash-content {
  position: relative;
  z-index: 10;
  margin-bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  padding: 0 16px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.title-mobile-prompt,
.title-prompt-pulse {
  font-family: 'Roboto', 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 0, 0, 0.75);
  animation: mobileTouchPulse 2.2s ease-in-out infinite;
  text-align: center;
  word-break: break-word;
  user-select: none;
}

@media screen and (max-height: 480px) {
  .title-splash-content {
    margin-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .title-mobile-prompt,
  .title-prompt-pulse {
    font-size: 12px !important;
    letter-spacing: 1.5px !important;
  }
}

@keyframes mobileTouchPulse {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.auth-modal-card {
  background: linear-gradient(160deg, rgba(16, 22, 36, 0.95) 0%, rgba(9, 12, 21, 0.98) 100%);
  border: 2px solid #eab308 !important;
  border-radius: 20px;
  padding: 28px 36px;
  box-shadow: 0 0 32px rgba(234, 179, 8, 0.28), 0 24px 60px rgba(0, 0, 0, 0.92);
  text-align: center;
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  animation: authCardPop 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #eab308, #fef08a, #eab308, transparent);
}

@keyframes authCardPop {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(14px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.auth-crest {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(234, 179, 8, 0.65));
  animation: authFloat 3s ease-in-out infinite;
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.auth-title {
  font-family: var(--font-cinzel, var(--font-serif, 'Cinzel', serif));
  font-size: 24px;
  font-weight: 900;
  color: #eab308;
  letter-spacing: 2px;
  text-shadow: 0 2px 14px rgba(234, 179, 8, 0.45);
  margin: 0;
}

.auth-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.auth-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .auth-fields-row {
    grid-template-columns: 1fr;
  }
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
}

.auth-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  opacity: 0.75;
}

.auth-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(234, 179, 8, 0.35);
  border-radius: 10px;
  padding: 10px 14px 10px 34px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #eab308;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.4);
}

.auth-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Selector de Género (#FRONTEND-TITLE-SCREEN-AND-CHAR-SELECT-01) */
.auth-gender-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-gender-header {
  display: flex;
  align-items: baseline;
}

.auth-gender-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.auth-gender-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(234, 179, 8, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
}

.auth-gender-btn:hover {
  background: rgba(234, 179, 8, 0.08);
  border-color: #eab308;
  color: #f8fafc;
}

.auth-gender-btn.selected {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.22) 0%, rgba(234, 179, 8, 0.08) 100%);
  border-color: #eab308;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.35), inset 0 0 8px rgba(234, 179, 8, 0.12);
}

.auth-gender-symbol {
  font-size: 16px;
  font-weight: 800;
}

.auth-gender-text {
  letter-spacing: 0.5px;
}

.auth-vocation-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-vocation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.auth-vocation-tip {
  font-size: 11px;
  color: #64748b;
}

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

@media (max-width: 580px) {
  .auth-vocation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.auth-voc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(234, 179, 8, 0.22);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.auth-voc-card:hover {
  background: rgba(234, 179, 8, 0.08);
  border-color: #eab308;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.auth-voc-card.selected {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.18) 0%, rgba(234, 179, 8, 0.06) 100%);
  border-color: #eab308;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.35), inset 0 0 12px rgba(234, 179, 8, 0.12);
}

.auth-voc-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.2);
  color: #fef08a;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.auth-voc-icon {
  font-size: 24px;
  margin-top: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.auth-voc-name {
  font-family: var(--font-cinzel, var(--font-serif, 'Cinzel', serif));
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.4px;
}

.auth-voc-desc {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: 2px;
}

.auth-error-alert {
  background: rgba(220, 38, 38, 0.20);
  border: 1.5px solid #ef4444;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  animation: authShake 0.4s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(234, 179, 8, 0.25);
  border-top-color: #eab308;
  border-radius: 50%;
  animation: authSpin 0.75s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

.auth-status-text {
  font-size: 13px;
  font-weight: 600;
  color: #eab308;
}

.btn-auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  border: 1.5px solid #fef08a;
  border-radius: 10px;
  color: #0b0f19;
  font-family: var(--font-cinzel, var(--font-serif, 'Cinzel', serif));
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.45);
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
  box-shadow: 0 6px 26px rgba(234, 179, 8, 0.65);
}

.btn-auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-auth-guest {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
  border-radius: 8px;
  font-weight: bold;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-auth-guest:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #bae6fd;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-auth-guest:active:not(:disabled) {
  transform: translateY(0);
}

.btn-auth-guest:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.auth-footer-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
}

.auth-server-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #94a3b8;
}

.auth-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* ==========================================================================
   HUD DE ARENA DE BOSS Y GUARDIÁN GIDEON (#CLIENT-BOSS-ARENAS-02)
   ========================================================================== */

#boss-arena-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1200;
  box-sizing: border-box;
}

/* Barra de Vida Gigante Centrada Superior */
.boss-arena-bar-card {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(340px, 46vw, 680px);
  background: linear-gradient(180deg, rgba(20, 10, 20, 0.96), rgba(8, 6, 12, 0.98));
  border: 2px solid #b91c1c;
  border-top-color: #ef4444;
  border-bottom-color: #7f1d1d;
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.45), 0 4px 12px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.9);
  padding: 8px 16px 10px 16px;
  pointer-events: auto;
  box-sizing: border-box;
  animation: arena-bar-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes arena-bar-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -15px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.boss-arena-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.boss-arena-skull-badge {
  font-size: 15px;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
  flex-shrink: 0;
}

.boss-arena-name {
  font-family: 'Press Start 2P', monospace, sans-serif;
  font-size: 13px;
  color: #fee2e2;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 2px 2px 0 #000;
  letter-spacing: 1px;
  font-weight: 700;
  flex: 1;
  text-transform: uppercase;
}

.boss-arena-hp-text {
  font-family: monospace;
  font-size: 12px;
  color: #fca5a5;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  text-shadow: 1px 1px 0 #000;
}

.boss-arena-hp-track {
  width: 100%;
  height: 16px;
  background: rgba(25, 8, 12, 0.95);
  border: 1px solid #7f1d1d;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.boss-arena-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #991b1b, #ef4444, #f87171);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

/* Cronómetro Digital Visible en Esquina Superior Derecha */
.boss-arena-timer-container {
  position: absolute;
  top: 18px;
  right: 24px;
  background: rgba(14, 10, 18, 0.94);
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace, sans-serif;
  font-size: 11px;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  box-sizing: border-box;
  animation: arena-timer-pulse 1s ease-in-out infinite alternate;
}

@keyframes arena-timer-pulse {
  from {
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  }
  to {
    border-color: #f87171;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
  }
}

.arena-timer-icon {
  font-size: 14px;
}

.boss-arena-timer-text {
  font-family: 'Press Start 2P', monospace, sans-serif;
  font-size: 11px;
  color: #ffffff;
}

.boss-arena-timer-val {
  font-family: 'Press Start 2P', monospace, sans-serif;
  font-size: 12px;
  color: #ef4444;
  font-weight: 700;
  margin-left: 4px;
}

/* Estado de Victoria en Cronómetro */
.boss-arena-timer-container.victory {
  border-color: #f59e0b !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.7) !important;
  color: #fef08a !important;
  animation: victory-glow 0.8s ease-in-out infinite alternate !important;
}

@keyframes victory-glow {
  from {
    border-color: #f59e0b;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
  }
  to {
    border-color: #fde047;
    box-shadow: 0 0 28px rgba(253, 224, 71, 0.85);
  }
}

.boss-arena-timer-val.victory-gold {
  color: #fde047 !important;
}

/* Toast Estilizado de Salas Llenas (#ARENAS_FULL) */
.toast-arenas-full {
  border: 2px solid #ef4444 !important;
  outline: 2px solid #eab308 !important;
  background: linear-gradient(135deg, rgba(28, 12, 16, 0.97), rgba(16, 8, 14, 0.98)) !important;
  color: #fef08a !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), 0 0 12px rgba(234, 179, 8, 0.5) !important;
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  letter-spacing: 0.5px !important;
}

/* Globo de Diálogo Flotante de Gideon */
.guardian-speech-bubble {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(22, 14, 28, 0.96), rgba(12, 8, 18, 0.98));
  border: 2px solid #ef4444;
  outline: 1px solid #eab308;
  border-radius: 8px;
  padding: 10px 18px;
  color: #fef08a;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(239, 68, 68, 0.5);
  z-index: 1300;
  pointer-events: none;
  max-width: 480px;
  text-align: center;
  animation: speech-bubble-pop 0.3s ease-out;
}

.guardian-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 8px 0 8px;
  border-style: solid;
  border-color: #ef4444 transparent transparent transparent;
}

@keyframes speech-bubble-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* Botón de Entrada a la Arena en Diálogo con Soporte de Cooldown */
.btn-enter-boss-arena {
  background: linear-gradient(180deg, #9333ea, #7e22ce) !important;
  border: 1px solid #c084fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5) !important;
  font-weight: 700 !important;
}

.btn-enter-boss-arena:hover:not(:disabled) {
  background: linear-gradient(180deg, #a855f7, #9333ea) !important;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.8) !important;
}

.btn-enter-boss-arena:disabled,
.btn-enter-boss-arena.btn-cooldown {
  background: linear-gradient(180deg, #374151, #1f2937) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
  cursor: not-allowed !important;
  opacity: 0.85 !important;
  box-shadow: none !important;
}

/* Sprite de Portal Iluminado al Derrotar al Jefe */
.portal-exit-illuminated {
  filter: drop-shadow(0 0 15px #fde047) drop-shadow(0 0 25px rgba(245, 158, 11, 0.9)) brightness(1.3) !important;
  animation: portal-exit-pulse 1s infinite alternate !important;
}

@keyframes portal-exit-pulse {
  from {
    filter: drop-shadow(0 0 12px #fde047) drop-shadow(0 0 20px rgba(245, 158, 11, 0.8)) brightness(1.2);
  }
  to {
    filter: drop-shadow(0 0 22px #fde047) drop-shadow(0 0 35px rgba(245, 158, 11, 1)) brightness(1.5);
  }
}

/* Destello de Misión de Caza Lista para Boss (#TASK-CONNECTOR-GIDEON-02) */
.flash-mission-ready {
  animation: mission-ready-glow 1.2s ease-out !important;
}

@keyframes mission-ready-glow {
  0% {
    box-shadow: inset 0 0 100px 30px rgba(234, 179, 8, 0.7);
    filter: brightness(1.25);
  }
  50% {
    box-shadow: inset 0 0 70px 20px rgba(234, 179, 8, 0.4);
    filter: brightness(1.1);
  }
  100% {
    box-shadow: none;
    filter: none;
  }
}

/* Botón Selector de Idioma (🇪🇸 ES / 🇬🇧 EN #I18N-SYSTEM-01) */
.btn-lang-toggle {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-lang-toggle:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-lang-toggle:active {
  transform: translateY(0);
}

.auth-lang-toggle {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  padding: 6px 12px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.auth-lang-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

/* ==========================================================================
   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 Monitor de Rendimiento Compacto (#FRONTEND-MOBILE-HUD-ERGONOMICS-02) */
.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: 0 !important;
  font-size: 8px !important;
  padding: 2px 5px !important;
  height: auto !important;
  width: fit-content !important;
  border-radius: 4px !important;
  background: rgba(10, 15, 26, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  letter-spacing: 0.2px !important;
  z-index: 20 !important;
}

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

#hud-perf-monitor .perf-separator {
  height: 8px !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 (48x48px) 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 !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  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;
}

.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;
}

.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 {
  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;
}

@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 {
    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-MOBILE-NPC-MODALS-FIX-01
   Normalización Ergonómica de Modales y Menús de NPCs en Móvil
   ========================================================================== */

/* 1. Reestructuración de .trade-viewport para Móvil (#modal-trade) */
@media screen and (max-width: 1024px) {
  .trade-viewport {
    display: flex !important;
    flex-direction: row !important; /* Lado a lado: Tienda a la izquierda, Mochila a la derecha */
    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 */
  .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;
  }
}

@media screen and (max-width: 1024px) and (max-height: 768px), screen and (max-width: 1024px) {
  .trade-inv-body {
    max-height: calc(92vh - 90px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  /* Panel de Detalles Flotante / Inferior en Móvil */
  #store-selected-item-card,
  #store-sell-item-card,
  #sell-selected-item-card {
    position: absolute !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 80% !important;
    background: rgba(11, 18, 33, 0.98) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.55) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95), 0 0 20px rgba(56, 189, 248, 0.25) !important;
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    z-index: 60 !important;
    overflow-y: auto !important;
    animation: storeCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  #store-selected-item-card {
    border-color: rgba(234, 179, 8, 0.55) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95), 0 0 20px rgba(234, 179, 8, 0.25) !important;
  }

  #store-selected-item-card .store-detail-header,
  #store-sell-item-card .store-detail-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }

  #store-selected-item-card .store-detail-icon-wrap,
  #store-sell-item-card .store-detail-icon-wrap {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 8px !important;
  }

  #store-selected-item-card .store-detail-name,
  #store-sell-item-card .store-detail-name {
    font-size: 13px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #store-selected-item-card .store-detail-level-badge,
  #store-sell-item-card .sell-detail-meta-row {
    font-size: 10px !important;
    margin-top: 2px !important;
  }

  #store-selected-item-card .store-detail-body,
  #store-sell-item-card .store-detail-body {
    display: none !important;
  }

  #store-selected-item-card .store-detail-footer,
  #store-sell-item-card .store-detail-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
  }

  #store-selected-item-card .store-qty-row,
  #store-sell-item-card .store-qty-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  #store-selected-item-card .store-qty-controls,
  #store-sell-item-card .store-qty-controls {
    display: flex !important;
    gap: 4px !important;
  }

  #store-selected-item-card .btn-store-qty,
  #store-sell-item-card .btn-store-qty {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    font-size: 14px !important;
  }

  #store-selected-item-card .btn-store-qty-max,
  #store-sell-item-card .btn-store-qty-max {
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
  }

  #store-selected-item-card .store-buy-qty-input,
  #store-sell-item-card .store-buy-qty-input {
    width: 44px !important;
    height: 30px !important;
    font-size: 13px !important;
  }

  #store-selected-item-card .store-price-row,
  #store-sell-item-card .store-price-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 12px !important;
    padding: 4px 0 !important;
  }

  #store-selected-item-card .btn-store-buy {
    min-height: 36px !important;
    height: 36px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    width: 100% !important;
  }

  #store-sell-item-card .store-sell-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #store-sell-item-card .btn-store-sell,
  #store-sell-item-card .btn-store-sell-all {
    min-height: 36px !important;
    height: 36px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
}

/* 2. Banco Real de Bruce y Baúl en Móvil (#bank-controls) */
#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;
}

@media screen and (max-height: 540px), screen and (max-width: 900px) {
  #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 #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;
}

/* 3. Diálogos de NPCs (#dialogue-modal) en Móvil */
body.mobile-touch-mode #dialogue-modal {
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  width: clamp(280px, 88vw, 560px) !important;
  max-width: 88vw !important;
  padding: 8px 12px !important;
  gap: 10px !important;
  border-radius: 10px !important;
}

@media screen and (max-width: 1024px) {
  #dialogue-modal {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width: clamp(280px, 88vw, 560px) !important;
    max-width: 88vw !important;
    padding: 8px 12px !important;
    gap: 10px !important;
    border-radius: 10px !important;
  }
  .dialogue-portrait {
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
  }
  .dialogue-speaker {
    font-size: 12px !important;
  }
  .dialogue-text {
    font-size: 11px !important;
    line-height: 1.25 !important;
    max-height: 42px !important;
    overflow-y: auto !important;
  }
  .btn-trade-action {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 32px !important;
    border-radius: 6px !important;
  }
}

/* 4. Selector de Vocaciones (#modal-change-vocation) en Móvil */
body.mobile-touch-mode .vocation-selection-list,
body.mobile-touch-mode .vocation-grid-list {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  overflow-y: auto !important;
  max-height: calc(92vh - 120px) !important;
}

@media screen and (max-width: 1024px) {
  .vocation-selection-list,
  .vocation-grid-list,
  .vocation-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    overflow-y: auto !important;
    max-height: calc(92vh - 120px) !important;
  }

  .vocation-card {
    padding: 4px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    min-height: auto !important;
    gap: 4px !important;
  }

  .vocation-card-left {
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
  }

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

  .vocation-card-body {
    align-items: center !important;
  }

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

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

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

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

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

  .vocation-confirm-panel {
    position: sticky !important;
    bottom: 0 !important;
    min-height: 36px !important;
    padding: 6px 12px !important;
    z-index: 20 !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;
}

/* ==========================================================================
   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;
  }

  /* Selector de género compacto en móvil */
  .auth-gender-section {
    margin-bottom: 4px !important;
  }

  .auth-gender-btn {
    height: 28px !important;
    padding: 2px 8px !important;
    font-size: 11px !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;
}

body.mobile-touch-mode .auth-gender-section {
  margin-bottom: 4px !important;
}

body.mobile-touch-mode .auth-gender-btn {
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 11px !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;
}

/* ==========================================================================
   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;
  }

  /* Botón de Salto con el mismo tamaño táctil grande y tarjeta redondeada */
  #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) + 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;
  }

  /* 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;
}

body.mobile-touch-mode #btn-touch-jump,
body.mobile-touch-mode #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) + 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;
}

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;
}

@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);
}

/* 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-trans-meta-row {
    font-size: 10px !important;
  }

  .btn-trade-confirm {
    padding: 6px 12px !important;
    font-size: 11px !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;
}
  min-height: 38px !important;
  margin-top: 2px !important;
  gap: 8px !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;
}

/* ==========================================================================
   MODAL DE INSPECCIÓN E INTERACCIÓN DE JUGADOR (#FRONTEND-PLAYER-INSPECTION-AND-ACTION-MODAL-01)
   ========================================================================== */
@keyframes inspectCardPop {
  0% { opacity: 0; transform: scale(0.93) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-player-inspect {
  position: fixed !important;
  inset: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1200 !important;
  background: rgba(4, 8, 18, 0.76) !important;
  backdrop-filter: blur(8px) !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;
}

/* Esquinas ornamentales estilo RPG */
.inspect-corner-accent {
  position: absolute !important;
  width: 12px !important;
  height: 12px !important;
  border-color: #eab308 !important;
  border-style: solid !important;
  pointer-events: none !important;
  opacity: 0.65 !important;
}

.inspect-corner-accent.tl {
  top: 6px !important;
  left: 6px !important;
  border-width: 2px 0 0 2px !important;
  border-top-left-radius: 4px !important;
}

.inspect-corner-accent.tr {
  top: 6px !important;
  right: 6px !important;
  border-width: 2px 2px 0 0 !important;
  border-top-right-radius: 4px !important;
}

.inspect-corner-accent.bl {
  bottom: 6px !important;
  left: 6px !important;
  border-width: 0 0 2px 2px !important;
  border-bottom-left-radius: 4px !important;
}

.inspect-corner-accent.br {
  bottom: 6px !important;
  right: 6px !important;
  border-width: 0 2px 2px 0 !important;
  border-bottom-right-radius: 4px !important;
}

/* Header */
.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;
}

/* Cuerpo de Inspección */
.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;
  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;
  background: rgba(10, 15, 26, 0.95);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(245, 158, 11, 0.2);
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.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: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}

.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 {
  width: 100%;
  height: 46px;
  background: rgba(14, 116, 144, 0.35);
  border: 1.5px solid #06b6d4;
  color: #67e8f9;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-auth-guest-clean:hover {
  background: rgba(14, 116, 144, 0.6);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* Lista de Personajes (Estilo Tibia / Lawl) */
.char-list-card, .char-create-card {
  width: 100%;
  max-width: 580px;
  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;
}

.char-list-header, .char-create-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;
}

.char-list-title, .char-create-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-create-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 4px 0 0 0;
}

.char-roster-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  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 {
  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,
.char-create-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.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);
}

.char-create-card {
  max-width: 680px !important;
}

.char-create-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .char-create-layout {
    grid-template-columns: 1fr;
  }
}

.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;
}

@media (max-width: 600px) {
  .char-list-card, .char-create-card, .auth-modal-card-clean {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 18px 14px !important;
  }
  .char-voc-selector-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

