/* MMORPG Experience — estilos RPG (v0.2.3) */

/* D-MINIMIZAR-F3 D-MF3-2 — aqui iba el @import de Google Fonts (Cinzel, Cinzel Decorative, EB Garamond, MedievalSharp, Montserrat, Inter y Uncial Antiqua, que no usaba nadie): las letras salen ahora de fuentes.css, que index.html enlaza antes que esta hoja. */

/* Variables de tema (por si se quita Tailwind más adelante) */
:root {
  /* v0.2.0 — espada oficial en assets/cursors/sword.png */
  --rpg-cursor-sword: url("./assets/cursors/sword.png") 4 2, auto;
  --rpg-dark: #050816;
  --rpg-card: #101827;
  --rpg-accent: #f59e0b;
  --rpg-accent-soft: #78350f;
  --mobile-breakpoint: 768px;
  /* Fuentes de emoji — deben aparecer después de Cinzel/Montserrat y antes del genérico final */
  --rpg-emoji-stack: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
  --rpg-font-display: "MedievalSharp", cursive;
  --rpg-font-display-alt: "Cinzel Decorative", "Cinzel", Georgia, var(--rpg-emoji-stack), serif;
  /* D-LETRA D-LT-1 — las dos letras salen de ui/tokens.css (--ui-fuente-titulo / --ui-fuente-texto); aquí sólo se enlazan */
  --rpg-font-ui: var(--ui-fuente-titulo, "Cinzel", Georgia, "Times New Roman", var(--rpg-emoji-stack), serif);
  --rpg-font-body: var(--ui-fuente-texto, "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, var(--rpg-emoji-stack), sans-serif);
  --rpg-gold-frame-border: 4px;
  --rpg-gold-gradient-frame: linear-gradient(145deg, #b8860b 0%, #f9f295 32%, #d4af37 55%, #8a7018 88%, #b8860b 100%);
  --rpg-glass-fill: linear-gradient(rgba(10, 15, 25, 0.88), rgba(10, 15, 25, 0.88));
  /* D-UI-2b-COLOR — color reservado de AGRO (única fuente; borde y glow del anillo de taunt lo derivan) */
  --vfx-aggro: #ec4899;
}

/* ——— v0.2.0 — cursor espada universal (fondo, chat, cristal); refuerzo bajo #rpg-root vs Tailwind ——— */
*,
*::before,
*::after {
  cursor: url("./assets/cursors/sword.png") 4 2, auto !important;
}

html,
body {
  cursor: url("./assets/cursors/sword.png") 4 2, auto !important;
  /* Scroll del documento hasta pie / Crónicas; solo recortamos desborde horizontal */
  overflow-x: hidden;
  overflow-y: auto;
}

/* Raíz: sin capar altura — el viewport escrolea con el body; clip solo en X */
#rpg-root {
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

#logBox,
#logBox *,
#chroniclesSection #logBox,
#chroniclesSection #logBox * {
  cursor: url("./assets/cursors/sword.png") 4 2, auto !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select,
[contenteditable="true"],
#rpg-root.rpg-cursor-sword-root input[type="text"],
#rpg-root.rpg-cursor-sword-root input[type="email"],
#rpg-root.rpg-cursor-sword-root input[type="password"],
#rpg-root.rpg-cursor-sword-root input[type="search"],
#rpg-root.rpg-cursor-sword-root input[type="url"],
#rpg-root.rpg-cursor-sword-root input[type="tel"],
#rpg-root.rpg-cursor-sword-root input[type="number"],
#rpg-root.rpg-cursor-sword-root textarea,
#rpg-root.rpg-cursor-sword-root select,
#rpg-root.rpg-cursor-sword-root [contenteditable="true"] {
  cursor: text !important;
}

/* Gana a Tailwind `cursor-*` (!important bajo #rpg-root) */
#rpg-root.rpg-cursor-sword-root,
#rpg-root.rpg-cursor-sword-root *,
#rpg-root.rpg-cursor-sword-root *::before,
#rpg-root.rpg-cursor-sword-root *::after {
  cursor: url("./assets/cursors/sword.png") 4 2, auto !important;
}

/* Sensación "cliente de juego": evita selección accidental en la UI de juego */
#game-container,
#game-container *:not(input):not(textarea):not(select):not(option):not([contenteditable="true"]) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Excepción: WebView Android no enfoca inputs si un ancestro fuerza user-select: none (p. ej. #game-container la heredan). */
input,
textarea,
select,
[contenteditable] {
  -webkit-user-select: text !important;
  user-select: text !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: text !important;
}

/* Base de app: usar clase body.rpg-app en index.html (sin Tailwind font-sans) para que la fuente no la pise .font-sans */
body.rpg-app {
  position: relative;
  background-color: #020617;
  font-family: var(--rpg-font-body) !important;
}

/* Imagen de fondo: blur + oscuro en esta capa (estable). NO usar backdrop-filter en #rpg-root:
   con fondo fixed detrás provoca parpadeo negro constante en Chrome/Edge al redibujar. */
body.rpg-app::before {
  content: "";
  position: fixed;
  inset: -14px;
  z-index: -1;
  /* D-OPCIONES-REDISENO A-2 — antes fondo.png difuminado (casi no se veía: lo tapan el marco y cada pantalla). */
  background: radial-gradient(ellipse at 50% 40%, #1d140a 0%, #0b0805 60%, #050403 100%);
  pointer-events: none;
}

body.rpg-app #rpg-root {
  background: transparent;
}

button,
a,
[role='button'] {
  transition: filter 0.15s ease;
  cursor: url("./assets/cursors/sword.png") 4 2, auto !important;
}

button:hover,
a:hover {
  filter: brightness(1.2);
}

/* ——— Nombre del juego + piezas “heroicas” (MedievalSharp, degradado oro) ———
   No usar en h2/h3 de sección: para eso está .rpg-section-title (Cinzel). */
.text-rpgName {
  font-family: var(--rpg-font-display) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.2;
  background: linear-gradient(to bottom, #ffffff 0%, #fde68a 40%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Títulos de sección (Cinzel), como “Crónicas del reino” / lemas en la referencia del splash */
.rpg-section-title {
  font-family: var(--rpg-font-ui);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

/* Nombres de personajes (misma familia que títulos heroicos, sin degradado obligatorio) */
.rpg-character-name {
  font-family: var(--rpg-font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Tarjeta splash con marco dorado CSS (opcional; el splash usa borde fino vía #splashScreen #splashLoadingCard) */
.splash-panel-framed {
  border: 3px solid transparent;
  border-radius: 1rem;
  background: linear-gradient(rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.5)) padding-box,
    var(--rpg-gold-gradient-frame) border-box;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.88),
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Títulos de paneles y secciones (menú) — Cinzel, oro claro */
.rpg-menu-title {
  font-family: var(--rpg-font-ui);
  color: #fef3c7;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
@media (min-width: 1024px) {
  h2.rpg-menu-title {
    font-size: 1.125rem !important;
    line-height: 1.35;
  }
  h2.rpg-menu-title.rpg-menu-title--combat {
    font-size: 1.25rem !important;
  }
}
.rpg-menu-title--combat {
  color: #fecaca;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
  border-bottom-color: rgba(248, 113, 113, 0.4);
}
/* Encabezado de zona en combate: nombre + FASE / OLEADA estilo RPG clásico */
.combat-zone-title-eq {
  font-family: var(--rpg-font-ui);
  color: #fde68a;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.35), 0 1px 0 rgba(0, 0, 0, 0.85);
  border-bottom-color: rgba(251, 191, 36, 0.35);
}
.combat-zone-subtitle-eq {
  font-family: var(--rpg-font-ui);
  letter-spacing: 0.06em;
}
.combat-zone-subtitle-eq .combat-header-phase {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.92em;
  color: var(--rpg-accent);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}
.combat-zone-subtitle-eq .combat-header-sep {
  color: rgba(180, 83, 9, 0.55);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.combat-zone-subtitle-eq .combat-header-wave {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.88em;
  color: #cbd5e1;
}
/* Cabecera de combate: zona + fase + oleada en una línea (sans-serif, sin sombra) */
.combat-zone-headline {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1.4rem;
  line-height: 1.35;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  text-shadow: none;
  margin: 0;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}
.rpg-heading-cinzel {
  font-family: var(--rpg-font-ui);
}

.text-rpgStat {
  font-family: var(--rpg-font-body);
  color: #d1d5db;
}
.text-rpgLevel {
  color: #ef4444;
  font-weight: 700;
}
.text-rpgGuild {
  color: #f59e0b;
  font-weight: 600;
}

/* Botón de emergencia (login / creación): limpieza localStorage + caches */
.btn-rpg {
  font-family: var(--rpg-font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(15, 23, 42, 0.85);
  color: #fcd34d;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-rpg:hover {
  background: rgba(120, 53, 15, 0.35);
  border-color: rgba(251, 191, 36, 0.75);
  color: #fef3c7;
}
.btn-rpg:active {
  transform: scale(0.98);
}

/* Crónicas / chat ciudad: sans legible (sin decorativas) */
#logBox.chronicle-log-panel {
  font-family: var(--rpg-font-body);
  font-size: 15px;
  line-height: 1.5;
  color: #e2e8f0;
}
/* Cambia los bloques de font-family que tienes seleccionados por esto: */

#logBox.chronicle-log-panel,
#chroniclesSection #logBox,
#chroniclesSection #logBox * {
    /* Forzamos Montserrat para máxima legibilidad en el chat */
    font-family: var(--ui-fuente-texto) !important;
    text-transform: none !important; /* Por si alguna clase superior ponía todo en mayúsculas */
    letter-spacing: 0.5px;
}

.rpg-chat-speaker {
    font-family: var(--ui-fuente-texto) !important;
    font-weight: 700; /* Mantenemos el nombre en negrita para que resalte */
    color: #fbbf24; /* Ese dorado está genial */
}
#cityChatInput {
  font-family: var(--rpg-font-body);
}
#chronicleScrollContent.rpg-chronicle-scroll-body {
  font-family: var(--rpg-font-body);
  font-size: 15px;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Botones de acción (Cinzel + blanco) */
main button.rpg-gradient-btn,
main button.rpg-press-3d,
main #cityChatSendBtn,
main #splashEnterBtn {
  font-family: var(--rpg-font-ui);
  font-weight: 700;
}
/* Cristal + borde ámbar. Nunca fijar ancho aquí: .rpg-panel / .bg-rpgCard van en header, grids y
   modales; width/padding/flex con !important rompía Tailwind (todo el sitio ~320px y header siempre columna). */
.rpg-panel,
.rpg-panel.bg-rpgCard,
.bg-rpgCard {
  background: rgba(10, 15, 25, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 0.75rem !important;
}

/* Marco dorado (gradiente CSS) + cristal — Selección / Creación / Opciones */
.rpg-medieval-frame {
  position: relative;
  border: var(--rpg-gold-frame-border) solid transparent !important;
  background: var(--rpg-glass-fill) padding-box, var(--rpg-gold-gradient-frame) border-box !important;
  background-clip: padding-box, border-box !important;
  background-origin: padding-box, border-box !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.92),
    0 12px 40px rgba(0, 0, 0, 0.5) !important;
  border-radius: 0 !important;
}

/* Skeleton (login / carga) */
@keyframes rpg-skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}
.rpg-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: linear-gradient(
    110deg,
    rgba(30, 41, 59, 0.85) 0%,
    rgba(51, 65, 85, 0.75) 35%,
    rgba(212, 175, 55, 0.22) 50%,
    rgba(51, 65, 85, 0.75) 65%,
    rgba(30, 41, 59, 0.85) 100%
  );
  background-size: 200% 100%;
  animation: rpg-skeleton-shimmer 1.35s ease-in-out infinite;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.15);
}

@keyframes rpg-menu-stagger-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#heroChoice:not(.hidden) > * {
  opacity: 0;
  animation: rpg-menu-stagger-in 0.55s ease-out forwards;
}
#heroChoice:not(.hidden) > *:nth-child(1) {
  animation-delay: 0.05s;
}
#heroChoice:not(.hidden) > *:nth-child(2) {
  animation-delay: 0.12s;
}
#heroChoice:not(.hidden) > *:nth-child(3) {
  animation-delay: 0.19s;
}
#heroChoice:not(.hidden) > *:nth-child(4) {
  animation-delay: 0.26s;
}
#heroChoice:not(.hidden) > *:nth-child(5) {
  animation-delay: 0.33s;
}
#heroChoice:not(.hidden) > *:nth-child(6) {
  animation-delay: 0.4s;
}
#heroChoice:not(.hidden) > *:nth-child(7) {
  animation-delay: 0.47s;
}

/* Título de crónicas de ciudad: MedievalSharp; el cuerpo del log sigue en --rpg-font-body */
#chroniclesSection > .flex > h2.rpg-menu-title {
  font-family: var(--rpg-font-display) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #fef3c7;
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

/* Cartas de combate: ancho = celda de la rejilla (2 columnas); 300px fijos rompía el layout y solapaba fichas */
#combatPartyList .combat-slot-inner.bg-rpgCard,
#combatEnemyList .combat-slot-inner.bg-rpgCard {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0.5rem 0.45rem !important;
  gap: 0.5rem !important;
}

/* Solo el slot (flex item) lleva min-width:0 para truncar texto; el inner al 100% no debe forzar min 0 */
#combatPartyList .combat-party-row .combat-slot:not(.combat-slot-pet),
#combatEnemyList .combat-slot {
  min-width: 0;
}

/* El JS pone min-width:150px en el nombre; en 2 columnas estrechas fuerza solapamiento */
#combatEnemyList .enemy-name-cell {
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Iconos de moneda / UI nítidos en pantallas densas */
img.h-5.w-5,
img.h-6.w-6.object-contain,
img.object-contain {
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

/* Botones: Cinzel negrita, texto blanco puro */
.rpg-gradient-btn {
  font-family: var(--rpg-font-ui);
  font-weight: 700;
  background-image: linear-gradient(180deg, var(--rpg-accent-soft) 0%, var(--rpg-accent) 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  border-bottom: 3px solid rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.12s ease-out;
}
.rpg-gradient-btn:hover {
  filter: brightness(1.06);
}
.rpg-gradient-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px !important;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

/* Mismo relieve 3D sin cambiar el color del gradiente (p. ej. Comenzar aventura, importar) */
.rpg-press-3d {
  font-family: var(--rpg-font-ui);
  font-weight: 700;
  color: #ffffff !important;
  border-bottom: 3px solid rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.rpg-press-3d:active {
  transform: translateY(2px);
  border-bottom-width: 1px !important;
  box-shadow: none;
}

/* Controles de combate: mismo relieve; conservan matices vía filter sobre el gradiente base */
#combatControlBar .combat-ctrl-btn {
  font-family: var(--rpg-font-ui);
  font-weight: 700;
  color: #ffffff !important;
  background-image: linear-gradient(180deg, var(--rpg-accent-soft) 0%, var(--rpg-accent) 100%);
  border-bottom: 3px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease-out, filter 0.12s ease-out;
}
#combatControlBar .combat-ctrl-auto {
  filter: hue-rotate(260deg) saturate(1.15);
}
#combatControlBar .combat-ctrl-farming {
  filter: saturate(0.35) brightness(0.85);
}
#combatControlBar .combat-ctrl-city {
  filter: hue-rotate(-5deg) saturate(0.9);
}
#combatControlBar .combat-ctrl-btn:hover {
  filter: brightness(1.08);
}
#combatControlBar .combat-ctrl-auto:hover {
  filter: hue-rotate(260deg) saturate(1.15) brightness(1.08);
}
#combatControlBar .combat-ctrl-farming:hover {
  filter: saturate(0.35) brightness(0.95);
}
#combatControlBar .combat-ctrl-city:hover {
  filter: hue-rotate(-5deg) saturate(0.9) brightness(1.08);
}
#combatControlBar .combat-ctrl-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

/* Nodo de recurso (post-oleada): clic central para recolectar */
#combatView .combat-resource-node-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.55) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 72%);
  opacity: 1;
  transition: opacity 0.38s ease-out;
}
#combatView .combat-resource-node-layer--fading {
  opacity: 0;
  pointer-events: none;
}
#combatView .combat-resource-node-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 1.25rem 0.95rem;
  max-width: min(92%, 22rem);
  font-family: var(--rpg-font-ui, inherit);
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
  text-align: center;
  cursor: pointer;
  border-radius: 0.85rem;
  border: 2px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 8px 28px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(245, 158, 11, 0.18);
  transition: transform 0.1s ease-out, filter 0.12s ease-out, border-color 0.12s ease-out, box-shadow 0.2s ease-out;
}
#combatView .combat-resource-node-btn:hover {
  filter: brightness(1.08);
  border-color: rgba(252, 211, 77, 0.75);
}
#combatView .combat-resource-node-btn:active {
  transform: scale(0.98);
}
#combatView .combat-resource-node-label {
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
#combatView .combat-resource-node-hint {
  font-size: 0.72em;
  font-weight: 600;
  color: rgba(203, 213, 225, 0.9);
  letter-spacing: 0.06em;
}

/* Barra de tiempo del nodo (5 s) + urgencia últimos 2 s */
#combatView .combat-resource-node-timerbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border-radius: 0 0 0.65rem 0.65rem;
  pointer-events: none;
}
#combatView .combat-resource-node-timerbar-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, #b45309, #fde68a);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
  animation-name: combat-resource-node-bar-shrink;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes combat-resource-node-bar-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

#combatView .combat-resource-node-btn--urgent {
  border-color: rgba(248, 113, 113, 0.72);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 8px 28px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(248, 113, 113, 0.35);
}
#combatView .combat-resource-node-btn--urgent .combat-resource-node-label,
#combatView .combat-resource-node-btn--urgent .combat-resource-node-hint {
  animation: combat-resource-node-urgent-pulse 0.28s ease-in-out infinite alternate;
}
@keyframes combat-resource-node-urgent-pulse {
  from {
    opacity: 1;
    filter: brightness(1);
  }
  to {
    opacity: 0.68;
    filter: brightness(1.2);
  }
}

/* Cristales de esencia: nodo post-oleada + destello / floaty de hallazgo */
#combatView .combat-resource-node-layer--essence {
  background: radial-gradient(ellipse at center, rgba(2, 6, 23, 0.78) 0%, rgba(15, 23, 42, 0.42) 52%, transparent 76%);
}
#combatView .combat-resource-node-btn--essence {
  border-width: 2px;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.99) 100%);
}
#combatView .combat-resource-node-btn--ess-azul {
  border-color: rgba(34, 211, 238, 0.62);
}
#combatView .combat-resource-node-btn--ess-amarilla {
  border-color: rgba(250, 204, 21, 0.58);
}
#combatView .combat-resource-node-btn--ess-purpura {
  border-color: rgba(192, 132, 252, 0.58);
}
#combatView .combat-resource-node-btn--ess-naranja {
  border-color: rgba(251, 146, 60, 0.58);
}

#combatView .combat-essence-hallazgo-burst {
  position: absolute;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  border-radius: 50%;
  transform: scale(0.35);
  opacity: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.22) 0%, transparent 36%),
    radial-gradient(circle at 50% 50%, var(--ess-ring, rgba(148, 163, 184, 0.4)) 0%, transparent 58%);
  box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.08), var(--ess-glow, 0 0 72px rgba(34, 211, 238, 0.55));
  transition:
    opacity 0.32s ease-out,
    transform 0.55s cubic-bezier(0.18, 0.95, 0.22, 1);
}
#combatView .combat-essence-hallazgo-burst--on {
  opacity: 1;
  transform: scale(1.12);
}

#combatView .combat-loot-floaty-essence-hallazgo {
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.65rem 1.15rem 0.78rem;
  font-size: clamp(1.05rem, 3.8vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  border-width: 2px;
  background: rgba(2, 6, 23, 0.9);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
}
#combatView .combat-essence-hallazgo-kicker {
  font-size: 0.55em;
  font-weight: 900;
  letter-spacing: 0.32em;
  opacity: 0.96;
}
#combatView .combat-essence-hallazgo-qty {
  font-size: 1.02em;
  font-weight: 800;
}
@keyframes combat-essence-hallazgo-float {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.82);
  }
  11% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
  }
  35% {
    opacity: 1;
    transform: translateY(-32px) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(-118px) scale(0.9);
  }
}
#combatView .combat-loot-floaty-essence-hallazgo-animate {
  animation: combat-essence-hallazgo-float 3.15s ease-out forwards;
}

/* Herrería — almacén maestro (iconos + contadores, v0.8.3) */
.forge-almacen-master {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.94) 0%, rgba(2, 6, 23, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(251, 191, 36, 0.07),
    0 4px 18px rgba(0, 0, 0, 0.45);
}
.forge-almacen-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(252, 211, 77, 0.92);
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(180, 83, 9, 0.28);
}
.forge-almacen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.35rem, 1fr));
  gap: 0.45rem;
  max-width: 100%;
}
@media (min-width: 480px) {
  .forge-almacen-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (min-width: 640px) {
  .forge-almacen-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.forge-almacen-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.35rem;
  padding: 0.4rem 0.3rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(161, 98, 7, 0.35);
  background: rgba(0, 0, 0, 0.42);
  cursor: help;
  transition: border-color 0.12s ease-out, background 0.12s ease-out;
}
.forge-almacen-tile:hover {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(15, 23, 42, 0.55);
}
.forge-almacen-icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}
.forge-almacen-count {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fde68a;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.forge-refinery-modern {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 0.85rem;
}
.forge-refinery-modern-list,
.forge-refinery-modern-detail {
  border-radius: 0.85rem;
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: rgba(2, 6, 23, 0.62);
  padding: 0.75rem;
}
.forge-refinery-modern-detail {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.forge-refinery-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(252, 211, 77, 0.95);
  margin-bottom: 0.5rem;
}
.forge-refinery-title--sub {
  margin-top: 0.75rem;
}
.forge-refinery-merc-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 24rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}
.forge-refinery-merc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(71, 85, 105, 0.62);
  background: rgba(2, 6, 23, 0.66);
  padding: 0.5rem 0.58rem;
  color: #e5e7eb;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.forge-refinery-merc-row:hover {
  border-color: rgba(217, 119, 6, 0.56);
}
.forge-refinery-merc-row--selected {
  border-color: rgba(14, 165, 233, 0.72);
  background: rgba(8, 47, 73, 0.56);
}
.forge-refinery-merc-row--combat {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.12) 0 7px,
    rgba(15, 23, 42, 0.14) 7px 14px
  );
}
.forge-refinery-merc-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fef3c7;
}
.forge-refinery-merc-meta {
  font-size: 0.62rem;
  color: #94a3b8;
}
.forge-refinery-skill-row {
  border-radius: 0.75rem;
  border: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(2, 6, 23, 0.56);
  padding: 0.58rem;
  margin-bottom: 0.5rem;
}
.forge-refinery-skill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}
.forge-refinery-skill-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fef3c7;
}
.forge-refinery-tier-badge {
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.62);
  padding: 0.12rem 0.44rem;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cbd5e1;
}
.forge-refinery-tier-badge--avanzado,
.forge-refinery-tier-badge--especialista,
.forge-refinery-tier-badge--maestro {
  border-color: rgba(192, 132, 252, 0.62);
  color: #e9d5ff;
  background: rgba(88, 28, 135, 0.24);
}
.forge-refinery-progress-track {
  margin-top: 0.42rem;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(51, 65, 85, 0.58);
  overflow: hidden;
}
.forge-refinery-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 48%, #22d3ee 100%);
}
.forge-refinery-skill-meta {
  margin-top: 0.32rem;
  font-size: 0.64rem;
  color: #94a3b8;
  line-height: 1.35;
}
.forge-refinery-action-btn {
  margin-top: 0.5rem;
  width: 100%;
  border-radius: 0.58rem;
  border: 1px solid rgba(217, 119, 6, 0.56);
  background: rgba(120, 53, 15, 0.4);
  color: #fef3c7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.34rem 0.5rem;
}
.forge-refinery-action-btn--selected {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(8, 47, 73, 0.62);
}
.forge-refinery-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(71, 85, 105, 0.62);
  background: rgba(15, 23, 42, 0.55);
}
.forge-refinery-levels {
  border-radius: 0.75rem;
  border: 1px solid rgba(71, 85, 105, 0.58);
  background: rgba(2, 6, 23, 0.56);
  overflow: hidden;
  min-height: 13rem;
}
.forge-refinery-info-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.forge-refinery-info-tab {
  border-radius: 0.55rem;
  border: 1px solid rgba(71, 85, 105, 0.62);
  background: rgba(2, 6, 23, 0.66);
  color: #cbd5e1;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.52rem;
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
.forge-refinery-info-tab:hover {
  border-color: rgba(217, 119, 6, 0.56);
  color: #fef3c7;
}
.forge-refinery-info-tab--active {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(8, 47, 73, 0.62);
  color: #e0f2fe;
}
.forge-refinery-info-panel {
  min-height: 13rem;
}
.forge-refinery-level-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.58rem;
  font-size: 0.62rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  line-height: 1.35;
}
.forge-refinery-level-item span:last-child {
  text-align: right;
  color: #94a3b8;
}
.forge-refinery-level-item:last-child {
  border-bottom: 0;
}
.forge-refinery-empty {
  border: 1px dashed rgba(100, 116, 139, 0.52);
  border-radius: 0.7rem;
  padding: 0.8rem;
  font-size: 0.68rem;
  color: #94a3b8;
}
@media (max-width: 900px) {
  .forge-refinery-modern {
    grid-template-columns: 1fr;
  }
  .forge-refinery-info-panel {
    min-height: 0;
  }
}

/* Esencias de herrería (orbes por color de rareza de mob) */
.forge-essence-gem {
  display: inline-block;
  width: 1.15rem;
  height: 1.35rem;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(0, 0, 0, 0.45);
  vertical-align: middle;
}
.forge-essence-gem--inline {
  width: 0.85rem;
  height: 1rem;
  flex-shrink: 0;
}
.forge-essence-gem--azul {
  background: radial-gradient(circle at 35% 30%, #bae6fd 0%, #0284c7 42%, #0c4a6e 100%);
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 0 12px rgba(56, 189, 248, 0.35);
}
.forge-essence-gem--amarilla {
  background: radial-gradient(circle at 35% 30%, #fef9c3 0%, #eab308 45%, #713f12 100%);
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.45),
    0 0 12px rgba(250, 204, 21, 0.35);
}
.forge-essence-gem--purpura {
  background: radial-gradient(circle at 35% 30%, #e9d5ff 0%, #9333ea 42%, #4c1d95 100%);
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    0 0 12px rgba(192, 132, 252, 0.4);
}
.forge-essence-gem--naranja {
  background: radial-gradient(circle at 35% 30%, #ffedd5 0%, #ea580c 42%, #7c2d12 100%);
  box-shadow:
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    0 0 12px rgba(251, 146, 60, 0.4);
}

/* Barras de vida en combate: tubo de energía */
#combatView .bar-background-hp {
  position: relative;
  height: 20px;
  min-height: 20px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  background-color: #0f172a;
}
#combatView .bar-fill-hp {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #047857 0%, #10b981 50%, #4ade80 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: width 0.25s ease-out, background 0.5s ease;
}
#combatView .bar-hp-pct-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(10px, 2.4vw, 12px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  /* ~Tailwind drop-shadow-md + legibilidad sobre el fill */
  filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.25)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));
  pointer-events: none;
  z-index: 2;
}
#combatView .bar-row-hp .bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
}
#combatView .bar-hp-fraction {
  font-size: 9px;
  font-weight: 600;
  color: rgba(209, 213, 219, 0.85);
  text-transform: none;
}

#combatView .bar-row-mp .bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
}
#combatView .bar-mp-fraction {
  font-size: 9px;
  font-weight: 600;
  color: rgba(209, 213, 219, 0.85);
  text-transform: none;
}

/* HP/MP: texto superpuesto sobre la barra (ahorra altura en tarjetas) */
#combatView .bar-track-overlay {
  position: relative;
}
#combatView .bar-row-hp--overlay .bar-track-overlay > .bar-fill-hp,
#combatView .bar-row-mp--overlay .bar-track-overlay > .bar-fill-mp {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100% !important;
  max-width: 100%;
  z-index: 0;
}
#combatView .bar-row-hp--overlay .bar-track-overlay > .bar-fill-hp {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
#combatView .bar-hp-mp-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 4px;
  z-index: 2;
  pointer-events: none;
  font-size: clamp(7px, 2.2vw, 10px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92), 0 0 4px rgba(0, 0, 0, 0.85);
}
#combatView .bar-hp-mp-overlay .bar-hp-fraction,
#combatView .bar-hp-mp-overlay .bar-mp-fraction {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
#combatView .bar-hp-mp-overlay--mp {
  color: #e0e7ff;
}
#combatView .bar-overlay-tag {
  opacity: 0.9;
  text-transform: uppercase;
  font-size: 0.78em;
  font-weight: 800;
}

/* Cabecera compacta: nombre + buffs en fila */
#combatView .combat-compact-header-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
#combatView .combat-status-icons--header {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  min-width: 0;
  max-width: 46%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#combatView .combat-status-icons--header::-webkit-scrollbar {
  display: none;
  height: 0;
}
#combatView .combat-status-icon-btn--header {
  font-size: 10px;
  line-height: 1;
  padding: 0;
  min-width: 0;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: help;
  opacity: 0.95;
}

/* Tooltip flotante estados bajo barras (data-tip-*; ver initCombatStatusPillTooltipDelegation) */
#combatStatusTooltipPop.combat-status-tooltip-pop,
.combat-status-tooltip-pop {
  position: fixed;
  z-index: 12150;
  pointer-events: none;
  max-width: min(288px, calc(100vw - 16px));
  padding: 9px 11px;
  border-radius: 6px;
  /* D-TOOLTIP-ORO (2026-10-14) — los tooltips con el estilo del juego (madera oscura y filete dorado), no el azul de antes:
     Miguel lo veía «en muchos sitios» al pasar el ratón. */
  border: 1px solid rgba(224, 178, 82, 0.6);
  background: linear-gradient(170deg, rgba(36, 24, 12, 0.98), rgba(22, 15, 8, 0.98));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 231, 161, 0.08) inset;
  font-size: 12px;
  line-height: 1.4;
  color: #f0e2bf;
  text-align: left;
}
.combat-status-tooltip-pop.hidden {
  display: none !important;
}
.combat-status-tooltip-pop__title {
  font-weight: 700;
  color: #fde68a;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.combat-status-tooltip-pop__body {
  color: #e4d3ad;
  font-size: 11px;
}
.combat-status-tooltip-pop__extra {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(224, 178, 82, 0.25);
  font-size: 10px;
  color: #b9a27a;
  font-variant-numeric: tabular-nums;
}

/* Tooltip global de UI (sustituye title nativo de Windows por estilo del juego) */
#gameGlobalTooltipPop.game-global-tooltip-pop,
.game-global-tooltip-pop {
  position: fixed;
  z-index: 12160;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 16px));
  padding: 9px 11px;
  border-radius: 6px;
  /* D-TOOLTIP-ORO (2026-10-14) — los tooltips con el estilo del juego (madera oscura y filete dorado), no el azul de antes:
     Miguel lo veía «en muchos sitios» al pasar el ratón. */
  border: 1px solid rgba(224, 178, 82, 0.6);
  background: linear-gradient(170deg, rgba(36, 24, 12, 0.98), rgba(22, 15, 8, 0.98));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 231, 161, 0.08) inset;
  font-size: 12px;
  line-height: 1.4;
  color: #f0e2bf;
  text-align: left;
  white-space: pre-line;
}
.game-global-tooltip-pop.hidden {
  display: none !important;
}

/* Franja de estados bajo barras (mouseover → tooltip custom) */
#combatView .combat-status-strip-below {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  min-height: 22px;
}
#combatView .combat-status-strip-below--enemy .combat-status-pill {
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.25);
}
#combatView .combat-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 5px;
  font-size: 13px;
  line-height: 1;
  border-radius: 6px;
  cursor: help;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}
#combatView .combat-status-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.75);
  filter: brightness(1.08);
}
#combatView .combat-status-pill--weaken { border-color: rgba(217, 70, 239, 0.55); box-shadow: 0 0 10px rgba(217, 70, 239, 0.2); }
#combatView .combat-status-pill--tashania { border-color: rgba(167, 139, 250, 0.6); box-shadow: 0 0 10px rgba(167, 139, 250, 0.22); }
#combatView .combat-status-pill--malaise { border-color: rgba(52, 211, 153, 0.5); }
#combatView .combat-status-pill--bardSlow { border-color: rgba(34, 211, 238, 0.55); }
#combatView .combat-status-pill--stun,
#combatView .combat-status-pill--mesmerize { border-color: rgba(250, 204, 21, 0.55); }
#combatView .combat-status-pill--taunted { border-color: rgba(248, 113, 113, 0.55); }
#combatView .combat-status-pill--STR,
#combatView .combat-status-pill--HSTE,
#combatView .combat-status-pill--selos { border-color: rgba(34, 197, 94, 0.45); }
#combatView .combat-status-pill--lightAbsorb,
#combatView .combat-status-pill--paladinArmor,
#combatView .combat-status-pill--paladinDivine { border-color: rgba(250, 204, 21, 0.55); box-shadow: 0 0 10px rgba(250, 204, 21, 0.18); }
#combatView .combat-status-pill--clericBarrier,
#combatView .combat-status-pill--clericCourage,
#combatView .combat-status-pill--clericHeroic { border-color: rgba(52, 211, 153, 0.5); }
#combatView .combat-status-pill--druidSkin { border-color: rgba(74, 222, 128, 0.5); }
#combatView .combat-status-pill--wizOkeils { border-color: rgba(56, 189, 248, 0.55); box-shadow: 0 0 10px rgba(14, 165, 233, 0.2); }
#combatView .combat-status-pill--grimAura,
#combatView .combat-status-pill--skVamp,
#combatView .combat-status-pill--skAcPlus { border-color: rgba(139, 92, 246, 0.5); }
#combatView .combat-status-pill--necro_fear { border-color: rgba(167, 139, 250, 0.5); }
#combatView .combat-status-pill--runeShield { border-color: rgba(244, 114, 182, 0.55); box-shadow: 0 0 10px rgba(244, 114, 182, 0.18); }
#combatView .combat-status-pill--clarity { border-color: rgba(34, 211, 238, 0.45); }
#combatView .combat-status-pill--bardClarify,
#combatView .combat-status-pill--bardCantana,
#combatView .combat-status-pill--bardHymn,
#combatView .combat-status-pill--bardPsalm,
#combatView .combat-status-pill--bardSelosFast { border-color: rgba(6, 182, 212, 0.5); }
#combatView .combat-status-pill--encQuicken { border-color: rgba(232, 121, 249, 0.5); }
#combatView .combat-status-pill--roguePoison,
#combatView .combat-status-pill--rogueDuelist { border-color: rgba(251, 191, 36, 0.5); }
#combatView .combat-status-pill--mnkStone { border-color: rgba(120, 113, 108, 0.55); }
#combatView .combat-status-pill--mnkInner { border-color: rgba(249, 115, 22, 0.5); }
#combatView .combat-status-pill--hunRush,
#combatView .combat-status-pill--hunMagpies,
#combatView .combat-status-pill--hunGuard,
#combatView .combat-status-pill--hunSky,
#combatView .combat-status-pill--hunTrueshot { border-color: rgba(163, 230, 53, 0.45); }
#combatView .combat-status-pill--shaWolf,
#combatView .combat-status-pill--shaInner { border-color: rgba(45, 212, 191, 0.5); }
#combatView .combat-status-pill--PET { border-color: rgba(251, 191, 36, 0.4); }
#combatView .combat-status-pill--defensiveStand { border-color: rgba(96, 165, 250, 0.5); }
#combatView .combat-status-pill--buff { border-color: rgba(148, 163, 184, 0.45); }

/* Swing / ATB: franja fina bajo MP */
#combatView .bar-row-swing {
  display: block;
  margin: 0;
  padding: 0;
  gap: 0;
}
#combatView .bar-row-swing .bar-background-swing {
  width: 100%;
  height: 4px;
  min-height: 4px;
  border-radius: 1px;
  background-color: #1e293b;
  position: relative;
  overflow: hidden;
}
#combatView .bar-row-swing .bar-fill {
  height: 100%;
}

#combatView .combat-card-inner--compact {
  gap: 2px !important;
  padding: 3px 5px !important;
}
#combatView .combat-bars-v49--compact {
  gap: 2px !important;
  flex: 1 1 auto;
  min-height: 0 !important;
}
#combatView .combat-bars-v49--compact.health-bar-container {
  padding: 3px 4px !important;
}

#combatView .combat-slot-inner.combat-slot-ally-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}
#combatView .combat-ally-name.text-rpgName {
  font-size: 0.7rem !important;
  line-height: 1.25 !important;
  letter-spacing: 0.05em !important;
  text-transform: none;
  width: 100%;
  text-align: center;
}
@media (min-width: 640px) {
  #combatView .combat-ally-name.text-rpgName {
    font-size: 0.8rem !important;
  }
}
#combatView .combat-slot-bars--ally {
  min-height: 0 !important;
  flex: 1 1 auto;
}
#combatView .combat-slot-enemy-card {
  min-width: 0;
}

/* Retrato enemigo: priorizar cabeza/torso (assets ~400×500), sin empujar barras */
#combatView #combatEnemyList .combat-card-img-col--enemy {
  overflow: hidden;
  max-height: 120px;
  height: 120px;
  align-self: flex-start;
  flex-shrink: 0;
}
#combatView #combatEnemyList .combat-card-img-col--enemy img {
  width: 100%;
  height: 100%;
  max-height: 120px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Log de combate: viñeta superior (noticias flotantes) */
.combat-log-smart {
  position: relative;
  isolation: isolate;
}
.combat-log-smart::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(5, 8, 22, 0.97), rgba(5, 8, 22, 0.4), transparent);
  pointer-events: none;
  z-index: 3;
  border-radius: 0.75rem 0.75rem 0 0;
}
.combat-log-smart .combat-log-box {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .app-shell {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  #combatControlBar .combat-ctrl-btn {
    font-size: max(16px, 0.875rem);
    min-height: 44px;
  }
  #combatLogBox {
    min-height: 0 !important;
  }
  #combat-log:not(.combat-log-visual-collapsed):not(.collapsed) #combatLogBox {
    max-height: min(42vh, 320px) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
}

@keyframes raid-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-2px, 1px) rotate(-0.2deg); }
  20% { transform: translate(2px, -1px) rotate(0.2deg); }
  30% { transform: translate(-3px, 2px) rotate(-0.3deg); }
  40% { transform: translate(3px, -2px) rotate(0.3deg); }
  50% { transform: translate(-2px, -1px) rotate(-0.2deg); }
  60% { transform: translate(2px, 1px) rotate(0.2deg); }
  70% { transform: translate(-3px, -2px) rotate(-0.3deg); }
  80% { transform: translate(3px, 2px) rotate(0.3deg); }
  90% { transform: translate(-1px, 1px) rotate(-0.1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.shake {
  animation: raid-shake 90ms linear infinite;
}

/* 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;
}

/* 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);
}

/* Botón de ciudad resaltado (pantalla por defecto) */
.city-building-highlight {
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.6);
  border-color: rgba(251, 191, 36, 0.9) !important;
}

/* Roster de aventureros en Guild Hall — scroll para 14 personajes */
.roster-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.8) rgba(30, 41, 59, 0.6);
}
.roster-scroll::-webkit-scrollbar {
  width: 5px;
}
.roster-scroll::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 3px;
}

/* Taberna — Modal de lore de personaje */
.tavern-lore-modal {
  animation: fadeSlideUp 0.18s ease-out both;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.roster-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.8);
  border-radius: 3px;
}

/* Bestiario: contenedor con scroll (30+ enemigos por zona) */
.bestiary-list {
  min-height: 120px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.8) rgba(30, 41, 59, 0.6);
}
/* Scrollbar del Bestiario — delgada y dorada */
.bestiary-list::-webkit-scrollbar {
  width: 4px;
}
.bestiary-list::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 2px;
}
.bestiary-list::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.8);
  border-radius: 2px;
}
.bestiary-list::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 191, 36, 0.9);
}

/* Ficha de detalle del Bestiario: scroll si hay mucho loot/habilidades */
.bestiary-detail {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.8) rgba(30, 41, 59, 0.6);
}
.bestiary-detail::-webkit-scrollbar {
  width: 4px;
}
.bestiary-detail::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 2px;
}
.bestiary-detail::-webkit-scrollbar-thumb {
  background: rgba(217, 119, 6, 0.8);
  border-radius: 2px;
}
.bestiary-detail::-webkit-scrollbar-thumb:hover {
  background: rgba(251, 191, 36, 0.9);
}

/* Encabezado del Bestiario fijo al hacer scroll */
.bestiary-header-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.95));
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

/* 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;
}

/* Platino brillante: degradado metálico para moneda */
.platino-brillante {
  background: linear-gradient(to bottom, #ffffff 0%, #e5e4e2 50%, #b0c4de 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0px 0px 2px rgba(255,255,255,0.5));
}

/* Focus visible para accesibilidad */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--rpg-accent);
  outline-offset: 2px;
}

/* Tácticas / mochila — tipografía legible móvil (v0.8.0) */
.guild-crystal-root .guild-tactics-panel-font,
.guild-crystal-root .guild-tactics-muted-heading {
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.guild-tactics-muted-heading {
  font-weight: 600;
}

/* 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);
}

/* Diario de misiones — bitácora (tipografía como Libro de Tácticas) */
#buildingPanel.building-quest-journal-active {
  background: rgba(12, 10, 8, 0.94);
  border-color: rgba(184, 134, 11, 0.55);
  box-shadow: 0 0 36px rgba(245, 158, 11, 0.12), inset 0 0 40px rgba(0, 0, 0, 0.35);
}

#panel-quest-journal {
  min-height: 280px;
}

#panel-quest-journal,
#panel-quest-journal * {
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.quest-journal-panel {
  position: relative;
  border: 1px solid rgba(120, 90, 45, 0.55);
  border-radius: 0.35rem 0.85rem 0.85rem 0.35rem;
  background:
    linear-gradient(90deg, rgba(58, 48, 32, 0.5) 0%, rgba(58, 48, 32, 0.5) 5px, transparent 5px),
    linear-gradient(165deg, rgba(42, 34, 22, 0.95) 0%, rgba(24, 20, 14, 0.97) 45%, rgba(12, 14, 22, 0.94) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 3px);
  box-shadow:
    inset 0 0 0 1px rgba(251, 191, 36, 0.08),
    inset 0 0 32px rgba(0, 0, 0, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.5),
    -6px 0 18px rgba(0, 0, 0, 0.25);
  padding: 0.85rem 0.95rem 0.95rem 1rem;
}

.quest-journal-panel::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 12%;
  bottom: 12%;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, transparent, rgba(185, 28, 28, 0.35) 15%, rgba(185, 28, 28, 0.45) 50%, rgba(185, 28, 28, 0.28) 85%, transparent);
  pointer-events: none;
  opacity: 0.85;
}

.quest-journal-columns {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

@media (max-width: 640px) {
  .quest-journal-columns {
    grid-template-columns: 1fr;
  }
}

.quest-journal-list-col {
  border-right: 1px solid rgba(184, 134, 11, 0.28);
  padding-right: 0.65rem;
}

@media (max-width: 640px) {
  .quest-journal-list-col {
    border-right: none;
    border-bottom: 1px solid rgba(184, 134, 11, 0.28);
    padding-right: 0;
    padding-bottom: 0.65rem;
  }
}

.quest-journal-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: rgba(251, 191, 36, 0.75);
  margin: 0.35rem 0 0.4rem;
}

.quest-journal-section-title--done {
  margin-top: 0.75rem;
  color: rgba(148, 163, 184, 0.85);
}

.quest-journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quest-journal-list--done .quest-journal-row-title {
  color: rgba(203, 213, 225, 0.9);
}

.quest-journal-row {
  position: relative;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  padding: 0.5rem 2.35rem 0.5rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(120, 90, 40, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: #fde68a;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.quest-journal-row:hover {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(69, 52, 24, 0.35);
}

.quest-journal-row--selected {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
  background: rgba(69, 52, 24, 0.45);
}

.quest-journal-row-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0.15rem;
}

.quest-journal-row-status {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(251, 191, 36, 0.92);
}

.quest-journal-row-progress {
  font-size: 0.68rem;
  line-height: 1.38;
  color: rgba(203, 213, 225, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quest-journal-badge {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  flex-shrink: 0;
}

.quest-journal-badge--done {
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.35);
}

.quest-journal-empty {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
  padding: 0.35rem 0.25rem;
  list-style: none;
}

.quest-journal-detail-col {
  padding: 0.15rem 0.25rem 0.35rem 0.5rem;
  min-height: 200px;
  border-left: 1px solid rgba(184, 134, 11, 0.22);
  margin-left: -0.15rem;
  padding-left: 0.85rem;
}

@media (max-width: 640px) {
  .quest-journal-detail-col {
    border-left: none;
    margin-left: 0;
    padding-left: 0.25rem;
    border-top: 1px solid rgba(184, 134, 11, 0.22);
    padding-top: 0.65rem;
  }
}

.quest-journal-detail-placeholder {
  font-size: 0.85rem;
  color: rgba(203, 213, 225, 0.8);
  line-height: 1.45;
  margin: 0;
}

.quest-journal-detail-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fcd34d;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.quest-journal-detail-story {
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(214, 211, 198, 0.9);
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(184, 134, 11, 0.28);
}

.quest-journal-detail-meta {
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.9);
}

.quest-journal-detail-meta--primary {
  margin: 0 0 0.15rem;
}

.quest-journal-detail-meta p {
  margin: 0.35rem 0;
}

.quest-journal-label {
  font-weight: 700;
  color: rgba(251, 191, 36, 0.85);
  margin-right: 0.25rem;
}

/* Bitácora — acordeón de misiones */
.quest-journal-acc-root {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quest-journal-acc-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quest-journal-acc-list--done .quest-journal-acc-title {
  color: rgba(203, 213, 225, 0.88);
}

.quest-journal-acc-item {
  border: 1px solid rgba(120, 90, 40, 0.4);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.quest-journal-acc-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  padding: 0.55rem 0.6rem;
  margin: 0;
  border: none;
  cursor: pointer;
  color: #fde68a;
  background: rgba(40, 32, 22, 0.35);
  font-family: Arial, Helvetica, sans-serif !important;
  transition: background 0.15s ease;
}

.quest-journal-acc-header:hover {
  background: rgba(69, 52, 24, 0.4);
}

.quest-journal-acc-header[aria-expanded="false"] .quest-journal-acc-chevron {
  transform: rotate(-90deg);
}

.quest-journal-acc-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  line-height: 1.6;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.quest-journal-acc-header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
}

.quest-journal-acc-title {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
}

.quest-journal-acc-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.32);
}

.quest-journal-acc-body {
  padding: 0 0.65rem 0.65rem 1.85rem;
}

.quest-journal-acc-body--collapsed {
  display: none;
}

.quest-journal-acc-story {
  margin: 0.15rem 0 0.5rem;
  padding-top: 0;
  border-top: none;
}

.quest-journal-acc-steps-h {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.75);
  margin: 0.35rem 0 0.25rem;
}

.quest-journal-acc-steps {
  list-style: decimal;
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quest-journal-acc-step {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(203, 213, 225, 0.82);
}

.quest-journal-acc-step-label {
  font-weight: 650;
  color: rgba(251, 191, 36, 0.78);
}

.quest-journal-acc-step-desc {
  font-size: 0.74rem;
  color: rgba(203, 213, 225, 0.78);
}

.quest-journal-acc-step--done .quest-journal-acc-step-label,
.quest-journal-acc-step--done .quest-journal-acc-step-desc {
  text-decoration: line-through;
  color: rgba(148, 163, 184, 0.65);
}

.quest-journal-acc-step--current .quest-journal-acc-step-label {
  text-decoration: none !important;
  color: #fef3c7;
  font-weight: 700;
  font-size: 0.8rem;
}

.quest-journal-acc-step--current .quest-journal-acc-step-desc {
  text-decoration: none !important;
  color: rgba(226, 232, 240, 0.95);
}

.quest-journal-turn-in-wrap {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(184, 134, 11, 0.35);
}

.quest-journal-btn-turn-in {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none !important;
  padding: 0.45rem 1.1rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.45);
  color: #a7f3d0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quest-journal-btn-turn-in:hover {
  background: rgba(6, 95, 70, 0.55);
  border-color: rgba(110, 231, 183, 0.65);
}

.quest-journal-acc-empty {
  margin: 0.15rem 0 0.35rem;
}

/* Diario — gestas: tarjeta activa + timeline */
.quest-story-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(165deg, rgba(30, 27, 75, 0.55) 0%, rgba(2, 6, 23, 0.92) 55%, rgba(2, 6, 23, 0.98) 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 0.75rem 0.85rem 0.85rem;
}
.quest-story-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.quest-story-card__titles {
  min-width: 0;
  flex: 1;
}
.quest-story-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e9d5ff;
  line-height: 1.25;
}
.quest-story-card__story {
  margin: 0.25rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quest-story-node--future .quest-story-node__label,
.quest-story-node--future .quest-story-node__desc {
  color: rgba(148, 163, 184, 0.72);
}
.quest-story-card__badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  color: #ede9fe;
  background: rgba(76, 29, 149, 0.45);
}
.quest-story-progress {
  margin-bottom: 0.65rem;
}
.quest-story-progress__track {
  height: 0.45rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.quest-story-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.45);
  transition: width 0.25s ease;
}
.quest-story-progress__label {
  display: block;
  margin-top: 0.25rem;
}
.quest-story-timeline {
  position: relative;
  padding-left: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.quest-story-node {
  position: relative;
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0 0.55rem 0.15rem;
}
.quest-story-node:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: 1.35rem;
  bottom: -0.1rem;
  width: 2px;
  background: rgba(100, 116, 139, 0.45);
  border-radius: 1px;
}
.quest-story-node__icon {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.65);
  background: rgba(15, 23, 42, 0.75);
  color: rgba(148, 163, 184, 0.95);
  z-index: 1;
}
.quest-story-node__icon--done {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(6, 78, 59, 0.55);
  color: #bbf7d0;
}
.quest-story-node__icon--current {
  border-color: rgba(96, 165, 250, 0.75);
  background: rgba(30, 58, 138, 0.55);
  color: #bfdbfe;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}
.quest-story-node__body {
  flex: 1;
  min-width: 0;
}
.quest-story-node__label {
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(253, 230, 138, 0.88);
}
.quest-story-node__desc {
  font-size: 0.74rem;
  color: rgba(203, 213, 225, 0.88);
  margin-top: 0.12rem;
}
.quest-story-text--done .quest-story-node__label,
.quest-story-text--done .quest-story-node__desc,
.quest-story-node--done .quest-story-node__label,
.quest-story-node--done .quest-story-node__desc {
  text-decoration: line-through;
  color: rgba(148, 163, 184, 0.62) !important;
}
.quest-story-node--current .quest-story-node__label {
  text-decoration: none !important;
  color: #fef9c3 !important;
}
.quest-story-node--current .quest-story-node__desc {
  text-decoration: none !important;
  color: rgba(241, 245, 249, 0.95) !important;
}
.quest-story-node--current .quest-story-node__body {
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(15, 23, 42, 0.65);
}
.quest-story-node--turnin .quest-story-node__body {
  border-color: rgba(52, 211, 153, 0.45);
}
.quest-story-hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.quest-hint-chip {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  line-height: 1.2;
}
.quest-hint-chip--emerald {
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #d1fae5;
  background: rgba(6, 78, 59, 0.45);
}
.quest-hint-chip--amber {
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fef3c7;
  background: rgba(120, 53, 15, 0.4);
}
.quest-journal-turn-in-wrap--inline {
  margin-top: 0.45rem;
  padding-top: 0;
  border-top: none;
}
.quest-archive-details > summary {
  list-style: none;
}
.quest-archive-details > summary::-webkit-details-marker {
  display: none;
}

/* Pestañas Gestas / Incursiones */
.quest-journal-mission-tabs .quest-mission-tab {
  font-family: Arial, Helvetica, sans-serif !important;
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: rgba(203, 213, 225, 0.88);
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}
.quest-journal-mission-tabs .quest-mission-tab:hover {
  border-color: rgba(245, 158, 11, 0.45);
  color: rgba(254, 243, 199, 0.95);
}
.quest-journal-mission-tabs .quest-mission-tab--active {
  border-color: rgba(251, 191, 36, 0.75) !important;
  color: #fffbeb !important;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.55) 0%, rgba(15, 23, 42, 0.92) 100%) !important;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.22), inset 0 1px 0 rgba(253, 230, 138, 0.12);
}

/* Incursiones — chips y botín previo */
#mission-panel-raids .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
















































/* Escuadra táctica — Escuadra Maestra v0.7.1 */
.guild-composition-banner {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.guild-combat-role-legend .guild-role-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  vertical-align: middle;
}

.guild-role-dot--tank {
  background: #38bdf8;
}

.guild-role-dot--healer {
  background: #4ade80;
}

.guild-role-dot--dps {
  background: #f87171;
}

.guild-role-dot--support {
  background: #fbbf24;
}

.guild-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.65);
}

.guild-role-pill--tank {
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}

.guild-role-pill--healer {
  border-color: rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
}

.guild-role-pill--dps {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.guild-role-pill--support {
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.guild-reserve-role-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

.guild-inv-chip-list .guild-inv-chip-row:hover {
  border-color: rgba(251, 191, 36, 0.35);
}

.guild-inv-empty-cell:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.guild-attr-with-bar .guild-stat-chip {
  width: 100%;
}

.guild-squad-root {
  overflow: visible;
}

.guild-squad-combat-flex {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  width: 100%;
}

/* Misma ficha compacta que reserva, aplicada al grupo de combate (fuera del grid de banquillo). */
.guild-squad-row--combat .guild-reserve-card-min {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 2px 0;
}
.guild-squad-row--combat .guild-reserve-card-avatar {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(129, 140, 248, 0.55);
  background: rgba(49, 46, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #c7d2fe;
  flex-shrink: 0;
}
.guild-squad-row--combat .guild-reserve-card-name {
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1.15;
  width: 100%;
  max-width: 100%;
}
.guild-squad-row--combat .guild-reserve-card-class {
  font-size: 0.5rem;
  line-height: 1.1;
  color: rgba(156, 163, 175, 0.95);
  width: 100%;
  max-width: 100%;
}
.guild-squad-row--combat .guild-reserve-card-level {
  font-size: 0.5rem;
  line-height: 1.1;
  color: rgba(148, 163, 184, 0.9);
}

@media (max-width: 900px) {
  .guild-squad-combat-flex {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Grupo de combate en móvil: rejilla compacta (misma ficha mini que reserva); barras solo ≥sm */
@media (max-width: 639px) {
  .guild-squad-combat-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    flex-wrap: unset !important;
    justify-content: stretch !important;
    align-items: stretch;
  }
  .guild-squad-row--combat .guild-squad-combat-slot,
  .guild-squad-row--combat .guild-party-slot--empty {
    flex: unset !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .guild-squad-row--combat .guild-reserve-card-name {
    font-size: 0.625rem;
  }
  .guild-squad-row--combat .guild-reserve-card-class,
  .guild-squad-row--combat .guild-reserve-card-level {
    font-size: 0.5625rem;
  }
  .guild-combat-card-extras {
    display: none !important;
  }
}

.guild-squad-row--combat .guild-squad-combat-slot,
.guild-squad-row--combat .guild-party-slot--empty {
  flex: 1 1 0;
  min-width: 0;
  max-width: 240px;
}

.guild-squad-row--combat .guild-squad-combat-slot {
  border: 2px solid rgba(255, 223, 120, 0.95) !important;
  box-shadow:
    0 0 0 1px rgba(184, 134, 11, 0.65),
    0 0 18px rgba(255, 193, 7, 0.38),
    inset 0 0 22px rgba(184, 134, 11, 0.14) !important;
  background: linear-gradient(165deg, rgba(28, 22, 8, 0.88), rgba(6, 8, 18, 0.92)) !important;
}

.guild-squad-combat-label {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px rgba(255, 200, 80, 0.35);
}

/* Reserva v0.7.8: 5×2 fijo, sin scroll lateral; contenedor acotado al ancho */
.guild-squad-reserve-section {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.guild-squad-reserve-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  grid-template-rows: repeat(2, auto);
  gap: clamp(3px, 1.1vw, 8px);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.guild-squad-reserve-grid > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Reserva: huecos y fichas compactas (tipografía base para placeholders) */
.guild-squad-reserve-grid .guild-squad-slot--reserve {
  font-size: 0.7rem;
  line-height: 1.2;
  min-height: 44px;
}

/* D-MGR-1 — roster completo en la escuadra: sección "En actividad" + disponibles fuera de formación.
   Reusa la ficha de reserva (.guild-squad-slot--reserve); aquí solo atenuación, badge y grids. */
.guild-squad-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
}
.guild-squad-busy-card {
  position: relative;
  opacity: 0.55;
  filter: grayscale(0.4) saturate(0.7);
  cursor: not-allowed;
  font-size: 0.7rem;
  line-height: 1.2;
}
.guild-squad-busy-card > *:not(.guild-activity-badge) {
  pointer-events: none;
}
.guild-activity-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  font-size: 8px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(120, 53, 15, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fcd34d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.guild-squad-join-card {
  font-size: 0.7rem;
  line-height: 1.2;
}

/* Tarjeta mínima reserva: avatar + nombre + clase + nivel (sin barras) */
.guild-squad-reserve-grid .guild-reserve-card-min {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 2px 0;
}

.guild-squad-reserve-grid .guild-reserve-card-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}


.guild-squad-reserve-grid .guild-reserve-card-avatar {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(129, 140, 248, 0.55);
  background: rgba(49, 46, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #c7d2fe;
  flex-shrink: 0;
}

.guild-squad-reserve-grid .guild-reserve-card-name {
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1.15;
  width: 100%;
  max-width: 100%;
}

.guild-squad-reserve-grid .guild-reserve-card-class {
  font-size: 0.5rem;
  line-height: 1.1;
  color: rgba(156, 163, 175, 0.95);
  width: 100%;
  max-width: 100%;
}

.guild-squad-reserve-grid .guild-reserve-card-level {
  font-size: 0.5rem;
  line-height: 1.1;
  color: rgba(148, 163, 184, 0.9);
}

.guild-squad-root .guild-squad-slot--reserve.group-member-slot {
  border: 1px solid rgba(100, 116, 139, 0.72) !important;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.72), rgba(2, 6, 23, 0.82)) !important;
  box-shadow: inset 0 0 10px rgba(15, 23, 42, 0.35);
}

.guild-party-drop-zone {
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.guild-party-drop-zone.slot-hover {
  transform: scale(1.05);
  z-index: 3;
  border-color: rgba(245, 158, 11, 0.98) !important;
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.55),
    0 10px 28px rgba(245, 158, 11, 0.32),
    inset 0 0 14px rgba(245, 158, 11, 0.1) !important;
}

/* Huecos vacíos (reserva/combate): mismo feedback ámbar por encima del grid */
.guild-squad-reserve-grid .guild-party-drop-zone.slot-hover,
.guild-squad-row--combat .guild-party-slot--empty.guild-party-drop-zone.slot-hover {
  transform: scale(1.05);
  z-index: 6;
}

/* Los hits de drag van al contenedor del slot, no al texto (el botón sigue clicable) */
.guild-squad-root .guild-party-drop-zone > * {
  pointer-events: none;
}
.guild-squad-root .guild-party-drop-zone .guild-reserve-join-btn {
  pointer-events: auto;
}

/* Mercenario / líder seleccionado — borde rojo brillante (El Elegido) */
.guild-squad-root .mercenary-slot-selected {
  border-color: rgba(255, 52, 78, 0.98) !important;
  box-shadow:
    0 0 0 2px rgba(255, 70, 95, 0.95),
    0 0 22px rgba(255, 35, 60, 0.58),
    0 0 44px rgba(255, 0, 45, 0.3) !important;
  position: relative;
  z-index: 4;
}
.guild-squad-row--combat .guild-squad-combat-slot.mercenary-slot-selected {
  box-shadow:
    0 0 0 2px rgba(255, 72, 95, 0.98),
    0 0 24px rgba(255, 48, 72, 0.58),
    0 0 48px rgba(255, 20, 55, 0.32),
    inset 0 0 22px rgba(255, 60, 85, 0.14) !important;
}
.guild-squad-reserve-grid .mercenary-slot-selected {
  box-shadow:
    0 0 0 2px rgba(255, 70, 92, 0.95),
    0 0 20px rgba(255, 40, 65, 0.52),
    0 0 38px rgba(255, 0, 50, 0.26) !important;
}

.guild-merc-dragging {
  opacity: 0.55;
}

.guild-crystal-root {
  font-family: var(--rpg-font-body);
}

.guild-member-header-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0.55rem;
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 0.85rem;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.82), rgba(3, 7, 18, 0.88));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.guild-crystal-panel {
  border: 1px solid rgba(184, 134, 11, 0.5);
  border-radius: 0.85rem;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.72), rgba(3, 7, 18, 0.8));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

#panel-inventario-equipo,
#panel-libro-tacticas {
  background: rgba(10, 14, 26, 0.7) !important;
  border: 1px solid #b8860b !important;
  box-shadow: inset 0 0 15px rgba(184, 134, 11, 0.2), 0 8px 22px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Libro de tácticas — legibilidad IA: tipografía sistema, sin versalitas forzadas */
#panel-libro-tacticas,
#panel-libro-tacticas * {
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

#panel-libro-tacticas .guild-crystal-title,
#panel-libro-tacticas h4,
#panel-libro-tacticas h5,
#panel-libro-tacticas label {
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

.guild-crystal-subpanel {
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.45);
}

.guild-crystal-title {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.05em;
  color: #f4d58f;
  text-transform: uppercase;
}

.group-member-slot {
  border: 1px solid rgba(184, 134, 11, 0.55) !important;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.78), rgba(2, 6, 23, 0.85)) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.group-member-slot > div:first-child > div:first-child {
  border-color: rgba(184, 134, 11, 0.8) !important;
  background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.32), rgba(15, 23, 42, 0.95)) !important;
  box-shadow: inset 0 0 10px rgba(184, 134, 11, 0.25);
}

.group-member-slot.ring-2.ring-amber-400 {
  box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.8), 0 0 16px rgba(255, 215, 0, 0.55);
}

.guild-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.guild-tab-btn {
  border: 1px solid rgba(184, 134, 11, 0.6);
  border-radius: 0.6rem;
  background: rgba(12, 18, 32, 0.8);
  color: rgba(216, 192, 137, 0.72);
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.45rem;
  transition: all 0.16s ease;
  border-bottom: none;
}

.guild-tab-btn:hover {
  border-color: rgba(255, 215, 0, 0.9);
  color: #ffe8b3;
}

.guild-tab-btn.active {
  background: linear-gradient(180deg, rgba(222, 179, 92, 0.32), rgba(124, 86, 26, 0.74));
  color: #ffd700;
  box-shadow: 0 0 16px rgba(184, 134, 11, 0.35);
}

.guild-tactic-select {
  border: 1px solid rgba(184, 134, 11, 0.55);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.75);
  color: #f0e6cf;
  padding: 0.42rem 0.55rem;
}

.guild-tactic-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.5);
  padding: 0.5rem 0.65rem;
  font-size: 0.76rem;
  color: #d1d5db;
}

.guild-spell-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 0.6rem;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.72), rgba(2, 6, 23, 0.82));
  padding: 0.45rem 0.55rem;
  text-align: left;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.guild-spell-row:hover {
  border-color: rgba(255, 215, 0, 0.75);
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.28);
  transform: translateY(-1px);
}

.guild-spell-row.is-active {
  border-color: rgba(255, 215, 0, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 247, 220, 0.7), 0 0 14px rgba(255, 215, 0, 0.3);
}

.guild-spell-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.guild-spell-row-toggle input[type="checkbox"] {
  accent-color: #d4af37;
}

.guild-ai-field {
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 0.6rem;
  background: rgba(2, 6, 23, 0.55);
  padding: 0.55rem 0.65rem;
}

.guild-ai-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.guild-ai-toggle-row input[type="checkbox"] {
  accent-color: #d4af37;
}

.guild-ai-slider {
  width: 100%;
  margin-top: 0.3rem;
  accent-color: #d4af37;
}

.guild-ai-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, rgba(104, 70, 15, 0.9), rgba(212, 175, 55, 0.95));
  border-radius: 999px;
}

.guild-ai-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: -4px;
  background: #f8e2a4;
  border: 1px solid #b8860b;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
}

.guild-ai-range {
  position: relative;
  --range-min: 0%;
  --range-max: 100%;
  --range-from: #ff2d55;
  --range-to: #fbbf24;
  overflow: hidden;
}

.guild-ai-range-track {
  height: 8px;
  border-radius: 999px;
  margin-top: 0.42rem;
  /* Solo el tramo entre MIN y MAX está coloreado; fuera queda el gris del track */
  background:
    linear-gradient(90deg,
      rgba(71, 85, 105, 0.45) 0,
      rgba(71, 85, 105, 0.45) var(--range-min),
      var(--range-from) var(--range-min),
      var(--range-to) var(--range-max),
      rgba(71, 85, 105, 0.45) var(--range-max),
      rgba(71, 85, 105, 0.45) 100%);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.45), 0 0 10px color-mix(in srgb, var(--range-to) 55%, transparent);
}

.guild-ai-range-slider {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 16px;
  margin-top: -12px;
  background: transparent;
  pointer-events: none;
  accent-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

/* Sin relleno nativo 0→thumb (WebKit / Firefox / Edge legacy); el relleno lo pinta .guild-ai-range-track */
.guild-ai-range .guild-ai-range-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent !important;
}

.guild-ai-range .guild-ai-range-slider::-moz-range-track {
  height: 8px;
  background: transparent;
}

.guild-ai-range .guild-ai-range-slider::-moz-range-progress {
  background: transparent;
}

.guild-ai-range .guild-ai-range-slider::-ms-fill-lower,
.guild-ai-range .guild-ai-range-slider::-ms-fill-upper {
  background: transparent;
}

.guild-ai-range-slider::-webkit-slider-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, 0.92);
  margin-top: -4px;
}

.guild-ai-range-slider-min::-webkit-slider-thumb {
  background: #ff2d55;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.95);
}

.guild-ai-range-slider-max::-webkit-slider-thumb {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.95);
}

.guild-ai-range-endpoints {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.guild-ai-range-pill {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.65);
  color: #d1d5db;
}

.guild-ai-range-pill-min {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.45);
}

.guild-ai-range-pill-max {
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.45);
}

.equip-slot {
  background:
    radial-gradient(circle at 50% 45%, rgba(184, 134, 11, 0.12), transparent 66%),
    rgba(0, 0, 0, 0.5) !important;
  border: 1px solid #b8860b !important;
  box-shadow: inset 0 0 10px rgba(184, 134, 11, 0.15);
}

.equip-slot:hover {
  border-color: #ffd700 !important;
  box-shadow: inset 0 0 10px rgba(184, 134, 11, 0.2), 0 0 12px rgba(255, 215, 0, 0.38);
}

.guild-equip-empty-rune {
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(214, 199, 166, 0.38);
  text-shadow: 0 0 10px rgba(184, 134, 11, 0.25);
}

.guild-equip-icon-cell {
  position: relative;
}

.guild-item-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88%;
  height: 88%;
  max-width: 2.6rem;
  max-height: 2.6rem;
  margin: 0 auto;
  color: var(--guild-item-tier, #9ca3af);
}

.inventory-slot .guild-item-icon-wrap {
  max-width: 2.35rem;
  max-height: 2.35rem;
  width: 82%;
  height: 82%;
}

.guild-item-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 5px var(--guild-item-tier, rgba(255, 255, 255, 0.35)));
}

.guild-item-rune-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 4px var(--guild-item-tier, rgba(255, 255, 255, 0.4)));
}

/* Marco y resplandor según rareza (--guild-item-tier en el wrap) */
.guild-item-icon-tier-frame {
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(156, 163, 175, 0.42), 0 0 12px rgba(0, 0, 0, 0.28);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  .guild-item-icon-tier-frame {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--guild-item-tier, #9ca3af) 52%, transparent),
      0 0 14px color-mix(in srgb, var(--guild-item-tier, #9ca3af) 38%, transparent);
  }
}

.guild-item-icon-emoji {
  color: var(--guild-item-tier, #9ca3af);
}

.guild-item-emoji-char {
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 5px var(--guild-item-tier, rgba(156, 163, 175, 0.55)));
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  .guild-item-emoji-char {
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--guild-item-tier, #9ca3af) 72%, transparent));
  }
}

/* Compat: clases antiguas (set-only) */
.guild-item-icon-wrap-set {
  border-radius: 6px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--guild-item-tier, #2ecc71) 52%, transparent),
    0 0 14px color-mix(in srgb, var(--guild-item-tier, #2ecc71) 38%, transparent);
}

.guild-item-icon-set-emoji {
  color: var(--guild-item-tier, #2ecc71);
}

.guild-set-emoji-char {
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--guild-item-tier, #2ecc71) 72%, transparent));
}

.guild-item-special-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: radial-gradient(circle, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.95);
  pointer-events: none;
}

.guild-inv-empty-slot {
  font-size: 0.95rem;
  color: rgba(100, 116, 139, 0.55);
}

.inventory-slot {
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.72), rgba(3, 7, 18, 0.85)) !important;
  border: 0.5px solid rgba(184, 134, 11, 0.55) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, filter 0.15s ease;
}

/* Mochila global: solo acento de borde al hover; sin sombra, transform, filter, z-index */
.inventory-slot-hover:hover {
  border-color: rgba(212, 175, 55, 0.55);
  transition: border-color 0.15s ease;
}

/* D-RAREZA-UNICA: aquí iban bordes de rareza de .guild-inv-chip-row (muertos: nadie emitía la clase; paleta desplazada) */

.guild-stat-chip {
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 0.5rem;
  padding: 0.35rem 0.45rem;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.68), rgba(3, 7, 18, 0.8));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.guild-stat-chip-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 3.25rem;
}

.guild-stat-chip-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: 100%;
}

.guild-stat-chip-label {
  font-size: 0.65rem;
  color: #9ca3af;
  line-height: 1.1;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.04em;
}

.guild-stat-chip-value {
  display: block;
  margin-top: 0.2rem;
  line-height: 1.15;
  text-align: center;
  width: 100%;
}

.guild-stat-chip-icon {
  color: #d4af37;
  text-shadow: 0 0 7px rgba(255, 215, 0, 0.35);
  flex-shrink: 0;
  line-height: 1;
}

/* Tooltips de atributos (desglose + fórmulas) en panel Mochila */
.guild-attrs-grid-wrap {
  overflow: visible;
}

.guild-stat-chip-wrap--tip {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.guild-stat-chip-wrap--tip:hover {
  z-index: 50;
}

.guild-stat-tooltip-popup {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 220px;
  max-width: min(340px, 94vw);
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(212, 175, 55, 0.75);
  background: rgba(6, 10, 22, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(251, 191, 36, 0.12);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #f8fafc;
}

.guild-stat-chip-wrap--tip:hover .guild-stat-tooltip-popup {
  opacity: 1;
  visibility: visible;
}

.guild-stat-tooltip-inner .guild-stat-tip-title {
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.78rem;
  color: #fef3c7;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.guild-stat-tip-gold {
  color: #fbbf24;
  font-weight: 600;
}

.guild-stat-tip-break {
  font-size: 0.7rem;
  color: #e2e8f0;
  margin-bottom: 0.35rem;
}

.guild-stat-tip-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.45), transparent);
  margin: 0.4rem 0;
}

.guild-stat-tip-line {
  margin-bottom: 0.35rem;
  color: #e2e8f0;
}

.guild-stat-tip-line:last-child {
  margin-bottom: 0;
}

.guild-stat-tip-muted {
  font-size: 0.68rem;
  color: #94a3b8;
}

.guild-stat-tip-warn {
  font-size: 0.68rem;
  color: #fcd34d;
}

.guild-stat-tip-base {
  color: #fef3c7;
}

.guild-stat-tip-equip {
  color: #6ee7b7;
}

/* Filtros Crystal Gold bajo la mochila */
.guild-inv-filter-row {
  overflow: visible;
}

.guild-inv-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.5rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(184, 134, 11, 0.65);
  background: linear-gradient(180deg, rgba(30, 24, 12, 0.9), rgba(12, 10, 6, 0.92));
  color: #f0e6cf;
  font-size: 0.62rem;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.guild-inv-filter-btn:hover {
  border-color: rgba(255, 215, 0, 0.95);
  color: #fff8e1;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.guild-inv-filter-btn.is-active {
  border-color: rgba(255, 215, 0, 0.95);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.35), rgba(90, 60, 18, 0.88));
  color: #fffbeb;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.28);
}

.guild-inv-filter-rune {
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.92;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.45));
}

.guild-inv-filter-text {
  white-space: nowrap;
}

.guild-inv-filter-btn--compact {
  padding: 0.22rem 0.38rem;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.guild-inv-slot-filtered-out {
  opacity: 0.2;
  filter: grayscale(0.9);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.guild-inv-slot-filtered-out:hover {
  opacity: 0.55;
  filter: grayscale(0.35);
}

/* RAREZAS-BRILLO:INICIO — GENERADO por scripts/build-content.mjs desde content/objetos.json (RAREZAS). No editar a mano. */
.comun, .equip-slot.comun, .inventory-slot.comun, .bestiary-loot-icon.comun { --ui-brillo-rareza: var(--ui-rareza-comun); animation: rarity-glow 2.5s ease-in-out infinite; }
.raro, .equip-slot.raro, .inventory-slot.raro, .bestiary-loot-icon.raro { --ui-brillo-rareza: var(--ui-rareza-raro); animation: rarity-glow 2.5s ease-in-out infinite; }
.excepcional, .equip-slot.excepcional, .inventory-slot.excepcional, .bestiary-loot-icon.excepcional { --ui-brillo-rareza: var(--ui-rareza-excepcional); animation: rarity-glow 2.5s ease-in-out infinite; }
.epico, .equip-slot.epico, .inventory-slot.epico, .bestiary-loot-icon.epico { --ui-brillo-rareza: var(--ui-rareza-epico); animation: rarity-glow 2.5s ease-in-out infinite; }
.legendario, .equip-slot.legendario, .inventory-slot.legendario, .bestiary-loot-icon.legendario { --ui-brillo-rareza: var(--ui-rareza-legendario); animation: rarity-glow 2.5s ease-in-out infinite; }
.set, .equip-slot.set, .inventory-slot.set, .bestiary-loot-icon.set { --ui-brillo-rareza: var(--ui-rareza-set); animation: rarity-glow 2.5s ease-in-out infinite; }
.unico, .equip-slot.unico, .inventory-slot.unico, .bestiary-loot-icon.unico { --ui-brillo-rareza: var(--ui-rareza-unico); animation: rarity-glow 2.5s ease-in-out infinite; }
.fino, .equip-slot.fino, .inventory-slot.fino, .bestiary-loot-icon.fino { --ui-brillo-rareza: var(--ui-rareza-fino); animation: rarity-glow 2.5s ease-in-out infinite; }
.mitico, .equip-slot.mitico, .inventory-slot.mitico, .bestiary-loot-icon.mitico { --ui-brillo-rareza: var(--ui-rareza-mitico); animation: rarity-glow 2.5s ease-in-out infinite; }
.fabled, .equip-slot.fabled, .inventory-slot.fabled, .bestiary-loot-icon.fabled { --ui-brillo-rareza: var(--ui-rareza-fabled); animation: rarity-glow 2.5s ease-in-out infinite; }
.artefacto, .equip-slot.artefacto, .inventory-slot.artefacto, .bestiary-loot-icon.artefacto { --ui-brillo-rareza: var(--ui-rareza-artefacto); animation: rarity-glow 2.5s ease-in-out infinite; }
.quest, .equip-slot.quest, .inventory-slot.quest, .bestiary-loot-icon.quest { --ui-brillo-rareza: var(--ui-rareza-quest); animation: rarity-glow 2.5s ease-in-out infinite; }
.common, .equip-slot.common, .inventory-slot.common, .bestiary-loot-icon.common { --ui-brillo-rareza: var(--ui-rareza-common); animation: rarity-glow 2.5s ease-in-out infinite; }
.uncommon, .equip-slot.uncommon, .inventory-slot.uncommon, .bestiary-loot-icon.uncommon { --ui-brillo-rareza: var(--ui-rareza-uncommon); animation: rarity-glow 2.5s ease-in-out infinite; }
.rare, .equip-slot.rare, .inventory-slot.rare, .bestiary-loot-icon.rare { --ui-brillo-rareza: var(--ui-rareza-rare); animation: rarity-glow 2.5s ease-in-out infinite; }
.epic, .equip-slot.epic, .inventory-slot.epic, .bestiary-loot-icon.epic { --ui-brillo-rareza: var(--ui-rareza-epic); animation: rarity-glow 2.5s ease-in-out infinite; }
.legendary, .equip-slot.legendary, .inventory-slot.legendary, .bestiary-loot-icon.legendary { --ui-brillo-rareza: var(--ui-rareza-legendary); animation: rarity-glow 2.5s ease-in-out infinite; }
.unique, .equip-slot.unique, .inventory-slot.unique, .bestiary-loot-icon.unique { --ui-brillo-rareza: var(--ui-rareza-unique); animation: rarity-glow 2.5s ease-in-out infinite; }
@keyframes rarity-glow {
  0%, 100% { box-shadow: 0 0 8px color-mix(in srgb, var(--ui-brillo-rareza) 45%, transparent), 0 0 16px color-mix(in srgb, var(--ui-brillo-rareza) 20%, transparent); }
  50% { box-shadow: 0 0 16px color-mix(in srgb, var(--ui-brillo-rareza) 85%, transparent), 0 0 30px color-mix(in srgb, var(--ui-brillo-rareza) 42%, transparent); }
}
/* RAREZAS-BRILLO:FIN */

/* Atlas zone tiers: T3 azul, T4 rojo, T5 naranja con fuego */
.atlas-zone-tier3 { box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); }
.atlas-zone-tier4 { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.atlas-zone-tier5 {
  animation: atlas-tier5-fire 2.5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(251, 146, 60, 0.6);
}
@keyframes atlas-tier5-fire {
  0%, 100% { box-shadow: 0 0 12px rgba(251, 146, 60, 0.5), 0 0 24px rgba(234, 88, 12, 0.2); }
  50% { box-shadow: 0 0 20px rgba(251, 146, 60, 0.9), 0 0 40px rgba(234, 88, 12, 0.5); }
}

/* Heavenly Planes - Plane of Air: aura blanca/cian con viento/rayos */
.heavenly-plane-air {
  animation: heavenly-plane-air-glow 2.5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}
@keyframes heavenly-plane-air-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 0 20px rgba(34, 211, 238, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.7), 0 0 36px rgba(34, 211, 238, 0.8); }
}

.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);
}

/* Pregonero - anuncios de desbloqueo de zona (dorado/negrita) */
.chronicle-pregonero {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), transparent);
  border-left: 3px solid #f59e0b;
  padding: 4px 0 4px 8px;
  margin: 3px 0;
  font-weight: 600;
}
.chronicle-pregonero .text-amber-400,
.chronicle-pregonero .text-yellow-200 {
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

#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);
}

/* D-OPCIONES-REDISENO D-OPC-3 — ya no se redimensionan (fuera las asas y «Interfaz bloqueada»); la clase sigue de colocación */
.resizable-panel {
  position: relative;
  overflow: auto;
  min-width: 240px;
  min-height: 160px;
}
/* Tooltip maestro: posición la fija el JS (position:fixed); no forzar centrado en móvil para que siga al cursor. */

/* Tooltip Maestra — lectura natural + marco oro envejecido (Bazaar, Gremio, Chat, Forja, Atlas… ) */
#masterItemTooltip {
  position: fixed !important;
  z-index: 12050;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  color: #fafaf9;
  max-width: calc(100vw - 20px);
  /* Por defecto NO debe capturar clicks ni dejar restos visuales */
  pointer-events: none;
  display: none !important;
  width: 0;
  height: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

/* Fase prep: en DOM con tamaño razonable pero invisible hasta positionItemTooltip */
#masterItemTooltip.master-tt-prep {
  pointer-events: none;
}

#masterItemTooltip,
#masterItemTooltip * {
  font-family: var(--rpg-font-body) !important;
  text-transform: none !important;
  font-variant: normal !important;
}

/* Activo: se vuelve visible y clicable */
#masterItemTooltip.master-tt-active {
  pointer-events: auto;
  display: block !important;
  width: auto;
  height: auto;
  opacity: 1;
  visibility: visible;
}
#masterItemTooltip .item-tooltip-outer,
#masterItemTooltip .master-tooltip-outer {
  min-width: 200px;
  max-width: min(350px, calc(100vw - 20px));
  overflow-x: hidden;
  contain: layout;
  background:
    linear-gradient(165deg, rgba(12, 14, 22, 0.97) 0%, rgba(6, 8, 14, 0.98) 100%) padding-box,
    var(--rpg-gold-gradient-frame) border-box !important;
  border: 3px solid transparent !important;
  border-radius: 14px !important;
  color: inherit;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 2px 24px rgba(0, 0, 0, 0.75),
    0 0 26px rgba(212, 175, 55, 0.32),
    0 0 52px rgba(139, 101, 8, 0.2),
    inset 0 1px 0 rgba(255, 248, 220, 0.14);
}

/* Evita que el nombre del objeto colapse a un ancho mínimo ridículo durante el layout */
#masterItemTooltip .master-tooltip-item-title {
  white-space: nowrap;
}
/* Panel interior: sin doble marco; el brillo va en el contenedor exterior */
#masterItemTooltip .master-tooltip {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #f5f5f4 !important;
}
/* Bestiario / flotante: mismo tratamiento tipográfico y marco que el tooltip maestro */
.enemy-tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  max-width: 320px;
}
.enemy-tooltip,
.enemy-tooltip * {
  font-family: var(--rpg-font-body) !important;
  text-transform: none !important;
  font-variant: normal !important;
}
.enemy-tooltip .master-tooltip,
.enemy-tooltip .enemy-tooltip-inner {
  background:
    linear-gradient(165deg, rgba(12, 14, 22, 0.97) 0%, rgba(6, 8, 14, 0.98) 100%) padding-box,
    var(--rpg-gold-gradient-frame) border-box !important;
  border: 3px solid transparent !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 2px 24px rgba(0, 0, 0, 0.75),
    0 0 26px rgba(212, 175, 55, 0.28),
    0 0 48px rgba(139, 101, 8, 0.18),
    inset 0 1px 0 rgba(255, 248, 220, 0.12);
  color: #f5f5f4 !important;
}
.master-tooltip {
  background-color: rgba(0, 0, 0, 0.95) !important;
  border: 1px solid #444 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  color: #f5f5f4 !important;
}
#masterItemTooltip .master-tooltip .text-gray-300,
#masterItemTooltip .master-tooltip .text-gray-400,
#masterItemTooltip .master-tooltip .text-gray-500 {
  color: #d6d3d1 !important;
}
#masterItemTooltip .text-amber-200,
#masterItemTooltip .text-amber-300,
#masterItemTooltip .master-tooltip .text-amber-200,
#masterItemTooltip .master-tooltip .text-amber-300 {
  color: #fde68a !important;
}
.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); }

/* Barra de control de expedición: contenedor unificado, sin superposición */
#combatControlBar {
  gap: 12px;
  position: relative;
  z-index: 100;
}
#v2CombatControlsDock:not(.hidden) {
  overflow-x: hidden;
  box-sizing: border-box;
}
/* Controles en cabecera: grid 2×2 en móvil, 4 columnas ≥600px; sin scroll lateral */
#v2CombatControlsDock:not(.hidden) #combatControlBar.combat-control-dock--grid {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 10px;
  justify-items: stretch;
  align-items: stretch;
  background: rgba(3, 7, 18, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@media (min-width: 600px) {
  #v2CombatControlsDock:not(.hidden) #combatControlBar.combat-control-dock--grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
#v2CombatControlsDock:not(.hidden) .btn-game-action {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 8px 6px;
  box-sizing: border-box;
}
/* Controles en cabecera (#v2CombatControlsDock): nunca barra fija inferior */
#v2CombatControlsDock:not(.hidden) #combatControlBar.combat-control-dock {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto;
}
#combatControlBar button,
#combatControlBar select,
.combat-log-focus-select,
.combat-log-pause-btn {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.combat-ctrl-btn {
  min-height: 40px;
  padding: 8px 16px;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
/* Modo Farmeo: toggle con fondo gris oscuro por defecto */
.combat-ctrl-farming {
  border-color: rgba(75, 85, 99, 0.8) !important;
  background: rgba(31, 41, 55, 0.9) !important;
}
.combat-ctrl-farming.border-emerald-500 {
  border-color: rgba(16, 185, 129, 0.9) !important;
  background: rgba(6, 95, 70, 0.8) !important;
}

/* v0.6.9 — botonera unificada (expedición / combate en cabecera; fila con wrap en pantallas estrechas) */
.btn-game-action {
  width: 200px;
  height: 50px;
  margin: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-family: "Cinzel", "Cinzel Decorative", var(--rpg-emoji-stack), serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  text-align: center;
  line-height: 1.15;
  padding: 0 10px;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
  color: #f5f0e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-game-action:hover {
  filter: brightness(1.08);
}
.btn-game-action:active {
  transform: scale(0.98);
}
.btn-game-action--farmeo {
  background: linear-gradient(180deg, #5c1a1a 0%, #3d1014 50%, #2a0c10 100%);
  border-color: #8b6969;
}
.btn-game-action--ciudad {
  background: linear-gradient(180deg, #8b6914 0%, #5c4010 50%, #3d2808 100%);
  border-color: #c4a35a;
  color: #fff8e8;
}
.btn-game-action--wave-segura {
  background: linear-gradient(180deg, #1d4a2e 0%, #0f3d24 50%, #0a2818 100%);
  border-color: #4ade80;
}
.btn-game-action--continuo {
  background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 50%, #0a1a30 100%);
  border-color: #60a5fa;
}
.btn-game-action--active {
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.55), 0 2px 10px rgba(0, 0, 0, 0.4);
  outline: 2px solid rgba(251, 211, 141, 0.85);
  outline-offset: 2px;
}

#combatControlBar,
#combatControlBar * {
  user-select: auto;
}
/* Floaty text de daño/curación */
/* Sacudida de pantalla (impactos de combate, jefe) */
@keyframes mmorpgScreenShake {
  0% { transform: translate3d(0, 0, 0); }
  22% { transform: translate3d(-5px, 3px, 0); }
  44% { transform: translate3d(5px, -2px, 0); }
  66% { transform: translate3d(-4px, 2px, 0); }
  88% { transform: translate3d(3px, -1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes mmorpgScreenShakeCrit {
  0% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-9px, 5px, 0); }
  36% { transform: translate3d(9px, -4px, 0); }
  54% { transform: translate3d(-7px, 4px, 0); }
  72% { transform: translate3d(7px, -3px, 0); }
  90% { transform: translate3d(-4px, 2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
#game-container.screen-shake,
#game-container.game-engine-host.screen-shake {
  animation: mmorpgScreenShake 0.36s ease-out 2;
  will-change: transform;
}
#game-container.critical-shake,
#game-container.game-engine-host.critical-shake {
  animation: mmorpgScreenShakeCrit 0.42s ease-out 3;
  will-change: transform;
}

/* Sacudida adicional del panel de combate (más amplia que el contenedor raíz). */
@keyframes mmorpgCombatViewShake {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-10px, 6px, 0); }
  50% { transform: translate3d(10px, -5px, 0); }
  75% { transform: translate3d(-7px, 4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes mmorpgCombatViewShakeCrit {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-16px, 9px, 0); }
  40% { transform: translate3d(16px, -7px, 0); }
  60% { transform: translate3d(-12px, 6px, 0); }
  80% { transform: translate3d(10px, -5px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
#combatView.combat-view-shake {
  animation: mmorpgCombatViewShake 0.4s ease-out 2;
  will-change: transform;
}
#combatView.combat-view-shake-crit {
  animation: mmorpgCombatViewShakeCrit 0.48s ease-out 3;
  will-change: transform;
}

/* Parpadeo al perder HP en el retrato del slot */
.combat-slot-inner.flash-hit {
  animation: combatSlotFlashHit 0.38s ease-out;
}
@keyframes combatSlotFlashHit {
  0% {
    filter: brightness(1);
    box-shadow: inset 0 0 0 transparent;
  }
  35% {
    filter: brightness(1.4) saturate(1.15);
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.55);
  }
  100% {
    filter: brightness(1);
    box-shadow: inset 0 0 0 transparent;
  }
}

/* Sacudida del retrato/slot en golpes críticos (además del screen-shake global). */
@keyframes combatSlotCritJolt {
  0% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-4px, 2px) rotate(-1.1deg); }
  30% { transform: translate(5px, -3px) rotate(1deg); }
  45% { transform: translate(-3px, 1px) rotate(-0.6deg); }
  60% { transform: translate(3px, -2px) rotate(0.5deg); }
  75% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.combat-slot.combat-slot-crit-jolt {
  animation: combatSlotCritJolt 0.52s cubic-bezier(0.36, 0.08, 0.22, 1) both;
  will-change: transform;
}

.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: #facc15 !important;
  font-size: 1.65em !important;
  font-weight: 900 !important;
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.95), 0 0 8px rgba(234, 179, 8, 0.75), 0 2px 4px rgba(0, 0, 0, 0.95);
}
.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)), -52px) scale(1.38); opacity: 1; }
  70% { transform: translate(calc(-50% + var(--floaty-offset-x)), -68px) scale(1.22); opacity: 0.92; }
  100% { transform: translate(calc(-50% + var(--floaty-offset-x)), -100px) scale(1.08); opacity: 0; }
}

/* ── Floaty diferenciados: crítico / curación / miss ── */
@keyframes floatyCrit {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(0.7); }
  25%  { opacity: 1; transform: translate(-50%, -10px) scale(1.35); }
  100% { opacity: 0; transform: translate(-50%, -38px) scale(1.05); }
}
@keyframes floatyNormal {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(0.9); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1.0); }
}
.floaty-crit {
  animation: floatyCrit 1.1s ease-out forwards !important;
  font-size: 1.45em !important;
  color: #FF3333 !important;
  text-shadow: 0 0 8px rgba(255, 50, 50, 0.7), 0 0 16px rgba(255, 0, 0, 0.3) !important;
  font-weight: 800 !important;
}
.floaty-heal {
  animation: floatyNormal 1.2s ease-out forwards !important;
  color: #22FF88 !important;
}
.floaty-miss {
  animation: floatyNormal 0.8s ease-out forwards !important;
  color: #64748b !important;
  font-size: 0.82em !important;
}
@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;
  }
}

/* Moneda dorada flotando al ganar platino en el log */
.combat-platinum-line {
  position: relative;
  min-height: 1.5em;
}
.combat-coin-floaty {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 1.5em;
  animation: coinFloatUp 2s ease-out forwards;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8));
}
@keyframes coinFloatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  30% { transform: translateY(-12px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-40px) scale(1); opacity: 0; }
}

/* Loot floaty: desplazamiento hacia inventario */
.combat-loot-floaty-container {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.combat-loot-floaty {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0) translateX(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.combat-loot-floaty-gold { border-color: rgba(251, 191, 36, 0.6); }
.combat-loot-floaty-item { border-color: rgba(34, 197, 94, 0.5); }
.combat-loot-icon { font-size: 1.1em; }
.combat-loot-floaty-animate {
  animation: lootFloatToInventory 2.5s ease-out forwards;
}
@keyframes lootFloatToInventory {
  0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.8); }
  15% { opacity: 1; transform: translateY(-8px) translateX(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) translateX(60px) scale(0.9); }
}

/* Layout estático de combate: 6 slots en 2 columnas (3 filas) - aliados y enemigos */
/* Altura +25% para que la 4ª barra (Maná/Ira/Poder) y los iconos de buffs/debuffs sean visibles sin scroll */
.combat-slots-grid {
  display: grid;
  /* minmax(0,1fr): evita columnas que colapsan o explotan con hijos flex (% ancho) */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  min-height: 350px;
  height: 100%;
  width: 100%;
  padding-bottom: 8px;
}
/* Aliados: 2×3 celdas = 6× .combat-party-row (espejo de #combatEnemyList.combat-slots-enemies-four) */
.combat-slots-allies {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(170px, 1fr));
}
/* Misma fuerza que enemigos: grid !important + minmax(0,1fr) evita columna aliados colapsada a píxeles */
#combatPartyList.combat-slots-allies-six {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(150px, auto)) !important;
  gap: 8px;
  min-height: 300px;
  width: 100%;
  align-content: start;
  justify-items: stretch;
}
#combatPartyList.combat-slots-allies-six .combat-slot:not(.combat-slot-empty) {
  min-width: 0;
  max-width: none;
  width: 100%;
}
/* Fila aliado+mascota: grid (no flex) para que la carta principal tome todo el ancho útil (minmax 0) */
#combatPartyList.combat-slots-allies-six > .combat-party-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 6px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  align-items: stretch;
}
#combatPartyList.combat-slots-allies-six > .combat-party-row > .combat-slot:not(.combat-slot-pet) {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}
#combatPartyList.combat-slots-allies-six > .combat-party-row > .combat-slot-pet {
  width: auto !important;
  min-width: 72px;
  max-width: 120px;
  justify-self: end;
  flex: none !important;
}
/* v0.9.5.81 — Fila con mascota: ~75 % carta dueño / ~25 % pet (evita que el pet quede fuera con 4 héroes). */
#combatPartyList.combat-slots-allies-six > .combat-party-row:has(> .combat-slot-pet) {
  grid-template-columns: minmax(0, 3fr) minmax(64px, 1fr) !important;
}
.combat-slot {
  min-height: 170px;
  height: auto;
  flex-shrink: 0;
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.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: 170px;
  box-sizing: border-box;
  overflow: visible;
  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: 0;
  padding-right: 0;
}
.combat-slot-bars {
  flex: 1;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}
.combat-slot-empty {
  visibility: hidden;
  pointer-events: none;
  min-height: 170px;
}
.combat-slot-empty .combat-slot-inner {
  border-color: transparent !important;
  background: transparent !important;
}

/* Pet: miniatura al 50% del tamaño de un personaje normal. Solo HP + barra de ataque. */
.combat-slot-pet {
  width: 50%;
  min-width: 90px;
  max-width: 120px;
  min-height: 44px;
  flex-shrink: 0;
}
.combat-slot-pet .combat-slot-inner {
  min-height: 44px;
  padding: 2px 4px;
  border-color: rgba(245, 158, 11, 0.5) !important;
}
.combat-slot-pet .combat-slot-bars {
  gap: 2px;
}
.combat-party-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 170px;
}
.combat-party-row .combat-slot:not(.combat-slot-pet) {
  flex: 1;
  min-width: 0;
}
.combat-party-row .combat-slot-pet {
  flex-shrink: 0;
  align-self: center;
}
/* Refuerzo genérico (p. ej. sin .six en teoría); .six arriba ya fuerza grid en la fila */
#combatPartyList > .combat-party-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* 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;
  flex: 0 1 auto;
  overflow-y: auto;
  margin-bottom: 0 !important;
  min-height: 0 !important;
}
body.in-combat #combat-log,
body.combat-ui-active #combat-log {
  width: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}
.combat-log-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  overflow: visible;
}
#combat-log {
  margin-bottom: 0;
  min-height: 0;
  max-height: none;
}
.combat-log-dock .combat-log-box {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(251, 191, 36, 0.22);
}
.combat-log-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  padding-bottom: 8px;
  min-height: 0;
  max-height: none;
  position: relative;
  z-index: 1;
}

/* Tipografía combate: Montserrat en nombres y log (legible frente a UI medieval) */
.rpg-combat-card-name,
.rpg-unit-name,
.rpg-character-card header h3 {
  font-family: var(--ui-fuente-texto) !important;
  text-transform: none !important;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Log de combate: tipografía de sistema legible (sin Cinzel/MedievalSharp) */
#combatLogBox,
#combatLogBox *,
.combat-log-message {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  text-transform: none !important;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
}

.combat-log-highlight {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 700;
}

/* Log de combate: registro antiguo + daño con degradados suaves */
#combatLogBox .rpg-combat-log-chronicle {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #e2e8f0;
}
@media (min-width: 769px) {
  #combatLogBox .rpg-combat-log-chronicle {
    font-size: 14px;
    line-height: 1.4;
  }
}
.combat-log-damage-dealt {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  background: linear-gradient(180deg, #fefce8 0%, #facc15 42%, #ca8a04 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85));
}
.combat-log-damage-taken {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  background: linear-gradient(180deg, #fecaca 0%, #ef4444 48%, #7f1d1d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9));
}
.combat-log-damage-dealt strong,
.combat-log-damage-dealt b,
.combat-log-damage-taken strong,
.combat-log-damage-taken b {
  font-weight: 800;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Enemigos: hasta 4 fichas en rejilla 2×2 (misma anchura que columna aliados) */
#combatEnemyList.combat-slots-enemies-four {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(150px, auto)) !important;
  gap: 8px;
  min-height: 300px;
  width: 100%;
  align-content: start;
  justify-items: stretch;
}
#combatEnemyList.combat-slots-enemies-four .combat-slot:not(.combat-slot-empty) {
  min-width: 0;
  max-width: none;
  width: 100%;
}
#combatEnemyList.combat-slots-enemies-four.combat-enemy-many .combat-slot-inner {
  transform: scale(0.94);
  transform-origin: top center;
}
/* Modo "muro" del boss final de zona (fase 10, ola named). */
/* D-JEFE-MECANICA-2 (D-JM2-1) — el jefe llega con escolta: el muro ocupa la fila de arriba y su escolta sale debajo en cartas
   normales (antes se ocultaba todo lo que no era el muro: con escolta, se peleaba contra dos invisibles). Los huecos vacíos, fuera. */
#combatEnemyList.combat-slots-enemies-four.combat-enemy-wall-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(350px, auto) !important;
  grid-auto-rows: auto !important;
  min-height: 350px;
  align-content: stretch;
}
#combatEnemyList.combat-slots-enemies-four.combat-enemy-wall-mode > .combat-slot.combat-slot-zone-wall {
  grid-column: 1 / -1;
  min-height: 350px;
}
#combatEnemyList.combat-slots-enemies-four.combat-enemy-wall-mode > .combat-slot.combat-slot-empty {
  display: none !important;
}
.combat-slot-zone-wall .combat-slot-inner {
  min-height: 350px !important;
  padding-top: 10px;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.5), 0 0 12px rgba(59, 130, 246, 0.25) inset !important;
}
.combat-enemy-wall-glyph {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.65));
  pointer-events: none;
  user-select: none;
  opacity: 0.92;
}
.combat-enemy-wall-image-wrap {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 96%);
  height: 200px;
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.combat-slot-zone-wall .combat-title-row,
.combat-slot-zone-wall .health-bar-container {
  position: relative;
  z-index: 2;
}
.combat-enemy-wall-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0, 0, 0, 0.75));
  opacity: 0.95;
}
.combat-enemy-wall-image-wrap--dragon .combat-enemy-wall-image {
  filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.45)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.7));
}
.combat-enemy-wall-image-wrap--warlord .combat-enemy-wall-image {
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.4)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.7));
}
.combat-enemy-wall-image-wrap--overlord .combat-enemy-wall-image {
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.35)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.7));
}
.combat-enemy-wall-glyph--dragon { color: #f97316; text-shadow: 0 0 16px rgba(251, 146, 60, 0.5); }
.combat-enemy-wall-glyph--warlord { color: #ef4444; text-shadow: 0 0 16px rgba(239, 68, 68, 0.5); }
.combat-enemy-wall-glyph--overlord { color: #a78bfa; text-shadow: 0 0 16px rgba(167, 139, 250, 0.5); }
/* Modo Foco: borde azul suave cuando hay un personaje seleccionado */
#combat-log.combat-log-focus-mode {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}
.combat-log-pause-btn.paused {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
.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;
}

/* Ocultar crónicas hasta que la vista ciudad esté activa (splash / héroe / creación no deben mostrar el chat) */
#chroniclesSection.is-chronicles-suppressed {
  display: none !important;
}

/* Crónicas y chat: prioridad de foco sobre overlays DE CIUDAD (que no bloqueen el input).
   D-CHAT-COMBATE — esta regla ya NO tiene nada que ver con el combate, aunque su
   nombre y su comentario original decían lo contrario desde el 2026-06-21: el
   overlay V3 monta a z-index 9000 y, sobre todo, la sección es descendiente de
   #cityView, que la shell oculta — de un display:none no se escapa apilando.
   En combate la sección se MUEVE al overlay; ver combat_exp/styles.css. */
#chroniclesSection.chronicles-section-combat,
body.in-combat #chroniclesSection,
body.combat-ui-active #chroniclesSection {
  position: relative;
  z-index: 100;
}
#cityChatInput {
  position: relative;
  z-index: 101;
}

/* Lista de usuarios online: scroll horizontal cuando hay muchos */
.online-users-list {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.online-users-list::-webkit-scrollbar {
  height: 4px;
}
.online-users-list::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.6);
  border-radius: 2px;
}

/* ========== Escritorio: barra de combate en flujo + ratón (grid del arena vía Tailwind) ========== */
@media (min-width: 1024px) {
  .combat-control-dock {
    position: relative !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Cabecera v2: mantener panel y grid 4 columnas pese al reset anterior */
  #v2CombatControlsDock:not(.hidden) #combatControlBar.combat-control-dock--grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    margin: 0 auto !important;
    background: rgba(3, 7, 18, 0.72) !important;
    border: 1px solid rgba(245, 158, 11, 0.28) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
  /* Log combate PC: 280px fijas, 14px, scroll */
  #combat-log.combat-log-container {
    overflow-x: hidden;
    overflow-y: visible;
  }
  #combatArenaWrapper #combat-log #combatLogBox {
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #e5e7eb;
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    box-sizing: border-box;
  }
  body.combat-ui-active #combatLogBox,
  body.in-combat #combatLogBox {
    font-size: 14px !important;
    line-height: 1.4 !important;
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
  }
  #combat-log.combat-log-visual-collapsed #combatLogBox {
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
  }
  #combat-log:not(.combat-log-visual-collapsed):not(.collapsed) #combatLogBox {
    max-height: min(42vh, 360px) !important;
    min-height: 280px !important;
    height: auto !important;
  }
  /* Cara a cara: dos columnas 50/50 a ancho completo del panel de combate */
  #combatView #combatFaceOff.combat-face-off {
    gap: 1rem;
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  #combatView .combat-slots-grid {
    grid-template-rows: repeat(3, auto);
    height: auto;
    min-height: 240px;
    align-content: start;
  }
  #combatView .combat-slots-allies {
    grid-template-rows: repeat(3, minmax(min-content, auto));
  }
  #combatView .combat-slots-allies-six {
    grid-template-rows: repeat(3, minmax(min-content, auto)) !important;
    min-height: 260px;
  }
  #combatView .combat-slots-enemies-four {
    grid-template-rows: repeat(2, minmax(min-content, auto)) !important;
    min-height: 260px;
  }
  #combatView .combat-slot:not(.combat-slot-pet),
  #combatView .combat-slot-empty:not(.combat-slot-pet) {
    flex-grow: 0;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
  body.combat-ui-active #combatView {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    min-height: min(560px, calc(100dvh - 152px)) !important;
    max-height: calc(100dvh - 88px) !important;
  }
}

/* Ratón en PC: feedback en botones (excluye tarjetas de edificio e iconos de estado) */
@media (min-width: 1024px) and (hover: hover) {
  main button[type="button"]:not(:disabled):not(.combat-status-icon-btn):not([id^="building"]):hover {
    filter: brightness(1.25);
    border-color: #f59e0b !important;
    transition: filter 0.12s ease-out, border-color 0.12s ease-out;
  }
}

/* ========== MOBILE: combate confrontación 2 columnas + log fijo + barra inferior ========== */
@media (max-width: 1023px) {
  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: calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
    flex-direction: column;
  }
  body.combat-ui-active #combatView .combat-view-head {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  /* Arena: grid 2+1 definido con Tailwind en HTML (col-start / col-span) */
  body.combat-ui-active #combatArenaWrapper {
    flex: 1;
    min-height: 0;
  }
  body.combat-ui-active #combatPartyList,
  body.combat-ui-active #combatEnemyList {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    min-height: 0 !important;
    align-items: stretch;
  }
  body.combat-ui-active #combatPartyList > .combat-party-row {
    width: 100%;
    max-width: 100%;
    align-items: flex-start !important;
  }
  body.combat-ui-active #combatView .combat-slot,
  body.combat-ui-active #combatView .combat-slot-inner,
  body.combat-ui-active #combatView .combat-slot-bars {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatView .combatant-card-v49 {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatEnemyList .combat-slot {
    flex: 0 0 auto;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0;
  }
  /* Aliados van dentro de .combat-party-row (flex row); hace falta flex:1, no 0 0 auto (evita carta en tira) */
  body.combat-ui-active #combatPartyList:not(.combat-slots-allies-six) .combat-party-row .combat-slot:not(.combat-slot-pet) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0;
    align-self: flex-start;
  }
  body.combat-ui-active #combatPartyList.combat-slots-allies-six > .combat-party-row > .combat-slot:not(.combat-slot-pet) {
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0;
    align-self: flex-start;
  }
  body.combat-ui-active #combatPartyList .combat-party-row .combat-slot-pet {
    flex: 0 0 auto !important;
    min-height: 0;
  }
  body.combat-ui-active .combat-slots-allies .combat-slot:not(.combat-slot-empty),
  body.combat-ui-active .combat-slots-enemies .combat-slot:not(.combat-slot-empty) {
    min-height: auto;
  }
  body.combat-ui-active .combat-slot-inner {
    min-height: 0;
    padding: 4px 5px;
  }
  /* Log en muelle inferior: sin altura fija global (compacto vía .combat-log-visual-collapsed) */
  body.combat-ui-active #combat-log {
    padding: 6px 8px;
    border-radius: 10px;
    overflow: hidden;
    flex-direction: column;
    flex-shrink: 0;
  }
  body.combat-ui-active #combat-log #combatLogExpandable {
    flex: 0 1 auto;
    min-height: 0;
    margin-top: 4px;
  }
  body.combat-ui-active #combat-log #combatLogBox {
    flex: 0 1 auto;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 6px 8px 8px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #e5e7eb;
  }
  body.combat-ui-active #combat-log .combat-log-expandable > div:first-of-type {
    margin-bottom: 4px;
  }
  /* Botonera expedición (layout clásico flex): scroll horizontal si no caben */
  body.combat-ui-active #combatControlBar.combat-control-dock:not(.combat-control-dock--grid) {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  body.combat-ui-active #combatControlBar.combat-control-dock--grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    overflow-x: hidden !important;
    justify-content: stretch;
    justify-items: stretch;
    padding-left: 10px;
    padding-right: 10px;
  }
  @media (min-width: 600px) {
    body.combat-ui-active #combatControlBar.combat-control-dock--grid {
      grid-template-columns: repeat(4, 1fr) !important;
    }
  }
  body.combat-ui-active #combatControlBar.combat-control-dock:not(.combat-control-dock--grid) .btn-game-action {
    min-height: 48px;
    width: 170px;
    min-width: 170px;
    max-width: 200px;
    flex-shrink: 0;
    margin: 4px 0;
  }
  body.combat-ui-active #combatControlBar.combat-control-dock--grid .btn-game-action {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px;
    margin: 0 !important;
    padding: 8px 6px;
    box-sizing: border-box;
  }
  #farmingModeBtn,
  #returnToCityBtn,
  #farmingSafeBtn,
  #offlineCombatBtn {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

/* Botones toggle (Farmeo, etc.) — estado activo (borde dorado) */
.btn-toggle-active {
  border-color: rgba(245, 158, 11, 0.95) !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35) inset, 0 0 18px rgba(245, 158, 11, 0.18);
}
  #atlasBestiaryContainer {
    position: relative;
    z-index: 999999 !important;
  }
  /* Combate móvil: 6 aliados visibles sin scroll — tarjetas ~60–70px */
  body.combat-ui-active #combatPartyList.combat-slots-allies-six {
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    gap: 2px !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: auto;
  }
  body.combat-ui-active #combatPartyList.combat-slots-allies-six > .combat-party-row {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 3px !important;
    align-items: stretch !important;
  }
  body.combat-ui-active #combatPartyList.combat-slots-allies-six > .combat-party-row:has(> .combat-slot.combat-slot-empty) {
    flex: 0 0 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
  }
  body.combat-ui-active #combatEnemyList.combat-slots-enemies-four {
    overflow-y: hidden !important;
    gap: 2px !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
  }
  body.combat-ui-active #combatEnemyList.combat-slots-enemies-four > .combat-slot:not(.combat-slot-empty) {
    flex: 1 1 0 !important;
    min-height: 0 !important;
  }
  body.combat-ui-active #combatEnemyList.combat-slots-enemies-four > .combat-slot.combat-slot-empty {
    flex: 0 0 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
  }
  body.combat-ui-active #combatView .combat-slot,
  body.combat-ui-active #combatView .combat-party-row {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatView .combat-slot-inner,
  body.combat-ui-active #combatView .combatant-card-v49 {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatView .combat-party-row {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatView .combat-slot-bars,
  body.combat-ui-active #combatView .health-bar-container.combat-bars-v49--compact {
    min-height: 0 !important;
  }
  body.combat-ui-active #combatView .combat-bars-v49 .bar-background,
  body.combat-ui-active #combatView .combat-bars-v49 .bar-background-hp {
    height: 11px !important;
    min-height: 11px !important;
    max-height: 11px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
  }
  body.combat-ui-active #combatView .bar-row-swing .bar-background-swing {
    height: 4px !important;
    min-height: 4px !important;
    max-height: 4px !important;
  }
  body.combat-ui-active #combatView .bar-row.ability-bar.ability-bar-bg {
    margin-top: 0 !important;
    padding: 1px 2px !important;
  }
  body.combat-ui-active #combatView .bar-row.ability-bar .ability-cast-track {
    height: 5px !important;
    min-height: 5px !important;
    max-height: 5px !important;
  }
  body.combat-ui-active #combatView .combat-bars-v49 .bar-label {
    font-size: 7px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 11px !important;
    min-height: 11px !important;
    max-height: 11px !important;
    letter-spacing: 0.02em;
  }
  body.combat-ui-active #combatView .bar-hp-fraction,
  body.combat-ui-active #combatView .bar-mp-fraction {
    font-size: 7px !important;
    font-weight: 600;
  }
  body.combat-ui-active #combatView .combat-compact-header-row {
    gap: 3px !important;
    margin-bottom: 0 !important;
    line-height: 1.1;
  }
  body.combat-ui-active #combatView .combat-ally-name-line,
  body.combat-ui-active #combatView .combat-enemy-name-line {
    font-size: 9px !important;
    line-height: 1.15 !important;
    font-weight: 600 !important;
  }
  body.combat-ui-active #combatView .combat-status-icon-btn--header {
    font-size: 9px !important;
    line-height: 1 !important;
  }
  body.combat-ui-active #combatPartyView > h3,
  body.combat-ui-active #combatEnemyView > h3 {
    margin-bottom: 2px !important;
    margin-top: 0 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }
  body.combat-ui-active #combatPartyView.combat-arena-allies,
  body.combat-ui-active #combatEnemyView.combat-arena-enemies {
    padding: 4px 5px !important;
  }
  body.combat-ui-active #combatFaceOff.combat-face-off {
    gap: 5px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
  body.combat-ui-active #combatView .combat-zone-headline {
    font-size: clamp(1rem, 3.8vw, 1.4rem) !important;
    line-height: 1.35 !important;
    text-shadow: none !important;
  }

  .atlas-phase-select {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  .atlas-map-container,
  #atlasBestiaryContainer,
  #buildingPanel .atlas-map-container,
  #buildingContent .atlas-map-container {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }
  #atlasBestiaryContainer .bestiary-list,
  #atlasBestiaryContainer .bestiary-detail {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }
}

/* 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;
}
/* Viewport layer: evita overflow/z-index de ancestros que ocultaban proyectiles */
.mmorpg-combat-vfx-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 15000;
  overflow: visible;
  contain: none;
}
.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: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor, 0 0 28px rgba(255, 255, 255, 0.12);
  animation: vfxProjectileFly 0.4s ease-out forwards;
}
/* Fragmento de hielo (proyectil mágico frío) */
.combat-vfx-ice-shard {
  width: 14px;
  height: 22px;
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.95), 0 0 6px rgba(147, 197, 253, 0.8);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  animation: vfxIceShardFly 0.42s ease-out forwards;
}
@keyframes vfxIceShardFly {
  0% {
    transform: translate(0, 0) rotate(-20deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) rotate(8deg);
    opacity: 0.35;
  }
}
/* Cura aliado → aliado (manos / energía sanadora) */
.combat-vfx-heal-hands {
  width: 22px;
  height: 26px;
  border-radius: 45% 45% 40% 40%;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.95), 0 0 32px rgba(190, 242, 100, 0.45);
  animation: vfxHealHandsFly 0.52s ease-out forwards;
}
@keyframes vfxHealHandsFly {
  0% {
    transform: translate(0, 0) scale(0.75);
    opacity: 1;
    filter: brightness(1.15);
  }
  55% {
    transform: translate(calc(var(--to-x, 0) * 0.55), calc(var(--to-y, 0) * 0.55)) scale(1.05);
    opacity: 0.95;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) scale(0.5);
    opacity: 0.2;
  }
}
.combat-vfx-heal-self-burst {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.9), inset 0 0 12px rgba(255, 255, 255, 0.35);
  animation: vfxHealSelfBurst 0.38s ease-out forwards;
}
@keyframes vfxHealSelfBurst {
  0% {
    transform: translate(0, 0) scale(0.35);
    opacity: 1;
  }
  70% {
    transform: translate(0, 0) scale(1.15);
    opacity: 0.85;
  }
  100% {
    transform: translate(0, 0) scale(0.9);
    opacity: 0;
  }
}
/* Taunt: pulso del tanque hacia el enemigo */
.combat-vfx-taunt-pulse {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.95), 0 0 28px rgba(245, 158, 11, 0.5);
  animation: vfxTauntPulseFly 0.36s ease-out forwards;
}
@keyframes vfxTauntPulseFly {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0)) scale(1.15);
    opacity: 0.25;
  }
}
/* D-UI-2b-VISUAL — Taunt V3: anillo de AGRO hueco, estacionario y expansivo sobre la card del tanque.
   Sustituye en V3 al pulso viajero (.combat-vfx-taunt-pulse queda intacto: lo usa el mundo V2). */
.combat-vfx-taunt-ring {
  width: 48px;
  height: 48px;
  /* .combat-vfx base centra con margin -8px (VFX de ~16px); a 48px toca -24px */
  margin-left: -24px;
  margin-top: -24px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--vfx-aggro, #ec4899);
  box-shadow: 0 0 16px color-mix(in srgb, var(--vfx-aggro, #ec4899) 85%, transparent), inset 0 0 10px color-mix(in srgb, var(--vfx-aggro, #ec4899) 45%, transparent);
  animation: vfxTauntRing 0.45s ease-out forwards;
}
@keyframes vfxTauntRing {
  0% {
    transform: translate(0, 0) scale(0.55);
    opacity: 1;
  }
  100% {
    transform: translate(0, 0) scale(1.7);
    opacity: 0;
  }
}
@keyframes vfxProjectileFly {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--to-x, 0), var(--to-y, 0));
    opacity: 0.3;
  }
}

/* (D-UI-CREACION: el resaltado de atributos prioritarios vive ahora en ui/creacion.css.) */

/* 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);
}

/* Selector de fase inicial: muchas opciones (hasta 10) con scroll nativo del navegador */
.atlas-phase-select {
  min-height: 2.5rem;
  max-height: 3rem;
  -webkit-appearance: menulist-button;
  appearance: menulist-button;
}
.atlas-phase-select option {
  padding: 0.25rem 0.5rem;
}

/* Atlas interactivo - mapa de Antonica */
/* D-ARTE-1-6 — el mapa nuevo es 4:3 y se ve entero: el contenedor tiene su misma proporción (antes 16:10 con «cover»,
   que recortaba el mapa y descolocaba los puntos en %). Si no cabe de alto, se estrecha en vez de recortarse. */
.atlas-map-container {
  aspect-ratio: 4 / 3;
  width: min(100%, calc(70vh * 4 / 3)) !important;
  margin-inline: auto;
  min-height: 0 !important;
  max-height: none;
  padding: 6%;
  box-sizing: border-box;
  /* D-MAP-AMBIENCE F1 — tunables (ajustar aqui, sin logica): */
  /* D-MAPA-VIDA D-MV-TB-2 (D-MV-22) — el ciclo dura el dia de juego (2 h reales) y map.ts pone el retraso con la hora del
     mundo (--atlas-ciclo-retraso, negativo): la tinta que se ve es siempre la de la hora (antes, un bucle suelto de 150 s) */
  --atlas-cycle-dur: 7200s;  /* duracion del ciclo dia/noche completo = DIA_MUNDO_MS */
  --atlas-night-max: 0.32;   /* opacidad maxima del tinte nocturno */
}
/* D-PULIDO (mapa, Miguel 2026-10-12) — fuera la capa de nubes que derivaba (::before): se notaba mucho y, como iba
   pegada al visor y no al mapa, se quedaba quieta al arrastrar. El ciclo de día y noche (::after) se queda. */
.atlas-map-container::before { content: none; }
/* y nada de «arrastrar imagen» nativo dentro del mapa */
.atlas-map-container img { -webkit-user-drag: none; user-select: none; }
/* D-MAP-AMBIENCE F1 — ciclo dia/noche: tinte ambiental en bucle
   (amanecer calido → mediodia limpio → ocaso calido → noche azul oscura).
   z-index 1 pero ::after va ULTIMO en el arbol → tiñe terreno+nubes+conectores
   y queda SIEMPRE bajo los puntos de zona (z>=2), gane quien gane la cascada. */
.atlas-map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  animation: atlasDayNight var(--atlas-cycle-dur) linear var(--atlas-ciclo-retraso, 0s) infinite;
}
/* D-MV-TB-2 — las tintas, en las franjas de D-MV-22 (minuto de 120): alba 0-10, dia 10-75, atardecer 75-85, noche 85-120 */
@keyframes atlasDayNight {
  0%   { background-color: rgba(255, 158, 92, 0.13); }  /* alba (minuto 0) */
  8%   { background-color: rgba(255, 236, 200, 0.03); } /* manana (minuto 10) */
  30%  { background-color: rgba(255, 255, 255, 0); }    /* mediodia */
  55%  { background-color: rgba(255, 192, 120, 0.09); } /* tarde */
  62%  { background-color: rgba(255, 192, 120, 0.1); }  /* dia pleno hasta aqui (minuto 75) */
  66%  { background-color: rgba(250, 140, 84, 0.15); }  /* ocaso (minuto 80) */
  71%  { background-color: rgba(18, 32, 78, var(--atlas-night-max)); } /* noche plena (minuto 85) */
  96%  { background-color: rgba(18, 32, 78, var(--atlas-night-max)); } /* noche (mantiene hasta el minuto 115) */
  100% { background-color: rgba(255, 158, 92, 0.13); }  /* vuelve al alba */
}
/* D-MV-TB-2 — con reducir movimiento, la tinta se queda fija en la hora (antes la capa desaparecia) */
@media (prefers-reduced-motion: reduce) {
  .atlas-map-container::after { animation-play-state: paused; }
}
/* D-RELOJ-24H D-R24-4 — fuera la pastilla de la hora del Atlas (.atlas-hora): la hora la dice el indicador de arriba
   (#uiReloj, public/ui/marco.css). La capa de noche de arriba se queda igual. */
.atlas-map-bg {
  min-height: 100%;
  background-image: url("./assets/mapa/mapa_mundo_2304.webp") !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  z-index: 0;
}
.atlas-map-overlay {
  background: transparent !important;
}
/* D-ARTE-1-6 — nombres de región sobre el mapa sin texto (los pinta map.ts en % del mapa). */
.atlas-map-nombre {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: var(--ui-fuente-titulo, Georgia, serif);
  font-size: clamp(9px, 1.35vw, 15px);
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 238, 196, 0.86);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.95), 0 1px 2px rgba(0, 0, 0, 0.95);
}
.atlas-map-points {
  position: absolute;
  inset: 0;
  /* D-CHAT T6 (D-CH6-11) — sin contexto de apilado propio: así las zonas (z 20) se comparan de verdad con los puntos de
     interés (z 18) y con el grupo (z 30), que viven en .atlas-viaje. Antes, con z 10 (y el z-[2] del marcado), todo punto
     quedaba encima de toda zona y la etiqueta de una zona bajo un punto llevaba al punto. */
  z-index: auto;
}
.atlas-map-point-wrapper {
  z-index: 20;
}
.atlas-map-point {
  cursor: pointer;
  position: relative;
  z-index: 20;
}
/* D-MAPA-3 — el mapa ampliado y arrastrable: el visor recorta y el lienzo (4:3, a lo ancho) se mueve y se acerca
   (mapa_visor.ts). Los puntos y los nombres se contraescalan con --mapa-zoom para no crecer en pantalla. */
.atlas-map-container.atlas-map-visor {
  aspect-ratio: auto;
  width: 100% !important;
  height: min(72vh, 760px);
  padding: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.atlas-map-container.atlas-map-visor:active { cursor: grabbing; }
.atlas-map-lienzo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* sin will-change: con él, el navegador pinta el lienzo una vez y lo amplía como imagen (hasta ×4) y los nombres
     salían borrosos hasta que el ratón los repintaba (Miguel, 2026-10-11) */
}
.atlas-map-lienzo .atlas-map-point,
.atlas-map-lienzo .atlas-map-nombre { scale: calc(1 / var(--mapa-zoom, 1)); }
/* D-MAPA-2 — un punto por zona; lo que aún no se conoce, «?» bajo niebla */
.atlas-zona-punto-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
}
.atlas-zona-punto {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(245, 197, 66, 0.85);
  background: rgba(10, 8, 6, 0.8);
  color: #fde68a;
  font-family: var(--ui-fuente-titulo, Georgia, serif);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.atlas-zona-punto:hover { background: rgba(80, 50, 10, 0.92); box-shadow: 0 0 14px rgba(251, 191, 36, 0.55); }
/* los puntos de zona tienen su tamaño: fuera el mínimo táctil de 48 px de .atlas-map-point en pantallas estrechas */
.atlas-map-lienzo .atlas-zona-punto { min-width: 0; min-height: 0; }
.atlas-zona-punto__estado { font-size: 9.5px; color: #cbd5e1; }
.atlas-zona-punto--dominada { border-color: rgba(52, 211, 153, 0.9); }
.atlas-zona-punto--cerrada {
  width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
  border-color: rgba(203, 213, 225, 0.5);
  background: rgba(30, 35, 45, 0.72);
  color: rgba(226, 232, 240, 0.8);
  font-size: 14px;
  cursor: default;
}
.atlas-zona-niebla::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 110px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(215, 222, 232, 0.62) 0%, rgba(200, 210, 222, 0.35) 45%, transparent 72%);
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}
.atlas-mapa-controles {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.atlas-mapa-controles button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(245, 197, 66, 0.7);
  background: rgba(10, 8, 6, 0.82);
  color: #fde68a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.atlas-mapa-controles button:hover { background: rgba(80, 50, 10, 0.92); }
@media (max-width: 768px) {
  .atlas-map-container.atlas-map-visor { overflow: hidden; touch-action: none; height: 64vh; }
}
@media (max-width: 768px) {
  /* Atlas: prioridad de clics en móvil (evita ventanas superpuestas bloqueando iconos) */
  #buildingPanel {
    position: relative;
    z-index: 500;
  }
  .atlas-map-container {
    position: relative;
    z-index: 1;
    min-height: 240px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
  }
  .atlas-map-point {
    min-width: 48px;
    min-height: 48px;
    font-size: 10px;
    touch-action: manipulation;
  }
  /* Crónicas y chat: z-index más bajo en móvil para no tapar el Atlas */
  body:not(.in-combat):not(.combat-ui-active) #chroniclesSection {
    z-index: 50;
  }
}

/* Atlas Tier 2 - iconos desbloqueados */
.atlas-tier2-wrapper {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  animation: atlas-tier2-fade-in 0.6s ease-out forwards;
}
.atlas-tier2-visible {
  opacity: 1;
}
.atlas-tier2-point {
  border-color: rgba(205, 127, 50, 0.9) !important;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.4);
}
.atlas-tier2-point:hover {
  border-color: rgba(210, 180, 140, 0.95) !important;
  box-shadow: 0 0 18px rgba(205, 127, 50, 0.6);
}
@keyframes atlas-tier2-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.atlas-map-connectors {
  z-index: 1;
}
.atlas-tier2-connector {
  stroke: rgba(205, 127, 50, 0.5);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
}
.atlas-tier3-connector {
  stroke: rgba(59, 130, 246, 0.5);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
}
.atlas-tier4-connector {
  stroke: rgba(239, 68, 68, 0.5);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
}
.atlas-tier5-connector {
  stroke: rgba(249, 115, 22, 0.6);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
}
.atlas-tier3-visible,
.atlas-tier4-visible,
.atlas-tier5-visible {
  opacity: 1;
  animation: atlas-tier2-fade-in 0.6s ease-out forwards;
}

.health-bar-container {
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bar-background {
  width: 100%;
  height: 8px;
  background-color: #222;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

/* Cast / habilidad: siempre visible; vacío = ranura azul “fantasma”, lleno = gradiente azul */
.ability-bar-bg {
  margin-top: 2px;
  border-radius: 3px;
  padding: 2px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(15, 23, 42, 0.55);
  opacity: 1;
}

.bar-row.ability-bar .ability-cast-track {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 58, 138, 0.35));
  box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.45);
  border-radius: 2px;
}

.bar-row.ability-bar.ability-bar-idle .ability-cast-track {
  background: linear-gradient(180deg, rgba(2, 6, 14, 0.98), rgba(8, 12, 28, 0.92));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.65);
}

.ability-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

.ability-bar-fill.ability-bar-v2-fill {
  background: linear-gradient(90deg, #1d4ed8, #38bdf8);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}

/* Fase de CARGA (IA decidió usar habilidad, barra llenándose antes del casteo) */
.ability-bar-fill.ability-bar-v2-fill.ability-bar--charging {
  background: linear-gradient(90deg, #78350f, #f59e0b);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.30);
  transition: width 0.18s linear;
}
/* Flash breve cuando la carga llega al 100% (la clase se quita al castear) */
.ability-bar-fill.ability-bar-v2-fill.ability-bar--charge-full {
  background: linear-gradient(90deg, #d97706, #fde68a);
  box-shadow: 0 0 10px rgba(253, 230, 138, 0.65);
}

/* Estado MEDITANDO — casters sin MP */
.ability-bar--meditating {
  background: linear-gradient(90deg, #1e3a5f, #0ea5e9) !important;
  box-shadow: 0 0 6px #0ea5e9aa !important;
  animation: meditationPulse 1.8s ease-in-out infinite !important;
  position: relative;
}
.ability-bar--meditating::after {
  content: "MEDITANDO";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  color: #e0f2fe;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}
@keyframes meditationPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1;   }
}

.bar-label {
  font-size: 0.65rem;
  color: #bbb;
  margin-top: 1px;
  text-transform: uppercase;
}

.combatant-card-v49 {
  min-height: 150px;
}
#combatView .combatant-card-v49.combat-card-inner--compact {
  min-height: 0;
}

.combat-bars-v49 .bar-background {
  height: 10px;
}
.combat-bars-v49 .bar-background-hp {
  height: 20px !important;
  min-height: 20px !important;
}
#combatView .combat-bars-v49--compact .bar-background-hp {
  height: 12px !important;
  min-height: 12px !important;
}

/* v4.9.x hotfix: avoid clipping 3rd/4th bars */
#combatView .combat-slot,
#combatView .combat-slot-inner,
#combatView .combat-slot-bars,
#combatView .combat-party-row {
  overflow: visible !important;
}

#combatView .combat-slot,
#combatView .combat-slot-inner,
#combatView .combat-party-row {
  min-height: 170px !important;
}

#combatView .combat-slot-bars {
  min-height: 150px !important;
}

#combatView #combatEnemyList .combat-slot,
#combatView #combatPartyList .combat-slot {
  max-height: none !important;
}

/* Combate compacto: anular min-height altos del layout de escritorio */
body.combat-ui-active #combatView .combat-slot-inner,
body.combat-ui-active #combatView .combat-party-row,
body.combat-ui-active #combatView .combat-slot-bars {
  min-height: 0 !important;
}

/* =========================================
   ESTILO PROFESIONAL DE JUEGO (v5.2.1)
   Inspirado en image_7.png
   ========================================= */

/* Contenedor principal del cabecero */
.top-bar {
  background-color: transparent !important;
  border-bottom: 2px solid #333 !important;
  padding: 20px 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.8);
  position: relative;
  z-index: 100;
}

/* Título Principal (Dorado y Épico) */
.top-bar h1 {
  font-family: 'Cinzel', serif; /* O 'Times New Roman' si no tienes Cinzel */
  color: #e6b800 !important; /* Dorado base */
  text-transform: uppercase;
  letter-spacing: 5px;
  margin: 0;
  font-size: 2.2em;
  /* Efecto de textura dorada y resplandor */
  background: linear-gradient(180deg, #fff 0%, #e6b800 40%, #806600 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(230, 184, 0, 0.6));
}

/* Subtítulo (The Combat Simulator) */
.top-bar h1::after {
  content: "THE COMBAT SIMULATOR";
  display: block;
  font-size: 0.35em;
  color: #aaa;
  letter-spacing: 3px;
  margin-top: 5px;
  -webkit-text-fill-color: #aaa; /* Cancela el gradient del padre */
  filter: none;
}

/* Contenedor de estadísticas (Nivel, XP, Platino) */
.top-bar .stats-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  color: #eee;
  font-family: 'Verdana', sans-serif;
  font-size: 0.9em;
  text-shadow: 1px 1px 2px #000;
}

/* Nivel [ LVL 1 ] (Limpio, sin cajas) */
.top-bar .stat-level {
  color: #ccc;
}

/* Contenedor de la barra de XP */
.top-bar .xp-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #888;
  font-size: 0.8em;
}

/* Barra de XP Refinada */
.top-bar .xp-bar-wrapper {
  width: 250px;
  height: 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 0 5px #000;
}

/* Relleno de la barra de XP (Verde Neón con resplandor) */
.top-bar .xp-bar-fill {
  height: 100%;
  /* Gradiente verde neón a oscuro */
  background: linear-gradient(90deg, #00ff00 0%, #008000 100%);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
  transition: width 0.3s ease; /* Para que la animación de carga sea suave */
}

/* Panel de Platino (Premium feel con icono) */
.top-bar .stat-platinum {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffd700; /* Color Oro */
  font-weight: bold;
  /* Resplandor ámbar suave */
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Icono de Platino (Requiere que tengas una imagen de monedas) */
.top-bar .stat-platinum::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: url("./assets/images/bolsa_platino.png") no-repeat center/contain;
  /* Si no tienes imagen, este resplandor simulará la moneda */
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  border-radius: 50%;
}

/* v4.9.39: iconos de estado en combate (hover/focus = tooltip nativo) */
.combat-status-icons .combat-status-icon-btn:focus {
  outline: 1px solid rgba(129, 140, 248, 0.7);
  outline-offset: 1px;
}

/* v4.9.42: parallax de fondo por zona + auras de clase + level-up dorado */

/* v4.9.42: panel de depuración de combate oculto salvo CONFIG.showDebug o clase en body */
#combat-debug-panel {
  display: none !important;
}
body.combat-debug-on #combat-debug-panel {
  display: block !important;
}
#combatView {
  --combat-parallax-x: 0;
  --combat-parallax-y: 0;
  --combat-zone-bg: radial-gradient(ellipse at 50% 28%, rgba(99, 102, 241, 0.28) 0%, rgba(30, 27, 75, 0.55) 42%, #0f172a 100%);
}
#combatView::before {
  content: "";
  position: absolute;
  inset: -14%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: var(--combat-zone-bg);
  background-size: 118% 118%;
  background-position: calc(50% + var(--combat-parallax-x, 0) * 4.5%) calc(50% + var(--combat-parallax-y, 0) * 4.5%);
  opacity: 0.93;
  transition: background-position 0.14s ease-out;
}
#combatView > * {
  position: relative;
  z-index: 1;
}

.combat-card-aura-warrior {
  box-shadow: inset 0 0 32px rgba(220, 38, 38, 0.38), 0 0 0 1px rgba(248, 113, 113, 0.4) !important;
  background-image: radial-gradient(ellipse at 25% 0%, rgba(239, 68, 68, 0.28), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-wizard {
  box-shadow: inset 0 0 32px rgba(59, 130, 246, 0.45), 0 0 0 1px rgba(96, 165, 250, 0.42) !important;
  background-image: radial-gradient(ellipse at 72% 8%, rgba(59, 130, 246, 0.26), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-druid {
  box-shadow: inset 0 0 32px rgba(34, 197, 94, 0.42), 0 0 0 1px rgba(74, 222, 128, 0.4) !important;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.24), transparent 60%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-paladin {
  box-shadow: inset 0 0 32px rgba(250, 204, 21, 0.38), 0 0 0 1px rgba(253, 224, 71, 0.45) !important;
  background-image: radial-gradient(ellipse at 40% 0%, rgba(250, 204, 21, 0.22), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-shadowknight {
  box-shadow: inset 0 0 32px rgba(88, 28, 135, 0.5), 0 0 0 1px rgba(167, 139, 250, 0.4) !important;
  background-image: radial-gradient(ellipse at 80% 10%, rgba(109, 40, 217, 0.3), transparent 55%), linear-gradient(180deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.62)) !important;
}
.combat-card-aura-cleric {
  box-shadow: inset 0 0 32px rgba(52, 211, 153, 0.32), 0 0 0 1px rgba(167, 243, 208, 0.42) !important;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(209, 250, 229, 0.2), transparent 60%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-shaman {
  box-shadow: inset 0 0 32px rgba(45, 212, 191, 0.38), 0 0 0 1px rgba(94, 234, 212, 0.4) !important;
  background-image: radial-gradient(ellipse at 30% 0%, rgba(45, 212, 191, 0.22), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-mage {
  box-shadow: inset 0 0 32px rgba(249, 115, 22, 0.42), 0 0 0 1px rgba(251, 146, 60, 0.45) !important;
  background-image: radial-gradient(ellipse at 70% 5%, rgba(234, 88, 12, 0.26), transparent 55%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-necro {
  box-shadow: inset 0 0 32px rgba(126, 34, 206, 0.45), 0 0 0 1px rgba(192, 132, 252, 0.42) !important;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(147, 51, 234, 0.28), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.6)) !important;
}
.combat-card-aura-enchanter {
  box-shadow: inset 0 0 32px rgba(217, 70, 239, 0.38), 0 0 0 1px rgba(232, 121, 249, 0.42) !important;
  background-image: radial-gradient(ellipse at 60% 8%, rgba(217, 70, 239, 0.22), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-hunter {
  box-shadow: inset 0 0 32px rgba(34, 197, 94, 0.35), 0 0 0 1px rgba(163, 230, 53, 0.38) !important;
  background-image: radial-gradient(ellipse at 45% 0%, rgba(132, 204, 22, 0.2), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-rogue {
  box-shadow: inset 0 0 32px rgba(245, 158, 11, 0.4), 0 0 0 1px rgba(251, 191, 36, 0.42) !important;
  background-image: radial-gradient(ellipse at 25% 0%, rgba(245, 158, 11, 0.22), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-monk {
  box-shadow: inset 0 0 32px rgba(249, 115, 22, 0.36), 0 0 0 1px rgba(251, 146, 60, 0.4) !important;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(234, 88, 12, 0.2), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}
.combat-card-aura-bard {
  box-shadow: inset 0 0 32px rgba(34, 211, 238, 0.38), 0 0 0 1px rgba(103, 232, 249, 0.42) !important;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(6, 182, 212, 0.2), transparent 58%), linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.58)) !important;
}

.combat-level-up-flash {
  animation: combatLevelUpGoldFlash 0.88s ease-out forwards;
}
@keyframes combatLevelUpGoldFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    filter: brightness(1);
  }
  40% {
    box-shadow: 0 0 36px 10px rgba(250, 204, 21, 0.88);
    filter: brightness(1.28);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    filter: brightness(1);
  }
}

.combat-level-up-burst {
  position: absolute;
  inset: -8px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.58) 0%, rgba(250, 204, 21, 0.2) 45%, transparent 72%);
  animation: combatLevelUpBurstAnim 0.72s ease-out forwards;
  opacity: 0;
}
@keyframes combatLevelUpBurstAnim {
  0% {
    opacity: 0;
    transform: scale(0.52);
  }
  42% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 0;
    transform: scale(1.38);
  }
}

/* Columnas Tu grupo | Enemigos: misma altura flexible dentro del arena */
#combatPartyView,
#combatEnemyView {
  min-height: 280px;
  flex: 1 1 0;
  box-sizing: border-box !important;
}
@media (min-width: 1024px) {
  #combatPartyView,
  #combatEnemyView {
    min-height: 360px;
  }
}

/* Barra de casteo: track */
/* Reserva altura del nombre de habilidad: la franja de buffs no salta al castear */
#combatView .combat-bars-v49--compact .bar-row.ability-bar .bar-label,
#combatView .bar-row.ability-bar .bar-label {
  min-height: 12px;
  max-height: 12px;
  line-height: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
#combatView .bar-row.ability-bar .ability-cast-track {
  height: 8px;
  position: relative;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
#combatView .ability-bar-fill.ability-bar-v2-fill {
  height: 100%;
  transition: width 0.1s linear, background 0.25s ease, box-shadow 0.25s ease;
  will-change: width;
}
#combatView .ability-bar-fill.ability-bar-v2-fill.ability-bar--charging {
  transition: width 0.18s linear, background 0.25s ease;
}
#combatView .bar-row.ability-bar.ability-bar-idle .ability-cast-track {
  background: linear-gradient(180deg, rgba(2, 6, 14, 0.98), rgba(8, 12, 28, 0.92));
}

/* Log de combate: colapsado = discreto; expandido = más historial (siempre bajo el arena) */
#combat-log.combat-log-visual-collapsed #combatLogExpandable {
  display: flex !important;
  flex-direction: column;
}
#combat-log.combat-log-visual-collapsed .combat-log-expandable > div:first-of-type {
  display: none;
}
@media (max-width: 1023px) {
  #combat-log.combat-log-visual-collapsed #combatLogBox {
    max-height: 4.25rem !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
}
#combat-log.combat-log-visual-collapsed {
  min-height: 0;
}
#combat-log:not(.combat-log-visual-collapsed):not(.collapsed) #combatLogBox {
  max-height: min(38vh, 280px);
}
@media (max-width: 1023px) {
  /* Móvil en combate: muelle h-24 (96px) para no comer espacio a los luchadores */
  body.combat-ui-active #combat-log.combat-log-visual-collapsed {
    max-height: 6rem;
    overflow: hidden;
  }
  body.combat-ui-active #combat-log.combat-log-visual-collapsed #combatLogExpandable {
    max-height: calc(6rem - 2.75rem);
    min-height: 0;
  }
  body.combat-ui-active #combat-log.combat-log-visual-collapsed #combatLogBox {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  #combat-log:not(.combat-log-visual-collapsed):not(.collapsed) #combatLogBox {
    max-height: min(42vh, 320px);
  }
}

/* Botón dorado RPG (global) */
.rpg-button-gold {
  background: linear-gradient(to bottom, #2a2a3a, #1a1a2a) !important;
  border: 1px solid #f59e0b !important;
  color: #fbbf24 !important;
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.5) !important;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.1), 0 5px 15px rgba(0,0,0,0.5) !important;
  transition: all 0.2s ease !important;
  font-family: 'Cinzel', serif !important;
}

.rpg-button-gold:hover {
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6) !important;
  transform: translateY(-1px);
}

.rpg-button-gold:active {
  transform: translateY(1px);
}

/* Ancient Gold theme - Login / Character Creation */
#characterCreation:not(.hidden) {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  background: transparent !important;
}

#characterCreation.hidden {
  display: none !important;
}

#characterCreation .ancient-gold-backdrop {
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.5), rgba(2, 6, 23, 0.85) 70%, rgba(0, 0, 0, 0.95));
  border-radius: 1.25rem;
  padding: 0.5rem;
  position: relative;
}

.login-vortex-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#characterCreation .ancient-gold-panel {
  max-width: 1050px;
  margin: 0 auto;
  border: var(--rpg-gold-frame-border) solid transparent !important;
  background: var(--rpg-glass-fill) padding-box, var(--rpg-gold-gradient-frame) border-box !important;
  background-clip: padding-box, border-box !important;
  background-origin: padding-box, border-box !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-radius: 0;
  padding: 1.2rem;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.88),
    0 12px 40px rgba(0, 0, 0, 0.65);
  position: relative;
  z-index: 10;
}

#characterCreation .ancient-gold-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 96px;
  margin-bottom: 1rem;
}

#characterCreation .ancient-gold-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 200, 90, 0.45));
  opacity: 0.95;
}

#characterCreation .ancient-gold-panel h2,
#characterCreation .ancient-gold-panel h3 {
  font-family: var(--rpg-font-ui);
  letter-spacing: 0.04em;
}

#characterCreation .ancient-gold-panel .text-rpgName {
  font-family: var(--rpg-font-display);
  letter-spacing: 0.04em;
}

#characterCreation .ancient-gold-create-btn {
  font-family: var(--rpg-font-ui);
  border: 1px solid rgba(255, 218, 128, 0.9) !important;
  background: linear-gradient(180deg, #ffd778 0%, #d6a53a 45%, #b8860b 100%) !important;
  color: #1b1302 !important;
  text-shadow: 0 1px 0 rgba(255, 237, 177, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 210, 0.85),
    0 6px 16px rgba(120, 80, 8, 0.45),
    0 0 8px rgba(214, 165, 58, 0.35);
}

#characterCreation .ancient-gold-create-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe6a8 0%, #e6bf64 45%, #cf9a24 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 228, 0.95),
    0 8px 20px rgba(120, 80, 8, 0.6),
    0 0 18px rgba(255, 204, 102, 0.6) !important;
  transform: translateY(-1px);
}

#characterCreation .ancient-gold-create-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.img-blend-gold {
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.1);
}

.ancient-gold-panel {
  border: var(--rpg-gold-frame-border) solid transparent !important;
  background: linear-gradient(rgba(10, 14, 26, 0.55), rgba(10, 14, 26, 0.55)) padding-box,
    var(--rpg-gold-gradient-frame) border-box !important;
  background-clip: padding-box, border-box !important;
  background-origin: padding-box, border-box !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 0, 0, 0.8);
}

/* Header Ancient Gold */
.header-bar-ancient-gold {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.5) 0%, rgba(5, 7, 12, 0.7) 100%) !important;
  backdrop-filter: blur(15px) !important;
  border-bottom: 2px solid #b8860b !important;
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4), 0 0 30px rgba(0, 0, 0, 0.8) !important;
  min-height: 72px;
  height: auto;
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  position: static !important;
  z-index: 0 !important;
  overflow: visible;
}

/* Selector de idioma (cabecero): posición absoluta, no desplaza el título */
.header-bar-ancient-gold.v2-header-bar {
  position: relative !important;
}
.v2-header-lang-flags {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 6;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  pointer-events: auto;
}
.v2-lang-flag-btn {
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.28rem;
  margin: 0;
  border: none;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  /* Banderas son Regional Indicator Sequences — necesitan fuente emoji explícita en Windows */
  font-family: var(--rpg-emoji-stack), sans-serif;
}
.v2-lang-flag-btn:hover {
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.35);
}
.v2-lang-flag-btn:active {
  transform: scale(0.98);
}
/* Opciones: banderas más grandes + idioma activo */
.v2-lang-flag-btn--options {
  font-size: 2.25rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.45);
}
.v2-lang-flag-btn--active {
  outline: 2px solid rgba(212, 175, 55, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 14px rgba(212, 175, 55, 0.55);
  opacity: 1;
}

/* El contenido principal (incluida creación) debe quedar por encima del cabecero */
main,
#heroChoice,
#characterCreation,
#cityView {
  position: relative;
  z-index: 20;
}

/* D-OPCIONES-REDISENO A-2 — fuera el prefetch de fondo.png y de la capa atmosférica (ya no existen en la ciudad). */

/* Nivel en cabecera (Cinzel; el título del juego usa .text-rpgName = MedievalSharp) */
#userLevelText {
  font-family: "Cinzel", serif !important;
  color: #ffd700 !important;              /* Oro brillante */
  font-size: 0.92rem;                     /* Tamaño más compacto para móvil */
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6); /* Brillo dorado */
  display: flex;
  align-items: center;
  gap: 4px;                               /* Espacio entre palabra y número */
}

/* Este es solo el número (el valor $nivel) */
#userLevel {
  font-size: 1.05rem;
  font-weight: bold;
  color: #ffffff;                         /* Puedes ponerlo blanco o mantenerlo oro */
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@media (max-width: 768px) {
  #userLevelText { font-size: 0.82rem; letter-spacing: 1px; gap: 3px; }
  #userLevel { font-size: 0.95rem; }
}

/* Header dropdown menu */
.dropdown-options-menu {
  display: none;
  position: absolute;
  top: 55px;
  right: 20px;
  background: rgba(10, 14, 26, 0.95);
  border: 1px solid #b8860b;
  padding: 10px;
  z-index: 2000;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
}
.dropdown-options-menu.active {
  display: flex;
}
.dropdown-options-menu button {
  background: transparent;
  color: #b8860b;
  text-align: left;
  padding: 8px;
  width: 100%;
  transition: 0.3s;
}
.dropdown-options-menu button:hover {
  background: rgba(184, 134, 11, 0.1);
}

#optionsDropdown {
  background: rgba(10, 14, 26, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid #b8860b !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(184, 134, 11, 0.2) !important;
  border-radius: 4px;
  padding: 10px;
  z-index: 5000 !important;
}

#optionsDropdown button {
  font-family: "Cinzel", serif;
  color: #b8860b;
  font-size: 0.9rem;
  transition: 0.3s ease;
}

#optionsDropdown button:hover {
  background: rgba(184, 134, 11, 0.15);
  color: #ffd700;
}

#optionsIcon,
#optionsBtn {
  color: #d4af37 !important;
}

#optionsIcon:hover,
#optionsBtn:hover {
  filter: drop-shadow(0 0 5px #b8860b);
}

/* Durante splash/login: ocultar cabecero y botón flotante de selección */
body.splash-active .header-bar-ancient-gold,
body.splash-active #campToHeroSelectBtn,
body.splash-active #optionsIcon {
  display: none !important;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(3px);
}

@keyframes rpg-dialogue-panel-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Panel raíz: animación de entrada; layout de dos columnas solo en tutorial / Flanagan */
.tutorial-overlay-panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  opacity: 0;
  transform: scale(0.98);
  animation: rpg-dialogue-panel-in 0.3s ease forwards;
}

.tutorial-overlay-panel:not(.quest-dialogue-panel):not(.cloak-drama-panel) {
  width: min(1040px, 95vw);
  min-height: 420px;
  max-height: 92vh;
  padding: 1rem 1.25rem 1.5rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(240px, 1fr);
  align-items: end;
  gap: 0.35rem 1.15rem;
}

/* Cámara de diálogo de misiones — cristal, Cinzel + EB Garamond */
.quest-dialogue-overlay {
  z-index: 260;
}

.quest-dialogue-panel.tutorial-overlay-panel {
  width: min(820px, 96vw);
  max-height: 90vh;
  padding: 0;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quest-dialogue-layout {
  display: grid;
  grid-template-columns: minmax(120px, 0.92fr) minmax(200px, 1.35fr);
  gap: 0 0.15rem;
  align-items: end;
  min-height: min(360px, 72vh);
  max-height: 90vh;
}

.quest-dialogue-npc-col {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.35rem 0.2rem 0.65rem 0.65rem;
  pointer-events: none;
}

.quest-dialogue-portrait {
  width: min(38vw, 300px);
  max-height: min(70vh, 460px);
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(197, 160, 89, 0.16));
}

.quest-dialogue-codex-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(72vh, 520px);
  margin: 0.75rem 0.75rem 0.75rem 0;
  padding: 0.95rem 1.1rem 0.5rem;
  border-radius: 0.75rem;
  background: rgba(10, 8, 16, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(197, 160, 89, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 50px rgba(0, 0, 0, 0.52),
    0 0 1px rgba(197, 160, 89, 0.35);
  overflow: hidden;
}

.quest-dialogue-codex-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.quest-dialogue-heading-block {
  min-width: 0;
}

.quest-dialogue-kicker {
  margin: 0 0 0.2rem;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(197, 160, 89, 0.72);
}

.quest-dialogue-title {
  margin: 0;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2.1vw, 1.32rem);
  font-weight: 600;
  color: #c5a059;
  line-height: 1.22;
}

.quest-dialogue-subtitle {
  margin: 0.2rem 0 0;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 0.98rem;
  color: rgba(229, 224, 213, 0.78);
}

.quest-dialogue-close {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(197, 160, 89, 0.4);
  background: rgba(8, 6, 14, 0.55);
  color: rgba(197, 160, 89, 0.9);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease;
}

.quest-dialogue-close:hover {
  border-color: rgba(251, 191, 106, 0.85);
  color: #f5e6bc;
  box-shadow: 0 0 14px rgba(217, 150, 64, 0.45);
}

.quest-dialogue-body {
  flex: 1;
  min-height: 2.75rem;
  max-height: min(38vh, 280px);
  overflow-y: auto;
  margin-bottom: 0.35rem;
  padding-right: 0.35rem;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.52;
  color: #e5e0d5;
}

.quest-dialogue-body p {
  margin: 0 0 0.6em;
}

body.mmorpg-quest-dialogue-open #combatView {
  filter: saturate(0.85) brightness(0.92);
  pointer-events: none;
}

.dialogue-options,
.quest-dialogue-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.55rem 0 0.15rem;
  margin-top: auto;
  border-top: 1px solid rgba(197, 160, 89, 0.22);
  background: linear-gradient(to top, rgba(6, 4, 12, 0.88) 0%, rgba(6, 4, 12, 0.35) 55%, transparent 100%);
}

.dialogue-option-btn {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 0.55rem 1rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: linear-gradient(165deg, rgba(52, 44, 68, 0.95) 0%, rgba(18, 14, 28, 0.98) 50%, rgba(36, 28, 52, 0.92) 100%);
  color: #c5a059;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 0.8rem; /* D-LT-3: caja normal (antes uppercase a 0.68rem) */
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 6px rgba(0, 0, 0, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.38);
  transition: border-color 0.25s ease, color 0.2s ease, box-shadow 0.28s ease, transform 0.2s ease;
}

.dialogue-option-btn:hover:not(:disabled) {
  border-color: rgba(251, 191, 106, 0.88);
  color: #f5e6bc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 20px rgba(217, 150, 64, 0.5),
    0 0 36px rgba(251, 191, 36, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.42);
  transform: translateY(-1px);
}

.dialogue-option-btn--primary {
  border-color: rgba(212, 175, 89, 0.65);
  background: linear-gradient(165deg, rgba(72, 52, 28, 0.92) 0%, rgba(28, 18, 12, 0.96) 100%);
}

.dialogue-option-btn--disabled,
.dialogue-option-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.tutorial-apenao {
  position: relative;
  z-index: 3;
  left: auto;
  top: auto;
  transform: none;
  display: block;
  max-width: 100%;
  width: min(50vw, 430px);
  max-height: min(78vh, 540px);
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0;
  margin: 0;
  pointer-events: none;
  align-self: end;
  justify-self: start;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(197, 160, 89, 0.2));
}

.tutorial-pergamino-wrap {
  position: relative;
  z-index: 2;
  right: auto;
  top: auto;
  transform: none;
  width: min(52vw, 540px);
  height: min(72vh, 450px);
  max-height: min(72vh, 450px);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  background: rgba(10, 8, 16, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(197, 160, 89, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 50px rgba(0, 0, 0, 0.52),
    0 0 1px rgba(197, 160, 89, 0.35);
}

.tutorial-pergamino-text {
  position: relative;
  flex: 1;
  min-height: 0;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  padding: 1.3rem 1.45rem 4.35rem;
  overflow-y: auto;
  overflow-x: hidden;
  color: #e5e0d5;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: clamp(14px, 1.32vw, 20px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 160, 89, 0.45) transparent;
}

.tutorial-dialog {
  position: absolute;
  z-index: 4;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.86);
  padding: 0.8rem 0.9rem;
}

.tutorial-dialog-text {
  min-height: 3.4rem;
  color: #f8fafc;
  font-size: 0.95rem;
  line-height: 1.4;
  text-shadow: 0 0 12px rgba(15, 23, 42, 0.9);
}

.tutorial-dialog-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tutorial-dialog-actions--floating {
  position: absolute;
  z-index: 4;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
}

.tutorial-pergamino-wrap > .tutorial-dialog-actions--floating {
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.5rem 0.9rem 0.8rem;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(to top, rgba(6, 4, 12, 0.94) 0%, rgba(6, 4, 12, 0.45) 55%, transparent 100%);
  border-top: 1px solid rgba(197, 160, 89, 0.24);
}

.tutorial-btn {
  position: relative;
  border-radius: 0.35rem;
  padding: 0.48rem 1.2rem;
  min-width: 3.6rem;
  border: 1px solid rgba(197, 160, 89, 0.52);
  background: linear-gradient(165deg, rgba(55, 48, 72, 0.96) 0%, rgba(20, 16, 30, 0.98) 45%, rgba(38, 30, 54, 0.93) 100%);
  color: #c5a059;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -2px 6px rgba(0, 0, 0, 0.48),
    0 2px 10px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, color 0.2s ease, box-shadow 0.28s ease, transform 0.2s ease;
}

.tutorial-btn:hover {
  filter: none;
  border-color: rgba(251, 191, 106, 0.88);
  color: #f5e6bc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.17),
    0 0 18px rgba(217, 150, 64, 0.52),
    0 0 34px rgba(251, 191, 36, 0.22),
    0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.tutorial-btn-no {
  border-color: rgba(180, 90, 90, 0.55);
  color: #d4a5a5;
}

.tutorial-btn-no:hover {
  border-color: rgba(248, 113, 113, 0.75);
  color: #fecaca;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px rgba(220, 100, 80, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.45);
}

.tutorial-btn-yes {
  border-color: rgba(212, 175, 89, 0.62);
  color: #d4b46a;
}

.tutorial-btn-yes:hover {
  border-color: rgba(251, 191, 106, 0.9);
  color: #f5e6bc;
}

@media (max-width: 640px) {
  .tutorial-overlay-panel:not(.quest-dialogue-panel):not(.cloak-drama-panel) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(220px, 1fr);
    align-items: stretch;
    max-height: none;
  }

  .tutorial-apenao {
    width: min(78vw, 300px);
    max-height: 42vh;
    justify-self: center;
    align-self: end;
  }

  .tutorial-pergamino-wrap {
    width: 100%;
    height: min(48vh, 380px);
    max-height: min(48vh, 380px);
  }

  .quest-dialogue-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    min-height: 0;
  }

  .quest-dialogue-npc-col {
    padding: 0.25rem 0.5rem 0;
  }

  .quest-dialogue-portrait {
    width: min(58vw, 240px);
    max-height: 40vh;
  }

  .quest-dialogue-codex-col {
    margin: 0 0.5rem 0.65rem;
    max-height: min(52vh, 420px);
  }
}

/* Cinemática «El Sueño de Snail» — dos columnas: izquierda / derecha según escena */
.cloak-drama-panel {
  display: flex;
  flex-direction: column;
  min-height: min(78vh, 580px);
  max-height: 92vh;
  padding: 1rem 1.25rem 3.35rem;
  box-sizing: border-box;
}
.cloak-drama-detached-pool {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
  z-index: 0;
}
.cloak-drama-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  gap: 0.75rem 1.25rem;
  min-height: 0;
}
.cloak-drama-stage--with-footer {
  grid-template-rows: 1fr auto;
}
/* Solo dos retratos (p. ej. Snail | Bosckai), sin pergamino */
.cloak-drama-stage--portraits-only .cloak-drama-slot {
  min-height: min(56vh, 400px);
}
.cloak-drama-stage--portraits-only .cloak-drama-portrait-img {
  max-height: min(56vh, 400px);
}
.cloak-drama-slot {
  width: 100%;
  max-width: min(46vw, 440px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(46vh, 340px);
}
.cloak-drama-portrait-img {
  width: 100%;
  height: 100%;
  max-width: min(46vw, 440px);
  max-height: min(46vh, 340px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.22));
}
.cloak-drama-slot--filler {
  width: 100%;
  max-width: min(46vw, 440px);
  min-height: min(36vh, 260px);
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  box-sizing: border-box;
}
.cloak-drama-pergamino-span {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: min(92vw, 720px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 0.25rem;
}
.cloak-drama-pergamino-wrap {
  position: relative !important;
  width: 100% !important;
  max-width: min(46vw, 440px) !important;
  height: min(46vh, 340px) !important;
  max-height: min(46vh, 340px) !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
}
.cloak-drama-pergamino-span .cloak-drama-pergamino-wrap {
  max-width: min(92vw, 720px) !important;
  height: min(40vh, 300px) !important;
  max-height: min(40vh, 300px) !important;
}
.cloak-drama-overlay .tutorial-dialog-actions--floating {
  bottom: 0.35rem;
}

/* Texto dentro del área útil del rollo (no hereda 22% del .tutorial-pergamino-text global) */
.cloak-drama-overlay .cloak-drama-pergamino-wrap {
  overflow: hidden;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
}
.cloak-drama-overlay .cloak-drama-pergamino-wrap .tutorial-pergamino-text {
  position: relative;
  flex: 1;
  min-height: 0;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  padding: 0.7rem 0.95rem;
  font-size: clamp(10px, 2.05vw, 15px);
  line-height: 1.32;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

@media (max-width: 720px) {
  .cloak-drama-stage {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .cloak-drama-stage--with-footer {
    grid-template-rows: auto auto auto;
  }
  .cloak-drama-slot {
    min-height: min(38vh, 280px);
    max-width: min(92vw, 440px);
  }
  .cloak-drama-portrait-img {
    max-height: min(38vh, 280px);
  }
  .cloak-drama-pergamino-wrap {
    max-width: min(92vw, 440px) !important;
    height: min(42vh, 300px) !important;
    max-height: min(42vh, 300px) !important;
  }
  .cloak-drama-overlay .cloak-drama-pergamino-wrap .tutorial-pergamino-text {
    padding: 0.55rem 0.75rem;
    font-size: clamp(9px, 3vw, 14px);
    line-height: 1.28;
  }
  .cloak-drama-stage--portraits-only .cloak-drama-slot {
    min-height: min(42vh, 300px);
  }
  .cloak-drama-stage--portraits-only .cloak-drama-portrait-img {
    max-height: min(42vh, 300px);
  }
}

/* ——— Splash: fondo vivo, niebla, relámpago ——— */
.splash-screen-legendary {
  position: fixed;
  isolation: isolate;
}

.splash-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.splash-bg-photo {
  position: absolute;
  inset: -14px;
  z-index: 0;
  background: #070503;
  transform: scale(1.06);
  transform-origin: center center;
  /* Sin filter: drop-shadow aquí: sombras dinámicas + fondo en movimiento = parpadeo en WebView */
}

.splash-fog {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.42;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: none;
  -webkit-filter: none;
}

.splash-fog--a {
  z-index: 1;
  will-change: transform, background-position;
  background:
    radial-gradient(ellipse 90% 55% at 15% 45%, rgba(148, 163, 184, 0.35), transparent 52%),
    radial-gradient(ellipse 70% 45% at 75% 55%, rgba(100, 116, 139, 0.28), transparent 48%),
    radial-gradient(ellipse 50% 35% at 50% 80%, rgba(71, 85, 105, 0.22), transparent 50%);
  background-size: 180% 160%;
  animation: splash-fog-drift-a 85s ease-in-out infinite;
}

.splash-fog--b {
  z-index: 2;
  opacity: 0.38;
  will-change: transform, background-position;
  background:
    radial-gradient(ellipse 75% 50% at 60% 30%, rgba(203, 213, 225, 0.22), transparent 50%),
    radial-gradient(ellipse 85% 40% at 25% 70%, rgba(148, 163, 184, 0.2), transparent 55%);
  background-size: 200% 180%;
  animation: splash-fog-drift-b 105s ease-in-out infinite;
}

@keyframes splash-fog-drift-a {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    background-position: 20% 40%, 80% 60%, 50% 85%;
  }
  25% {
    transform: translate3d(8%, -5%, 0) rotate(0.35deg) scale(1.05);
    background-position: 35% 50%, 65% 45%, 58% 70%;
  }
  50% {
    transform: translate3d(12%, 3%, 0) rotate(-0.2deg) scale(1.07);
    background-position: 50% 35%, 45% 55%, 42% 60%;
  }
  75% {
    transform: translate3d(-4%, 6%, 0) rotate(0.15deg) scale(1.03);
    background-position: 10% 55%, 85% 40%, 55% 90%;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    background-position: 20% 40%, 80% 60%, 50% 85%;
  }
}

@keyframes splash-fog-drift-b {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1.02);
    background-position: 60% 30%, 25% 70%;
  }
  33% {
    transform: translate3d(-10%, 6%, 0) rotate(-0.4deg) scale(1.06);
    background-position: 45% 45%, 40% 55%;
  }
  66% {
    transform: translate3d(6%, -8%, 0) rotate(0.25deg) scale(1.04);
    background-position: 75% 25%, 15% 75%;
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1.02);
    background-position: 60% 30%, 25% 70%;
  }
}

.splash-screen-legendary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 55% 40% at 28% 18%, rgba(255, 255, 255, 0.22), transparent 58%),
    linear-gradient(185deg, rgba(200, 230, 255, 0.12) 0%, transparent 45%);
  mix-blend-mode: screen;
  transition: opacity 0.07s linear;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.splash-screen-legendary.splash-screen-legendary--flash::after {
  opacity: 1;
  transition: opacity 0.05s linear;
}

#splashScreen h1.splash-legendary-title.text-rpgName {
  filter:
    drop-shadow(0 0 18px rgba(255, 220, 140, 0.95))
    drop-shadow(0 0 42px rgba(245, 190, 80, 0.65))
    drop-shadow(0 0 72px rgba(245, 158, 11, 0.42))
    drop-shadow(0 0 110px rgba(180, 120, 30, 0.22))
    drop-shadow(0 3px 12px rgba(0, 0, 0, 0.98)) !important;
}

#splashScreen .splash-tagline.splash-tagline-legendary {
  font-family: "Cinzel", Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
  color: #c0c0c0 !important;
  -webkit-text-fill-color: #c0c0c0 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65), 0 0 20px rgba(192, 192, 192, 0.18);
}

/* Panel único de estado de sesión (bajo el logo; v0.2.3) */
.splash-gate-panel {
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.72) 0%, rgba(2, 6, 23, 0.78) 100%);
  border: 1px solid rgba(125, 211, 252, 0.28);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(224, 242, 254, 0.1);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

.splash-gate-panel__text:empty {
  min-height: 0;
}

/* Durante OAuth / login: oculta el panel de estado para dar espacio al skeleton de carga */
.splash-gate-panel.splash-gate-panel--oauth-active {
  visibility: hidden;
  overflow: hidden;
  max-height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-width: 0;
  box-shadow: none;
  pointer-events: none;
}

#splashScreen .v2-auth-mirror--compact {
  opacity: 0.92;
}

.splash-loading-card-legendary {
  position: relative;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.52) 0%, rgba(2, 6, 23, 0.62) 100%) !important;
  backdrop-filter: blur(26px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.15) !important;
  border: 1px solid rgba(212, 175, 55, 0.42) !important;
  box-shadow:
    0 0 0 1px rgba(90, 55, 15, 0.55),
    0 0 0 2px rgba(253, 224, 71, 0.22),
    0 0 28px rgba(245, 158, 11, 0.14),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 248, 220, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38) !important;
}

#splashLoadingCard .rpg-skeleton {
  background: linear-gradient(
    110deg,
    rgba(6, 78, 59, 0.88) 0%,
    rgba(8, 145, 178, 0.55) 38%,
    rgba(52, 211, 153, 0.45) 50%,
    rgba(6, 182, 212, 0.5) 62%,
    rgba(6, 78, 59, 0.88) 100%
  );
  background-size: 220% 100%;
  animation:
    rpg-skeleton-shimmer 1.35s ease-in-out infinite,
    splash-skeleton-pulse 2.4s ease-in-out infinite;
  box-shadow:
    inset 0 0 0 1px rgba(45, 212, 191, 0.35),
    0 0 12px rgba(34, 211, 238, 0.12);
}

@keyframes splash-skeleton-pulse {
  0%,
  100% {
    filter: brightness(1);
    opacity: 1;
  }
  50% {
    filter: brightness(1.12);
    opacity: 0.94;
  }
}

/* Sin scale: el pulso 4.2s + escala ~3.5% hacía “saltar” toda la tarjeta/splash en móvil (reflow visual). */
@keyframes splash-avatar-breath {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(245, 158, 11, 0.28),
      0 0 28px rgba(245, 158, 11, 0.1),
      inset 0 0 0 1px rgba(251, 191, 36, 0.32);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 20px rgba(245, 200, 100, 0.36),
      0 0 36px rgba(245, 158, 11, 0.14),
      inset 0 0 0 1px rgba(253, 224, 71, 0.4);
    filter: brightness(1.04);
  }
}

.splash-avatar-breath {
  animation: splash-avatar-breath 5.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .splash-avatar-breath {
    animation: none;
    filter: none;
  }
}

/* ——— v0.2.2 — Google login: cristal esmerilado al instante (pointerdown / teclado; sin esperar a Firebase) ——— */
#splashLoadingCard.splash-google-crystal-pending.splash-loading-card-legendary,
#splashScreen.splash-google-crystal-pending #splashLoadingCard.splash-loading-card-legendary {
  background: linear-gradient(
    155deg,
    rgba(30, 58, 95, 0.52) 0%,
    rgba(15, 23, 42, 0.88) 42%,
    rgba(2, 6, 23, 0.92) 100%
  ) !important;
  border-color: rgba(125, 211, 252, 0.48) !important;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.3),
    0 0 40px rgba(14, 165, 233, 0.22),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(224, 242, 254, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38) !important;
}

#v2LoginSlot.splash-google-crystal-pending.v2-glass {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  box-shadow:
    inset 0 1px 0 rgba(224, 242, 254, 0.08),
    0 8px 28px rgba(0, 0, 0, 0.48) !important;
}

/* ——— v0.2.2 — Móvil / táctil: sin blur (parpadeo WebView); cristal = rgba(255,255,255,0.1); niebla plana ——— */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  *,
  *::before,
  *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Cualquier filter con blur() en capas animadas destroza el compositor en Android */
  body.rpg-app::before {
    filter: brightness(0.6) !important;
    -webkit-filter: brightness(0.6) !important;
  }

  .splash-bg-photo {
    filter: brightness(0.6) !important;
    -webkit-filter: brightness(0.6) !important;
  }

  /* Niebla login: sin sombras dinámicas; sin animaciones pesadas (solo capas planas estáticas) */
  .splash-fog,
  .splash-fog--a,
  .splash-fog--b {
    filter: none !important;
    -webkit-filter: none !important;
    mix-blend-mode: normal;
    animation: none !important;
    will-change: auto !important;
  }

  .splash-fog--a {
    opacity: 0.32;
  }

  .splash-fog--b {
    opacity: 0.26;
  }

  /* Título: adiós a filter: drop-shadow (costoso sobre fondo en movimiento) */
  #splashScreen h1.splash-legendary-title.text-rpgName {
    filter: none !important;
    text-shadow:
      0 0 14px rgba(255, 220, 140, 0.55),
      0 0 28px rgba(245, 158, 11, 0.35),
      0 2px 10px rgba(0, 0, 0, 0.95) !important;
  }

  /* Sustituto del cristal esmerilado (sin backdrop-blur) */
  .rpg-panel,
  .rpg-panel.bg-rpgCard,
  .bg-rpgCard {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .header-bar-ancient-gold {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.08) 100%
    ) !important;
  }

  .splash-loading-card-legendary {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .splash-gate-panel {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
  }

  #splashLoadingCard.splash-google-crystal-pending.splash-loading-card-legendary,
  #splashScreen.splash-google-crystal-pending #splashLoadingCard.splash-loading-card-legendary {
    background: rgba(255, 255, 255, 0.12) !important;
  }

  #v2LoginSlot.splash-google-crystal-pending.v2-glass {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .rpg-medieval-frame,
  #characterCreation .ancient-gold-panel,
  .ancient-gold-panel {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)) padding-box,
      var(--rpg-gold-gradient-frame) border-box !important;
    background-clip: padding-box, border-box !important;
    background-origin: padding-box, border-box !important;
  }

  #optionsDropdown {
    background: rgba(255, 255, 255, 0.12) !important;
  }

  .tutorial-overlay-backdrop {
    background: rgba(2, 6, 23, 0.92) !important;
    filter: none !important;
    -webkit-filter: none !important;
  }
}

/* z-index ya definido arriba en bloque tema oscuro */

/* Temporizadores incursión / forja (barra + float de botín) */
/* Destello corto al pasar a "listo" */
.forge-queue-slot--ready-flash {
  animation: mmorpgReadyCardFlash 620ms ease-out;
}
@keyframes mmorpgReadyCardFlash {
  0% {
    box-shadow:
      0 0 0 0 rgba(253, 224, 71, 0),
      inset 0 0 0 0 rgba(254, 249, 195, 0);
  }
  35% {
    box-shadow:
      0 0 0 1px rgba(253, 224, 71, 0.85),
      0 0 20px rgba(251, 191, 36, 0.52),
      inset 0 0 16px rgba(254, 240, 138, 0.22);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(253, 224, 71, 0),
      inset 0 0 0 0 rgba(254, 249, 195, 0);
  }
}
@keyframes mmorpgTimerBarStripes {
  0% { background-position: 0 0; }
  100% { background-position: 30px 0; }
}
@keyframes mmorpgTimerBarSweep {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 0.45; }
  100% { transform: translateX(430%); opacity: 0; }
}
@keyframes mmorpgTimerBarPulse {
  0% { filter: saturate(1) brightness(1); }
  100% { filter: saturate(1.13) brightness(1.08); }
}
@keyframes mmorpgIncursionBarPulse {
  0% { filter: saturate(1.02) brightness(1); }
  100% { filter: saturate(1.16) brightness(1.08); }
}
@keyframes mmorpgRewardFloatUp {
  0% { opacity: 0; transform: translate3d(-50%, 8px, 0) scale(0.94); }
  14% { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(-50%, -40px, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .forge-queue-slot--ready-flash {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ——— Ayuntamiento / infraestructura (acordeón) ——— */

/* ——— Paneles de edificio (Ayuntamiento / Forja): legible sobre el fondo de ciudad ——— */
.v2-building-content-skin {
  border-radius: 0.8rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(184, 134, 11, 0.42);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.97) 0%, rgba(3, 7, 18, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(251, 191, 36, 0.07),
    0 0 0 1px rgba(59, 130, 246, 0.14),
    0 8px 26px rgba(0, 0, 0, 0.5);
}
.v2-building-content-skin .text-gray-300 {
  color: rgba(226, 232, 240, 0.9) !important;
}
.v2-building-content-skin .text-gray-400 {
  color: rgba(203, 213, 225, 0.82) !important;
}
.v2-building-content-skin .text-gray-500 {
  color: rgba(148, 163, 184, 0.88) !important;
}

@media (max-width: 767px) {
  #cityView #buildingPanel.rpg-panel {
    background: rgba(15, 23, 42, 0.94) !important;
    border: 1px solid rgba(184, 134, 11, 0.42) !important;
    box-shadow:
      0 0 0 1px rgba(59, 130, 246, 0.16),
      0 8px 28px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  }
}

/* Con el motor visible: no dejar restos del splash / puerta Alfa en el flujo (móvil scroll). */
body.game-engine-revealed #splashScreen {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.game-engine-revealed #mmorpgAlphaGateOverlay.mmorpg-alpha-gate-overlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   PHASE 1 VISUAL UPGRADE (HUD clarity + screen FX)
   ========================================================================== */
body.combat-ui-active #combatView {
  position: relative;
  isolation: isolate;
}
body.combat-ui-active #combatView::before,
body.combat-ui-active #combatView::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Viñeta y contraste global de combate */
body.combat-ui-active #combatView::before {
  z-index: 0;
  background:
    radial-gradient(120% 85% at 50% 35%, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0) 48%),
    radial-gradient(120% 120% at 50% 55%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.36) 100%);
}
/* Overlay ambiental por tier (ligero, sin coste alto) */
body.combat-ui-active[data-combat-tier="1"] #combatView::after {
  z-index: 0;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(15, 23, 42, 0.08));
}
body.combat-ui-active[data-combat-tier="2"] #combatView::after {
  z-index: 0;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.09), rgba(30, 41, 59, 0.1));
}
body.combat-ui-active[data-combat-tier="3"] #combatView::after {
  z-index: 0;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.09), rgba(30, 27, 75, 0.11));
}
body.combat-ui-active[data-combat-tier="4"] #combatView::after {
  z-index: 0;
  background: linear-gradient(180deg, rgba(234, 88, 12, 0.1), rgba(120, 53, 15, 0.11));
}
body.combat-ui-active[data-combat-tier="5"] #combatView::after {
  z-index: 0;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.11), rgba(69, 10, 10, 0.15));
}

/* HUD readability */
body.combat-ui-active #combatView .combat-zone-headline,
body.combat-ui-active #combatView .combat-zone-title-eq,
body.combat-ui-active #combatView .combat-zone-subtitle-eq {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.02em;
}
body.combat-ui-active #combatView .combat-slot-inner {
  backdrop-filter: saturate(1.08);
  border-color: rgba(148, 163, 184, 0.28);
}

/* Barras más legibles */
body.combat-ui-active #combatView .bar-background-hp,
body.combat-ui-active #combatView .bar-background-mp {
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(2, 6, 23, 0.35);
}
body.combat-ui-active #combatView .bar-fill-hp {
  filter: saturate(1.1) brightness(1.04);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
body.combat-ui-active #combatView .bar-fill-mp {
  filter: saturate(1.12) brightness(1.04);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.32);
}
body.combat-ui-active #combatView .ability-bar-fill.ability-bar-v2-fill.ability-bar--charging {
  box-shadow:
    0 0 10px rgba(250, 204, 21, 0.45),
    inset 0 0 8px rgba(251, 191, 36, 0.35);
  animation: combat-cast-pulse 0.75s ease-in-out infinite alternate;
}
/* Telegrafía de casteos enemigos */
body.combat-ui-active #combatView .bar-row.ability-bar.ability-bar--enemy-casting .ability-cast-track {
  border-color: rgba(248, 113, 113, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(248, 113, 113, 0.25),
    0 0 10px rgba(239, 68, 68, 0.18);
}
body.combat-ui-active #combatView .bar-row.ability-bar.ability-bar--enemy-danger .bar-label {
  color: #fecaca;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.45);
}
body.combat-ui-active #combatView .bar-row.ability-bar.ability-bar--enemy-imminent .ability-cast-track {
  animation: combat-enemy-cast-imminent 430ms ease-in-out infinite alternate;
}
@keyframes combat-enemy-cast-imminent {
  0% {
    filter: saturate(1.05) brightness(1);
    box-shadow:
      inset 0 0 0 1px rgba(248, 113, 113, 0.32),
      0 0 10px rgba(239, 68, 68, 0.22);
  }
  100% {
    filter: saturate(1.2) brightness(1.07);
    box-shadow:
      inset 0 0 0 1px rgba(252, 165, 165, 0.55),
      0 0 14px rgba(248, 113, 113, 0.44);
  }
}
@keyframes combat-cast-pulse {
  0% {
    filter: brightness(1) saturate(1.02);
    box-shadow:
      0 0 10px rgba(250, 204, 21, 0.35),
      inset 0 0 6px rgba(251, 191, 36, 0.25);
  }
  100% {
    filter: brightness(1.08) saturate(1.12);
    box-shadow:
      0 0 14px rgba(250, 204, 21, 0.62),
      inset 0 0 10px rgba(251, 191, 36, 0.42);
  }
}

/* Feedback de impacto/proc más visible */
.combat-slot-enemy-hit .combat-slot-inner {
  animation: combat-enemy-hit 0.33s ease-out, combat-enemy-hit-boost 0.33s ease-out;
}
.combat-slot.combat-slot-crit-jolt .combat-slot-inner {
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.55), 0 0 20px rgba(250, 204, 21, 0.45);
}
.combat-floaty.combat-floaty-crit {
  letter-spacing: 0.01em;
}
.combat-slot-inner.combat-slot-interrupt {
  animation: combat-slot-interrupt-pop 0.35s ease-out;
}
.combat-slot-inner.combat-slot-interrupt-perfect {
  animation: combat-slot-interrupt-perfect-pop 0.5s ease-out;
}
.combat-slot-inner.combat-slot-heal-surge {
  animation: combat-slot-heal-surge 0.46s ease-out;
}
.combat-slot-inner.combat-slot-mitigation-surge {
  animation: combat-slot-mitigation-surge 0.4s ease-out;
}
.combat-slot-inner.combat-slot-under-focus {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.42),
    0 0 16px rgba(239, 68, 68, 0.3);
}
.combat-slot-inner.combat-slot-aggro-target {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.62),
    0 0 18px rgba(245, 158, 11, 0.38),
    inset 0 0 12px rgba(245, 158, 11, 0.12);
}
.combat-slot-inner.combat-slot-gcd-lock::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(2, 132, 199, 0.02)),
    repeating-linear-gradient(-45deg, rgba(56, 189, 248, 0.15) 0 7px, rgba(2, 132, 199, 0.06) 7px 14px);
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.9) var(--combat-lock-pct, 0%), rgba(0, 0, 0, 0) calc(var(--combat-lock-pct, 0%) + 14%));
  animation: combat-lock-scan 0.6s linear infinite;
}
.combat-slot-inner.combat-slot-gcd-lock {
  position: relative;
}
@keyframes combat-enemy-hit-boost {
  0% { transform: scale(1); }
  35% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes combat-slot-interrupt-pop {
  0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.0); }
  30% { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.55), 0 0 18px rgba(239, 68, 68, 0.45); }
  100% { box-shadow: none; }
}
@keyframes combat-slot-interrupt-perfect-pop {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.0); }
  28% { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.75), 0 0 24px rgba(250, 204, 21, 0.6); }
  100% { box-shadow: none; }
}
@keyframes combat-slot-heal-surge {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.0); }
  35% { box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.56), 0 0 18px rgba(34, 197, 94, 0.4); }
  100% { box-shadow: none; }
}
@keyframes combat-slot-mitigation-surge {
  0% { box-shadow: 0 0 0 0 rgba(125, 211, 252, 0); }
  35% { box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.6), 0 0 16px rgba(56, 189, 248, 0.4); }
  100% { box-shadow: none; }
}
@keyframes combat-lock-scan {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 0, 34px 0; }
}

/* Botonera de combate premium */
#combatControlBar .combat-ctrl-btn {
  border-width: 1px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 5px 14px rgba(2, 6, 23, 0.45);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
#combatControlBar .combat-ctrl-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
#combatControlBar .combat-ctrl-btn:active {
  transform: translateY(0);
}

/* Danger mode: el combate se vuelve visualmente más tenso con grupo bajo de vida */
body.combat-ui-active[data-combat-danger="1"] #combatView::before {
  background:
    radial-gradient(120% 85% at 50% 35%, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0) 48%),
    radial-gradient(130% 120% at 50% 60%, rgba(185, 28, 28, 0.08) 12%, rgba(0, 0, 0, 0.45) 100%);
}
body.combat-ui-active[data-combat-danger="2"] #combatView::before {
  background:
    radial-gradient(120% 85% at 50% 35%, rgba(255, 255, 255, 0.01), rgba(0, 0, 0, 0) 48%),
    radial-gradient(135% 125% at 50% 62%, rgba(220, 38, 38, 0.15) 10%, rgba(0, 0, 0, 0.56) 100%);
}
body.combat-ui-active[data-combat-danger="2"] #combatView {
  animation: combat-danger-pulse 1.2s ease-in-out infinite alternate;
}
body.combat-ui-active[data-combat-wipe-risk="1"] #combatView .combat-zone-headline {
  color: #fca5a5;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
body.combat-ui-active[data-combat-wipe-risk="2"] #combatView .combat-zone-headline {
  color: #fda4af;
  text-shadow: 0 0 14px rgba(244, 63, 94, 0.5);
  animation: combat-wipe-risk-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes combat-danger-pulse {
  0% { filter: saturate(1.02) brightness(1); }
  100% { filter: saturate(1.12) brightness(0.98); }
}
@keyframes combat-wipe-risk-pulse {
  0% { opacity: 0.88; letter-spacing: 0.02em; }
  100% { opacity: 1; letter-spacing: 0.04em; }
}

/* Flash breve cuando salta proc de arma */
#combatView.combat-proc-flash::after {
  background:
    radial-gradient(65% 45% at 50% 55%, rgba(56, 189, 248, 0.22), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, rgba(56, 189, 248, 0.08), rgba(2, 6, 23, 0));
  animation: combat-proc-flare 220ms ease-out;
}
@keyframes combat-proc-flare {
  0% { opacity: 0.06; }
  35% { opacity: 0.55; }
  100% { opacity: 0.08; }
}

/* ═══════════════════════════════════════════════════════
   stat-num — números tabulares para alineación consistente
   Se aplica también vía selector a los contenedores conocidos
   de números en combate y panel de stats.
   ═══════════════════════════════════════════════════════ */
.stat-num,
.bar-hp-fraction,
.bar-mp-fraction,
.guild-stat-chip-value,
#xpTextDisplay {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════
   app-processing — cursor de procesamiento + spinner esquina
   El cursor espada global prevalece con !important, así que
   el indicador visual es el spinner dorado en esquina inferior.
   ═══════════════════════════════════════════════════════ */
.app-processing,
.app-processing * {
  cursor: progress !important;
}
@keyframes rpgSpinProcess {
  to { transform: rotate(360deg); }
}
body.app-processing::after {
  content: "";
  position: fixed;
  bottom: 12px;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-top-color: #D4AF37;
  border-radius: 50%;
  animation: rpgSpinProcess 0.55s linear infinite;
  z-index: 9999;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   divider-medieval — separador de sección dorado con rombo
   ═══════════════════════════════════════════════════════ */
.divider-medieval {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  opacity: 0.55;
}
.divider-medieval::before,
.divider-medieval::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #8B6914 25%,
    #D4AF37 50%,
    #8B6914 75%,
    transparent 100%
  );
}

/* ═══════════════════════════════════════════════════════
   bg-noise — micro-textura de ruido sobre fondos oscuros
   Se aplica al body y a .guild-crystal-subpanel vía selector.
   ═══════════════════════════════════════════════════════ */
.bg-noise,
body,
.guild-crystal-subpanel {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

/* ═══════════════════════════════════════════════════════
   rpgFadeIn — animación de entrada suave (fade + slide 5px)
   ═══════════════════════════════════════════════════════ */
/* Tutorial Tour — highlight de botón de navegación */
.tutorial-tour-highlight {
  animation: tutorialPulse 1.4s ease-in-out infinite;
  position: relative;
  z-index: 100;
}

@keyframes tutorialPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200, 168, 75, 0.7), 0 0 0 0 rgba(200, 168, 75, 0.4); }
  50%  { box-shadow: 0 0 0 6px rgba(200, 168, 75, 0.2), 0 0 14px 4px rgba(200, 168, 75, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(200, 168, 75, 0); }
}

@keyframes rpgFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-rpg-in {
  animation: rpgFadeIn 0.18s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════
   ring-glow-gold — glow dorado para elementos seleccionados
   ═══════════════════════════════════════════════════════ */
.ring-glow-gold {
  box-shadow:
    0 0 10px 2px rgba(212, 175, 55, 0.35),
    0 0 20px 4px rgba(212, 175, 55, 0.12),
    inset 0 0 6px rgba(212, 175, 55, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ═══════════════════════════════════════════════════════
   btn-rpg — hover expresivo (transform + filter)
   Extiende el .btn-rpg existente; no duplica estilos base.
   ═══════════════════════════════════════════════════════ */
.btn-rpg {
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}
.btn-rpg:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.10);
}
.btn-rpg:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.92);
  transition-duration: 0.05s;
}

/* ═══════════════════════════════════════════════════════
   card-rpg-hover — elevación sutil en hover para cards / slots
   Usa variables para combinar translateX (p.ej. slots centrados del paper doll)
   con translateY en hover sin machacar transform.
   ═══════════════════════════════════════════════════════ */
.card-rpg-hover {
  --rpg-translate-x: 0px;
  --rpg-translate-y: 0px;
  transform: translateX(var(--rpg-translate-x)) translateY(var(--rpg-translate-y));
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-rpg-hover:hover {
  --rpg-translate-y: -2px;
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 8px rgba(212, 175, 55, 0.12);
}

/* ═══════════════════════════════════════════════════════
   nav-rpg — items de menú lateral con acento dorado
   También se aplica sobre city-nav-tile para reforzar el patrón.
   ═══════════════════════════════════════════════════════ */
.nav-rpg,
.city-nav-tile {
  border-left: 2px solid transparent;
  transition:
    background-color 0.15s ease,
    border-left-color 0.15s ease;
}
.nav-rpg:hover,
.city-nav-tile:hover {
  background-color: rgba(212, 175, 55, 0.07);
  border-left-color: rgba(212, 175, 55, 0.4);
}
.nav-rpg.active,
.city-nav-tile.active,
.city-nav-tile[data-active="1"],
.city-nav-tile.city-nav-tile--active {
  background-color: rgba(212, 175, 55, 0.12);
  border-left-color: #D4AF37;
}

/* ═══════════════════════════════════════════════════════
   Scrollbar medieval dorada (thin, non-webkit fallback incluido)
   ═══════════════════════════════════════════════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: #8B6914 #1a1108;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #1a1108;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #D4AF37 0%, #8B6914 50%, #D4AF37 100%);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 50%, #FFD700 100%);
}
::-webkit-scrollbar-corner { background: #1a1108; }

/* ═══════════════════════════════════════════════════════
   Utilidad: fuente medieval Cinzel para títulos de sección
   ═══════════════════════════════════════════════════════ */
.font-medieval {
  font-family: 'Cinzel', Georgia, serif !important;
  letter-spacing: 0.05em;
}

/* Excepciones: títulos del Guild Hall recuperan Cinzel aunque estén dentro
   de paneles que aplican Arial globalmente */
#panel-libro-tacticas .guild-crystal-title,
.guild-crystal-title {
  font-family: 'Cinzel', Georgia, serif !important;
  letter-spacing: 0.05em;
}

/* Accesibilidad / rendimiento */
@media (prefers-reduced-motion: reduce) {
  #game-container.screen-shake,
  #game-container.game-engine-host.screen-shake,
  #game-container.critical-shake,
  #game-container.game-engine-host.critical-shake,
  #combatView.combat-view-shake,
  #combatView.combat-view-shake-crit,
  .combat-slot.combat-slot-crit-jolt,
  .combat-floaty.combat-floaty-animate,
  .combat-floaty.combat-floaty-crit.combat-floaty-animate,
  body.combat-ui-active[data-combat-danger="2"] #combatView,
  body.combat-ui-active #combatView .ability-bar-fill.ability-bar-v2-fill.ability-bar--charging,
  body.combat-ui-active #combatView .bar-row.ability-bar.ability-bar--enemy-imminent .ability-cast-track,
  .combat-slot-inner.combat-slot-interrupt,
  .combat-slot-inner.combat-slot-interrupt-perfect,
  .combat-slot-inner.combat-slot-heal-surge,
  .combat-slot-inner.combat-slot-mitigation-surge,
  .combat-slot-inner.combat-slot-gcd-lock::after,
  body.combat-ui-active[data-combat-wipe-risk="2"] #combatView .combat-zone-headline,
  #combatView.combat-proc-flash::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* [UX v0.9.5.5] Animación puntitos NPC escribiendo */
@keyframes npcTypingBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.npc-typing-dots {
  animation: npcTypingBlink 1.2s ease-in-out infinite;
  letter-spacing: 2px;
}

/* D-OPCIONES-REDISENO D-OPC-4 (a) — fuera el tamaño de letra de Opciones (sólo cambiaba la raíz en rem, y sólo tras abrir Opciones) */

/* ============================================
   MEJORAS VISUALES — BATCH 1
   ============================================ */

/* --- SCROLLBAR MEDIEVAL --- */
* {
  scrollbar-width: thin;
  scrollbar-color: #8B6914 #1a1108;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1a1108; border-radius: 3px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #D4AF37 0%, #8B6914 50%, #D4AF37 100%);
  border-radius: 3px;
  border: 1px solid #1a1108;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 50%, #FFD700 100%);
}
::-webkit-scrollbar-corner { background: #1a1108; }
.medieval-scroll { scrollbar-width: thin; scrollbar-color: #8B6914 #1a1108; }

/* --- GLOW --- */
.glow-gold {
  box-shadow: 0 0 10px 2px rgba(212,175,55,0.40),
              0 0 20px 4px rgba(212,175,55,0.15),
              inset 0 0 8px rgba(212,175,55,0.08);
}
.glow-red {
  box-shadow: 0 0 10px 2px rgba(220,38,38,0.45),
              0 0 20px 4px rgba(220,38,38,0.15);
}
.glow-green {
  box-shadow: 0 0 10px 2px rgba(34,197,94,0.40),
              0 0 20px 4px rgba(34,197,94,0.12);
}
.glow-blue {
  box-shadow: 0 0 10px 2px rgba(96,165,250,0.40),
              0 0 20px 4px rgba(96,165,250,0.12);
}
.glow-gold, .glow-red, .glow-green, .glow-blue {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* --- BORDES Y SEPARADORES --- */
.panel-medieval {
  position: relative;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.panel-medieval::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(212,175,55,0.6) 0%,
    rgba(139,105,20,0.3) 40%,
    rgba(212,175,55,0.6) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.divider-medieval {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  opacity: 0.6;
}
.divider-medieval::before,
.divider-medieval::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, #8B6914 30%, #D4AF37 50%, #8B6914 70%, transparent 100%);
}
.divider-medieval-icon {
  color: #D4AF37;
  font-size: 10px;
  flex-shrink: 0;
}

/* --- NÚMEROS TABULARES --- */
.stat-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}

/* --- TEXTURAS DE PANEL --- */
.bg-panel-textured {
  background-color: #0f0d08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 150px 150px;
}
.bg-section-textured {
  background-color: rgba(255,255,255,0.02);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 120px 120px;
}

/* --- ANIMACIÓN ENTRADA DE PANELES --- */
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-animate-in {
  animation: zoneScaleIn 0.18s ease-out forwards;
}

/* --- HOVER STATES --- */
.btn-medieval {
  transition: transform 0.12s ease, box-shadow 0.15s ease,
              filter 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn-medieval:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.12);
}
.btn-medieval:active:not(:disabled) {
  transform: translateY(0px) scale(0.99);
  filter: brightness(0.95);
  transition-duration: 0.05s;
}

.card-interactive {
  --ci-tx: 0px;
  --ci-ty: 0px;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              border-color 0.15s ease;
}
.card-interactive:hover {
  --ci-ty: -2px;
  transform: translateX(var(--ci-tx)) translateY(var(--ci-ty));
  border-color: rgba(212,175,55,0.6);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 8px rgba(212,175,55,0.15);
}

.equip-slot-droppable[style*="translateX(-50%)"].card-interactive,
.equip-slot-center.card-interactive {
  --ci-tx: -50%;
}

.nav-item-medieval {
  transition: background-color 0.15s ease, border-left-color 0.15s ease;
  border-left: 2px solid transparent;
}
.nav-item-medieval:hover {
  background-color: rgba(212,175,55,0.08);
  border-left-color: rgba(212,175,55,0.5);
}
.nav-item-medieval.active {
  background-color: rgba(212,175,55,0.12);
  border-left-color: #D4AF37;
}

.slot-empty-medieval {
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border: 1px dashed rgba(212,175,55,0.2);
}
.slot-empty-medieval:hover {
  background-color: rgba(212,175,55,0.05);
  border-color: rgba(212,175,55,0.4);
}

/* --- TRANSICIONES DE ENTRADA POR ZONA --- */
@keyframes zoneSlideLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes zoneScaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes zoneFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes zoneMapReveal {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes zoneSlideRight {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes zoneFadeSlow {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.zone-enter-tavern    { animation: zoneScaleIn 0.20s ease-out forwards; }
.zone-enter-forge     { animation: zoneScaleIn 0.20s ease-out forwards; }
.zone-enter-bazaar    { animation: zoneScaleIn 0.18s ease-out forwards; }
.zone-enter-map       { animation: zoneScaleIn 0.25s ease-out forwards; }
.zone-enter-missions  { animation: zoneScaleIn 0.20s ease-out forwards; }
.zone-enter-cityhall  { animation: zoneScaleIn 0.25s ease-out forwards; }

.app-shell-frame {
  position: relative;
  padding: 2px;
}

.app-shell-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212, 175, 55, 0.7);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.12);
  pointer-events: none;
  z-index: 1;
}

.app-shell-frame .corner-mark {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #D4AF37;
  border-style: solid;
  z-index: 2;
  pointer-events: none;
}
.app-shell-frame .corner-mark.tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.app-shell-frame .corner-mark.tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.app-shell-frame .corner-mark.bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.app-shell-frame .corner-mark.br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

.app-shell-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(212,175,55,0.5) 20%, rgba(212,175,55,0.5) 80%, transparent);
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

.app-shell-divider::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: rgba(212,175,55,0.6);
  rotate: 45deg;
}

.city-nav-sidebar {
  position: relative;
  border-right: 1px solid rgba(212,175,55,0.3);
  padding-right: 4px;
}

.city-nav-sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.5) 20%, rgba(212,175,55,0.5) 80%, transparent);
  pointer-events: none;
}

.city-nav-title {
  position: relative;
  padding-left: 10px;
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.06em;
}

.city-nav-title::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, #D4AF37, transparent);
}

.panel-inner-frame {
  position: relative;
}

.panel-inner-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212,175,55,0.25);
  pointer-events: none;
  z-index: 1;
}

.panel-inner-frame .pif-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: rgba(212,175,55,0.7);
  border-style: solid;
  z-index: 2;
  pointer-events: none;
}
.panel-inner-frame .pif-corner.tl { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.panel-inner-frame .pif-corner.tr { top: 4px; right: 4px; border-width: 1.5px 1.5px 0 0; }
.panel-inner-frame .pif-corner.bl { bottom: 4px; left: 4px; border-width: 0 0 1.5px 1.5px; }
.panel-inner-frame .pif-corner.br { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }

.member-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

/* D-RETIRO-V3 F3 (D-RV3-17) — aquí estaba el retrato del panel Habilidades v3 (.guild-abilities-member-portrait), retirado. */

.guild-ability-v2-xp .ability-xp-bar-wrap {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.guild-ability-v2-xp .ability-xp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.25s ease;
}
.guild-ability-v2-xp .ability-xp-label {
  display: block;
}
.guild-ability-v2-xp .ability-xp-blocks {
  display: block;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ── Fix touch WebView Android ─────────────────────────────────────────── */
/* En WebView Android las capas fixed pueden absorber taps aunque sean     */
/* transparentes. Forzamos pointer-events correctos en el splash y gate.   */

#splashScreen .splash-atmosphere,
#splashScreen .splash-fog,
#splashScreen .splash-fog--a,
#splashScreen .splash-fog--b,
#splashScreen::before,
#splashScreen::after,
#splashScreen.splash-screen-legendary::after,
#splashScreen .splash-bg-photo {
  pointer-events: none !important;
}

#emailAuthPanel,
#emailAuthPanel * {
  pointer-events: auto !important;
}

#emailLoginBtn,
#emailRegisterBtn {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 30001 !important;
}

/* Avatar picker — navegación con flechas */
#avatar-picker-img {
  transition: opacity 0.2s ease;
  display: block;
}
#avatar-picker-dots span,
#options-avatar-dots span {
  display: inline-block;
}
#options-avatar-img {
  transition: opacity 0.2s ease;
  display: block;
}
#avatar-arrow-left,
#avatar-arrow-right {
  user-select: none;
  -webkit-user-select: none;
}

@keyframes targetRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.combat-slot-targeted .combat-slot-inner {
  position: relative;
}
.combat-slot-targeted .combat-slot-inner::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: conic-gradient(from 0deg, transparent 60%, #ff4444 80%, #ffaa00 90%, transparent 100%);
  animation: targetRotate 1.5s linear infinite;
  z-index: 0;
  pointer-events: none;
}
.combat-slot-targeted .combat-slot-inner::after {
  content: '⚔️';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  z-index: 10;
  filter: drop-shadow(0 0 4px #ff4444);
  pointer-events: none;
}

/* ── Tooltip estilo EQ ── */
#masterItemTooltip {
  min-width: 240px;
  max-width: 320px;
  background: #0a0804;
  border: 1px solid transparent;
  border-image: linear-gradient(180deg, #c8a84b, #6b4f1a, #c8a84b) 1;
  border-radius: 0;
  box-shadow: 0 0 18px rgba(180, 130, 30, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.6);
  padding: 0;
  font-family: "Cinzel", serif;
  z-index: 9999;
}
.tt-inner {
  background: #110e08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  padding: 10px 12px;
}
.tt-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin-bottom: 2px;
}
.tt-meta {
  font-size: 10px;
  color: #9a8c6a;
  letter-spacing: 0.08em;
  margin-bottom: 1px;
}
.tt-classes {
  font-size: 10px;
  color: #7a9ab5;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.tt-divider {
  border: none;
  border-top: 1px solid rgba(180, 130, 30, 0.3);
  margin: 6px 0;
}
.tt-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 8px;
  margin-bottom: 4px;
}
.tt-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #c8b98a;
}
.tt-stat-val {
  color: #f0d060;
  font-weight: 600;
  margin-left: 6px;
}
.tt-stat-val.positive {
  color: #6fd46f;
}
.tt-stat-val.negative {
  color: #e05555;
}
.tt-effect {
  font-size: 11px;
  color: #7ecfb0;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}
.tt-lore {
  font-size: 10px;
  color: #6a7a9a;
  font-style: italic;
  margin-top: 4px;
  border-top: 1px solid rgba(100, 80, 30, 0.3);
  padding-top: 4px;
}
.tt-price {
  font-size: 10px;
  color: #6a6050;
  margin-top: 6px;
  border-top: 1px solid rgba(100, 80, 30, 0.2);
  padding-top: 4px;
}
.tt-weapontype {
  font-size: 10px;
  color: #a08050;
  letter-spacing: 0.06em;
}
.tt-origin {
  font-size: 10px;
  color: rgba(251, 191, 130, 0.75);
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(100, 80, 30, 0.25);
}
.tt-compare {
  font-size: 10px;
  color: #9a9a8a;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(100, 80, 30, 0.25);
}

/* Bazaar — nombre limpio + badge tier/rol */

/* Tooltip — misma línea secundaria que Bazaar para `[T# · ROL]` */
.tt-item-tier-role-badge {
  font-size: 10px;
  opacity: 0.55;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Quest journal — numeración de pasos */
.quest-step-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.65;
  margin-right: 2px;
}

/* ═══════════════════════════════════════
   Guild XP Bar — barra de XP grupal
═══════════════════════════════════════ */
.guild-xp-bar-wrap {
  margin: 0 0 14px 0;
  padding: 10px 14px 12px;
  background: linear-gradient(135deg, #0d0a04 0%, #1a1206 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(212,175,55,0.08);
}
.guild-xp-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.guild-xp-bar-discipline {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: rgba(212, 175, 55, 0.7);
  text-transform: uppercase;
}
.guild-xp-bar-tier {
  font-size: 0.85rem;
  font-weight: 700;
  color: #D4AF37;
  text-shadow: 0 0 8px rgba(212,175,55,0.4);
  letter-spacing: 0.04em;
}
.guild-xp-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,0.2);
}
.guild-xp-bar-fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg,
    #8B6914 0%,
    #D4AF37 50%,
    #F5E070 80%,
    #D4AF37 100%
  );
  background-size: 200% 100%;
  animation: guild-xp-shimmer 2.5s linear infinite;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(212,175,55,0.5);
}
@keyframes guild-xp-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.guild-xp-bar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}
.guild-xp-bar-xp {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
}
.guild-xp-bar-next {
  font-size: 0.7rem;
  color: rgba(212,175,55,0.6);
  font-style: italic;
}

/* ── Incursion XP bar in panel header ─────────────────────────── */
.guild-xp-bar-header-panel {
  width: 100%;
}
.guild-xp-bar-header-panel .guild-xp-bar-wrap {
  margin-bottom: 0;
  border-radius: 8px;
}

/* ═══════════════════════════════════
   Incursiones — cards activas y setup
═══════════════════════════════════ */

/* Refinería — botón quickstart en el nuevo setup panel */
.forge-refinery-quickstart-btn {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(212,175,55,0.4);
  background: rgba(212,175,55,0.08);
  color: #D4AF37;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.forge-refinery-quickstart-btn:hover {
  background: rgba(212,175,55,0.18);
  border-color: rgba(212,175,55,0.6);
}
.forge-refinery-quickstart-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════
   Guild XP Bar — variante Refinería (verde esmeralda)
═══════════════════════════════════════ */
[data-discipline="refineria"].guild-xp-bar-wrap {
  background: linear-gradient(135deg, #041a0d 0%, #0a2e18 100%);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(52,211,153,0.08);
}
[data-discipline="refineria"] .guild-xp-bar-discipline {
  color: rgba(52, 211, 153, 0.7);
}
[data-discipline="refineria"] .guild-xp-bar-tier {
  color: #34D399;
  text-shadow: 0 0 8px rgba(52,211,153,0.4);
}
[data-discipline="refineria"] .guild-xp-bar-track {
  border-color: rgba(52,211,153,0.2);
}
[data-discipline="refineria"] .guild-xp-bar-fill {
  background: linear-gradient(90deg,
    #065f46 0%,
    #34D399 50%,
    #6EE7B7 80%,
    #34D399 100%
  );
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(52,211,153,0.5);
  animation: guild-xp-shimmer-green 2.5s linear infinite;
}
@keyframes guild-xp-shimmer-green {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
[data-discipline="refineria"] .guild-xp-bar-next {
  color: rgba(52, 211, 153, 0.6);
}

/* ═══════════════════════════════════════
   Cards activas refinería — borde verde
═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   Refinería — botón y panel con tono verde
═══════════════════════════════════════ */
.forge-refinery-quickstart-btn {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.06);
  color: #34D399;
}
.forge-refinery-quickstart-btn:hover {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.6);
}

/* Títulos "Mercenarios libres" / "Perfil de X" en verde */

/* Mercs seleccionados en verde dentro del contexto refinería */

/* ═══════════════════════════════════════════════════════════
   Incursiones — paleta marrón cálido
   ═══════════════════════════════════════════════════════════ */

/* Contenedor raíz — fondo transparente (hereda el fondo del juego) */
#incursionNodesMount,
#incursionNodesMount .forge-thorin-root {
  background: transparent;
}

/* Fila mercenario — tono ámbar oscuro */

/* Guild XP bar — variante incursiones (marrón cálido) */
[data-discipline="incursiones"].guild-xp-bar-wrap {
  background: linear-gradient(135deg, #1a0f05 0%, #2e1a08 100%);
  border-color: rgba(180, 110, 40, 0.35);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(180,110,40,0.08);
}
[data-discipline="incursiones"] .guild-xp-bar-discipline {
  color: rgba(210, 150, 60, 0.7);
}
[data-discipline="incursiones"] .guild-xp-bar-tier {
  color: #D4922A;
  text-shadow: 0 0 8px rgba(212,146,42,0.4);
}
[data-discipline="incursiones"] .guild-xp-bar-track {
  border-color: rgba(180,110,40,0.2);
}
[data-discipline="incursiones"] .guild-xp-bar-fill {
  background: linear-gradient(90deg,
    #5c3010 0%,
    #D4922A 50%,
    #E8B060 80%,
    #D4922A 100%
  );
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(212,146,42,0.5);
  animation: guild-xp-shimmer-brown 2.5s linear infinite;
}
@keyframes guild-xp-shimmer-brown {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
[data-discipline="incursiones"] .guild-xp-bar-next {
  color: rgba(210, 150, 60, 0.6);
}

/* Cards activas incursiones — tono marrón cálido */

/* Botones de recurso (Madera / Piedra / Hierro) */

/* Títulos de sección dentro del panel de incursiones */
#incursionNodesMount .forge-refinery-title {
  color: rgba(210, 150, 60, 0.85);
}

/* ═══════════════════════════════════════════════════════════
   HERRERÍA — Azul acero
   Paleta: accent #4a8fa8 · oscuro #1e4a5e · claro #6ab4cc · borde #2a6a82
   ═══════════════════════════════════════════════════════════ */

/* Guild XP bar — variante herrería (azul acero) */
[data-discipline="herreria"].guild-xp-bar-wrap {
  background: linear-gradient(135deg, #050f18 0%, #0d2130 100%);
  border-color: rgba(74, 143, 168, 0.35);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(74,143,168,0.08);
}
[data-discipline="herreria"] .guild-xp-bar-discipline {
  color: rgba(106, 180, 204, 0.7);
}
[data-discipline="herreria"] .guild-xp-bar-tier {
  color: #6ab4cc;
  text-shadow: 0 0 8px rgba(74,143,168,0.5);
}
[data-discipline="herreria"] .guild-xp-bar-track {
  border-color: rgba(74,143,168,0.22);
}
[data-discipline="herreria"] .guild-xp-bar-fill {
  background: linear-gradient(90deg,
    #1e4a5e 0%,
    #4a8fa8 50%,
    #6ab4cc 80%,
    #4a8fa8 100%
  );
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(74,143,168,0.5);
  animation: guild-xp-shimmer-steel 2.5s linear infinite;
}
@keyframes guild-xp-shimmer-steel {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
[data-discipline="herreria"] .guild-xp-bar-next {
  color: rgba(106, 180, 204, 0.6);
}

/* Vista contenedora de herrería */
.smithing-view {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Cards activas herrería */
.smithing-active-jobs {
  margin-bottom: 6px;
}
.smithing-active-card {
  border: 1px solid rgba(74, 143, 168, 0.3);
  border-radius: 8px;
  margin-bottom: 6px;
  background: rgba(0,0,0,0.3);
  overflow: hidden;
}
.smithing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(74, 143, 168, 0.08);
  cursor: pointer;
  user-select: none;
}
.smithing-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6ab4cc;
  letter-spacing: 0.02em;
}
.smithing-card-merc {
  color: #6ab4cc;
}
.smithing-card-sep {
  color: rgba(106,180,204,0.4);
  font-weight: 400;
}
.smithing-card-recipe {
  color: rgba(200, 230, 240, 0.85);
  font-weight: 500;
}
.smithing-card-chevron {
  background: none;
  border: none;
  color: rgba(74, 143, 168, 0.6);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0 4px;
}
.smithing-card-body {
  padding: 8px 10px;
}
.smithing-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(74,143,168,0.2);
}
.smithing-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e4a5e 0%, #4a8fa8 60%, #6ab4cc 100%);
  transition: width 0.6s ease;
  box-shadow: 0 0 6px rgba(74,143,168,0.4);
}
.smithing-progress-bar-fill--ready {
  background: linear-gradient(90deg, #065f46 0%, #34D399 100%);
  box-shadow: 0 0 6px rgba(52,211,153,0.5);
}
.smithing-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}
.smithing-time-left {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
}
.smithing-claim-btn {
  display: block;
  width: 100%;
  padding: 5px 8px;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid rgba(74, 143, 168, 0.55);
  background: rgba(30, 74, 94, 0.5);
  color: #6ab4cc;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.smithing-claim-btn:hover:not(:disabled) {
  background: rgba(74, 143, 168, 0.2);
  border-color: rgba(74, 143, 168, 0.75);
}
.smithing-claim-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Panel principal dos columnas */
.smithing-setup-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.smithing-mercs-col {
  border-right: 1px solid rgba(74, 143, 168, 0.18);
  padding-right: 12px;
}
.smithing-slots-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.smithing-col-title {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(106, 180, 204, 0.75);
  margin-bottom: 7px;
}
.smithing-mercs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.smithing-merc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}
.smithing-merc-row:hover {
  background: rgba(74, 143, 168, 0.1);
  border-color: rgba(74, 143, 168, 0.25);
}
.smithing-merc-row.selected {
  background: rgba(74, 143, 168, 0.15);
  border-color: rgba(74, 143, 168, 0.4);
}
.smithing-merc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.smithing-merc-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c8e8f4;
}
.smithing-merc-class {
  font-size: 0.68rem;
  color: rgba(106, 180, 204, 0.6);
}
.smithing-merc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #0a1e28;
  border: 1.5px solid #2a6a82;
}
.smithing-merc-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #4a8fa8;
  font-weight: 600;
}

/* Grid de slots de fabricación */
.smithing-slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
}
.smithing-slot-btn {
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid rgba(74, 143, 168, 0.4);
  background: rgba(30, 74, 94, 0.35);
  color: #6ab4cc;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.smithing-slot-btn:hover {
  background: rgba(74, 143, 168, 0.18);
  border-color: rgba(74, 143, 168, 0.65);
  transform: translateY(-1px);
}
.smithing-slot-btn:active {
  transform: translateY(0);
}

/* Mensajes de estado vacío */
.forge-no-mercs-msg,
.smithing-no-selection {
  font-size: 0.72rem;
  color: rgba(150, 180, 190, 0.5);
  font-style: italic;
  padding: 4px 0;
}

/* Responsivo: una columna en pantallas estrechas */
@media (max-width: 600px) {
  .smithing-setup-panel {
    grid-template-columns: 1fr;
  }
  .smithing-mercs-col {
    border-right: none;
    border-bottom: 1px solid rgba(74, 143, 168, 0.15);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .smithing-slots-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   FORJA — Púrpura arcano
   Paleta: accent #7c4fa8 · oscuro #3d1e5e · claro #a87fd4 · borde #5a2e8a
   ═══════════════════════════════════════════════════════════ */

/* Guild XP bar — variante forja (púrpura arcano) */
[data-discipline="forja"].guild-xp-bar-wrap {
  background: linear-gradient(135deg, #0d0718 0%, #1a0d30 100%);
  border-color: rgba(124, 79, 168, 0.35);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(124,79,168,0.08);
}
[data-discipline="forja"] .guild-xp-bar-discipline {
  color: rgba(168, 127, 212, 0.7);
}
[data-discipline="forja"] .guild-xp-bar-tier {
  color: #a87fd4;
  text-shadow: 0 0 8px rgba(124,79,168,0.5);
}
[data-discipline="forja"] .guild-xp-bar-track {
  border-color: rgba(124,79,168,0.22);
}
[data-discipline="forja"] .guild-xp-bar-fill {
  background: linear-gradient(90deg,
    #3d1e5e 0%,
    #7c4fa8 50%,
    #a87fd4 80%,
    #7c4fa8 100%
  );
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(124,79,168,0.5);
  animation: guild-xp-shimmer-purple 2.5s linear infinite;
}
@keyframes guild-xp-shimmer-purple {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
[data-discipline="forja"] .guild-xp-bar-next {
  color: rgba(168, 127, 212, 0.6);
}

/* Vista contenedora de masterforge */
.masterforge-view {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Cards activas de forja */

/* Panel principal dos columnas */
.masterforge-setup-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.masterforge-mercs-col {
  border-right: 1px solid rgba(124, 79, 168, 0.18);
  padding-right: 12px;
}
.masterforge-items-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.masterforge-col-title {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(168, 127, 212, 0.75);
  margin-bottom: 7px;
}
.masterforge-mercs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.masterforge-merc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}
.masterforge-merc-row:hover {
  background: rgba(124, 79, 168, 0.1);
  border-color: rgba(124, 79, 168, 0.25);
}
.masterforge-merc-row.selected {
  background: rgba(124, 79, 168, 0.15);
  border-color: rgba(124, 79, 168, 0.4);
}
.masterforge-merc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.masterforge-merc-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #dcc8f5;
}
.masterforge-merc-class {
  font-size: 0.68rem;
  color: rgba(168, 127, 212, 0.6);
}

/* Grid de items mejorables */
.masterforge-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.masterforge-item-card {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(124, 79, 168, 0.3);
  background: rgba(61, 30, 94, 0.2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.masterforge-item-card:hover {
  background: rgba(124, 79, 168, 0.15);
  border-color: rgba(124, 79, 168, 0.55);
  transform: translateY(-1px);
}
.masterforge-item-card:active {
  transform: translateY(0);
}
.masterforge-item-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.masterforge-item-sub {
  font-size: 0.65rem;
  color: rgba(200, 180, 230, 0.55);
  margin-bottom: 3px;
}
.masterforge-item-nodes {
  font-size: 0.65rem;
  color: #a87fd4;
  font-weight: 600;
}

/* Mensajes estado vacío */
.masterforge-empty-msg {
  font-size: 0.72rem;
  color: rgba(168, 127, 212, 0.45);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* Responsivo */
@media (max-width: 600px) {
  .masterforge-setup-panel {
    grid-template-columns: 1fr;
  }
  .masterforge-mercs-col {
    border-right: none;
    border-bottom: 1px solid rgba(124, 79, 168, 0.15);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .masterforge-items-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────
   INCURSIONES — Botón Abandonar
   ───────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────────
   FORJA — Badge "FORJADO" y slot picker cards
   ───────────────────────────────────────────────────────────────────────── */
.forge-forjado-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(61, 30, 94, 0.65);
  border: 1px solid rgba(90, 46, 138, 0.55);
  color: #a87fd4;
  line-height: 1;
  flex-shrink: 0;
}

[data-forge-slot-option] {
  cursor: pointer;
  user-select: none;
  min-height: 76px;
}
[data-forge-slot-option]:active {
  transform: scale(0.97);
}

/* ─────────────────────────────────────────────────────────────────────────
   AYUNTAMIENTO — Descripción narrativa + beneficio por nivel
   ───────────────────────────────────────────────────────────────────────── */

/* ——— EMOJI SAFETY NET ———————————————————————————————————————————————————————
   Elementos que renderizan emoji (floaties, pills, log, slots, iconos de clase).
   La cascada de Cinzel/Montserrat no tiene glifos emoji; estos selectores aseguran
   que "Segoe UI Emoji" / "Apple Color Emoji" se consulten antes del genérico final.
   REGLA: nunca añadir un selector con emoji sin incluirlo en esta lista o en --rpg-emoji-stack.
   ————————————————————————————————————————————————————————————————————————————— */
.combat-floaty,
.combat-status-pill,
.combat-slot-inner,
.guild-item-icon-emoji,
.guild-item-emoji-char,
.guild-set-emoji-char,
.v2-lang-flag-btn--options {
  font-family: var(--rpg-emoji-stack), sans-serif;
}

/* ——— Panel Relaciones — D-PULIDO-RELACIONES D-PUL-REL-11: fuera la raíz, la cabecera, las columnas, el botón de
 * gremio y el detalle de gremio viejos (ningún elemento los usa; el armazón vive en ui/sitio.css). */
.relations-close-btn {
  background: none;
  border: 1px solid #5a3a1a;
  color: #c9a84c;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
.relations-empty-msg {
  color: #5a4a2a;
  font-size: 0.8rem;
  text-align: center;
  padding: 24px 0;
}
.relations-tier-group {
  margin-bottom: 6px;
  background: #12100e;
  border: 1px solid #4a3a1a;
  border-radius: 6px;
  overflow: hidden;
}
.relations-tier-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  background: #1a1610;
  transition: background 0.15s;
}
.relations-tier-header:hover {
  background: #221e14;
}
.relations-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.relations-tier-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  flex: 1;
}
.relations-tier-count {
  font-size: 0.75rem;
  color: #6a5a3a;
}
.relations-tier-chevron {
  font-size: 0.7rem;
  color: #6a5a3a;
  transition: transform 0.2s;
}
.relations-tier-group.open .relations-tier-chevron {
  transform: rotate(90deg);
}
.relations-tier-members {
  display: none;
  padding: 4px 8px 8px;
}
.relations-tier-group.open .relations-tier-members {
  display: block;
}
.relations-npc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.relations-npc-card:hover {
  background: rgba(201, 168, 76, 0.08);
}
.relations-npc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #3a2a1a;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1410;
}
.relations-npc-info {
  flex: 1;
}
.relations-npc-name {
  font-size: 0.9rem;
  color: #e8d5a3;
}
.relations-npc-class {
  font-size: 0.75rem;
  color: #7a6a4a;
}
.relations-npc-detail {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 92vw);
  background: #12100e;
  border: 1px solid #4a3a1a;
  border-radius: 8px;
  z-index: 1100;
  padding: 20px;
  color: #e8d5a3;
}
.relations-npc-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.relations-npc-detail-hero {
  display: flex;
  gap: 12px;
  align-items: center;
}
.relations-npc-detail-name {
  font-size: 1.1rem;
  color: #e8d5a3;
}
.relations-npc-detail-class {
  font-size: 0.8rem;
  color: #7a6a4a;
}
.relations-npc-detail-tier {
  font-size: 0.8rem;
  margin-top: 2px;
}
.relations-npc-detail-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.78rem;
  color: #7a6a4a;
}
.relations-faction-bar-wrap {
  margin: 16px 0 8px;
}
.relations-faction-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6a5a3a;
  margin-bottom: 4px;
}
.relations-faction-bar-track {
  position: relative;
  height: 14px;
  background: #1e1a14;
  border-radius: 7px;
  border: 1px solid #3a2a1a;
  overflow: hidden;
}
.relations-faction-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.4s ease;
}
.relations-faction-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #12100e;
  pointer-events: none;
}
.relations-faction-points-text {
  text-align: center;
  font-size: 0.8rem;
  color: #9a8a5a;
  margin-top: 6px;
}
.relations-guild-group {
  margin-bottom: 6px;
  background: #12100e;
  border: 1px solid #4a3a1a;
  border-radius: 6px;
  overflow: hidden;
}
.relations-guild-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: #1a1610;
  transition: background 0.15s;
}
.relations-guild-header:hover {
  background: #221e14;
}
.relations-guild-emblem {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #2a1a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  font-family: var(--rpg-emoji-stack), sans-serif;
}
.relations-guild-name {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  flex: 1;
}
.relations-guild-known {
  font-size: 0.75rem;
  color: #5a4a2a;
}
.relations-guild-chevron {
  margin-left: 8px;
}
.relations-guild-body {
  display: none;
  padding: 12px;
  border-top: 1px solid #2a1a0a;
  background: #0e0c0a;
}
.relations-guild-group.open .relations-guild-body {
  display: block;
}
.relations-guild-lore {
  font-size: 0.8rem;
  color: #8a7a5a;
  line-height: 1.5;
  margin-bottom: 12px;
}
.relations-guild-members-title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #6a5a3a;
  margin-bottom: 8px;
}
.relations-guild-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.8rem;
}
.relations-guild-member-row--clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0 -6px;
  transition: background 0.15s;
}
.relations-guild-member-row--clickable:hover {
  background: rgba(201, 168, 76, 0.08);
}
.relations-guild-member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #3a2a1a;
  flex-shrink: 0;
}
.relations-guild-member-row .known {
  color: #e8d5a3;
}
.relations-guild-member-row .unknown {
  color: #6a5a3a;
}
.relations-guild-dot--unknown {
  color: #5a4a3a;
  font-family: var(--rpg-emoji-stack), sans-serif;
}
.relations-guild-dot {
  font-family: var(--rpg-emoji-stack), sans-serif;
  flex-shrink: 0;
}
.relations-guild-pts {
  font-size: 0.72rem;
  color: #5a4a2a;
  margin-left: auto;
}

/* Combat V2 — modal post-combate (estilo pergamino V1 / chronicleScroll) */
.v2-combat-rewards-overlay {
  background: rgba(0, 0, 0, 0.9) !important;
}
.v2-combat-rewards-panel {
  background: rgba(10, 8, 5, 0.97) !important;
  border: 1px solid rgba(212, 175, 55, 0.6) !important;
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.15),
    0 24px 64px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 220, 140, 0.08) !important;
}
.v2-combat-rewards-panel .rpg-menu-title {
  font-family: var(--rpg-font-ui, "Cinzel", serif) !important;
  letter-spacing: 0.04em;
}
.v2-combat-rewards-body {
  font-family: var(--rpg-font-body, "Nunito", sans-serif);
  color: #e2e8f0;
}
.v2-combat-rewards-member {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(212, 175, 55, 0.35) !important;
}
.v2-combat-rewards-accept {
  font-family: var(--rpg-font-ui, "Cinzel", serif) !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.v2-combat-item-tooltip {
  position: fixed;
  z-index: 22000;
  display: none;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: rgba(10, 8, 5, 0.98);
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* ===== D-MAPA-VIAJE fase 2 — el viaje por el mapa: huellas, minifiguras, puntos de interés y eventos ===== */
.atlas-viaje { position: absolute; inset: 0; pointer-events: none; } /* D-CH6-11 — sin z-index: sus hijos se comparan con las zonas */
/* D-CH6-11 — un punto se pone por encima de la zona que lo tapa al pasar el ratón o el foco por su parte libre */
.atlas-poi:hover, .atlas-poi:focus-visible { z-index: 21; }
/* D-CH6-11 — la caja de la zona (sin escalar) es mucho mayor que lo que se ve (el botón, contraescalado con --mapa-zoom):
   sólo el botón recoge el ratón, para no tapar los puntos de alrededor ahora que la zona va por encima */
.atlas-map-lienzo .atlas-zona-punto-wrap { pointer-events: none; }
.atlas-map-lienzo .atlas-zona-punto-wrap > .atlas-map-point { pointer-events: auto; }
.atlas-huellas { position: absolute; inset: 0; }
.atlas-huella {
  position: absolute; width: 0.26%; aspect-ratio: 10 / 17; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 17'%3E%3Cellipse cx='5' cy='5.2' rx='3.6' ry='5' fill='%232e2012'/%3E%3Cellipse cx='5' cy='13.6' rx='2.7' ry='3' fill='%232e2012'/%3E%3C/svg%3E") center / contain no-repeat;
  --esp: 1; transform: translate(-50%, -50%) rotate(var(--ang, 0deg)) scaleX(var(--esp)); opacity: 0.85;
  animation: atlas-huella-in 0.6s ease-out both;
}
.atlas-huella--der { --esp: -1; }
.atlas-huella--vieja { opacity: 0.3; animation: none; }
@keyframes atlas-huella-in {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--ang, 0deg)) scaleX(var(--esp)) scale(1.8); }
  to { opacity: 0.85; transform: translate(-50%, -50%) rotate(var(--ang, 0deg)) scaleX(var(--esp)) scale(1); }
}
.atlas-grupo {
  position: absolute; z-index: 30; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 1px;
  /* D-DP-11 — `translate:`, no `transform:`: el `scale:` envuelve a `transform:` y encoge su translate, y el grupo se apartaba de las huellas con el zoom */
  translate: -50% -88%; transform-origin: 50% 88%; scale: calc(1 / var(--mapa-zoom, 1));
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65)); pointer-events: none;
}
.atlas-grupo--izquierda { flex-direction: row; }
.atlas-mini {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 12%;
  border: 2px solid #b48a3c; background: #1c140b; user-select: none;
}
.atlas-mini--lider { width: 32px; height: 32px; border-color: #f2c45a; }
.atlas-grupo--izquierda .atlas-mini { scale: -1 1; }
.atlas-grupo--andando .atlas-mini { animation: atlas-mini-paso 0.42s ease-in-out infinite alternate; }
.atlas-grupo--andando .atlas-mini:nth-child(2n) { animation-delay: 0.21s; }
@keyframes atlas-mini-paso {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(-4px) rotate(4deg); }
}
.atlas-poi {
  position: absolute; z-index: 18; translate: -50% -50%; scale: calc(1 / var(--mapa-zoom, 1)); /* D-DP-11 */
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 0; cursor: pointer; pointer-events: auto; font: inherit;
}
.atlas-poi__marca {
  width: 11px; height: 11px; border-radius: 50%; background: #e9d8a6; border: 2px solid #4a3418;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 8px rgba(245, 210, 122, 0.55);
}
.atlas-poi--ciudad .atlas-poi__marca { width: 16px; height: 16px; background: #f5d27a; border-color: #6b4a14; }
.atlas-poi__nombre {
  font-size: 10px; line-height: 1.1; color: #f6ead0; white-space: nowrap; letter-spacing: 0.02em;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
.atlas-poi:hover .atlas-poi__marca, .atlas-poi:focus-visible .atlas-poi__marca { background: #fff2c2; }
.atlas-poi--nuevo { animation: atlas-poi-nuevo 1.4s ease-out; }
@keyframes atlas-poi-nuevo {
  0% { opacity: 0; filter: drop-shadow(0 0 0 #f5d27a); }
  40% { opacity: 1; filter: drop-shadow(0 0 10px #f5d27a); }
  100% { filter: drop-shadow(0 0 0 #f5d27a); }
}
.atlas-evento {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40;
  width: min(420px, calc(100% - 24px)); padding: 12px 14px; border-radius: 10px; cursor: default;
  background: rgba(22, 15, 8, 0.95); border: 1px solid #b48a3c; color: #f1e4c3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); animation: atlas-evento-in 0.25s ease-out;
}
@keyframes atlas-evento-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.atlas-evento__titulo { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #f5c96a; }
.atlas-evento__texto { margin: 6px 0 10px; font-size: 13px; line-height: 1.4; }
.atlas-evento__opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-evento__opciones button {
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: #3a2810; border: 1px solid #c69a46; color: #f8e7bd; cursor: pointer;
}
.atlas-evento__opciones button:hover { background: #4d3615; }
.atlas-viaje-rapido {
  /* Smoke 0.9.5.935 — arriba: abajo lo tapa la barra inferior a 1280×720 (el visor sigue por debajo de ella). A su altura, enfrente, los controles del mapa; por encima de construir, que comparte esquina (z-index 31) */
  position: absolute; left: 10px; top: 10px; z-index: 35; padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; background: rgba(22, 15, 8, 0.85); border: 1px solid #8a6a30; color: #e8d6a8; cursor: pointer;
}
.atlas-map-visor:has(.atlas-construir) .atlas-viaje-rapido { display: none; } /* construir abre en esa misma esquina */
.atlas-viaje-rapido--activo { border-color: #f2c45a; color: #fff0c4; box-shadow: 0 0 8px rgba(242, 196, 90, 0.5); }
.atlas-aviso {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 45; pointer-events: none;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: rgba(22, 15, 8, 0.92); border: 1px solid #c69a46; color: #fbe7b0;
  animation: atlas-aviso 2.6s ease-out both;
}
@keyframes atlas-aviso { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) {
  .atlas-mini { width: 22px; height: 22px; }
  .atlas-mini--lider { width: 27px; height: 27px; }
  .atlas-evento { bottom: 8px; padding: 10px 12px; }
}

/* D-MAPA-VIAJE fase 3 (claude/_CLAUDE_D_MAPA_VIAJE_3_MESA.md) — niebla, lo que se intuye y el rótulo de descubrimiento */
.atlas-niebla { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.atlas-zona-oculta { display: none !important; }
.atlas-zona-intuida-nueva { animation: atlas-poi-nuevo 1.4s ease-out; }
.atlas-poi--intuido .atlas-poi__marca { background: rgba(200, 206, 220, 0.75); border-color: #3b4252; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 8px rgba(200, 210, 230, 0.5); }
.atlas-poi--intuido .atlas-poi__nombre { font-size: 12px; font-weight: 700; color: #e2e8f0; }
.atlas-poi--sin-camino { cursor: default; pointer-events: none; opacity: 0.8; }
.atlas-rotulo {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 46; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 34px 12px;
  background: radial-gradient(ellipse at center, rgba(22, 15, 8, 0.88) 0%, rgba(22, 15, 8, 0.6) 60%, transparent 100%);
  text-align: center; animation: atlas-rotulo 3s ease-out both;
}
.atlas-rotulo__antes { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: #e8cf8e; text-shadow: 0 1px 3px #000; }
.atlas-rotulo__nombre {
  font-family: 'Cinzel', Georgia, serif; font-size: clamp(22px, 4.2vw, 40px); font-weight: 700; line-height: 1.1; color: #fff1c9;
  text-shadow: 0 2px 4px #000, 0 0 18px rgba(245, 201, 106, 0.55);
}
.atlas-rotulo__tipo { font-size: 12px; font-style: italic; color: #d9c393; text-shadow: 0 1px 2px #000; }
/* D-MAPA-ENTRADAS (claude/_CLAUDE_D_MAPA_ENTRADAS_MESA.md) — la entrada pintada encima del nombre; como los puntos, no
   crece con el zoom (contraescalada con --mapa-zoom). La entrada se apoya en el sitio de la zona. */
.atlas-entrada { display: block; width: 64px; height: 64px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7)); }
.atlas-zona-punto-wrap--entrada { transform: translate(-50%, -70%); }
.atlas-map-lienzo .atlas-zona-punto--entrada { background: none; border: 0; box-shadow: none; padding: 0; gap: 0; }
.atlas-map-lienzo .atlas-zona-punto--entrada:hover { background: none; box-shadow: none; }
.atlas-zona-punto--entrada:hover .atlas-entrada { filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.75)); }
.atlas-zona-punto__placa {
  display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: -6px; padding: 2px 9px; border-radius: 999px;
  border: 1.5px solid rgba(245, 197, 66, 0.85); background: rgba(10, 8, 6, 0.82); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.atlas-zona-punto--dominada .atlas-zona-punto__placa { border-color: rgba(52, 211, 153, 0.9); }
/* D-MAZMORRA-CAZA D-MC-4 — la zona con llave aún cerrada: el sello de candado sobre la entrada y la entrada en gris */
.atlas-zona-punto--llave { position: relative; }
.atlas-zona-punto--llave .atlas-entrada { filter: grayscale(0.85) brightness(0.7) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7)); }
.atlas-candado { position: absolute; z-index: 3; top: 6px; left: 50%; width: 34px; height: 34px; transform: translateX(-50%); object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8)); }
.atlas-poi--entrada { translate: -50% -70%; transform-origin: 50% 70%; } /* D-DP-11 — el origen, en el ancla: sin él sigue derivando */
.atlas-poi--entrada:hover .atlas-entrada, .atlas-poi--entrada:focus-visible .atlas-entrada { filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.75)); }
@keyframes atlas-rotulo {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* D-MAZMORRAS-31..33 — las mazmorras vivas en el Atlas */
.atlas-viva .atlas-entrada { filter: drop-shadow(0 0 2px #f3e6c8) drop-shadow(0 0 4px #f3e6c8) drop-shadow(0 0 6px rgba(255, 210, 120, .6)); }
.atlas-viva--e1 .atlas-entrada { transform: scale(.85); }
.atlas-viva--desbordada .atlas-entrada { filter: drop-shadow(0 0 2px #f3e6c8) drop-shadow(0 0 8px rgba(255, 50, 30, .95)); animation: atlas-viva-latido 1.6s ease-in-out infinite; }
.atlas-viva--desbordada .atlas-poi__nombre { color: #ff8a7a; }
@keyframes atlas-viva-latido { 50% { filter: drop-shadow(0 0 2px #f3e6c8) drop-shadow(0 0 14px rgba(255, 50, 30, 1)); } }
/* el sello de la viva va estampado en un disco de pergamino, para leerse sobre el mapa pintado */
.atlas-viva .atlas-viva__sello { width: 58px; height: 58px; padding: 4px; border-radius: 50%; background: radial-gradient(circle, #f6ecd2 0%, #ecdcb4 62%, rgba(236, 220, 180, .85) 70%, rgba(236, 220, 180, 0) 74%); box-sizing: content-box; }

/* D-COMPENDIO-1 — la ficha de objeto única (src/ui/ficha_objeto.ts), al estilo de la ventana de objeto de EQ */
.ficha-objeto { background: rgba(8, 8, 10, 0.96); border: 1px solid rgba(214, 178, 94, 0.55); border-radius: 4px; padding: 10px 12px; min-width: 270px; max-width: 340px; font-family: "Consolas", "Courier New", monospace; font-size: 12px; line-height: 1.45; color: #d9d4c7; box-shadow: 0 6px 24px rgba(0,0,0,0.6); }
.ficha-objeto, .ficha-objeto *, #masterItemTooltip .ficha-objeto, #masterItemTooltip .ficha-objeto * { font-family: "Consolas", "Courier New", monospace !important; text-transform: none !important; letter-spacing: normal; }
.ficha-objeto .fo-nombre { color: var(--fo-color, #e8e8e8); font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.ficha-objeto .fo-etiquetas { color: #e3b341; font-size: 11px; letter-spacing: 0.04em; margin-bottom: 6px; }
.ficha-objeto .fo-tenue { color: #8f8a7d; }
.ficha-objeto .fo-stats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; margin: 6px 0; padding-top: 6px; border-top: 1px solid rgba(214,178,94,0.2); }
.ficha-objeto .fo-celda { display: flex; justify-content: space-between; gap: 8px; }
.ficha-objeto .fo-celda span:last-child { color: #f2efe6; }
/* D-BOTIN-2 D-BT2-1 — los afijos de la calidad, una línea cada uno con el color de la rareza del objeto */
.ficha-objeto .fo-afijo { color: var(--fo-color, #f2efe6); }
.ficha-objeto .fo-comparar { margin-top: 6px; font-size: 11px; color: #8f8a7d; }
/* D-COMPARADOR D-CMP-5 — el veredicto del comparador, encima de los deltas */
.ficha-objeto .fo-veredicto { margin-top: 6px; font-size: 13px; color: #8f8a7d; } /* D-SMOKE-9 D-SM9-12: 12 → 13 px */
.ficha-objeto .fo-mas { color: #6fdc6f; }
.ficha-objeto .fo-menos { color: #ef6b6b; }
.ficha-objeto .fo-pie { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(214,178,94,0.2); font-size: 11px; color: #b8a77a; }

/* D-COMPENDIO-1 — la ficha lleva el marco rectangular de su rareza (ui/marcos/tooltip_<rareza>.webp, de la entrega
   marcos_rareza_2026-10-09) estirado en 9 partes, y su icono arriba a la izquierda. El contenedor del tooltip se
   vuelve transparente cuando lleva una ficha, para no tener dos marcos. */
#masterItemTooltip:has(.ficha-objeto) { background: none !important; border: none !important; border-image: none !important; padding: 0 !important; box-shadow: none !important; min-width: 0; max-width: none; }
.ficha-objeto[data-rareza] { border-style: solid; border-color: transparent; border-radius: 0; background-clip: padding-box; background-color: rgba(10, 9, 8, 0.97); }
.ficha-objeto[data-rareza="comun"] { border-width: 11px; border-image: url("/ui/marcos/tooltip_comun.webp") 22 / 11px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="raro"] { border-width: 15px; border-image: url("/ui/marcos/tooltip_raro.webp") 30 / 15px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="excepcional"] { border-width: 22px; border-image: url("/ui/marcos/tooltip_excepcional.webp") 44 / 22px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="epico"] { border-width: 24px; border-image: url("/ui/marcos/tooltip_epico.webp") 48 / 24px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="legendario"] { border-width: 22px; border-image: url("/ui/marcos/tooltip_legendario.webp") 44 / 22px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="set"] { border-width: 15px; border-image: url("/ui/marcos/tooltip_set.webp") 30 / 15px stretch; padding: 6px 8px; }
.ficha-objeto[data-rareza="unico"] { border-width: 26px; border-image: url("/ui/marcos/tooltip_unico.webp") 52 / 26px stretch; padding: 6px 8px; }
.ficha-objeto .fo-cabeza { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ficha-objeto .fo-icono { width: 34px; height: 34px; flex: none; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.ficha-objeto .fo-icono--silueta { display: inline-block; background: var(--fo-color, #e8e8e8); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }

/* D-COMPENDIO — la enciclopedia (src/modules/compendio.ts) */
.sitio-raiz[data-sitio="compendio"] .cp-apartados { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cp-apartado { padding: 5px 12px; border: 1px solid rgba(214,178,94,0.35); border-radius: 4px; background: rgba(0,0,0,0.35); color: #e9dcb8; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.cp-apartado--activo { border-color: rgba(240,200,110,0.9); background: rgba(120,90,30,0.35); color: #ffe7a8; }
.cp-rejilla { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.3fr); gap: 12px; min-height: 0; }
@media (max-width: 1000px) { .cp-rejilla { grid-template-columns: 1fr; } }
.cp-filtros { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cp-filtros input, .cp-filtros select { background: rgba(0,0,0,0.5); border: 1px solid rgba(214,178,94,0.3); color: #eadfc4; font-size: 12px; padding: 4px 6px; border-radius: 3px; }
.cp-filtros .cp-buscar { flex: 1 1 140px; }
.cp-lista { display: flex; flex-direction: column; gap: 3px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.cp-fila { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid transparent; border-radius: 3px; background: rgba(0,0,0,0.25); text-align: left; }
.cp-fila:hover { border-color: rgba(214,178,94,0.35); background: rgba(60,45,20,0.35); }
.cp-fila--activa { border-color: rgba(240,200,110,0.8); background: rgba(90,68,25,0.45); }
.cp-fila__texto { display: flex; flex-direction: column; line-height: 1.2; }
.cp-fila__nombre { font-size: 13px; }
.cp-fila__sub { font-size: 11px; color: #9b927d; }
.cp-icono { width: 28px; height: 28px; flex: none; object-fit: contain; }
.cp-icono--silueta, .cp-icono--oculto { display: inline-block; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.cp-icono--silueta { background: var(--cp-color, #e8e8e8); }
.cp-icono--oculto { background: #3d3830; }
.cp-oculto { color: #6f675a; letter-spacing: 0.15em; }
.cp-tenue { color: #9b927d; }
.cp-vacio { color: #9b927d; font-style: italic; padding: 8px 2px; }
.cp-pagina { display: flex; flex-direction: column; gap: 12px; }
.cp-ficha .ficha-objeto { max-width: none; }
/* D-COMBATE-UI D-CUI-4/5 (claude/_CLAUDE_D_COMBATE_UI_MESA.md) — la ficha de hechizo y la de estado: el marco de madera y oro
   de la ficha de objeto, con el icono grande. La misma en el combate, en Tácticas y en el Compendio (src/ui/combate_ui.ts). */
.ficha-hechizo, .ficha-hechizo * { font-family: var(--ui-fuente-texto) !important; text-transform: none !important; letter-spacing: normal; }
.ficha-hechizo .fh-nombre { font-family: 'Cinzel', serif !important; }
.ficha-hechizo { width: 300px; border-style: solid; border-width: 11px; border-color: transparent; border-image: url("/ui/marcos/tooltip_comun.webp") 22 / 11px stretch; background-clip: padding-box; background-color: rgba(10, 9, 8, 0.97); padding: 6px 8px; color: #d9d4c7; font-size: 12px; line-height: 1.45; box-shadow: 0 6px 24px rgba(0,0,0,0.6); text-align: left; }
.ficha-hechizo .fh-cabeza { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ficha-hechizo .fh-icono { width: 56px; height: 56px; flex: none; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(214,178,94,0.7), 0 2px 6px rgba(0,0,0,0.8); }
.ficha-hechizo .fh-icono--vacio { display: inline-block; background: radial-gradient(circle, #3a2a14, #140e06); }
.ficha-hechizo .fh-nombre { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; color: #f3dfa0; }
.ficha-hechizo .fh-tipo { font-size: 11px; color: #e3b341; letter-spacing: 0.03em; }
.ficha-hechizo .fh-stats { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; padding: 5px 0; border-top: 1px solid rgba(214,178,94,0.25); border-bottom: 1px solid rgba(214,178,94,0.25); }
.ficha-hechizo .fh-celda { display: flex; justify-content: space-between; gap: 6px; }
.ficha-hechizo .fh-celda--ancha { grid-column: 1 / -1; }
.ficha-hechizo .fh-celda span:first-child { color: #9d957f; }
.ficha-hechizo .fh-celda span:last-child { color: #f2efe6; text-align: right; }
.ficha-hechizo .fh-hace { margin: 6px 0 4px; color: #efe9d7; }
.ficha-hechizo .fh-pie { font-size: 11px; color: #b8a77a; }
.ficha-estado--bueno .fh-icono { box-shadow: 0 0 0 2px #4fbf5a, 0 2px 6px rgba(0,0,0,0.8); }
.ficha-estado--malo .fh-icono { box-shadow: 0 0 0 2px #d6453a, 0 2px 6px rgba(0,0,0,0.8); }
.ficha-estado--malo .fh-tipo { color: #ff9c8c; }
.ficha-estado--bueno .fh-tipo { color: #9be59f; }
.cp-bloque h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #e3b341; margin: 0 0 4px; }
.cp-bloque p { margin: 0 0 4px; font-size: 13px; color: #e2d9c3; }
.cp-lista-datos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.cp-lista-datos li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted rgba(214,178,94,0.15); padding: 2px 0; color: #e2d9c3; }

/* D-COMPENDIO paso 2 — Mundo y Criaturas */
.cp-grupo { margin: 8px 0 2px; padding: 2px 4px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #e3b341; border-bottom: 1px solid rgba(214,178,94,0.25); }
.cp-enlace { background: none; border: none; padding: 0; color: #f0d68a; text-align: left; cursor: pointer; text-decoration: underline dotted rgba(240,214,138,0.5); }
.cp-enlace:hover { color: #fff1c4; }
.cp-retrato { object-fit: cover; border-radius: 3px; border: 1px solid rgba(214,178,94,0.35); }
.cp-icono--hueco { display: inline-flex; align-items: center; justify-content: center; border: 1px dashed rgba(214,178,94,0.25); border-radius: 3px; color: #6f675a; font-size: 13px; }
.cp-nombre--named { color: #ffcf6b; }
.cp-portada { width: 100%; max-height: 180px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(214,178,94,0.35); }
.cp-titulo-pagina h3, .cp-cabecera-criatura h3 { margin: 0; font-size: 18px; color: #ffe7a8; }
.cp-cabecera-criatura { display: flex; gap: 12px; align-items: flex-start; }
.cp-cabecera-criatura p { margin: 2px 0; font-size: 13px; }
.cp-retrato-grande { width: 110px; height: 150px; flex: none; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid rgba(214,178,94,0.45); }
.cp-cuadricula { display: grid; grid-template-columns: repeat(5, auto 1fr); gap: 2px 8px; font-size: 12px; color: #e2d9c3; }
.cp-cuadricula span:nth-child(even) { color: #ffe7a8; }

/* D-COMPENDIO-9 — el selector de zona encima del Atlas (src/modules/map.ts abrirZona) */
.atlas-selector { position: fixed; inset: 0; z-index: 12040; display: flex; align-items: center; justify-content: center; }
.atlas-selector__fondo { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.atlas-selector__caja { position: relative; width: min(420px, 92vw); max-height: 80vh; overflow-y: auto; padding: 16px 18px; background: rgba(14,11,7,0.97); border: 1px solid rgba(214,178,94,0.6); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.7); color: #e9dcb8; }
.atlas-selector__cabeza { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.atlas-selector__cabeza h3 { margin: 0; font-size: 18px; color: #ffe7a8; flex: 1; }
.atlas-selector__cabeza span { font-size: 12px; color: #b8a77a; }
.atlas-selector__x { background: none; border: none; color: #e9dcb8; font-size: 20px; line-height: 1; cursor: pointer; }
.atlas-selector__lema { margin: 0 0 10px; font-size: 12px; color: #b8a77a; }
.atlas-selector__aviso { margin: 0 0 10px; font-size: 12px; color: #f0a35b; }
.atlas-selector__lista { display: flex; flex-direction: column; gap: 6px; }
/* D-DP1-9 — las tarjetas de los camps de una zona de caza (opción B de Miguel): caben 5 camps y el jefe en una fila a 1366×768, sin scroll */
.atlas-selector__caja--camps { width: min(1100px, 92vw); text-transform: none; letter-spacing: normal; font-family: var(--ui-fuente-texto, inherit); }
.atlas-selector__caja--camps * { text-transform: none; letter-spacing: normal; }
.atlas-selector__tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.atlas-camp { position: relative; display: block; height: 300px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; color: #efe6d0; font: inherit;
  background: #0d1320; border: 1px solid #3a3322; border-radius: 6px; }
.atlas-camp[aria-disabled="true"] { cursor: help; }
.atlas-camp:hover:not([aria-disabled="true"]), .atlas-camp:focus-visible { border-color: #e9c46a; }
.atlas-camp--abierto { border-color: #2f7a4c; }
.atlas-camp--jefe { border-color: #8a2f2f; }
.atlas-camp__retrato { position: absolute; left: 50%; bottom: 58px; height: calc(100% - 70px); width: 100%; object-fit: contain; object-position: bottom; transform: translateX(-50%); }
.atlas-camp--sombra .atlas-camp__retrato { filter: grayscale(1) brightness(0.35); }
.atlas-camp__pie { position: absolute; inset: auto 0 0 0; display: block; padding: 8px 10px; background: rgba(10, 15, 28, 0.9); border-top: 1px solid #3a3322; }
.atlas-camp__nombre { display: block; font-size: 15px; font-weight: 500; line-height: 1.2; }
.atlas-camp--sombra .atlas-camp__nombre { color: #a39a84; }
.atlas-camp__nivel { display: block; margin-top: 2px; font-size: 12px; color: #a39a84; }
.atlas-camp__sello { position: absolute; z-index: 1; top: 8px; right: 8px; padding: 2px 7px; border-radius: 99px; font-size: 11px; color: #a39a84; background: rgba(10, 15, 28, 0.8); }
.atlas-camp--abierto .atlas-camp__sello { color: #9be7b4; }
.atlas-camp--hecho .atlas-camp__sello { color: #e9c46a; }
.atlas-camp--jefe .atlas-camp__sello { color: #ffb4a8; }
.atlas-camp__faltan { position: absolute; z-index: 2; inset: auto 6px 64px 6px; display: none; flex-direction: column; gap: 3px; padding: 6px 8px; border-radius: 5px;
  background: rgba(10, 8, 6, 0.94); border: 1px solid rgba(214, 178, 94, 0.5); font-size: 12px; line-height: 1.3; color: #efe6d0; }
.atlas-camp:hover .atlas-camp__faltan, .atlas-camp:focus-visible .atlas-camp__faltan, .atlas-camp--ver .atlas-camp__faltan { display: flex; }
.atlas-camp__req s { color: #a39a84; }
.atlas-selector__opcion { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid rgba(110,180,110,0.55); border-radius: 4px; background: rgba(20,60,30,0.55); color: #e6f5df; text-align: left; cursor: pointer; }
.atlas-selector__opcion:hover:not([disabled]) { background: rgba(30,90,45,0.75); }
.atlas-selector__opcion[disabled] { opacity: 0.45; cursor: not-allowed; border-color: rgba(214,178,94,0.3); background: rgba(0,0,0,0.35); }
.atlas-selector__texto { font-weight: 700; }
.atlas-selector__sub { font-size: 11px; color: #b9c9b0; }
.atlas-selector__pie { display: flex; justify-content: space-between; margin-top: 12px; }
.atlas-selector__enlace { background: none; border: none; color: #f0d68a; font-size: 12px; text-decoration: underline dotted; cursor: pointer; }
.atlas-selector__enlace--tenue { color: #8f8a7d; }

/* D-COMPENDIO paso 3 — Habilidades, Inicio, buscador único, volver y grupos plegables */
.cp-buscador { margin: 0 0 8px; }
.cp-buscador .cp-buscar { width: 100%; background: rgba(0,0,0,0.5); border: 1px solid rgba(214,178,94,0.45); color: #eadfc4; font-size: 13px; padding: 6px 10px; border-radius: 4px; }
.cp-plegable > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.cp-plegable > summary::-webkit-details-marker { display: none; }
.cp-plegable > summary::before { content: "▸"; color: #b8a77a; font-size: 10px; }
.cp-plegable[open] > summary::before { content: "▾"; }
.cp-plegable > summary em { margin-left: auto; font-style: normal; color: #8f8a7d; letter-spacing: 0; }
.cp-icono-grupo { width: 16px; height: 16px; object-fit: contain; }
.cp-icono-grande { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 4px; border: 1px solid rgba(214,178,94,0.45); }
.cp-volver { align-self: flex-start; margin-bottom: 6px; background: none; border: 1px solid rgba(214,178,94,0.35); border-radius: 3px; color: #e9dcb8; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.cp-tabla { width: 100%; border-collapse: collapse; font-size: 12px; color: #e2d9c3; }
.cp-tabla th { text-align: left; font-weight: 600; color: #e3b341; border-bottom: 1px solid rgba(214,178,94,0.3); padding: 2px 4px; }
.cp-tabla td { padding: 2px 4px; }
.cp-tabla__efecto td { color: #9b927d; font-size: 11px; border-bottom: 1px dotted rgba(214,178,94,0.15); padding-bottom: 4px; }
/* D-COMPENDIO paso 4 — los artículos de Mecánicas */
.cp-articulo p { margin: 0 0 8px; line-height: 1.5; }
.cp-vinetas { margin: 0 0 8px; padding-left: 18px; font-size: 13px; color: #e2d9c3; line-height: 1.5; }
.cp-vinetas li { margin: 0 0 2px; }
/* D-TUTORIAL-CHAT D-TC-6 — el botón de relanzar un tutorial */
.cp-lanzar { padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #2a1d08; background: linear-gradient(180deg, #f6dc98, #d9b25c); border: 1px solid rgba(255, 236, 180, 0.9); }
.cp-lanzar-aviso { margin: 6px 0 0; }
.cp-progreso { justify-content: space-between; }
.cp-progreso .cp-fila__texto { flex: 1; gap: 4px; }
.cp-barra { display: block; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.cp-barra span { display: block; height: 100%; background: linear-gradient(90deg, #b8862f, #f0d68a); }
.cp-progreso__cifra { font-size: 12px; color: #e9dcb8; white-space: nowrap; }
/* D-PULIDO-COMPENDIO (claude/_CLAUDE_D_PULIDO_COMPENDIO_MESA.md) — la pantalla pulida.
   D-PUL-COM-1: las filas de un grupo plegable (<details>, que es bloque) a todo el ancho y con la separación de las de Objetos. */
.cp-plegable > .cp-fila { width: 100%; box-sizing: border-box; margin-top: 3px; }
/* D-PUL-COM-2: a pantalla completa — la rejilla llena el alto del sitio; en la lista, buscador y filtros fijos y sólo
   se desplazan las filas; la ficha se desplaza dentro de su sección (sitio.css). Sin el tope fijo de 58vh en escritorio. */
.sitio-raiz[data-sitio="compendio"] .cp-rejilla { flex: 1 1 0; grid-template-rows: minmax(0, 1fr); }
.sitio-raiz[data-sitio="compendio"] .cp-sec-lista > .sitio-seccion__cuerpo { display: flex; flex-direction: column; overflow: hidden; }
.sitio-raiz[data-sitio="compendio"] #cp-lista { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sitio-raiz[data-sitio="compendio"] #cp-lista > .cp-filtros { flex: none; }
.sitio-raiz[data-sitio="compendio"] .cp-lista { flex: 1; min-height: 0; max-height: none; }
@media (max-width: 1000px) {
  .sitio-raiz[data-sitio="compendio"] .cp-rejilla { flex: none; grid-template-rows: none; }
  .sitio-raiz[data-sitio="compendio"] .cp-sec-lista > .sitio-seccion__cuerpo { display: block; overflow: visible; }
  .sitio-raiz[data-sitio="compendio"] #cp-lista { display: block; }
  .sitio-raiz[data-sitio="compendio"] .cp-lista { max-height: 58vh; }
}
/* D-PUL-COM-3: la letra de texto también en buscadores, filtros y tabla de rangos (Cinzel es todo versalitas). */
.sitio-raiz[data-sitio="compendio"] :is(input, select, option, td) { font-family: var(--ui-fuente-texto) !important; }
/* D-COMPENDIO-VISUAL (claude/_CLAUDE_D_COMPENDIO_VISUAL_MESA.md) — imágenes e iconos en todo el Compendio.
   D-CV-2: las pestañas son losas con su icono pintado y el nombre debajo; el buscador único va en la misma fila. */
.sitio-raiz[data-sitio="compendio"] .cp-barra-sup { flex: none; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sitio-raiz[data-sitio="compendio"] .cp-apartados { margin: 0; gap: 8px; flex-wrap: wrap; }
.sitio-raiz[data-sitio="compendio"] .cp-buscador { flex: 1 1 260px; margin: 0 0 4px; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 108px; padding: 8px 4px 7px; border-radius: 8px;
  border: 1px solid rgba(214,178,94,.25); background: linear-gradient(180deg, rgba(30,22,10,.85), rgba(10,8,5,.92)); color: #e9dcb8; text-transform: none; letter-spacing: 0; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado__icono { width: 56px; height: 56px; border-radius: 6px; background: center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(233,196,106,.35), 0 4px 10px rgba(0,0,0,.6); filter: saturate(.8) brightness(.85); transition: filter .15s ease; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado__icono--recorte, .sitio-raiz[data-sitio="compendio"] .cp-losa__icono--recorte { background-size: 170%; background-position: 50% 10%; background-color: #120d08; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado__nombre { font-family: var(--ui-fuente-titulo) !important; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado:hover { transform: translateY(-3px); border-color: rgba(240,200,110,.8); box-shadow: 0 6px 16px rgba(0,0,0,.6), 0 0 14px rgba(233,196,106,.25); color: #fff3c4; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado:hover .cp-apartado__icono { filter: none; }
.sitio-raiz[data-sitio="compendio"] .cp-apartado--activo { border-color: #e9c46a; background: linear-gradient(180deg, rgba(96,70,24,.92), rgba(32,24,10,.95)); color: #fff3c4;
  box-shadow: 0 0 0 1px rgba(233,196,106,.5), 0 0 18px rgba(233,196,106,.25); }
.sitio-raiz[data-sitio="compendio"] .cp-apartado--activo .cp-apartado__icono { filter: none; box-shadow: 0 0 0 2px #e9c46a, 0 4px 12px rgba(0,0,0,.6); }
.sitio-raiz[data-sitio="compendio"] :is(.cp-apartado, .cp-losa):focus-visible { outline: 2px solid #ffe7a1; outline-offset: 2px; }
/* D-CV-1: la portada — escenas del juego que se suceden con fundido y un acercamiento lento */
.sitio-raiz[data-sitio="compendio"] .cp-portada-inicio { position: relative; flex: 1 1 0; min-height: 0; display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(214,178,94,.45); box-shadow: 0 10px 30px rgba(0,0,0,.6); background: #0a0806; }
.cp-fondos { position: absolute; inset: 0; overflow: hidden; }
.cp-fondo { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity 1.5s ease; }
.cp-fondo--visible { opacity: 1; animation: cp-acercar 9s ease-out both; }
@keyframes cp-acercar { from { transform: scale(1); } to { transform: scale(1.08); } }
.cp-fondos__velo { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,6,3,.9) 0%, rgba(8,6,3,.62) 42%, rgba(8,6,3,.08) 100%), linear-gradient(0deg, rgba(8,6,3,.92) 0%, rgba(8,6,3,.35) 38%, transparent 60%); }
.cp-portada__contenido { position: relative; z-index: 1; margin-top: auto; width: 100%; max-height: 100%; overflow-y: auto; padding: 18px 26px 14px; display: flex; flex-direction: column; gap: 6px; }
.sitio-raiz[data-sitio="compendio"] .cp-portada__titulo { margin: 0; padding-top: .12em; line-height: 1.25; font-family: var(--ui-fuente-titulo) !important; font-size: clamp(26px, 2.4vw, 40px); letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff3c4, #e0b252 55%, #9a6a1c); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 12px rgba(0,0,0,.8)); }
.cp-portada__texto { margin: 0; max-width: 680px; font-size: 13.5px; line-height: 1.5; color: #efe3c8; text-shadow: 0 1px 3px #000; }
.cp-losas { display: grid; grid-template-columns: repeat(5, minmax(120px, 170px)); gap: 12px; margin-top: 6px; }
.sitio-raiz[data-sitio="compendio"] .cp-losa { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 10px 8px; border-radius: 10px;
  border: 1px solid rgba(214,178,94,.35); background: rgba(10,8,5,.74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: #efe3c8; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.sitio-raiz[data-sitio="compendio"] .cp-losa:hover { transform: translateY(-4px); border-color: rgba(240,200,110,.85); box-shadow: 0 8px 20px rgba(0,0,0,.6), 0 0 16px rgba(233,196,106,.3); }
.cp-losa__icono { width: 62px; height: 62px; border-radius: 8px; background: center / cover no-repeat; box-shadow: 0 0 0 1px rgba(233,196,106,.45), 0 4px 12px rgba(0,0,0,.6); }
.sitio-raiz[data-sitio="compendio"] .cp-losa__nombre { font-family: var(--ui-fuente-titulo) !important; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: #ffe7a8; }
.cp-losa .cp-barra { width: 100%; }
.cp-barra--llena span { background: linear-gradient(90deg, #6f8f5a, #b9d79a); }
.cp-losa__cifra { font-size: 12px; color: #d9cba6; }
.cp-portada__total { margin: 2px 0 0; font-size: 13px; color: #d9cba6; text-shadow: 0 1px 3px #000; }
/* D-CV-3: el arte de cada zona (entrada pintada, recorte del mapa del mundo o sello) y de las técnicas */
.cp-mapa { display: inline-block; background-repeat: no-repeat; border-radius: 3px; border: 1px solid rgba(214,178,94,.35); }
.cp-portada.cp-mapa { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 3.6 / 1; }
.cp-sello { object-fit: contain; border-radius: 3px; background: #efe6d0; border: 1px solid rgba(214,178,94,.35); }
.cp-portada.cp-sello { height: 160px; padding: 10px; }
/* D-CV-4: las capturas del juego en los artículos de Mecánicas */
.cp-figura { margin: 0 0 12px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(214,178,94,.4); background: #0a0806; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.cp-figura img { display: block; width: 100%; height: auto; max-height: 38vh; object-fit: contain; background: #0a0806; }
.sitio-raiz[data-sitio="compendio"] .cp-figura figcaption { padding: 6px 10px; font-family: var(--ui-fuente-texto) !important; font-size: 12px; font-style: italic; color: #cbbd99; border-top: 1px solid rgba(214,178,94,.2); }
.cp-miniatura { width: 40px; object-fit: cover; border-radius: 3px; border: 1px solid rgba(214,178,94,.35); }
@media (prefers-reduced-motion: reduce) {
  .cp-fondo--visible { animation: none; }
  .cp-fondo { transition-duration: 3s; }
  .sitio-raiz[data-sitio="compendio"] :is(.cp-apartado, .cp-losa) { transition: none; }
  .sitio-raiz[data-sitio="compendio"] :is(.cp-apartado, .cp-losa):hover { transform: none; }
}
@media (max-width: 1000px) {
  .sitio-raiz[data-sitio="compendio"] .cp-portada-inicio { flex: none; min-height: 620px; }
  .cp-losas { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .sitio-raiz[data-sitio="compendio"] .cp-apartado { width: 78px; }
  .sitio-raiz[data-sitio="compendio"] .cp-apartado__icono { width: 44px; height: 44px; }
}

/* ===== D-MAPA-REGIONES (claude/_CLAUDE_D_MAPA_REGIONES_MESA.md, T1) — el Atlas en dos niveles ===== */
/* la imagen de la región (map.ts la pone en --atlas-fondo; sólo se carga la de la región en la que se está) */
.atlas-map-bg.atlas-map-bg--region { background-image: var(--atlas-fondo) !important; }
/* D-MRG-14/15 — los caminos trazados y las piezas: sobre la base, bajo la niebla (que va con z-index 1) */
.atlas-map-lienzo .atlas-caminos { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.atlas-map-lienzo .atlas-piezas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.atlas-pieza { position: absolute; max-width: none; height: auto; user-select: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.atlas-pieza--resaltada { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
/* D-MRG-5 — el nivel de la zona junto a su nombre, con el color de dificultad respecto al líder */
.atlas-zona-nivel { font-weight: 700; color: var(--atlas-con, #f2f2f2); }
.atlas-zona-nivel--red { --atlas-con: #ff6b5e; }
.atlas-zona-nivel--yellow { --atlas-con: #f1d058; }
.atlas-zona-nivel--white { --atlas-con: #f2f2f2; }
.atlas-zona-nivel--blue { --atlas-con: #7aa8ff; }
.atlas-zona-nivel--lightblue { --atlas-con: #79d6ff; }
.atlas-zona-nivel--green { --atlas-con: #6ee06e; }
.atlas-zona-nivel--gray { --atlas-con: #a8a8a8; }
/* D-MRG-20 — las salidas de la región: un letrero en su borde */
.atlas-salida { flex-direction: row; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 8px; background: rgba(22, 15, 8, 0.86); border: 1px solid #c69a46; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.atlas-salida:hover, .atlas-salida:focus-visible { background: rgba(80, 50, 10, 0.92); box-shadow: 0 0 12px rgba(251, 191, 36, 0.55); }
.atlas-salida__flecha { font-size: 18px; line-height: 1; color: #f5c96a; }
.atlas-salida .atlas-poi__nombre { font-size: 11px; text-align: left; color: #fbe7b0; }
.atlas-salida .atlas-poi__nombre small { font-size: 9.5px; color: #d9c393; font-style: italic; }
/* D-DEMO-TOPE D-DT-3 — en la demo, la salida a una región de fuera: a la vista, más apagada y con borde gris */
.atlas-salida--demo { border-color: #8a7a5c; background: rgba(22, 15, 8, 0.7); }
.atlas-salida--demo .atlas-salida__flecha { color: #b9a77f; }
/* D-MRG-3 — el botón del mapa del mundo / de vuelta a la región */
.atlas-mapa-controles button.atlas-mapa-vista { width: auto; min-width: 34px; padding: 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.atlas-ayuda__region { color: #f5d27a; }
/* D-MRG-3/4 — el mapa del mundo: las regiones (las no pisadas, bajo la niebla), los enlaces y los nombres */
.atlas-mundo-regiones { position: absolute; inset: 0; z-index: 1; }
.atlas-mundo-region { position: absolute; background: transparent; border: 2px dashed rgba(245, 210, 122, 0.35); border-radius: 10px; cursor: pointer; padding: 0; transition: background 0.2s, border-color 0.2s; }
.atlas-mundo-region:hover { background: rgba(245, 210, 122, 0.1); border-color: rgba(245, 210, 122, 0.85); }
.atlas-mundo-region--actual { border-style: solid; border-color: rgba(251, 191, 36, 0.85); box-shadow: inset 0 0 24px rgba(251, 191, 36, 0.25); }
.atlas-mundo-region--niebla { background: rgba(16, 18, 26, 0.55); }
.atlas-mundo-region--niebla:hover { background: rgba(16, 18, 26, 0.4); }
.atlas-mundo-enlaces { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.atlas-mundo-enlace { fill: none; stroke: rgba(255, 236, 190, 0.85); stroke-width: 0.22; stroke-dasharray: 0.7 0.5; stroke-linecap: round; filter: drop-shadow(0 0 0.3px #000); }
.atlas-mundo-enlace--barco { stroke: rgba(170, 215, 255, 0.85); }
.atlas-mundo-nombre { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.atlas-mundo-nombre small { font-size: 0.68em; letter-spacing: 0.08em; opacity: 0.85; }
.atlas-mundo-nombre--niebla { opacity: 0.55; }
/* D-COMBATE-ARREGLOS D-CA-6 (claude/_CLAUDE_D_COMBATE_ARREGLOS_MESA.md, adenda A-2) — el mundo limpio para el jugador: la región se
   pulsa pero no se dibuja (el rectángulo es del editor); al pasar, se ilumina su nombre; el camino, sólo el del viaje en curso */
.atlas-mundo-region--limpia, .atlas-mundo-region--limpia:hover, .atlas-mundo-region--limpia.atlas-mundo-region--actual { background: transparent; border: 0; box-shadow: none; }
.atlas-mundo-nombre { transition: color 0.2s, text-shadow 0.2s, transform 0.2s; }
.atlas-mundo-nombre--encima { color: #ffe9a8; text-shadow: 0 0 10px rgba(255, 210, 120, 0.85), 0 1px 3px #000; }
.atlas-mundo-enlace--viaje { stroke-width: 0.3; }
/* en el mapa del mundo no hay puntos: la capa vacía no tapa las regiones */
.atlas-map-points:empty { pointer-events: none; }

/* ── D-MAPA-VIDA T-A (claude/_CLAUDE_D_MAPA_VIDA_MESA.md) ─────────────────────────────────────────────────────────────── */
/* D-MV-12 — el medallón pintado de cada tipo de punto de interés (hojas C1/C2 de Miguel) */
.atlas-poi__medallon { width: 30px; height: 30px; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); transition: transform 0.15s; }
.atlas-poi:hover .atlas-poi__medallon, .atlas-poi:focus-visible .atlas-poi__medallon { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8)); }
/* D-MV-16 — la ciudad con murallas: sólo su nombre rotulado (se entra cruzándolas) */
.atlas-poi--rotulo { cursor: inherit; pointer-events: none; }
.atlas-poi--rotulo .atlas-poi__nombre { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; color: #fff3cf; }
/* D-MV-11 — la ruta prevista */
.atlas-ruta { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.atlas-ruta polyline { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.atlas-ruta__sombra { stroke: rgba(20, 12, 4, 0.55); stroke-width: 5px; stroke-dasharray: 2 9; }
.atlas-ruta__linea { stroke: #ffe29a; stroke-width: 2.5px; stroke-dasharray: 2 9; }
/* D-MV-17 — la velocidad de druida, chamán o bardo */
.atlas-viaje-rapido--druid, .atlas-viaje-rapido--shaman { border-color: #6f9c4b; }
.atlas-viaje-rapido--bard { border-color: #a07bc4; }
/* D-DIOSES F1 D-DIO-4 — la bendición de Zéfira (Templo) */
.atlas-viaje-rapido--bendicion { border-color: #58b7c9; }
/* ───────── D-CONSTRUIR-MAPA fase 1 (claude/_CLAUDE_D_CONSTRUIR_MAPA_MESA.md, D-CM-7) — construir en el mapa ───────── */
.atlas-mapa-controles button.atlas-construir-btn { font-size: 11px; }
.atlas-mapa-controles button.atlas-construir-btn--apagado { opacity: 0.45; }
/* D-CONSTRUIR-GUIADO D-CG-3 — construir aún cerrado: apagado y con «Aún no» (estático: nada se anima, D-CG-9) */
.atlas-mapa-controles button.atlas-construir-btn--bloqueado { opacity: 0.6; filter: grayscale(0.7); cursor: help; }
.atlas-construir-btn__aun { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 6px; font-size: 9px; line-height: 14px; background: rgba(0, 0, 0, 0.45); color: #e8d9b0; border: 1px solid rgba(232, 217, 176, 0.45); vertical-align: middle; }
.atlas-construir__tarjeta--guia-no { opacity: 0.45; filter: grayscale(0.8); cursor: default; position: relative; }
.atlas-construir__tarjeta--guia-no:hover { border-color: inherit; background: inherit; }
.atlas-construir__aun { align-self: flex-end; font-size: 10px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.5); color: #e8d9b0; }
.atlas-map-visor--construir .atlas-map-lienzo { cursor: crosshair; }
.atlas-construir {
  position: absolute; left: 10px; top: 10px; z-index: 31; width: min(560px, calc(100% - 70px)); max-height: min(calc(100% - 20px), calc(100vh - 330px)); overflow: auto;
  padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(245, 197, 66, 0.7);
  background: linear-gradient(180deg, rgba(34, 24, 12, 0.96), rgba(16, 11, 6, 0.96)); color: #f6ead0; font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.atlas-construir__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: #fde68a; margin-bottom: 4px; }
.atlas-construir__cerrar { background: none; border: 0; color: #fde68a; font-size: 18px; cursor: pointer; line-height: 1; }
.atlas-construir__ayuda { color: #d9c9a3; margin: 4px 0; }
.atlas-construir__motivo { color: #ffb4a8; font-weight: 700; margin: 6px 0; }
.atlas-construir__sub { color: #fde68a; margin: 8px 0 2px; font-weight: 700; }
.atlas-construir__tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 6px; }
.atlas-construir__tarjeta {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(245, 197, 66, 0.45); background: rgba(0, 0, 0, 0.35);
}
.atlas-construir__tarjeta:hover { border-color: #f5c542; background: rgba(80, 50, 10, 0.5); }
.atlas-construir__tarjeta--falta { opacity: 0.8; }
.atlas-construir__pieza { height: 38px; width: auto; object-fit: contain; align-self: center; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.atlas-construir__nombre { font-weight: 700; color: #fde68a; font-size: 13px; }
.atlas-construir__efecto { color: #e9dcc0; font-size: 11px; }
.atlas-construir__precio, .atlas-construir__horas { color: #bfae88; font-size: 11px; }
.atlas-construir__costes { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.atlas-construir__coste { display: flex; align-items: center; gap: 6px; color: #b9f3b0; }
.atlas-construir__coste img { width: 18px; height: 18px; object-fit: contain; }
.atlas-construir__coste span { flex: 1; }
.atlas-construir__coste--falta { color: #ff9c8c; }
.atlas-construir__botones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.atlas-construir__boton {
  font: inherit; cursor: pointer; padding: 5px 10px; border-radius: 7px; border: 1px solid rgba(245, 197, 66, 0.7);
  background: rgba(10, 8, 6, 0.85); color: #fde68a;
}
.atlas-construir__boton--si { background: linear-gradient(180deg, #7a5212, #4f330a); color: #fff3cf; }
.atlas-construir__boton--no { border-color: rgba(255, 140, 120, 0.6); color: #ffc9bd; }
.atlas-construir__boton:disabled { opacity: 0.5; cursor: default; }
.atlas-construir__mini { font: inherit; font-size: 11px; cursor: pointer; padding: 1px 7px; border-radius: 6px; border: 1px solid rgba(245, 197, 66, 0.6); background: rgba(0, 0, 0, 0.4); color: #fde68a; }
.atlas-construir__gente { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.atlas-construir__gente li { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.atlas-construir__nadie { color: #a8987a; font-style: italic; }
.atlas-construir__barra { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(245, 197, 66, 0.4); overflow: hidden; margin: 4px 0; }
.atlas-construir__barra span { display: block; height: 100%; background: linear-gradient(90deg, #c8892a, #f5c542); }
.atlas-construir-previa { position: absolute; inset: 0; z-index: 17; pointer-events: none; }
.atlas-construir-previa svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.atlas-construir-previa__trazo { fill: none; stroke: #f5c542; stroke-width: 4; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.atlas-construir-previa__trazo.atlas-construir-previa--ok { stroke: #9be38a; }
.atlas-construir-previa__punto { position: absolute; width: 12px; height: 12px; border-radius: 50%; translate: -50% -50%; scale: calc(1 / var(--mapa-zoom, 1)); background: #f5c542; border: 2px solid #3a2608; }
.atlas-construir-previa__punto.atlas-construir-previa--no { background: #ff7d6b; }
.atlas-construir-previa__pieza { position: absolute; width: 2.9%; height: auto; transform: translate(-50%, -50%); opacity: 0.7; filter: drop-shadow(0 0 6px rgba(245, 197, 66, 0.9)); }
/* D-CONSTRUIR-GUIADO A-2 — el primer camino que propone el tutorial: trazo ancho y claro, y una marca pulsable (sin animación) */
.atlas-construir-previa__trazo--sugerida { stroke: #fff3b0; stroke-width: 7; stroke-dasharray: none; filter: drop-shadow(0 0 6px rgba(255, 220, 120, 0.95)); }
.atlas-construir-sugerida { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; scale: calc(1 / var(--mapa-zoom, 1)); padding: 0; border-radius: 50%; pointer-events: auto; cursor: pointer; background: radial-gradient(circle, #fff7d0 0 35%, #f5c542 36% 60%, rgba(245, 197, 66, 0.25) 61%); border: 2px solid #3a2608; box-shadow: 0 0 0 4px rgba(255, 236, 170, 0.55), 0 0 18px 6px rgba(255, 214, 120, 0.7); }
.atlas-construir-previa__pieza.atlas-construir-previa--no { filter: grayscale(1) drop-shadow(0 0 6px rgba(255, 110, 90, 0.9)); }
.atlas-obra-marca {
  position: absolute; z-index: 18; translate: -50% -50%; scale: calc(1 / var(--mapa-zoom, 1)); pointer-events: auto; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%; padding: 0; border: 2px solid #f5c542; background: rgba(20, 14, 6, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.atlas-obra-marca--hecha { width: 16px; height: 16px; border-color: rgba(245, 197, 66, 0.55); background: rgba(20, 14, 6, 0.25); opacity: 0.75; }
.atlas-obra-marca:hover { background: rgba(80, 50, 10, 0.7); opacity: 1; }
.atlas-obra-marca__barra { position: absolute; left: -6px; right: -6px; bottom: -9px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.atlas-obra-marca__barra span { display: block; height: 100%; background: #f5c542; }
