/**
 * MMORPG Experience - Estilos oscuros RPG
 * Complementa Tailwind CSS (CDN) con tema Norrath.
 */

/* Variables de tema (por si se quita Tailwind más adelante) */
:root {
  --rpg-dark: #050816;
  --rpg-card: #101827;
  --rpg-accent: #f59e0b;
  --rpg-accent-soft: #78350f;
  --mobile-breakpoint: 768px;
}

/* Touch: elimina retraso 300ms en móviles, área táctil mínima */
html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button, a, [role="button"] {
  touch-action: manipulation;
}

/* Overlay de ambiente */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(circle at top, rgba(245, 158, 11, 0.07), transparent 60%);
  z-index: 0;
}

/* Scrollbar del log de crónicas */
#logBox::-webkit-scrollbar {
  width: 6px;
}
#logBox::-webkit-scrollbar-track {
  background: transparent;
}
#logBox::-webkit-scrollbar-thumb {
  background: rgba(55, 65, 81, 0.8);
  border-radius: 3px;
}
#logBox::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.9);
}

/* Asegurar que el contenido esté por encima del overlay */
.relative {
  position: relative;
  z-index: 1;
}

/* Transiciones suaves en botones de edificios */
button[id^="building"] {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

/* Taberna: indicador cuando hay misión lista para entregar */
#buildingTavern.tavern-quest-ready {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
  background: radial-gradient(circle at center, #0a0f1a 0%, #020617 45%, rgba(0,0,0,1) 100%),
    radial-gradient(circle at top, rgba(251, 191, 36, 0.35), transparent 65%);
  animation: tavern-quest-pulse 2s ease-in-out infinite;
}
@keyframes tavern-quest-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* Focus visible para accesibilidad */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--rpg-accent);
  outline-offset: 2px;
}

/* Ficha de personaje Guild Hall - zona agradable y grande */
#buildingPanel.building-guild-active {
  background: rgba(5, 8, 22, 0.92);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 40px rgba(129, 140, 248, 0.15);
}

.equip-slot {
  transition: background 0.15s, border-color 0.15s;
}
.equip-slot:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(129, 140, 248, 0.4);
}

/* Tooltip mejorado para slots de equipo */
.equip-slot[title] {
  cursor: help;
}

/* Slots de equipo: mínimo 44x44px para touch (mobile friendly) */
.equip-slot-droppable {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

/* Selector de Equipo: panel grande para móvil */
#equipmentSelectorModal {
  display: flex;
}
#itemDetailModal.hidden {
  display: none !important;
}
#backupExportModal.hidden,
#backupImportModal.hidden {
  display: none !important;
}
#backupImportCode {
  -webkit-user-select: text;
  user-select: text;
}

/* Chat GM - destacar sobre todo lo demás */
.chronicle-gm-line {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.25), transparent);
  border-left: 3px solid #ef4444;
  padding: 2px 0 2px 6px;
  margin: 2px 0;
}
.chronicle-gm-name {
  color: #fca5a5 !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}
.chronicle-gm-msg {
  color: #f87171 !important;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

/* Chat SERVER - aviso global GM entrada (amarillo/púrpura) */
.chronicle-server-line {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), transparent);
  border-left: 3px solid #a855f7;
  padding: 2px 0 2px 6px;
  margin: 2px 0;
}
.chronicle-server-msg {
  color: #fbbf24 !important;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

/* Habilidades de Named - destacar en Crónicas */
.chronicle-named-line {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), transparent);
  border-left: 3px solid #f59e0b;
  padding: 2px 0 2px 6px;
  margin: 2px 0;
}
.chronicle-named-ability {
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}
#itemDetailModal .item-detail-panel {
  min-height: min(400px, 70vh);
}
#itemDetailModal #itemDetailActions button {
  flex: 1;
  min-width: 100px;
}
@media (max-width: 767px) {
  #itemDetailModal .item-detail-panel {
    max-height: 85vh;
    min-height: 50vh;
  }
}
#itemToast {
  max-width: 90vw;
}

#equipmentSelectorModal.hidden {
  display: none !important;
}
.equipment-selector-panel {
  min-height: 50vh;
}
@media (max-width: 767px) {
  .equipment-selector-panel {
    max-height: 90vh;
    min-height: 60vh;
  }
}
.equipment-selector-item {
  min-height: 44px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.equipment-selector-item:hover,
.equipment-selector-item:active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(129, 140, 248, 0.5);
}
.equipment-selector-item.equipment-class-compatible {
  border-left: 3px solid rgba(34, 197, 94, 0.8);
}
.equipment-selector-item.equipment-class-incompatible {
  opacity: 0.7;
}

.equip-slot-unico {
  box-shadow: 0 0 12px rgba(255, 51, 51, 0.5);
}

/* Tooltip Maestra (Bazaar, Inventario) */
.master-tooltip {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.1);
}
.master-tooltip.border-sky-500\/70 { border-color: rgba(56, 189, 248, 0.7); box-shadow: 0 0 20px rgba(56, 189, 248, 0.25); }
.master-tooltip.border-purple-500\/70 { border-color: rgba(168, 85, 247, 0.7); box-shadow: 0 0 20px rgba(168, 85, 247, 0.25); }
.master-tooltip.border-orange-500\/80 { border-color: rgba(249, 115, 22, 0.8); box-shadow: 0 0 20px rgba(249, 115, 22, 0.25); }
.master-tooltip.border-red-500\/90 { border-color: rgba(239, 68, 68, 0.9); box-shadow: 0 0 24px rgba(239, 68, 68, 0.35); }

/* Botón Retirarse: esquina superior derecha, pequeño, gris/rojo oscuro */
#retreatBtn {
  position: absolute !important;
  top: 12px;
  right: 12px;
  z-index: 9999 !important;
  pointer-events: auto !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  border: 1px solid rgba(127, 29, 29, 0.9) !important;
  background: rgba(69, 10, 10, 0.9) !important;
  color: rgba(248, 113, 113, 0.95) !important;
}
#retreatBtn:hover {
  background: rgba(127, 29, 29, 0.8) !important;
}
/* Botón Retirarse: ventana de oportunidad (glow cuando activo) */
.retreat-btn-glow {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7), 0 0 40px rgba(245, 158, 11, 0.4);
  animation: retreatGlowPulse 1.2s ease-in-out infinite;
}
.retreat-btn-pause-glow {
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.9), 0 0 48px rgba(245, 158, 11, 0.6), inset 0 0 12px rgba(251, 191, 36, 0.3);
  animation: retreatPauseGlow 0.8s ease-in-out infinite;
  border-color: rgba(251, 191, 36, 0.95) !important;
}
@keyframes retreatGlowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.7), 0 0 40px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 28px rgba(245, 158, 11, 0.9), 0 0 50px rgba(245, 158, 11, 0.5); }
}
@keyframes retreatPauseGlow {
  0%, 100% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.9), 0 0 48px rgba(245, 158, 11, 0.6), inset 0 0 12px rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 0 32px rgba(251, 191, 36, 1), 0 0 60px rgba(245, 158, 11, 0.8), inset 0 0 16px rgba(251, 191, 36, 0.4); }
}

/* Floaty text de daño/curación */
.combat-card-wrapper {
  position: relative;
  overflow: visible;
}
.combat-floaty {
  position: absolute;
  left: 50%;
  top: 25%;
  --floaty-offset-x: 0px;
  transform: translate(calc(-50% + var(--floaty-offset-x)), -50%);
  font-weight: 700;
  font-size: 1.1em;
  text-shadow: 0 0 4px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,1);
  pointer-events: none;
  z-index: 20;
  opacity: 1;
  transition: none;
}
.combat-floaty.combat-floaty-animate {
  animation: floatyRise 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.combat-floaty.combat-floaty-crit {
  color: #eab308 !important;
  text-shadow: 0 0 8px rgba(234,179,8,0.8), 0 0 4px rgba(0,0,0,0.9);
}
.combat-floaty.combat-floaty-crit.combat-floaty-animate {
  animation: floatyRiseCrit 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.combat-floaty.combat-floaty-levelup {
  color: #FFD700 !important;
  font-weight: bold !important;
  font-size: 1.3em !important;
  text-shadow: 0 0 6px rgba(255,215,0,0.9), 0 0 4px rgba(0,0,0,0.9);
}
.combat-floaty.combat-floaty-levelup.combat-floaty-animate {
  animation: floatyRise 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes floatyRiseCrit {
  0% { transform: translate(calc(-50% + var(--floaty-offset-x)), -50%) scale(1.3); opacity: 1; }
  20% { transform: translate(calc(-50% + var(--floaty-offset-x)), -45px) scale(1.35); opacity: 1; }
  70% { transform: translate(calc(-50% + var(--floaty-offset-x)), -55px) scale(1.2); opacity: 0.95; }
  100% { transform: translate(calc(-50% + var(--floaty-offset-x)), -90px) scale(1.1); opacity: 0; }
}
@keyframes floatyRise {
  0% {
    transform: translate(calc(-50% + var(--floaty-offset-x)), -50%) scale(1);
    opacity: 1;
  }
  40% {
    transform: translate(calc(-50% + var(--floaty-offset-x)), -35px) scale(1.05);
    opacity: 0.98;
  }
  100% {
    transform: translate(calc(-50% + var(--floaty-offset-x)), -85px) scale(1);
    opacity: 0;
  }
}

/* Layout estático de combate: 6 slots en 2 columnas (3 filas) - aliados y enemigos */
.combat-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  min-height: 280px;
  height: 100%;
  width: 100%;
  padding-bottom: 8px;
}
.combat-slots-allies,
.combat-slots-enemies {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, minmax(88px, 1fr));
}
.combat-slot {
  min-height: 88px;
  height: auto;
  flex-shrink: 0;
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.combat-slot-miniboss,
.combat-slot-boss {
  overflow: visible !important;
  min-height: 110px;
}
.combat-slot-boss {
  min-height: 120px;
}
.combat-slot-inner {
  width: 100%;
  height: 100%;
  min-height: 88px;
  box-sizing: border-box;
  overflow: hidden;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.combat-slot-miniboss .combat-slot-inner,
.combat-slot-boss .combat-slot-inner {
  overflow: visible !important;
}
.combat-slot[data-enemy-idx]:not(.combat-slot-empty) {
  overflow: visible;
}
.combat-slot-enemy-inner {
  overflow-x: visible;
}
.enemy-name-cell {
  min-width: 150px;
  padding-right: 8px;
}
.combat-slot-bars {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.combat-slot-empty {
  visibility: hidden;
  pointer-events: none;
  min-height: 88px;
}
.combat-slot-empty .combat-slot-inner {
  border-color: transparent !important;
  background: transparent !important;
}

/* Feedback visual: enemigo recibe daño (flash + shake) */
.combat-slot-enemy-hit .combat-slot-inner {
  animation: combat-enemy-hit 0.35s ease-out;
}
.combat-slot-shake .combat-slot-inner {
  animation: combat-enemy-hit 0.35s ease-out, combat-shake 0.35s ease-out;
}
.combat-slot-flash .combat-slot-inner {
  --magic-flash-color: #7c3aed;
  animation: combat-magic-flash 0.35s ease-out;
}
@keyframes combat-enemy-hit {
  0% { filter: brightness(1); box-shadow: 0 0 0 transparent; }
  20% { filter: brightness(1.9); box-shadow: 0 0 12px rgba(239,68,68,0.6); }
  40% { filter: brightness(1.5); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
  100% { filter: brightness(1); box-shadow: 0 0 0 transparent; }
}
@keyframes combat-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}
@keyframes combat-magic-flash {
  0% { filter: brightness(1); box-shadow: 0 0 0 transparent; }
  25% { filter: brightness(1.8); box-shadow: 0 0 14px var(--magic-flash-color); }
  50% { filter: brightness(1.5); box-shadow: 0 0 10px var(--magic-flash-color); }
  100% { filter: brightness(1); box-shadow: 0 0 0 transparent; }
}

/* Enemigo muerto: desvanecimiento suave 1.5s para que el floaty de daño sea visible */
.combat-slot-enemy-fade-out {
  animation: combat-enemy-fade-out 1.5s ease-out forwards;
}
@keyframes combat-enemy-fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Modo combate inmersivo: oculta navegación, expande combate */
body.combat-ui-active .city-view-nav,
body.combat-ui-active #buildingPanel,
body.combat-ui-active .combat-ui-hide {
  display: none !important;
}
body.combat-ui-active #combatView {
  display: flex !important;
  grid-column: 1 / -1;
  min-height: calc(100vh - 180px);
  max-height: calc(100vh - 120px);
}
body.combat-ui-active #combatLogBox,
body.in-combat #combatLogBox {
  width: 100% !important;
  min-height: 400px !important;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 38px !important;
}
body.in-combat #combat-log,
body.combat-ui-active #combat-log {
  width: 100% !important;
  height: 400px !important;
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 38px !important;
}
.combat-log-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  overflow: visible;
}
#combat-log {
  margin-bottom: 38px;
  min-height: 440px;
}
.combat-log-box {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  padding-bottom: 20px;
  min-height: 420px;
  position: relative;
  z-index: 1;
}
.combat-wave-separator {
  background: rgba(75, 85, 99, 0.15);
  letter-spacing: 0.05em;
}
.combat-slot-miniboss .combat-slot-inner {
  transform: scale(1.15);
  transform-origin: top center;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  border-color: rgba(59, 130, 246, 0.7) !important;
  min-height: 100px;
}
.combat-slot-boss .combat-slot-inner {
  transform: scale(1.3);
  transform-origin: top center;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.7), 0 0 8px rgba(239, 68, 68, 0.4);
  border-color: rgba(251, 191, 36, 0.8) !important;
  min-height: 115px;
}
.combat-enemy-name-miniboss {
  margin-top: -16px;
  position: relative;
  z-index: 1;
}
.combat-enemy-name-boss {
  margin-top: -20px;
  position: relative;
  z-index: 1;
  font-size: 1.2em !important;
  font-weight: bold !important;
}
.combat-enemy-hpbar-boss {
  min-width: 120%;
}
.combat-glow-miniboss { filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.8)); }
.combat-glow-boss { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.9)) drop-shadow(0 0 4px rgba(239, 68, 68, 0.5)); }
body.in-combat #buildingPanel {
  display: none !important;
}

/* ========== MOBILE: Layout táctico (max-width: 768px) ========== */
@media (max-width: 768px) {
  body.combat-ui-active #combatView {
    min-height: 100dvh;
    min-height: 100vh;
    max-height: none;
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    gap: 6px;
    flex-direction: column;
  }
  /* Contenedor principal: columna (enemigos arriba 60%, grupo abajo 40%) */
  body.combat-ui-active #combatView > .grid {
    order: 1;
    flex: 1;
    min-height: 0;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
  }
  /* Enemigos: 60% superior, centrados, grandes, scroll horizontal si hay varios */
  body.combat-ui-active #combatView > .grid > div:last-child {
    order: 1;
    flex: 0 0 60%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.combat-ui-active #combatView #combatEnemyList {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 140px;
    min-width: 100%;
    gap: 8px;
    padding-bottom: 4px;
  }
  body.combat-ui-active #combatView #combatEnemyList .combat-slot {
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 180px;
    min-height: 120px;
  }
  body.combat-ui-active #combatView #combatEnemyList .combat-slot-empty {
    min-width: 80px;
  }
  /* Grupo (Party): 40% inferior, cuadrícula 3x2, barras HP horizontales grandes */
  body.combat-ui-active #combatView > .grid > div:first-child {
    order: 2;
    flex: 0 0 40%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.combat-ui-active #combatView #combatPartyList {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    min-height: 100px;
    flex: 1;
  }
  body.combat-ui-active #combatView #combatPartyList .combat-slot {
    min-height: 72px;
  }
  body.combat-ui-active #combatView #combatPartyList .combat-slot-bars {
    flex-direction: column;
    gap: 2px;
  }
  body.combat-ui-active #combatView #combatPartyList .combat-slot [style*="height"] {
    min-height: 10px !important;
    height: 12px !important;
  }
  /* Log: colapsable, 3 líneas visibles o colapsado */
  #combat-log {
    order: 2;
    min-height: 36px;
    max-height: 80px;
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    flex-shrink: 0;
    overflow: visible;
  }
  #combat-log #combatLogBox {
    min-height: 0;
    max-height: 4.5em;
    overflow-y: auto;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.4;
  }
  #combat-log.collapsed {
    min-height: 36px;
    max-height: 36px;
  }
  #combat-log.collapsed #combatLogBox {
    display: none !important;
  }
  .combat-slots-allies .combat-slot,
  .combat-slots-enemies .combat-slot {
    min-height: 72px;
  }
  .combat-slot-inner {
    min-height: 72px;
    padding: 4px 6px;
  }
  #autoCombatBtn,
  #farmingModeBtn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Botones Taberna: área táctil 44px */
.tavern-hire-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Proyectiles VFX */
#combatView {
  position: relative;
}
.combat-vfx-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}
/* Muerte: mismo frame que floaty final */
.combat-card-wrapper.combat-dead {
  animation: combatDeathPulse 0.3s ease-out forwards;
}
@keyframes combatDeathPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
  100% { opacity: 0.6; transform: scale(1); }
}

.combat-projectile {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: -8px;
  margin-top: -8px;
  box-shadow: 0 0 12px currentColor;
  animation: projectileFly 0.4s ease-out forwards;
}
@keyframes projectileFly {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0));
    opacity: 0.3;
  }
}

/* Lay on Hands - partículas doradas */
.combat-loh-particle {
  position: absolute;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  pointer-events: none;
  animation: lohParticleFly 0.5s ease-out forwards;
}
@keyframes lohParticleFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) scale(0.3);
    opacity: 0;
  }
}

/* VFX universal */
.combat-vfx {
  position: absolute;
  margin-left: -8px;
  margin-top: -8px;
  pointer-events: none;
}
.combat-vfx-melee {
  width: 24px;
  height: 4px;
  background: linear-gradient(90deg, #eab308 0%, #fef08a 50%, transparent 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px #eab308;
  animation: vfxMeleeSlash 0.18s ease-out forwards;
}
/* Espada / Corte (Guerrero, Paladín, Monje) */
.combat-vfx-sword {
  width: 28px;
  height: 5px;
  background: linear-gradient(90deg, #eab308 0%, #fef08a 40%, #ca8a04 80%, transparent 100%);
  border-radius: 1px;
  box-shadow: 0 0 10px #eab308, 0 0 4px #fef08a;
  animation: vfxSwordSlash 0.18s ease-out forwards;
}
@keyframes vfxSwordSlash {
  0% { transform: translate(0, 0) scaleX(0.2); opacity: 1; }
  100% { transform: translate(var(--to-x, 0), var(--to-y, 0)) scaleX(1); opacity: 0.85; }
}
/* Daga (Rogue / Pícaro) */
.combat-vfx-dagger {
  width: 16px;
  height: 3px;
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 60%, transparent 100%);
  border-radius: 1px;
  box-shadow: 0 0 6px #475569;
  animation: vfxDaggerStab 0.14s ease-out forwards;
}
@keyframes vfxDaggerStab {
  0% { transform: translate(0, 0) scaleX(0.5); opacity: 1; }
  100% { transform: translate(var(--to-x, 0), var(--to-y, 0)) scaleX(1); opacity: 0.9; }
}
/* Colmillos / Dientes (animales: Lobo, Cocodrilo, etc.) */
.combat-vfx-fangs {
  width: 22px;
  height: 12px;
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 50%, #475569 100%);
  clip-path: polygon(0 100%, 25% 0, 50% 60%, 75% 0, 100% 100%);
  box-shadow: 0 0 8px #64748b, inset 0 1px 0 rgba(255,255,255,0.3);
  animation: vfxFangsBite 0.16s ease-out forwards;
}
@keyframes vfxFangsBite {
  0% { transform: translate(0, 0) scale(0.6); opacity: 1; }
  100% { transform: translate(var(--to-x, 0), var(--to-y, 0)) scale(1); opacity: 0.85; }
}
.combat-vfx-monk {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 0 12px #fbbf24, 0 0 24px #f59e0b;
  animation: vfxMonkBurst 0.15s ease-out forwards;
}
@keyframes vfxMonkBurst {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  50% {
    transform: translate(calc(var(--to-x, 0) * 0.5), calc(var(--to-y, 0) * 0.5)) scale(1.2);
    opacity: 0.9;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) scale(0.8);
    opacity: 0.6;
  }
}
.combat-bard-note {
  position: absolute;
  font-size: 1.2em;
  font-weight: bold;
  pointer-events: none;
  z-index: 18;
  animation: bardNoteFloat 1.8s ease-out forwards;
  text-shadow: 0 0 8px currentColor;
}
@keyframes bardNoteFloat {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-15px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
}
@keyframes vfxMeleeSlash {
  0% {
    transform: translate(0, 0) scaleX(0.3);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) scaleX(1);
    opacity: 0.8;
  }
}
.combat-vfx-arrow {
  width: 20px;
  height: 4px;
  background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%);
  clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 70%);
  box-shadow: 0 0 6px #64748b;
  animation: vfxProjectileFly 0.35s ease-out forwards;
}
.combat-vfx-projectile {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
  animation: vfxProjectileFly 0.4s ease-out forwards;
}
@keyframes vfxProjectileFly {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0));
    opacity: 0.3;
  }
}

/* Resaltado de atributos prioritarios por clase (creación de personaje) */
.attr-row-priority {
  border: 2px solid rgba(245, 158, 11, 0.9) !important;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), inset 0 0 12px rgba(245, 158, 11, 0.08);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(180, 83, 9, 0.06) 100%) !important;
}

/* Panel informativo del Atlas - pergamino/piedra oscura con bordes decorados */
.atlas-zone-panel {
  background: linear-gradient(145deg, #1c1917 0%, #292524 30%, #1c1917 100%) !important;
  background-image:
    linear-gradient(rgba(120, 53, 15, 0.15) 0%, transparent 50%),
    linear-gradient(145deg, #1c1917 0%, #292524 30%, #1c1917 100%) !important;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(180, 83, 9, 0.3),
    0 0 30px rgba(120, 53, 15, 0.4);
  position: relative;
}
.atlas-zone-panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 0.6rem;
  pointer-events: none;
}
.atlas-zone-panel h2 {
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Atlas interactivo - mapa de Antonica */
.atlas-map-container {
  aspect-ratio: 16 / 10;
  min-height: 280px;
  max-height: 70vh;
}
.atlas-map-bg {
  min-height: 100%;
  background-image: url('./assets/images/mapa_antonica.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  z-index: 0;
}
.atlas-map-overlay {
  background: transparent !important;
}
.atlas-map-points {
  position: absolute;
  inset: 0;
  z-index: 10;
}
.atlas-map-point-wrapper {
  z-index: 20;
}
.atlas-map-point {
  cursor: pointer;
  position: relative;
  z-index: 20;
}
@media (max-width: 768px) {
  .atlas-map-container {
    min-height: 240px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .atlas-map-point {
    min-width: 48px;
    min-height: 48px;
    font-size: 10px;
  }
}
