@charset "UTF-8";
@font-face {
  font-family: "DejaVuSansCondensed";
  src: url("../fonts/DejaVuSansCondensed.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "DejaVuSerif";
  src: url("../fonts/DejaVuSerif.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Cardinal";
  src: url("../fonts/Cardinal.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Augusta";
  src: url("../fonts/Augusta.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "MinionPro-Regular";
  src: url("../fonts/MinionPro-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "MyriadPro-Regular";
  src: url("../fonts/MyriadPro-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "AdobeClean-LightIt";
  src: url("../fonts/AdobeClean-LightIt.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
}
:root {
  --police-nom-cartes: "DejaVuSansCondensed";
  --police-description-cartes: "DejaVuSansCondensed";
  --police-texte-general: "DejaVuSansCondensed";
  --police-titres: "DejaVuSerif";
  --police-glossaire: "DejaVuSansCondensed";
  --police-menus: "DejaVuSansCondensed";
}

/* ===== Scrollbar vertical estilo RPG madera (solo inventario) ===== */
.inventory-content ::-webkit-scrollbar {
  width: 16px; /* grosor general */
  background-color: #3b2615; /* fondo madera oscura */
  border-left: 2px solid #a67c52; /* borde dorado claro */
}

/* Canal (track) del scroll */
.inventory-content ::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #3b2615 0%, #2c1a0f 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

/* Barra desplazable (thumb) */
.inventory-content ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c49a6c 0%, #8b5e2b 100%);
  border: 2px solid #3b2615; /* borde oscuro para separar del track */
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}

/* Hover del thumb */
.inventory-content ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d7b679 0%, #a6763b 100%);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}

/* Flechas (arriba / abajo) */
.inventory-content ::-webkit-scrollbar-button {
  background-color: #8b5e2b;
  border: 1px solid #a67c52;
  height: 16px;
  width: 16px;
  border-radius: 2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 8px;
}

/* Flecha arriba */
.inventory-content ::-webkit-scrollbar-button:vertical:decrement {
  background-image: linear-gradient(145deg, #c49a6c 10%, #8b5e2b 90%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path fill="%233b2615" d="M4 1 L1 6 L7 6 Z"/></svg>');
}

/* Flecha abajo */
.inventory-content ::-webkit-scrollbar-button:vertical:increment {
  background-image: linear-gradient(145deg, #c49a6c 10%, #8b5e2b 90%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path fill="%233b2615" d="M4 7 L1 2 L7 2 Z"/></svg>');
}

/* Efecto cuando está presionado */
.inventory-content ::-webkit-scrollbar-button:active {
  background-image: linear-gradient(145deg, #8b5e2b 10%, #d7b679 90%);
}

.inventory-content ::-webkit-scrollbar-button:vertical:decrement:active {
  background-image: linear-gradient(145deg, #8b5e2b 10%, #d7b679 90%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path fill="%233b2615" d="M4 1 L1 6 L7 6 Z"/></svg>');
}

.inventory-content ::-webkit-scrollbar-button:vertical:increment:active {
  background-image: linear-gradient(145deg, #8b5e2b 10%, #d7b679 90%), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path fill="%233b2615" d="M4 7 L1 2 L7 2 Z"/></svg>');
}

html, body {
  min-width: 1920px;
  min-height: 1080px;
  width: 1920px;
  height: 100vh;
  overflow: hidden;
}

html {
  scroll-snap-type: y mandatory;
}

body {
  font-family: var(--police-texte-general, "DejaVuSansCondensed"), sans-serif;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
  background-color: black;
}

p {
  font-size: 1.7rem;
}

h2 {
  font-size: 2.2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--police-titres, "DejaVuSerif"), serif;
}

#effets-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

ul {
  margin-bottom: 0;
}

.txt-action br {
  display: none;
}

.txt-action p {
  margin-bottom: 0;
}

.character-creation-overlay {
  flex-direction: column;
  position: relative;
}

/* Capa de fondo dinámico para selección de clase */
.class-background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease-in-out, opacity 0.5s ease-in-out;
  z-index: 0;
  pointer-events: none;
}

.character-creation-overlay > *:not(.class-background-layer):not(.back-button-header) {
  position: relative;
  z-index: 1;
}

/* ===== PANTALLA DE SELECCIÓN DE CLASE (Nuevo diseño) ===== */
.class-select-screen {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.class-select-layout {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  gap: 20px;
  align-items: stretch;
}

/* Panel izquierdo - Información de clase */
.class-info-panel {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  border: none;
  z-index: 2;
}

/* Contenedores con bordes estilo inventario */
.class-info-box {
  background: rgba(20, 30, 50, 0.85);
  border: 6px solid #3b2615;
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-info-box .class-info-header {
  border-bottom: 1px solid rgba(166, 124, 82, 0.4);
}

.class-info-box .class-info-section-title {
  color: #e0e8f0;
}

.class-info-box .class-info-description {
  color: #c0c8d0;
  background: transparent;
  padding: 8px 0;
}

.class-info-box .class-info-section {
  background: transparent;
}

.class-info-box .char-icon-stat,
.class-info-box .stat-box-group,
.class-info-box span,
.class-info-box i {
  color: #e0e8f0;
}

.class-info-box .class-info-name {
  color: #f0e6d2;
}

.class-info-box .class-info-icon {
  background: rgba(255, 255, 255, 0.1);
}

.class-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(200, 170, 100, 0.5);
}

.class-info-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
}

.class-info-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: #f0e6d2;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  flex: 1;
}

.class-weapon-types {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.weapon-type-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 162, 39, 0.2);
  border: 2px solid rgba(201, 162, 39, 0.6);
  border-radius: 50%;
  color: #c9a227;
  font-size: 1rem;
  cursor: help;
  transition: all 0.3s ease;
}

.weapon-type-icon:hover {
  background: rgba(201, 162, 39, 0.4);
  border-color: #c9a227;
  transform: scale(1.1);
}

.class-info-description {
  font-size: 0.85rem;
  color: #c0b8a8;
  line-height: 1.5;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.class-info-section {
  background: transparent;
  border-radius: 8px;
  padding: 8px 0;
}

.class-info-section-title {
  font-size: 0.9rem;
  color: #c8aa64;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-info-section-title i {
  font-size: 0.8rem;
}

/* Características */
.class-characteristics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.char-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.char-label {
  color: #a0a0a0;
}

.char-value {
  color: #f0e6d2;
  font-weight: bold;
}

/* Stats principales */
.class-main-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-group {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px;
}

.stat-group-title {
  font-size: 0.7rem;
  color: #c8aa64;
  margin-bottom: 4px;
  text-align: center;
}

.stat-row-mini {
  display: flex;
  justify-content: space-around;
  font-size: 0.75rem;
  color: #d0d0d0;
}

.stat-row-mini span {
  color: #f0e6d2;
}

/* Características con iconos */
.class-characteristics-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.char-icon-stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  cursor: default;
  position: relative;
}

.char-icon-stat i {
  font-size: 1rem;
  color: #c8aa64;
}

.char-icon-stat .char-icon-value {
  font-size: 0.85rem;
  font-weight: bold;
  color: #f0e6d2;
}


/* Stats grid con cajas de colores */
.class-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.class-stats-header {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 2px;
}

.stats-header-spacer {
  width: 24px;
}

.stats-header-labels {
  display: flex;
  gap: 2px;
}

.stats-header-labels span {
  width: 28px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: #c8aa64;
}

.class-stats-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.stat-box-group {
  display: flex;
  gap: 2px;
  align-items: center;
  cursor: default;
  position: relative;
}


.stat-box-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: skewX(-12deg);
  border: 0.5px solid rgba(0, 0, 0, 0.3);
}

.stat-box-icon i {
  font-size: 0.65rem;
  color: white;
  transform: skewX(12deg);
}

/* Colores de iconos */
.stat-box-icon.attack-phys { background-color: #ed1c22; }
.stat-box-icon.attack-mag { background-color: #3f47cc; }
.stat-box-icon.defense-phys { background-color: #22b34c; }
.stat-box-icon.defense-mag { background-color: #a84fa9; }
.stat-box-icon.armor-phys { background-color: #7f7f7f; }
.stat-box-icon.armor-mag { background-color: #5a5a8a; }

.stat-box {
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: skewX(-12deg);
  border: 0.5px solid rgba(0, 0, 0, 0.3);
}

.stat-box span {
  font-size: 0.7rem;
  font-weight: bold;
  color: white;
  transform: skewX(12deg);
}

/* Colores de cajas de ataque físico */
.stat-box.top.attack { background-color: #ed1c22; }
.stat-box.mid.attack { background-color: #ff7f26; }
.stat-box.bot.attack { background-color: #ffc90d; }

/* Colores de cajas de ataque mágico */
.stat-box.top.attack-mag { background-color: #3f47cc; }
.stat-box.mid.attack-mag { background-color: #00a2ea; }
.stat-box.bot.attack-mag { background-color: #00a3e8; }

/* Colores de cajas de defensa física */
.stat-box.top.defense { background-color: #23b14d; }
.stat-box.mid.defense { background-color: #b5e51d; }
.stat-box.bot.defense { background-color: #fef200; }

/* Colores de cajas de defensa mágica */
.stat-box.top.defense-mag { background-color: #a349a3; }
.stat-box.mid.defense-mag { background-color: #feaec9; }
.stat-box.bot.defense-mag { background-color: #7092bf; }

/* Colores de cajas de armadura física */
.stat-box.top.armor { background-color: #c3c3c3; }
.stat-box.mid.armor { background-color: #7f7f7f; }
.stat-box.bot.armor { background-color: #5a5a5a; }

/* Colores de cajas de armadura mágica */
.stat-box.top.armor-mag { background-color: #9a7fbf; }
.stat-box.mid.armor-mag { background-color: #7a5f9f; }
.stat-box.bot.armor-mag { background-color: #5a3f7f; }

/* Centro - Contenedor del carrusel */
.class-character-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 400px;
  position: relative;
  padding-top: 20px;
}

/* Bullets de navegación con iconos de clase */
.class-nav-bullets {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  z-index: 20;
}

.class-nav-bullet {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(100, 100, 120, 0.6);
  background: rgba(30, 30, 40, 0.8);
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.class-nav-bullet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(50%) brightness(0.7);
  transition: all 0.3s ease;
}

.class-nav-bullet:hover:not(.locked) {
  border-color: rgba(200, 170, 100, 0.8);
  transform: scale(1.1);
}

.class-nav-bullet:hover:not(.locked) img {
  filter: grayscale(0%) brightness(1);
}

.class-nav-bullet.active {
  border-color: #c9a227;
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.5);
  transform: scale(1.15);
}

.class-nav-bullet.active img {
  filter: grayscale(0%) brightness(1);
}

.class-nav-bullet.locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.class-nav-bullet .bullet-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: #888;
  font-size: 1.2rem;
}

/* Carrusel 3D - Contenedor con perspectiva */
.carousel-3d-perspective {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
  min-height: 500px;
  perspective: 1100px;
}

/* Contenedor del carrusel con preserve-3d */
.carousel-3d-container {
  width: 1200px;
  height: 420px;
  position: relative;
  transform-style: preserve-3d;
}

/* Cada item del carrusel */
.carousel-3d-item {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  cursor: pointer;
  transition: transform 1s ease, opacity 1s ease;
}

.carousel-3d-item img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease, max-height 0.5s ease;
}

/* Item activo (al frente) */
.carousel-3d-item.active {
  z-index: 10;
  cursor: default;
}

.carousel-3d-item.active img {
  max-height: 420px;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.6));
}

/* Items laterales */
.carousel-3d-item.side {
  z-index: 5;
  cursor: pointer;
  pointer-events: auto;
}

.carousel-3d-item.side img {
  max-height: 280px;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3)) brightness(0.5);
  pointer-events: auto;
}

.carousel-3d-item.side:hover img {
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3)) brightness(0.7);
}

/* Items atrás (ocultos) */
.carousel-3d-item:not(.active):not(.side) {
  z-index: 1;
  opacity: 0.3;
  pointer-events: none;
}

/* Placeholder cuando no hay imagen */
.carousel-3d-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 350px;
  color: rgba(200, 200, 220, 0.5);
}

.carousel-3d-placeholder i {
  font-size: 5rem;
}

/* Flechas de navegación del selector de clases */
.class-carousel-arrow {
  background: url("../assets/UI/fleche.webp") no-repeat center/contain;
  width: 64px;
  height: 64px;
  border: none;
  cursor: pointer;
  min-width: 64px;
  flex-shrink: 0;
  z-index: 15;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin: 0 -250px;
}

.class-carousel-arrow:hover {
  opacity: 1;
  transform: scale(1.1);
}

.class-carousel-arrow.left {
  transform: rotate(180deg);
  order: 0;
}

.class-carousel-arrow.left:hover {
  transform: rotate(180deg) scale(1.1);
}

.class-carousel-arrow.right {
  order: 4;
}

.class-character-image {
  max-height: 55vh;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  transition: opacity 0.3s ease;
}

/* Panel derecho - Selector de clases */
.class-selector-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  padding-top: 40px;
  z-index: 2;
}

.class-selector-title {
  font-size: 1.1rem;
  color: #f0e6d2;
  margin: 0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.class-selector-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.class-selector-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(40, 40, 50, 0.8);
  border: 2px solid rgba(100, 100, 120, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.class-selector-btn:hover:not(.locked) {
  background: rgba(60, 60, 80, 0.9);
  border-color: rgba(150, 150, 170, 0.7);
  transform: translateX(-5px);
}

.class-selector-btn.active {
  background: linear-gradient(135deg, rgba(200, 170, 100, 0.3), rgba(180, 150, 80, 0.2));
  border-color: #c8aa64;
  box-shadow: 0 0 15px rgba(200, 170, 100, 0.3);
}

.class-selector-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.class-selector-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.class-selector-name {
  flex: 1;
  font-size: 1rem;
  color: #f0e6d2;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.class-selector-lock {
  position: absolute;
  right: 15px;
  color: #888;
}

/* Footer - Botón Select */
.class-select-footer {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.class-select-btn {
  padding: 15px 60px;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #1a1a1a;
  background: linear-gradient(180deg, #f0e6d2 0%, #c8aa64 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(200, 170, 100, 0.4);
}

.class-select-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 170, 100, 0.6);
  background: linear-gradient(180deg, #fff 0%, #d4b876 100%);
}

.class-select-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(180deg, #888 0%, #666 100%);
}

.class-select-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.profile-select-overlay,
.profile-create-overlay,
.mode-select-overlay,
.difficulty-select-overlay,
.character-creation-overlay,
.options-menu-overlay,
.start-menu-overlay,
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("/assets/UI/menu-principal.webp") no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  font-family: var(--police-menus, "DejaVuSansCondensed"), sans-serif;
}

.back-button {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 50px;
  height: 50px;
  background: rgba(40, 40, 50, 0.8);
  border: 2px solid rgba(100, 100, 120, 0.6);
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  transition: all 0.3s ease;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.back-button:hover {
  background: rgba(66, 153, 225, 0.8);
  border-color: rgb(66, 153, 225);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.5);
}
.back-button:active {
  transform: scale(0.95);
}
.back-button i {
  pointer-events: none;
}

/* Botón volver con texto (header de pantallas) */
.back-button-header {
  position: fixed !important;
  top: 15px !important;
  left: 15px !important;
  right: auto !important;
  transform: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  background: transparent;
  border: none;
  color: #f5c542;
  cursor: pointer;
  font-size: 1.4em;
  font-weight: bold;
  font-family: var(--police-menus, "DejaVuSansCondensed"), sans-serif;
  transition: transform 0.2s ease, filter 0.2s ease;
  z-index: 9999;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.back-button-header::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  background: url('../assets/UI/arrow-back.png') no-repeat center/contain;
  flex-shrink: 0;
}

.back-button-header:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.back-button-header:active {
  transform: scale(0.95);
}

.back-button-header i {
  display: none;
}

#globalTooltip {
  max-width: 250px;
  background-color: rgba(30, 30, 30, 0.9);
  color: #f0f0f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 1.5rem;
  font-family: "Arial", sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.tippy-box[data-theme~=translucent] {
  background-color: rgba(30, 30, 45, 0.95);
  color: #f0f0f0;
  backdrop-filter: blur(4px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  font-size: 12px;
}

.tippy-box[data-theme~=translucent] .tippy-arrow {
  color: rgba(30, 30, 45, 0.95);
}

.tippy-box[data-theme~=card-preview] {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.tippy-box[data-theme~=card-preview] .tippy-arrow {
  display: none;
}

#screenOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  z-index: 9999;
  pointer-events: none;
  display: none;
}

.topbar {
  position: fixed;
  display: flex;
  flex-direction: column;
  width: 50%;
  left: 25%;
  z-index: 100;
  top: -500px;
}
.topbar > .card {
  width: 100%;
  height: 500px;
  margin-bottom: 20px;
  transition: all 0.3s ease-in-out;
}
.topbar > .card h4 {
  text-align: center;
}
.topbar > .card .content {
  display: flex;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  gap: 20px;
  flex-wrap: wrap;
  width: fit-content;
  margin: auto;
}
.topbar > .card .content button {
  min-width: fit-content;
  width: fit-content;
}
.topbar > .card.open {
  transform: translateY(500px);
}
.topbar > .card.open .content {
  max-height: 500px;
  overflow: auto;
}
.topbar .toggle-panel {
  position: absolute;
  bottom: -35px;
  left: calc(50% - 17.5px);
  top: initial;
}
.topbar .toggle-panel:hover {
  top: initial;
}

.sidebar {
  position: fixed;
  display: flex;
  flex-direction: column;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 0;
}
.sidebar.sidebar-left {
  left: 0;
}
.sidebar.sidebar-left > .card {
  width: 300px;
  left: -300px;
  margin-bottom: 20px;
  transition: all 0.3s ease-in-out;
}
.sidebar.sidebar-left > .card .content {
  display: flex;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}
.sidebar.sidebar-left > .card.open {
  transform: translateX(300px);
}
.sidebar.sidebar-left > .card.open .content {
  max-height: 500px;
  overflow: auto;
}
.sidebar.sidebar-left > .card.inventaire .toggle-panel {
  background: rgba(46, 204, 113, 0.8);
}
.sidebar.sidebar-left > .card.fiche-perso .fiche {
  width: 100%;
}
.sidebar.sidebar-right {
  display: none;
  right: 0;
}
.sidebar.sidebar-right > .card {
  right: 0;
  width: 403px;
  margin-bottom: 20px;
  transition: all 0.3s ease-in-out;
}
.sidebar.sidebar-right > .card .content {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}
.sidebar.sidebar-right > .card .toggle-panel {
  left: -35px;
  right: auto;
}
.sidebar.sidebar-right > .card.open {
  transform: translateX(-403px);
}
.sidebar.sidebar-right > .card.open .content {
  max-height: 300px;
}
.sidebar.sidebar-right > .card.quetes .toggle-panel {
  background: rgba(241, 196, 15, 0.8);
}
.sidebar.sidebar-right > .card.journal .toggle-panel {
  background: rgba(155, 89, 182, 0.8);
}

.game-container {
  height: calc(100vh - 70px);
}

.main-content {
  margin: 0 100px;
  height: 100%;
}

.icon-loot {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  vertical-align: middle;
}

#scene-event {
  position: relative; /* Important pour contenir le canvas */
  overflow: hidden; /* Empêche le canvas de déborder visuellement */
  width: fit-content; /* Ajuster si nécessaire */
  height: fit-content; /* Ajuster si nécessaire */
  max-width: 100%;
  max-height: calc(100vh - 75px);
}
#scene-event img {
  max-width: calc(100vw - 200px);
  max-height: calc(100vh - 110px);
}

.fabric-overlay-container {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 11;
  pointer-events: none;
}

#fabricCanvas {
  /* Styles spécifiques au canvas si besoin, mais z-index sur conteneur est mieux */
  /* Assurer qu'il n'a pas de pointer-events par défaut */
  pointer-events: none;
}

/* Style pour activer les pointeurs quand le mode interaction est actif */
#scene-event.interaction-mode #fabricCanvas {
  pointer-events: auto; /* Permettre clic sur canvas */
}

#scene-event.interaction-mode .fabric-overlay-container {
  pointer-events: auto; /* Permettre clic sur conteneur */
}

#scene-event.open img {
  top: 0;
  left: 0;
  position: absolute;
}
#scene-event.open .canvas-container {
  display: block;
}

.toggle-panel {
  position: absolute;
  top: 10px;
  right: -35px;
  width: 35px;
  height: 35px;
  background: rgba(52, 152, 219, 0.8);
  color: white;
  text-align: center;
  line-height: 35px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.toggle-panel:hover {
  top: 3px;
  transition: top 0.2s ease-in-out;
}

.evenement {
  position: relative;
  width: fit-content;
  margin: auto;
  max-width: 100%;
  height: calc(100vh - 75px);
  max-height: fit-content;
}
.evenement .titre {
  width: 100%;
  z-index: 1;
}
.evenement .titre h2 {
  color: #fff;
  padding-top: 5px;
  display: block;
  font-size: 2.2rem;
  margin-bottom: 0;
}
.evenement .titre h3 {
  margin-bottom: 0;
  color: #b6f1ca;
}
.evenement .event-text {
  max-height: 40vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.6);
  padding: 25px 50px 15px;
  bottom: -2px;
  color: white;
  font-size: 1.6rem;
  line-height: 1.3;
  position: absolute;
  width: 100%;
  min-height: 100px;
  z-index: 10;
}
.evenement .event-text br {
  display: none;
}
.evenement .event-text p {
  scroll-snap-align: start;
}
.evenement .card-body {
  padding-top: 0;
}

.close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: yellow;
  z-index: 20;
}

.description-evenement {
  display: flex;
  position: relative;
  z-index: 11;
  padding: 0;
  min-height: 75px;
  align-items: center;
}
.description-evenement span {
  font-size: 23px;
}
.description-evenement .icon-choix {
  width: 35px;
}
.description-evenement button {
  height: fit-content;
}

.event-text[x-cloak] {
  display: none;
}

[x-cloak] {
  display: none;
}

.journal {
  background: rgb(155, 89, 182);
}
.journal .nav-link {
  color: white;
}
.journal .journal-list,
.journal .combat-log {
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
}

.carte-monde {
  width: 100vw;
  z-index: 1000;
  left: 0;
  position: absolute;
  top: 0;
  margin-top: 0 !important;
  border-radius: 0;
  height: 100vh;
}
.carte-monde .card-body {
  perspective: 1200px;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: #5c677d; /* Couleur de fond comme sur ton exemple */
  overflow-x: scroll;
  overflow-y: hidden;
}
.carte-monde .card-body > img {
  transform: rotateX(55deg) rotateY(0deg);
  transform-origin: 0 20%;
  position: relative;
  left: 30vw;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  image-rendering: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.carte-img {
  width: 1400px;
  height: 43vw;
  transform: rotateX(55deg);
  transform-origin: 0 20%;
  transform-style: preserve-3d;
  position: relative;
  z-index: 1;
}

.points-map {
  position: absolute;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}

.points-map .wrap {
  position: relative;
  width: 100%;
  height: 100%;
  left: 30vw;
}

.point-map {
  position: absolute;
  pointer-events: auto; /* pour réactiver les clics */
}

.conditional-description {
  color: #17a2b8; /* Exemple de bleu info */
}

/* Conversation overlay (s'intègre dans le thème du jeu) */
.conversation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  z-index: 8000;
  /* Mieux vaut un z-index plus grand que la plupart de tes sidebars/éléments */
  display: flex; /* Pour centrer le container */
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  /* Retire display: none; ici, c'est Alpine qui fera x-show="false" => display:none */
}

.conversation-container {
  max-width: 800px;
  background: #222;
  border-radius: 10px;
  padding: 25px 40px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
  /* etc. */
}

/* Chaque nœud de conversation (empilé) */
.conversation-node {
  animation: fadeIn 0.5s ease-in-out;
}

/* Zone d'affichage pour le PNJ de gauche et de droite */
.pnj-gauche,
.pnj-droite {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

/* Style pour les photos des PNJ */
.pnj-gauche img,
.pnj-droite img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid #fff;
}

.pnj-gauche .container-photo {
  margin-right: 20px;
}

.pnj-droite .container-photo {
  margin-left: 20px;
}

.container-photo {
  position: relative;
}
.container-photo h2 {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-top: -30px;
  background-color: red;
  border: 1px solid white;
}

.pnj-droite {
  flex-direction: row-reverse;
}

.pnj-gauche img {
  transform: scaleX(-1);
}

/* Texte des dialogues dans les nœuds */
.conversation-node > div:not(.conversation-choices) > p > p {
  max-height: 100%;
  max-width: 100%;
  text-align: justify;
  line-height: 1.8rem;
  font-size: 30px;
}

.conversation-node > div:not(.conversation-choices) > p {
  cursor: pointer;
  flex-grow: 1;
  height: 100%;
  display: flex;
  align-items: center;
  overflow-y: auto;
  margin-bottom: 0;
}

.conversation-node p {
  color: #fff;
  font-size: 1.1rem;
}

/* Zone des boutons de choix */
.conversation-choices {
  margin-top: 10px;
  text-align: center;
}

/* Boutons de choix (et bouton "..." s'il n'y a pas d'options) */
.conversation-choices button {
  background: rgba(52, 152, 219, 0.8);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  margin: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.conversation-choices button:hover {
  background: rgb(52, 152, 219);
}

/* Bouton de fermeture de la conversation */
.fermer-conversation {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 3100;
}

/* Animation d'apparition */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-out {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

#companion-reactions-display {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10009;
}

.companion-dialogue-line {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(40, 40, 60, 0.85);
  color: #e0e0ff;
  padding: 8px 15px;
  border-radius: 15px;
  border: 1px solid #6a7fba;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  z-index: 10010;
  max-width: 60%;
  text-align: center;
  font-style: italic;
  font-size: 1.5rem;
  pointer-events: none;
  font-family: var(--police-texte-general, "DejaVuSansCondensed"), sans-serif;
}
.companion-dialogue-line strong {
  color: #d5b778;
}

.companion-hint-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: rgba(255, 248, 220, 0.92);
  color: #5b4d2a;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #f0e68c;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 10010;
  max-width: 300px;
  font-size: 1.5rem;
  pointer-events: none;
  font-family: var(--police-texte-general, "DejaVuSansCondensed"), sans-serif;
}
.companion-hint-popup i.fa-lightbulb {
  margin-right: 8px;
  color: #ffc107;
}
.companion-hint-popup strong {
  color: rgb(38.6578947368, 32.7105263158, 17.8421052632);
}

.journal-entry.type-companion {
  color: #e0e0ff;
  font-style: italic;
  border-left: 3px solid #6a7fba;
  padding-left: 5px;
}

.inventory-screen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 30, 0.1);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.inventory-content {
  width: 95%;
  max-width: 1350px;
  border: 10px solid #3b2615;
  border-radius: 35px;
  box-shadow: 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f, 0 0 0 8px #d4a76a, 0 0 0 11px #8b5e2b, 0 0 0 14px #c49a6c, 0 0 0 16px #6b4423, 0 0 0 18px rgba(212, 167, 106, 0.4), 0 2px 4px rgba(212, 167, 106, 0.5), 0 -2px 4px rgba(139, 94, 43, 0.4), 0 8px 30px rgba(0, 0, 0, 0.7) !important;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  max-height: 700px;
  position: relative;
  padding: 0;
  overflow: visible;
}
.inventory-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 35px;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, rgba(59, 38, 21, 0.3) 0%, transparent 25%), radial-gradient(circle at 80% 70%, rgba(107, 68, 35, 0.25) 0%, transparent 30%), radial-gradient(circle at 50% 90%, rgba(139, 94, 43, 0.2) 0%, transparent 20%), radial-gradient(circle at 10% 80%, rgba(59, 38, 21, 0.25) 0%, transparent 25%), radial-gradient(circle at 90% 20%, rgba(107, 68, 35, 0.2) 0%, transparent 30%), radial-gradient(ellipse at 40% 50%, rgba(212, 167, 106, 0.15) 0%, transparent 40%), radial-gradient(ellipse at 70% 40%, rgba(166, 124, 82, 0.1) 0%, transparent 35%), linear-gradient(135deg, rgba(212, 167, 106, 0.05) 0%, transparent 50%, rgba(59, 38, 21, 0.08) 100%);
  opacity: 0.7;
  z-index: 1;
}
.inventory-content .row {
  display: flex;
  flex-wrap: nowrap;
  overflow: visible;
  position: relative;
  z-index: 2;
}
.inventory-content .row .col-lg-3 {
  flex: 0 0 320px;
  min-width: 340px;
  max-width: 350px;
  padding: 20px 30px;
  min-height: 580px;
  max-height: 600px;
  align-content: center;
}
.inventory-content .row .col-element-bonuses {
  flex: 0 0 auto;
  min-width: 300px;
  max-width: 300px;
  padding: 20px 10px;
  min-height: 580px;
  max-height: 600px;
  align-content: flex-start;
  /* transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; */
}
.inventory-content .row .col-lg-4 {
  flex: 1;
  min-width: 250px;
  max-width: none;
  padding: 20px 0;
  min-height: 600px;
  align-content: center;
}
.inventory-content .row .col-lg-4 .quick-items-container {
  margin-top: 1.5rem;
  margin-right: 50px;
  align-self: end;
  position: relative;
  display: flex;
  flex-direction: column;
}
.inventory-content .row .col-lg-5 {
  flex: 0 0 350px;
  max-width: 430px;
  padding: 20px;
  min-height: 600px;
  align-content: center;
  position: relative;
  overflow: visible;
}

.simple-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.simple-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background-color: transparent;
  border-radius: 4px;
}
.simple-stat-item i {
  font-size: 24px;
  width: 24px;
  text-align: center;
}
.simple-stat-item .stat-value-simple {
  flex: 1;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.simple-stat-item-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 0;
  background-color: transparent;
  border-radius: 4px;
}
.simple-stat-item-text .stat-label-text {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 600;
}
.simple-stat-item-text .stat-value-simple {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.player-basic-info {
  background: rgba(255, 255, 255, 0.55);
  border: 6px solid #3b2615;
  border-radius: 25px;
  box-shadow: inset 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f;
  padding: 12px;
  margin-bottom: 1rem;
}
.player-basic-info .stat-label-text, .player-basic-info .stat-value-simple {
  color: #000 !important;
}

.player-combat-stats {
  background: rgba(255, 255, 255, 0.55);
  border: 6px solid #3b2615;
  border-radius: 25px;
  box-shadow: inset 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f;
  padding: 15px 10px 15px 12px;
  height: 77%;
  box-sizing: border-box;
}
.player-combat-stats h6, .player-combat-stats .stat-value, .player-combat-stats .stat-value-inline, .player-combat-stats .position-label {
  color: #000 !important;
}

.combat-stats-container {
  max-height: 100%;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 38, 21, 0.3) transparent;
}
.combat-stats-container::-webkit-scrollbar {
  width: 4px;
}
.combat-stats-container::-webkit-scrollbar-track {
  background: transparent;
}
.combat-stats-container::-webkit-scrollbar-thumb {
  background: rgba(59, 38, 21, 0.3);
  border-radius: 2px;
}
.combat-stats-container::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 38, 21, 0.5);
}

.fiche.small {
  height: 100% !important;
}

.elemental-info-container {
  background: rgba(255, 255, 255, 0.55);
  border: 6px solid #3b2615;
  border-radius: 25px;
  box-shadow: inset 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f;
  height: 99%;
  padding: 20px 12px;
}
.elemental-info-container h5, .elemental-info-container h6 {
  color: #012939 !important;
}
.elemental-info-container .element-attack, .elemental-info-container .element-defense, .elemental-info-container .status-value {
  color: #000 !important;
}

.elemental-info-scroll-wrapper {
  max-height: 520px;
  overflow-y: auto;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 38, 21, 0.5) transparent;
}
.elemental-info-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
}
.elemental-info-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.elemental-info-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(59, 38, 21, 0.5);
  border-radius: 3px;
}
.elemental-info-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: rgba(59, 38, 21, 0.7);
}

.exp-bar-container {
  padding: 0;
  background-color: transparent;
}

.exp-bar-inline {
  display: flex;
  align-items: center;
}
.exp-bar-inline .stat-label-text {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.exp-bar-inline .exp-values {
  font-size: 0.7rem;
  color: #d1d5db;
  font-weight: 500;
  white-space: nowrap;
}

.exp-bar-bg {
  flex: 1;
  min-width: 80px;
  height: 14px;
  background: #012a3a;
  border-radius: 7px;
  border: 1px solid #374151;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.exp-bar-fill {
  height: 100%;
  background: var(--xp-fill-color, #e0b060);
  border-radius: 6px;
  transition: width 0.5s ease-out;
  position: relative;
  box-shadow: 0 0 8px rgba(224, 176, 96, 0.4);
}

/* === EXP BAR - THREE-SLICE MODE === */
/* En mode 3-slice : la barre change de taille selon la valeur, le filler remplit 100% */
.exp-bar-bg.three-slice-mode {
  /* flex: 1 devient width variable basée sur le parent */
  flex: none;
  width: calc(var(--xp-max-width, 100%) * var(--xp-value, 100) / 100);
  min-width: calc(var(--ts-slice1, 5px) + var(--ts-slice-end-width, 5px) + 4px);
  transition: width 0.5s ease-out;
}

.exp-bar-bg.three-slice-mode .exp-bar-fill {
  display: none;
}

.exp-bar-bg.three-slice-mode .ts-fill-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--xp-fill-color, #e0b060);
  border-radius: 6px;
  z-index: 0;
}

.exp-bar-bg.three-slice-mode .ts-frame-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  z-index: 1;
  overflow: hidden;
  border-radius: 7px;
}

.exp-bar-bg.three-slice-mode .ts-zone {
  background-image: var(--ts-image);
  background-repeat: no-repeat;
}

.exp-bar-bg.three-slice-mode .ts-start {
  flex-shrink: 0;
  flex-grow: 0;
  width: var(--ts-slice1, 5px);
  height: 100%;
  background-position: left center;
  background-size: auto 100%;
}

.exp-bar-bg.three-slice-mode .ts-middle {
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
  height: 100%;
  background-position: calc(-1 * var(--ts-slice1, 5px)) center;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

.exp-bar-bg.three-slice-mode .ts-end {
  flex-shrink: 0;
  flex-grow: 0;
  width: var(--ts-slice-end-width, 5px);
  height: 100%;
  background-position: right center;
  background-size: auto 100%;
}

.simple-stat-item-full {
  grid-column: 1/-1;
}

.stat-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-with-icon i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.stat-position-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.stat-position {
  text-align: center;
  padding: 2px 4px;
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.position-label {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: bold;
  text-transform: uppercase;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: bold;
}

.combat-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 0.9rem;
}
.combat-stat-item i {
  font-size: 18px;
  width: 18px;
  text-align: center;
}
.combat-stat-item .stat-label {
  flex: 1;
  color: #e5e7eb;
}
.combat-stat-item .stat-value-right {
  font-size: 0.9rem;
  font-weight: bold;
  min-width: 45px;
  text-align: right;
}

.text-purple {
  color: #a78bfa !important;
}

.element-bonus-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.element-bonus-card {
  background-color: transparent !important;
  border: none !important;
  padding: 4px !important;
}

.element-icon {
  font-size: 20px !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  min-width: 26px;
  text-align: center;
}

.element-attack {
  font-size: 0.85rem !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color: #ff8c00 !important;
}

.element-defense {
  font-size: 0.85rem !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.element-defense.text-primary {
  color: #4dabf7 !important;
}

.element-separator {
  font-weight: bold;
  color: #6c757d !important;
}

.status-bonus-grid,
.status-resistance-grid,
.status-immunity-grid,
.status-combined-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start; /* Alinear iconos a la izquierda */
}

.status-item {
  display: flex;
  align-items: center;
  padding: 2px 4px 2px 4px; /* Padding simétrico */
  padding-left: 0 !important; /* Sin padding izquierdo */
  background-color: transparent !important;
  border-radius: 4px;
}
.status-item .status-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}
.status-item .status-value {
  font-size: 0.75rem;
  font-weight: bold;
}

.status-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.combat-stat-item-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.combat-stat-item-inline i {
  font-size: 0.85rem;
}
.combat-stat-item-inline .stat-value-inline {
  margin-left: 6px;
  font-size: 0.85rem;
}

.list-unstyled.small i {
  font-size: 0.85em;
}

.inventory-burger-btn {
  background: none !important;
  border: none !important;
  color: white !important;
  opacity: 1 !important;
  transition: none !important;
}
.inventory-burger-btn:hover {
  background: none !important;
  border: none !important;
  color: white !important;
  opacity: 1 !important;
  transform: none !important;
}
.inventory-burger-btn:focus {
  box-shadow: none !important;
  outline: none !important;
}
.inventory-burger-btn:active {
  background: none !important;
  border: none !important;
  color: white !important;
}
.inventory-burger-btn i {
  font-size: 1.2em;
  color: white;
}

.inventory-slider-nav {
  display: none;
  gap: 15px;
}
.inventory-slider-nav .slider-arrow {
  background: none;
  border: none;
  color: #c49a6c;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  font-size: 1.1em;
}
.inventory-slider-nav .slider-arrow:hover {
  color: #d7b679;
  transform: scale(1.2);
}
.inventory-slider-nav .slider-arrow:active {
  transform: scale(0.95);
}
.inventory-slider-nav .slider-bullets .bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(196, 154, 108, 0.3);
  border: 1px solid #c49a6c;
  display: inline-block;
  transition: all 0.3s ease;
}
.inventory-slider-nav .slider-bullets .bullet.active {
  width: 12px;
  height: 12px;
  background-color: #c49a6c;
  box-shadow: 0 0 8px rgba(196, 154, 108, 0.6);
}

.inventory-close-btn {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #ffffff;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 10;
}
.inventory-close-btn i {
  font-size: 1.8rem;
  font-weight: 900;
}
.inventory-close-btn:hover {
  opacity: 1;
}

.inventory-tabs-menu {
  position: fixed;
  top: 250px;
  right: 80px;
  z-index: 1000;
  width: 200px;
  background-color: rgba(1, 42, 58, 0.95);
  border: none;
  border-radius: 8px;
  flex-direction: column;
  padding: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}
.inventory-tabs-menu .nav-item {
  width: 100%;
  margin-bottom: 5px;
}
.inventory-tabs-menu .nav-item .nav-link {
  width: 100%;
  text-align: left;
  border-radius: 4px;
  padding: 8px 12px;
  color: #ffffff;
  border: none;
  transition: background-color 0.2s ease;
}
.inventory-tabs-menu .nav-item .nav-link:hover {
  background-color: #e0b060;
  color: #ffffff;
}
.inventory-tabs-menu .nav-item .nav-link.active {
  background-color: #e0b060;
  color: #ffffff;
}

.character-equipment-schema {
  /* L'image de silhouette est déjà stylée en ligne */
}

.equipment-slot {
  position: absolute;
  width: 45px; /* Taille des slots - Reducido proporcionalmente */
  height: 45px;
  border: 2px dashed #6b7280; /* Bordure tirets gris */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.05); /* Fond très léger */
  transition: background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer; /* Pour indiquer qu'on peut cliquer pour déséquiper */
}

.equipment-slot:hover,
.equipment-slot.drag-over-active { /* Classe à ajouter dynamiquement avec JS au dragover */
  background-color: rgba(59, 130, 246, 0.2); /* Bleu léger au survol/drop possible */
  border-color: #3b82f6; /* Bordure bleue */
}

.equipment-slot.slot-occupied {
  border-style: solid;
  border-color: #4ade80; /* Vert quand occupé */
  background-color: rgba(74, 222, 128, 0.1);
}

.equipment-slot img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  pointer-events: none; /* Pour que le clic aille sur le slot parent */
}

.equipment-slot i { /* Pour les icônes placeholder */
  font-size: 17px; /* Reducido proporcionalmente */
  color: #9ca3af; /* Gris clair pour icônes */
  pointer-events: none;
}

.placeholder-icon {
  font-size: 24px;
  color: #9ca3af;
  pointer-events: none;
}

.equipment-slot.highlight-compatible {
  border-color: #ffc107;
  background-color: rgba(255, 193, 7, 0.15);
}

.equipment-slot.highlight-restricted {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.15);
}

/* Positionnement spécifique des slots - Ajustado para 275px altura */
.slot-casque {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-armure {
  top: 53px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-arme {
  top: 53px;
  left: 15px;
} /* Main droite du perso (gauche de l'écran) */
/* .slot-bouclier { top: 53px; right: 15px; } Si vous avez un slot bouclier */
.slot-accessoire1 {
  top: 102px;
  left: 22px;
}

.slot-accessoire2 {
  top: 102px;
  right: 22px;
}

.slot-arme2 {
  top: 53px;
  right: 15px;
}

.slot-gants {
  top: 151px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-ceinture {
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
}

.slot-bottes {
  top: 249px;
  left: 50%;
  transform: translateX(-50%);
}

.combat-item-slots {
  /* Contenedor de slots con fondo de correa continuo */
  position: relative;
  background: url("../assets/combats/UI/laniere-centre.webp");
  background-repeat: repeat-x;
  background-size: auto 32px;
  background-position: center;
  padding: 5px 0;
}
.combat-item-slots::before {
  content: "";
  width: 32px;
  height: 32px;
  background: url("../assets/combats/UI/bout-laniere.webp");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: right;
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
}
.combat-item-slots::after {
  content: "";
  width: 50px;
  height: 32px;
  background: url("../assets/combats/UI/laniere-centre.webp");
  background-repeat: repeat-x;
  background-size: auto 32px;
  background-position: left;
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}

.combat-item-slots .equipment-slot { /* Pour les slots d'objets de combat rapide */
  position: relative; /* Pas de positionnement absolu, ils sont dans un flex container */
  transform: none;
  width: 41px; /* Reducido proporcionalmente */
  height: 41px;
  background: url("../assets/combats/UI/bouton-point.webp");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.combat-item-slots .equipment-slot span { /* Pour les numéros */
  font-size: 1.5em;
  color: #6b7280;
}

.inv-container {
  position: fixed;
  top: 150px;
  right: 168px;
  background: url(../assets/UI/inventario.webp) no-repeat center;
  background-size: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  width: 495px;
  height: 580px;
  z-index: 6100;
  pointer-events: auto;
  /* left: 55px; */
}

.inv-container .d-flex.align-items-center.mb-2 {
  position: relative;
  top: 50px;
  max-width: 350px;
  left: 60px;
  gap: 30px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 62px);
  grid-auto-rows: 62px;
  gap: 10px;
  padding: 5px;
  max-width: 357px;
  max-height: 340px;
  position: relative;
  top: 111px;
  left: 43px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.inventory-grid::-webkit-scrollbar {
  display: none;
}

.inventory-item {
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; /* Ancho uniforme para todos los items */
  max-width: 60px; /* Reducido proporcionalmente */
  height: 60px; /* Reducido proporcionalmente */
  min-width: 0; /* Evita que el contenido expanda el item */
  transition: box-shadow 0.2s ease-out, border-color 0.2s ease-out, filter 0.2s ease-out;
  position: relative; /* Pour la jauge de durabilité */
  background: transparent;
  border: none;
}

.inventory-item.equipped {
  border: 2px solid #ffc107 !important;
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.7);
}

.inventory-item:hover {
  /* Efecto de brillo estilo WoW */
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 0 8px rgba(255, 255, 255, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8) !important;
  filter: brightness(1.15);
}

.inventory-item:active { /* Pendant le drag */
  cursor: grabbing;
  opacity: 0.7;
  filter: brightness(0.9);
}

.inventory-item-icon {
  max-width: 50px;
  max-height: 45px;
  object-fit: contain;
  margin-bottom: 2px;
}

.inventory-item-name {
  display: none; /* Ocultar el nombre del item */
}

.inventory-item-qty {
  font-size: 0.7rem;
  color: #9ca3af;
  position: absolute;
  bottom: 2px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0 3px;
  border-radius: 3px;
}

.durability-bar {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  overflow: hidden;
}

.durability-bar-inner {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

/* === DURABILITY BAR - THREE-SLICE MODE === */
.durability-bar.three-slice-mode {
  /* La largeur varie selon la durabilité */
  width: calc((100% - 8px) * var(--dur-value, 100) / 100);
  left: 4px;
  right: auto;
  min-width: calc(var(--ts-slice1, 2px) + var(--ts-slice-end-width, 2px) + 2px);
  transition: width 0.3s ease-out;
}

.durability-bar.three-slice-mode .durability-bar-inner {
  display: none;
}

.durability-bar.three-slice-mode .ts-fill-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dur-fill-color, #28a745);
  border-radius: 2px;
  z-index: 0;
}

.durability-bar.three-slice-mode .ts-frame-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  z-index: 1;
  overflow: hidden;
  border-radius: 2px;
}

.durability-bar.three-slice-mode .ts-zone {
  background-image: var(--ts-image);
  background-repeat: no-repeat;
}

.durability-bar.three-slice-mode .ts-start {
  flex-shrink: 0;
  width: var(--ts-slice1, 2px);
  height: 100%;
  background-position: left center;
  background-size: auto 100%;
}

.durability-bar.three-slice-mode .ts-middle {
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  background-position: calc(-1 * var(--ts-slice1, 2px)) center;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

.durability-bar.three-slice-mode .ts-end {
  flex-shrink: 0;
  width: var(--ts-slice-end-width, 2px);
  height: 100%;
  background-position: right center;
  background-size: auto 100%;
}

/* ---------------- Merchant Popup Styles ---------------- */
/* ---------------- Marchand Menu Vertical Styles ---------------- */
.marchand-menu-vertical {
  position: fixed;
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
  z-index: 10015;
  background: #1a1a2e;
  border: 3px solid #3b2615;
  border-radius: 12px;
  padding: 15px;
  width: 220px !important;
  min-width: 180px;
  color: white;
}
.marchand-menu-vertical[x-cloak] {
  display: none !important;
}

.marchand-modal-overlay[x-cloak] {
  display: none !important;
}

.marchand-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(59, 38, 21, 0.5);
}

.marchand-menu-title {
  margin: 0;
  font-size: 1rem;
  color: #ffd700;
}

.marchand-menu-close {
  background: transparent;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 5px;
  font-size: 1rem;
}
.marchand-menu-close:hover {
  color: #ff6b6b;
}

.marchand-menu-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.marchand-menu-item {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(59, 38, 21, 0.3);
  border-radius: 6px;
  padding: 10px 15px;
  color: white;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}
.marchand-menu-item:hover {
  background: rgba(255, 215, 0, 0.2);
}

.marchand-scene-exit {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(220, 53, 69, 0.8);
  border: 2px solid rgb(220, 53, 69);
  border-radius: 8px;
  padding: 12px 20px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background-color 0.2s ease;
  z-index: 10001;
}
.marchand-scene-exit:hover {
  background: rgb(220, 53, 69);
}

.debug-menu-toggle-merchant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(220, 38, 38, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10017;
  color: white;
  font-size: 20px;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.debug-menu-toggle-merchant:hover {
  transform: scale(1.1);
  background: rgb(220, 38, 38);
}

/* ---------------- Marchand Modal Styles ---------------- */
.marchand-modal-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 10016;
  display: flex;
  align-items: center;
  justify-content: end;
  padding: 40px;
  pointer-events: none;
}

.marchand-modal-content {
  pointer-events: auto;
  background: #1a1a2e;
  border: 3px solid #3b2615;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  color: white;
  /* Draggable support */
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.marchand-modal-content.dragging {
  transition: none !important;
  user-select: none;
}

.marchand-modal-content.marchand-modal-compact {
  max-width: 450px;
}

.marchand-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(59, 38, 21, 0.5);
  cursor: move;
}

.marchand-modal-header:active {
  cursor: grabbing;
}

.marchand-modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: #ffd700;
}

.marchand-modal-close {
  background: transparent;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 5px;
  font-size: 1.2rem;
}
.marchand-modal-close:hover {
  color: #ff6b6b;
}

.marchand-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}

.marchand-modal-footer {
  padding: 10px 20px;
  border-top: 1px solid rgba(59, 38, 21, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffd700;
}

.marchand-modal-back {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(59, 38, 21, 0.5);
  border-radius: 6px;
  padding: 8px 15px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}
.marchand-modal-back:hover {
  background: rgba(255, 215, 0, 0.2);
}

/* ---------------- Merchant Shop Modal - Dual Panel Style ---------------- */
.marchand-modal-content.marchand-modal-buy {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}

.marchand-modal-content.marchand-modal-buy .marchand-modal-header,
.marchand-modal-content.marchand-modal-buy .marchand-modal-footer {
  display: none;
}

.marchand-modal-content.marchand-modal-buy .marchand-modal-body {
  padding: 0;
}

/* Estilos especiales cuando el modal está en modo recetas */
.marchand-modal-content.marchand-modal-recipes {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}

.marchand-modal-content.marchand-modal-recipes .marchand-modal-header,
.marchand-modal-content.marchand-modal-recipes .marchand-modal-footer {
  display: none;
}

.marchand-modal-content.marchand-modal-recipes .marchand-modal-body {
  padding: 0;
}

/* Estilos especiales cuando el modal está en modo posada */
.marchand-modal-content.marchand-modal-inn {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}

.marchand-modal-content.marchand-modal-inn .marchand-modal-header,
.marchand-modal-content.marchand-modal-inn .marchand-modal-footer {
  display: none;
}

.marchand-modal-content.marchand-modal-inn .marchand-modal-body {
  padding: 0;
  background: transparent;
}

/* Estilos especiales cuando el modal está en modo entrenamiento */
.marchand-modal-content.marchand-modal-training {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}

.marchand-modal-content.marchand-modal-training .marchand-modal-header,
.marchand-modal-content.marchand-modal-training .marchand-modal-footer {
  display: none;
}

.marchand-modal-content.marchand-modal-training .marchand-modal-body {
  padding: 0;
  background: transparent;
}

/* Estilos especiales cuando el modal está en modo reclutamiento */
.marchand-modal-content.marchand-modal-recruitment {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}

.marchand-modal-content.marchand-modal-recruitment .marchand-modal-header,
.marchand-modal-content.marchand-modal-recruitment .marchand-modal-footer {
  display: none;
}

.marchand-modal-content.marchand-modal-recruitment .marchand-modal-body {
  padding: 0;
  background: transparent;
}

.merchant-shop-service {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.merchant-shop-layout {
  display: flex;
  gap: 20px;
  align-items: center;
  cursor: move;
}

.merchant-shop-layout:active {
  cursor: grabbing;
}

/* Panel base */
.merchant-shop-panel {
  display: flex;
  flex-direction: column;
}

/* Panel tienda (izquierda) */
.merchant-shop-store {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-radius: 8px;
  box-shadow:
    inset 0 2px 4px rgba(255, 215, 0, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.5);
  padding: 10px;
}

/* Panel inventario (derecha) */
.merchant-shop-inventory {
  width: 320px;
  height: 400px;
}

.merchant-shop-inventory-bg {
  position: relative;
  background-image: url('/assets/UI/inventario.webp');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header de paneles */
.merchant-shop-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.4);
  margin-bottom: 8px;
}

.merchant-shop-inventory-bg .merchant-shop-panel-header {
  padding: 46px 40px 8px 40px;
  border-bottom: none;
}

.merchant-shop-panel-title {
  color: #ffd700;
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.merchant-shop-gold {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffd700;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Scroll area */
.merchant-shop-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
  max-height: 340px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 90, 43, 0.6) transparent;
}

.merchant-shop-store .merchant-shop-scroll-area {
  max-height: 300px; /* 6 filas * 40px + 5 gaps * 9px + padding */
}

.merchant-shop-inventory-bg .merchant-shop-scroll-area {
  padding: 33px 32px 24px 44px;
  max-height: 310px;
}

.merchant-shop-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.merchant-shop-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.merchant-shop-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(139, 90, 43, 0.6);
  border-radius: 3px;
}

/* Grid de slots */
.merchant-shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  grid-auto-rows: 40px;
  gap: 9px 8px;
  justify-content: center;
}

.merchant-shop-store .merchant-shop-grid {
  grid-template-columns: repeat(5, 40px);
  grid-template-rows: repeat(6, 40px);
  grid-auto-rows: 40px;
  gap: 9px 8px;
}

/* Slots */
.merchant-shop-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(139, 90, 43, 0.3);
  border-radius: 4px;
}

.merchant-shop-slot.merchant-shop-slot-filled {
  background: rgba(80, 50, 25, 0.6);
  border: 2px solid rgba(139, 90, 43, 0.5);
  cursor: grab;
}

.merchant-shop-slot.merchant-shop-slot-filled:active {
  cursor: grabbing;
}

/* Inventario jugador: sin fondos ni bordes */
.merchant-shop-inventory .merchant-shop-slot {
  background: transparent;
  border: none;
}

.merchant-shop-inventory .merchant-shop-slot.merchant-shop-slot-filled {
  background: transparent;
  border: none;
}

.merchant-shop-slot-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.merchant-shop-item-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.merchant-shop-item-qty {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.55rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 1px 3px;
  border-radius: 3px;
  min-width: 12px;
  text-align: center;
  pointer-events: none;
}

.merchant-shop-item-price {
  position: absolute;
  top: -2px;
  left: -2px;
  font-size: 0.5rem;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.merchant-shop-item-price i {
  font-size: 0.45rem;
}

/* Precio de compra (verde) */
.merchant-shop-price-buy {
  color: #ffd700;
}

/* Precio de venta (naranja) */
.merchant-shop-price-sell {
  color: #fd7e14;
}

/* Footer */
.merchant-shop-footer {
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.merchant_back_to_menu {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 90, 43, 0.5);
  border-radius: 6px;
  padding: 6px 16px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.merchant_back_to_menu:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
}

/* Panel de Recetas del Mercader */
.merchant-recipes-service {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Menú de inventario en panel de recetas */
.merchant-recipes-service .merchant-shop-inventory {
  position: relative;
}

.merchant-recipes-service .craft-inventory-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.merchant-recipes-service .merchant-shop-inventory-bg .merchant-shop-scroll-area {
  max-height: 345px; /* 7 filas * 40px + 6 gaps * 9px + padding */
}

.recipe-inventory-tabs-menu {
  position: absolute;
  top: 75px;
  left: 30px;
  right: 30px;
  z-index: 100;
}

/* Highlight cuando se arrastra sobre el panel */
.merchant-shop-scroll-area.drag-over {
  background: rgba(255, 215, 0, 0.1);
}

/* ---------------- New Craft Service Styles - Stacked Modals ---------------- */
.craft-service-new {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.craft-stacked-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  height: 100%;
}

/* Wrapper para inventario + recetas laterales */
.craft-top-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Recetas verticales (lateral izquierdo) - 3 columnas colapsables */
.craft-recipes-vertical {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  padding-top: 24px;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-radius: 8px;
  align-self: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Grid de recetas */
.craft-recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(6, 48px);
  grid-auto-flow: column;
  gap: 6px;
  transition: all 0.3s ease;
}

/* Estados de columnas */
.craft-recipes-vertical.craft-recipes-cols-3 .craft-recipes-grid {
  grid-template-columns: repeat(3, 48px);
}
.craft-recipes-vertical.craft-recipes-cols-2 .craft-recipes-grid {
  grid-template-columns: repeat(2, 48px);
}
.craft-recipes-vertical.craft-recipes-cols-2 .craft-recipes-grid .craft-recipe-slot-vertical:nth-child(n+13) {
  display: none;
}
.craft-recipes-vertical.craft-recipes-cols-1 .craft-recipes-grid {
  grid-template-columns: repeat(1, 48px);
}
.craft-recipes-vertical.craft-recipes-cols-1 .craft-recipes-grid .craft-recipe-slot-vertical:nth-child(n+7) {
  display: none;
}

/* Botón toggle para colapsar/expandir */
.craft-recipes-toggle-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  padding: 0;
  background: rgba(139, 90, 43, 0.7);
  border: 1px solid rgba(199, 150, 80, 0.6);
  border-radius: 3px;
  color: #ffd700;
  font-size: 0.55rem;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}
.craft-recipes-toggle-btn:hover {
  background: rgba(199, 150, 80, 0.8);
  border-color: #ffd700;
}

.craft-recipe-slot-vertical {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 4px;
  background: rgba(80, 50, 25, 0.6);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 4px;
  transition: all 0.2s ease;
}
.craft-recipe-slot-vertical.craft-recipe-empty {
  border-style: dashed;
  border-color: rgba(139, 90, 43, 0.3);
  background: rgba(0, 0, 0, 0.2);
}
.craft-recipe-slot-vertical.craft-recipe-filled {
  cursor: pointer !important;
}
.craft-recipe-slot-vertical.craft-recipe-filled:hover {
  border-color: rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.1);
}
.craft-recipe-slot-vertical.craft-recipe-selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.25);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Modal base styles - efecto de ventanas apiladas */
.craft-modal-top,
.craft-modal-middle,
.craft-modal-bottom {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 4px rgba(255, 215, 0, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.5);
}

/* MODAL SUPERIOR - Recetas + Inventario */
.craft-modal-top {
  position: relative;
  background-image: url('/assets/UI/inventario.webp');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: none;
  box-shadow: none;
  padding: 0;
  cursor: move;
  width: 320px;
  height: 400px;
}

.craft-modal-top-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header del inventario con burger y contador */
.craft-inventory-header {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.craft-inventory-burger-btn {
  padding: 2px 6px;
  font-size: 0.7rem;
  background: rgba(60, 40, 20, 0.8);
  border: 1px solid rgba(139, 90, 43, 0.6);
  color: #ffd700;
  border-radius: 3px;
  cursor: pointer !important;
}
.craft-inventory-burger-btn:hover {
  background: rgba(139, 90, 43, 0.8);
  border-color: #ffd700;
}

.craft-inventory-slots-display {
  font-size: 0.75rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Menú desplegable de categorías */
.craft-inventory-tabs-menu {
  position: absolute;
  top: 95px;
  left: 30px;
  right: 30px;
  background: rgba(40, 25, 10, 0.98);
  border: 2px solid rgba(139, 90, 43, 0.8);
  border-radius: 4px;
  list-style: none;
  padding: 4px;
  margin: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.craft-inventory-tabs-menu li {
  flex: 1 1 auto;
}

.craft-tab-link {
  display: block;
  padding: 3px 6px;
  font-size: 0.65rem;
  color: #c4a35a;
  text-decoration: none;
  cursor: pointer !important;
  text-align: center;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.craft-tab-link:hover {
  background: rgba(139, 90, 43, 0.5);
  color: #ffd700;
}
.craft-tab-link.active {
  background: rgba(139, 90, 43, 0.8);
  color: #ffd700;
}

/* Área scrolleable del inventario */
.craft-inventory-scroll-area {
  position: absolute;
  top: 118px;
  left: 30px;
  width: 258px;
  height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar personalizada */
.craft-inventory-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.craft-inventory-scroll-area::-webkit-scrollbar-track {
  background: rgba(40, 25, 10, 0.5);
  border-radius: 3px;
}
.craft-inventory-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(139, 90, 43, 0.8);
  border-radius: 3px;
}
.craft-inventory-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(199, 150, 80, 0.9);
}

.craft-recipe-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Inventario grid - ahora dentro del scroll-area */
.craft-inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-auto-rows: 36px;
  column-gap: 15px;
  row-gap: 11px;
}

.craft-inventory-item {
  position: relative;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default !important;
  transition: all 0.2s ease;
}
.craft-inventory-item.craft-item-needed {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  cursor: pointer !important;
}

.craft-inventory-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.craft-inventory-qty {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 3px;
  border-radius: 2px;
  color: #ffd700;
  font-weight: bold;
}


.craft-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(139, 90, 43, 0.6);
  border: 1px solid rgba(139, 90, 43, 0.8);
  border-radius: 4px;
  color: #ffd700;
  cursor: pointer !important;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}
.craft-back-btn:hover {
  background: rgba(139, 90, 43, 0.9);
}
.craft-back-btn i {
  font-size: 0.75rem;
}

/* Estilos especiales cuando el modal está en modo fabricación */
.marchand-modal-content.marchand-modal-craft {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}
.marchand-modal-content.marchand-modal-craft .marchand-modal-header,
.marchand-modal-content.marchand-modal-craft .marchand-modal-footer {
  display: none;
}
.marchand-modal-content.marchand-modal-craft .marchand-modal-body {
  padding: 0;
}

/* MODAL MEDIO - Ingredientes horizontales */
.craft-modal-middle {
  padding: 8px 10px;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.craft-ingredients-horizontal {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
}

/* Slot de receta equipada */
.craft-recipe-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(80, 50, 25, 0.7);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 4px;
  cursor: pointer !important;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.craft-recipe-slot.craft-slot-filled {
  border-color: rgba(139, 90, 43, 0.8);
}
.craft-recipe-slot.craft-slot-empty {
  border-style: dashed;
  border-color: rgba(139, 90, 43, 0.3);
  background: rgba(0, 0, 0, 0.2);
}

/* Flecha */
.craft-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: rgba(255, 215, 0, 0.7);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Grid de ingredientes con wrap */
.craft-ingredients-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.craft-ingredient-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(80, 50, 25, 0.7);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
/* Ingrediente completo */
.craft-ingredient-slot.craft-ingredient-complete {
  border-color: rgba(40, 167, 69, 0.8);
  opacity: 1;
}
.craft-ingredient-slot.craft-ingredient-complete .craft-ingredient-icon {
  filter: none;
}

/* Ingrediente parcialmente agregado */
.craft-ingredient-slot.craft-ingredient-partial {
  border-color: rgba(255, 193, 7, 0.8);
  opacity: 0.8;
}
.craft-ingredient-slot.craft-ingredient-partial .craft-ingredient-icon {
  filter: saturate(0.7);
}

/* Ingrediente pendiente (nada agregado) */
.craft-ingredient-slot.craft-ingredient-pending {
  border-color: rgba(139, 90, 43, 0.5);
  opacity: 0.4;
}
.craft-ingredient-slot.craft-ingredient-pending .craft-ingredient-icon {
  filter: grayscale(80%);
}

.craft-ingredient-slot.craft-slot-empty {
  border-style: dashed;
  border-color: rgba(139, 90, 43, 0.3);
  background: rgba(0, 0, 0, 0.2);
}

.craft-ingredient-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.craft-ingredient-qty {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.55rem;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 3px;
  border-radius: 2px;
  color: #ffd700;
  font-weight: bold;
}

/* MODAL INFERIOR - Resultado + Botones */
.craft-modal-bottom {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.craft-result-display {
  display: none; /* Temporalmente oculto */
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background: rgba(80, 50, 25, 0.7);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.craft-result-display.craft-result-pending {
  opacity: 0.35;
  filter: grayscale(80%);
}

.craft-result-display.craft-result-ready {
  opacity: 1;
  filter: none;
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.craft-result-icon {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.craft-result-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(139, 90, 43, 0.5);
  font-size: 1.2rem;
}

/* Botón pequeño de fabricar */
.craft-button-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(139, 90, 43, 0.7);
  border: 2px solid rgba(139, 90, 43, 0.9);
  border-radius: 6px;
  color: #ffd700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.craft-button-small:hover:not(:disabled) {
  background: rgba(160, 110, 50, 0.9);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.craft-button-small:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.craft-button-small i {
  font-size: 1rem;
}

/* ========================================
   REPAIR SERVICE - Interfaz de Reparación
   ======================================== */

.repair-service-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.repair-stacked-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* MODAL SUPERIOR - Inventario */
.repair-modal-top {
  position: relative;
  background-image: url('/assets/UI/inventario.webp');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: none;
  box-shadow: none;
  padding: 0;
  cursor: move;
  width: 320px;
  height: 400px;
}

.repair-modal-top-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header del inventario con burger y contador */
.repair-inventory-header {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.repair-inventory-burger-btn {
  padding: 2px 6px;
  font-size: 0.7rem;
  background: rgba(60, 40, 20, 0.8);
  border: 1px solid rgba(139, 90, 43, 0.6);
  color: #ffd700;
  border-radius: 3px;
  cursor: pointer !important;
}
.repair-inventory-burger-btn:hover {
  background: rgba(139, 90, 43, 0.8);
  border-color: #ffd700;
}

.repair-inventory-slots-display {
  font-size: 0.75rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Menú desplegable de categorías */
.repair-inventory-tabs-menu {
  position: absolute;
  top: 70px;
  left: 30px;
  right: 30px;
  background: rgba(40, 25, 10, 0.98);
  border: 2px solid rgba(139, 90, 43, 0.8);
  border-radius: 4px;
  list-style: none;
  padding: 4px;
  margin: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.repair-inventory-tabs-menu li {
  flex: 1 1 auto;
}

.repair-tab-link {
  display: block;
  padding: 3px 6px;
  font-size: 0.65rem;
  color: #c4a35a;
  text-decoration: none;
  cursor: pointer !important;
  text-align: center;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.repair-tab-link:hover {
  background: rgba(139, 90, 43, 0.5);
  color: #ffd700;
}
.repair-tab-link.active {
  background: rgba(139, 90, 43, 0.8);
  color: #ffd700;
}

/* Área scrolleable del inventario */
.repair-inventory-scroll-area {
  position: absolute;
  top: 118px;
  left: 30px;
  width: 258px;
  height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar personalizada */
.repair-inventory-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.repair-inventory-scroll-area::-webkit-scrollbar-track {
  background: rgba(40, 25, 10, 0.5);
  border-radius: 3px;
}
.repair-inventory-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(139, 90, 43, 0.8);
  border-radius: 3px;
}
.repair-inventory-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(199, 150, 80, 0.9);
}

/* Grid del inventario */
.repair-inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-auto-rows: 36px;
  column-gap: 15px;
  row-gap: 11px;
}

.repair-inventory-item {
  position: relative;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default !important;
  transition: all 0.2s ease;
}

/* Items dañados con indicador rojo */
.repair-inventory-item.repair-item-damaged {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.15);
  box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
  cursor: pointer !important;
}
.repair-inventory-item.repair-item-damaged:hover {
  border-color: #ff6b7a;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
}

.repair-inventory-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.repair-inventory-qty {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.85);
  padding: 1px 3px;
  border-radius: 2px;
  color: #ffd700;
  font-weight: bold;
}

/* Indicador de daño (icono de herramienta) */
.repair-damage-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #dc3545;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: white;
  box-shadow: 0 0 4px rgba(220, 53, 69, 0.8);
}

/* MODAL INFERIOR - Slots de reparación */
.repair-modal-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-radius: 8px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.5);
}

.repair-slots-panel {
  display: flex;
  gap: 10px;
}

.repair-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background: rgba(80, 50, 25, 0.6);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 4px;
  transition: all 0.2s ease;
}
.repair-slot.repair-slot-empty {
  border-style: dashed;
  border-color: rgba(139, 90, 43, 0.3);
  background: rgba(0, 0, 0, 0.2);
}
.repair-slot.repair-slot-filled {
  border-color: #dc3545;
  cursor: pointer !important;
}
.repair-slot.repair-slot-filled:hover {
  border-color: #ff6b7a;
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.repair-slot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.repair-slot-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.repair-slot-cost {
  font-size: 0.55rem;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 2px;
}
.repair-slot-cost i {
  font-size: 0.5rem;
}

/* Fila de acción con botón y costo */
.repair-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.repair-total-cost {
  font-size: 0.9rem;
  color: #ffd700;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}
.repair-total-cost i {
  color: #ffc107;
}

.repair-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(139, 90, 43, 0.7);
  border: 2px solid rgba(139, 90, 43, 0.9);
  border-radius: 6px;
  color: #ffd700;
  font-size: 0.85rem;
  cursor: pointer !important;
  transition: all 0.2s ease;
}
.repair-action-btn:hover:not(:disabled) {
  background: rgba(160, 110, 50, 0.9);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}
.repair-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed !important;
}

.repair-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(139, 90, 43, 0.6);
  border: 1px solid rgba(139, 90, 43, 0.8);
  border-radius: 4px;
  color: #ffd700;
  cursor: pointer !important;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}
.repair-back-btn:hover {
  background: rgba(139, 90, 43, 0.9);
}
.repair-back-btn i {
  font-size: 0.75rem;
}

/* Estilos especiales cuando el modal está en modo reparación */
.marchand-modal-content.marchand-modal-repair {
  background: transparent;
  border: none;
  box-shadow: none;
  width: fit-content;
  max-width: none;
}
.marchand-modal-content.marchand-modal-repair .marchand-modal-header,
.marchand-modal-content.marchand-modal-repair .marchand-modal-footer {
  display: none;
}
.marchand-modal-content.marchand-modal-repair .marchand-modal-body {
  padding: 0;
}

/* Barras de durabilidad en inventario de reparación */
.repair-durability-bar {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
}
.repair-durability-bar-inner {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* === REPAIR DURABILITY BAR - THREE-SLICE MODE === */
.repair-durability-bar.three-slice-mode {
  width: calc((100% - 4px) * var(--dur-value, 100) / 100);
  left: 2px;
  right: auto;
  min-width: calc(var(--ts-slice1, 2px) + var(--ts-slice-end-width, 2px) + 2px);
  transition: width 0.3s ease-out;
}

.repair-durability-bar.three-slice-mode .repair-durability-bar-inner {
  display: none;
}

.repair-durability-bar.three-slice-mode .ts-fill-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dur-fill-color, #28a745);
  border-radius: 2px;
  z-index: 0;
}

.repair-durability-bar.three-slice-mode .ts-frame-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  z-index: 1;
  overflow: hidden;
  border-radius: 2px;
}

.repair-durability-bar.three-slice-mode .ts-zone {
  background-image: var(--ts-image);
  background-repeat: no-repeat;
}

.repair-durability-bar.three-slice-mode .ts-start {
  flex-shrink: 0;
  width: var(--ts-slice1, 2px);
  height: 100%;
  background-position: left center;
  background-size: auto 100%;
}

.repair-durability-bar.three-slice-mode .ts-middle {
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  background-position: calc(-1 * var(--ts-slice1, 2px)) center;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

.repair-durability-bar.three-slice-mode .ts-end {
  flex-shrink: 0;
  width: var(--ts-slice-end-width, 2px);
  height: 100%;
  background-position: right center;
  background-size: auto 100%;
}

/* Barras de durabilidad en inventario de fabricación */
.craft-durability-bar {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
}
.craft-durability-bar-inner {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* === CRAFT DURABILITY BAR - THREE-SLICE MODE === */
.craft-durability-bar.three-slice-mode {
  width: calc((100% - 4px) * var(--dur-value, 100) / 100);
  left: 2px;
  right: auto;
  min-width: calc(var(--ts-slice1, 2px) + var(--ts-slice-end-width, 2px) + 2px);
  transition: width 0.3s ease-out;
}

.craft-durability-bar.three-slice-mode .craft-durability-bar-inner {
  display: none;
}

.craft-durability-bar.three-slice-mode .ts-fill-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dur-fill-color, #28a745);
  border-radius: 2px;
  z-index: 0;
}

.craft-durability-bar.three-slice-mode .ts-frame-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  z-index: 1;
  overflow: hidden;
  border-radius: 2px;
}

.craft-durability-bar.three-slice-mode .ts-zone {
  background-image: var(--ts-image);
  background-repeat: no-repeat;
}

.craft-durability-bar.three-slice-mode .ts-start {
  flex-shrink: 0;
  width: var(--ts-slice1, 2px);
  height: 100%;
  background-position: left center;
  background-size: auto 100%;
}

.craft-durability-bar.three-slice-mode .ts-middle {
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  background-position: calc(-1 * var(--ts-slice1, 2px)) center;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

.craft-durability-bar.three-slice-mode .ts-end {
  flex-shrink: 0;
  width: var(--ts-slice-end-width, 2px);
  height: 100%;
  background-position: right center;
  background-size: auto 100%;
}

/* Tooltip de slots de reparación */
.repair-slot-tooltip {
  text-align: center;
  padding: 4px;
}
.repair-tooltip-name {
  font-weight: bold;
  color: #ffd700;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.repair-tooltip-durability {
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 2px;
}
.repair-tooltip-cost {
  font-size: 0.8rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Botón unificado para merchant */
.merchant-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(40, 167, 69, 0.8);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.merchant-action-button:hover:not(:disabled) {
  background: rgb(40, 167, 69);
}
.merchant-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Legacy popup-marchand for compatibility */
.popup-marchand {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10015;
  width: 80%;
  max-width: 600px;
}

.popup-marchand-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  background-size: cover;
  background-position: center;
  z-index: 10000;
}

.img-merchant {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding: 8px;
}

/* Clean merchant item styles (no background) */
.merchant-item-clean {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
  transition: transform 0.1s ease-out;
  position: relative;
  padding: 5px;
}
.merchant-item-clean:hover {
  transform: scale(1.05);
}

.merchant-item-name-small {
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: #e5e7eb;
  text-align: center;
}

.merchant-item-price-icon {
  font-size: 0.7rem;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 3px;
}
.merchant-item-price-icon i {
  font-size: 0.6rem;
}

/* Icon-only grid for buy/sell (more items per row) */
.merchant-grid-icons {
  grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
  gap: 6px;
}

.merchant-item-icon-only {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  position: relative;
  transition: transform 0.1s ease-out;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(59, 38, 21, 0.3);
}

.merchant-item-icon-only:hover {
  transform: scale(1.1);
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
}

.merchant-item-icon-only .merchant-item-icon {
  width: 40px;
  height: 40px;
}

.merchant-item-icon-only .merchant-item-qty {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}

.merchant-empty-message {
  text-align: center;
  width: 100%;
  color: #6c757d;
  font-size: 0.85rem;
  padding: 40px 20px;
  grid-column: 1/-1;
}

/* Training clean styles */
.training-profile-selector-clean {
  margin-bottom: 15px;
}

.training-label {
  color: #fdf1d0;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
}

.profile-selector-grid-clean {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.profile-card-clean {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
}
.profile-card-clean.selected .profile-name-clean {
  color: #ffd700;
}

.profile-avatar-clean {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name-clean {
  font-size: 0.85rem;
  color: #fdf1d0;
  font-weight: bold;
}

/* Inn clean styles */
.inn-service {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.inn-shop-layout {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  position: relative;
  padding-bottom: 50px;
}

.inn-welcome-panel {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.95) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-radius: 8px;
  box-shadow:
    inset 0 2px 4px rgba(255, 215, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.5);
  width: 100%;
  min-width: 600px;
}

.inn-welcome-content {
  padding: 15px;
  text-align: center;
}

.inn-welcome-content .inn-icon {
  margin-bottom: 10px;
}

.inn-description {
  color: #fdf1d0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.inn-select-hint {
  color: #ffd700;
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.inn-status-row {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.inn-status-card {
  padding: 10px;
  min-width: 100px;
}

.inn-comfort-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.inn-comfort-levels {
  width: 100%;
}

.inn-shop-layout .craft-back-btn {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.inn-status-label {
  color: #fdf1d0;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.inn-status-value {
  color: #fdf1d0;
  font-size: 1.2rem;
}

/* Inn Comfort Level Cards */
.inn-comfort-levels h6 {
  color: #ffd700;
  font-weight: 600;
}

.inn-comfort-card {
  background: linear-gradient(145deg, rgba(50, 40, 30, 0.9) 0%, rgba(35, 28, 20, 0.95) 100%);
  border: 2px solid rgba(139, 90, 43, 0.5);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
}

/* Hover desactivado para inn-comfort-card */

.inn-comfort-card.disabled {
  opacity: 0.5;
  filter: grayscale(50%);
}

.inn-comfort-card.inn-comfort-premium {
  background: linear-gradient(145deg, rgba(70, 50, 20, 0.95) 0%, rgba(50, 35, 15, 0.98) 100%);
  border-color: rgba(255, 215, 0, 0.5);
}

.inn-comfort-icon {
  font-size: 2rem;
  color: #ffd700;
  margin-bottom: 10px;
}

.inn-comfort-title {
  color: #fdf1d0;
  font-weight: 600;
  margin-bottom: 8px;
}

.inn-comfort-recovery {
  color: #28a745;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.inn-comfort-cost {
  color: #ffd700;
  font-size: 14px;
  font-weight: bold;
}

/* Recruitment clean styles */
.recruitment-companion-card-clean {
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.recruitment-companion-card-clean.already-recruited {
  opacity: 0.6;
}

.recruitment-spacer {
  flex: 1;
}

.recruitment-stats-inline {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.recruitment-stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.85rem;
}

.companion-portrait-clean {
  display: flex;
  justify-content: center;
}

.companion-portrait-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
}

.recruitment-companion-name {
  color: #fdf1d0;
  font-weight: bold;
  font-size: 1rem;
  margin: 10px 0 5px 0;
}

.recruitment-companion-description {
  color: white;
  font-size: 0.8rem;
  margin-bottom: 10px;
  font-weight: normal;
}

.recruitment-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin: 2px;
  background: #fdf1d0;
  color: rgb(33, 37, 41);
}
.recruitment-badge.badge-attacker {
  background: #dc3545;
  color: white;
}
.recruitment-badge.badge-defender {
  background: #28a745;
  color: white;
}

.recruitment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.recruitment-cost-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffc107;
  font-size: 0.9rem;
}

.recruitment-button {
  padding: 5px 10px;
  background: rgba(40, 167, 69, 0.8);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.recruitment-button:hover:not(:disabled) {
  background: rgb(40, 167, 69);
}
.recruitment-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Training skill card styles */
.skill-card-training {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(59, 38, 21, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.skill-card-training:hover {
  background: rgba(255, 215, 0, 0.1);
}
.skill-card-training.already-known {
  opacity: 0.6;
}

.skill-icon-training {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.skill-info-training {
  flex: 1;
  min-width: 0;
}

.skill-header-training {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.skill-name-training {
  color: #fdf1d0;
  font-size: 0.9rem;
}

.skill-price-training {
  color: #ffd700;
  font-size: 0.8rem;
}
.skill-price-training i {
  font-size: 0.7rem;
}

.skill-description-training {
  color: #a0a0a0;
  font-size: 0.75rem;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.skill-mechanics-training {
  margin-bottom: 8px;
}

.skill-power-row {
  margin-bottom: 4px;
}

.power-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  transform: skewX(-12deg);
}
.power-stat i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: white;
  transform: skewX(12deg);
}
.power-stat span {
  width: 22px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  transform: skewX(12deg);
  font-size: 0.65rem;
}
.power-stat.power-physical i {
  background: #ed1c22;
}
.power-stat.power-physical span:nth-child(2) {
  background: #ed1c22;
}
.power-stat.power-physical span:nth-child(3) {
  background: #ff7f26;
}
.power-stat.power-physical span:nth-child(4) {
  background: #ffc90d;
}
.power-stat.power-magical i {
  background: #3f47cc;
}
.power-stat.power-magical span:nth-child(2) {
  background: #3f47cc;
}
.power-stat.power-magical span:nth-child(3) {
  background: #7092be;
}
.power-stat.power-magical span:nth-child(4) {
  background: #00a8f3;
}

.skill-effects-training {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.effect-item-training {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.effect-icon-training {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.effect-name-training {
  font-size: 0.65rem;
  color: #d0d0d0;
}

.skill-footer-training {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-stock-training {
  font-size: 0.7rem;
  color: #6c757d;
}

.skill-known-badge-training {
  font-size: 0.7rem;
  color: #28a745;
}

/* Recruitment combat stats */
.recruitment-combat-stats {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.combat-stat-row {
  display: flex;
  justify-content: center;
}

.stat-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  transform: skewX(-12deg);
}
.stat-bar i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: white;
  transform: skewX(12deg);
}
.stat-bar span {
  width: 22px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  transform: skewX(12deg);
  font-size: 0.65rem;
}
.stat-bar.stat-attack-physical i {
  background: #ed1c22;
}
.stat-bar.stat-attack-physical span:nth-child(2) {
  background: #ed1c22;
}
.stat-bar.stat-attack-physical span:nth-child(3) {
  background: #ff7f26;
}
.stat-bar.stat-attack-physical span:nth-child(4) {
  background: #ffc90d;
}
.stat-bar.stat-attack-magical i {
  background: #3f47cc;
}
.stat-bar.stat-attack-magical span:nth-child(2) {
  background: #3f47cc;
}
.stat-bar.stat-attack-magical span:nth-child(3) {
  background: #00a2ea;
}
.stat-bar.stat-attack-magical span:nth-child(4) {
  background: #00a3e8;
}
.stat-bar.stat-defense-physical i {
  background: #22b34c;
}
.stat-bar.stat-defense-physical span:nth-child(2) {
  background: #23b14d;
}
.stat-bar.stat-defense-physical span:nth-child(3) {
  background: #b5e51d;
}
.stat-bar.stat-defense-physical span:nth-child(4) {
  background: #fef200;
}
.stat-bar.stat-defense-magical i {
  background: #a84fa9;
}
.stat-bar.stat-defense-magical span:nth-child(2) {
  background: #a349a3;
}
.stat-bar.stat-defense-magical span:nth-child(3) {
  background: #feaec9;
}
.stat-bar.stat-defense-magical span:nth-child(4) {
  background: #7092bf;
}
.stat-bar.stat-armor-physical i {
  background: #7f7f7f;
}
.stat-bar.stat-armor-physical span:nth-child(2) {
  background: #7f7f7f;
}
.stat-bar.stat-armor-physical span:nth-child(3) {
  background: #999;
}
.stat-bar.stat-armor-physical span:nth-child(4) {
  background: #b3b3b3;
}
.stat-bar.stat-armor-magical i {
  background: #6a5acd;
}
.stat-bar.stat-armor-magical span:nth-child(2) {
  background: #6a5acd;
}
.stat-bar.stat-armor-magical span:nth-child(3) {
  background: #9370db;
}
.stat-bar.stat-armor-magical span:nth-child(4) {
  background: #ba55d3;
}

.combat-stat-row-dual {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  justify-content: center;
}

.recruitment-elemental-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.elemental-item {
  display: flex;
  align-items: center;
  gap: 2px;
}
.elemental-item .elemental-icon {
  font-size: 14px;
}
.elemental-item .elemental-value {
  min-width: 24px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transform: skewX(-12deg);
  border: 0.5px solid rgba(0, 0, 0, 0.3);
}
.elemental-item .elemental-value span {
  color: white;
  font-size: 0.6rem;
  font-weight: bold;
  transform: skewX(12deg);
}

.recruitment-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.status-item-recruitment {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}
.status-item-recruitment .status-icon-small {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.status-item-recruitment .status-bonus, .status-item-recruitment .status-resist {
  font-size: 0.65rem;
  font-weight: bold;
}

.recruitment-immunities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.recruitment-immunities .immunity-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.8;
}

.merchant-item {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
  transition: transform 0.1s ease-out;
  position: relative;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #6c757d;
}

.merchant-item:hover {
  transform: scale(1.05);
}

.merchant-item-icon {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  margin-bottom: 4px;
}

.merchant-item-name {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: #e5e7eb;
  text-align: center;
}

.merchant-item-price {
  font-size: 0.7rem;
  position: absolute;
  bottom: 2px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0 3px;
  border-radius: 3px;
  color: #ffd700;
}

.merchant-item-qty {
  font-size: 0.7rem;
  position: absolute;
  bottom: 2px;
  left: 4px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0 3px;
  border-radius: 3px;
  color: #9ca3af;
}

/* ========================================
   MERCHANT TRAINING SERVICE - NEW LAYOUT
   ======================================== */
.merchant-training-service {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Zona de drag para mover la ventana */
.training-drag-handle {
  height: 18px;
  cursor: move;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(60, 40, 20, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-left: 120px;
  position: relative;
  z-index: 2;
}

.training-layout {
  display: flex;
  gap: 0;
  min-height: 300px;
}

/* Panel de pestañas (izquierda) */
.training-tabs-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 120px;
  flex-shrink: 0;
  padding-top: 8px;
}

.training-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(50, 35, 20, 0.9) 0%, rgba(40, 28, 15, 0.95) 100%);
  border: 2px solid #5a3a1a;
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.training-tab:hover {
  background: linear-gradient(180deg, rgba(70, 50, 25, 0.95) 0%, rgba(55, 40, 20, 0.98) 100%);
}

.training-tab.active {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(45, 30, 15, 0.98) 100%);
  border-color: #8b5a2b;
  box-shadow: inset 0 1px 3px rgba(255, 215, 0, 0.15);
  z-index: 1;
  border-right: none;
  margin-right: -3px;
}

.training-tab-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 90, 43, 0.6);
  flex-shrink: 0;
}

.training-tab.active .training-tab-avatar {
  border-color: #ffd700;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

.training-tab-name {
  font-size: 0.75rem;
  color: #a0907a;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
}

.training-tab.active .training-tab-name {
  color: #ffd700;
}

/* Panel de contenido (derecha) */
.training-content-panel {
  flex: 1;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow:
    inset 0 2px 4px rgba(255, 215, 0, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.5),
    -4px 0 8px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  min-width: 350px;
  position: relative;
  z-index: 2;
}

.training-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.4);
}

.training-content-title {
  color: #ffd700;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.training-skills-section {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  max-height: 250px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 90, 43, 0.6) transparent;
}

.training-skills-section::-webkit-scrollbar {
  width: 6px;
}

.training-skills-section::-webkit-scrollbar-track {
  background: transparent;
}

.training-skills-section::-webkit-scrollbar-thumb {
  background: rgba(139, 90, 43, 0.6);
  border-radius: 3px;
}

.training-skills-subtitle {
  color: #d4c4a8;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.3);
}

/* Grid de habilidades - 2 columnas */
.training-skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Tarjeta de habilidad - horizontal */
.training-skill-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  max-width: 240px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(139, 90, 43, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.training-skill-card:hover {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.4);
}

.training-skill-card.already-known {
  opacity: 0.4;
  pointer-events: none;
}

.training-skill-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 90, 43, 0.4);
}

.training-skill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.training-skill-header {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.training-skill-name {
  color: #fdf1d0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.training-skill-price {
  color: #ffd700;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

.training-skill-price i {
  font-size: 0.6rem;
}

.training-skill-card p.training-skill-description,
.training-skill-card .training-skill-description,
.merchant-training-service p.training-skill-description,
.merchant-training-service .training-skill-description,
.marchand-modal-content .training-skill-card p.training-skill-description {
  color: #a0a0a0 !important;
  font-size: 0.65rem !important;
  margin: 2px 0 !important;
  line-height: 1.25 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.training-skill-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.training-skill-stock {
  font-size: 0.65rem;
  color: #7a7a7a;
}

.training-skill-known-badge {
  font-size: 0.65rem;
  color: #28a745;
  font-weight: 500;
}

/* Indicador de oro */
.training-gold-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 15px;
  border-top: 1px solid rgba(139, 90, 43, 0.3);
  color: #ffd700;
  font-size: 0.9rem;
  font-weight: 600;
}

.training-gold-indicator i {
  font-size: 0.85rem;
}

/* Footer con botón volver */
.training-footer {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  margin-left: 120px;
}

.training-footer .merchant_back_to_menu {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(139, 90, 43, 0.6);
  padding: 6px 16px;
  font-size: 0.8rem;
}

/* ========================================
   MERCHANT RECRUITMENT SERVICE - TABS LAYOUT
   ======================================== */
.merchant-recruitment-service {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Zona de drag para mover la ventana */
.recruitment-drag-handle {
  height: 18px;
  cursor: move;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(60, 40, 20, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-left: 120px;
  position: relative;
  z-index: 2;
}

.recruitment-layout {
  display: flex;
  gap: 0;
  min-height: 350px;
}

/* Panel de pestañas (izquierda) */
.recruitment-tabs-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 120px;
  flex-shrink: 0;
  padding-top: 8px;
}

.recruitment-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(50, 35, 20, 0.9) 0%, rgba(40, 28, 15, 0.95) 100%);
  border: 2px solid #5a3a1a;
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recruitment-tab:hover {
  background: linear-gradient(180deg, rgba(70, 50, 25, 0.95) 0%, rgba(55, 40, 20, 0.98) 100%);
}

.recruitment-tab.active {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(45, 30, 15, 0.98) 100%);
  border-color: #8b5a2b;
  box-shadow: inset 0 1px 3px rgba(255, 215, 0, 0.15);
  z-index: 1;
  border-right: none;
  margin-right: -3px;
}

.recruitment-tab.recruited {
  opacity: 0.4;
  pointer-events: none;
}

.recruitment-tab-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 90, 43, 0.6);
  flex-shrink: 0;
}

.recruitment-tab.active .recruitment-tab-avatar {
  border-color: #ffd700;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

.recruitment-tab-name {
  font-size: 0.75rem;
  color: #a0907a;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
}

.recruitment-tab.active .recruitment-tab-name {
  color: #ffd700;
}

.recruitment-empty-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 10px;
  color: #7a7a7a;
  font-size: 0.7rem;
  text-align: center;
}

.recruitment-empty-tabs i {
  font-size: 1.5rem;
  color: #28a745;
}

/* Panel de contenido (derecha) */
.recruitment-content-panel {
  flex: 1;
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.98) 0%, rgba(45, 30, 15, 0.98) 100%);
  border: 3px solid #8b5a2b;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow:
    inset 0 2px 4px rgba(255, 215, 0, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.5),
    -4px 0 8px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  min-width: 320px;
  position: relative;
  z-index: 2;
}

.recruitment-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.4);
}

.recruitment-content-title {
  color: #ffd700;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Detalle del compañero */
.recruitment-companion-detail {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recruitment-companion-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.recruitment-detail-portrait {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #8b5a2b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.recruitment-companion-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recruitment-detail-name {
  color: #ffd700;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.recruitment-companion-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recruitment-type-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(139, 90, 43, 0.5);
  border-radius: 3px;
  color: #a0907a;
}

.recruitment-detail-description {
  color: #a0a0a0;
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
}

/* Stats principales */
.recruitment-detail-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.recruitment-stat-box {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 90, 43, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #d4c4a8;
}

.recruitment-stat-box i {
  font-size: 0.7rem;
  color: #8b5a2b;
}

.recruitment-stat-box i.fa-heart { color: #dc3545; }
.recruitment-stat-box i.fa-bolt { color: #ffc107; }
.recruitment-stat-box i.fa-crosshairs { color: #28a745; }
.recruitment-stat-box i.fa-running { color: #17a2b8; }

/* Grid de combate */
.recruitment-combat-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.combat-stat-row {
  display: flex;
  gap: 10px;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(139, 90, 43, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  flex: 1;
}

.stat-bar i {
  font-size: 0.65rem;
  width: 14px;
  text-align: center;
}

.stat-bar span {
  color: #d4c4a8;
  min-width: 16px;
  text-align: center;
}

.stat-attack-physical i { color: #dc3545; }
.stat-attack-magical i { color: #9b59b6; }
.stat-defense-physical i { color: #3498db; }
.stat-defense-magical i { color: #1abc9c; }

/* Contenido vacío */
.recruitment-empty-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #7a7a7a;
  padding: 30px;
}

.recruitment-empty-content i {
  font-size: 2.5rem;
  opacity: 0.5;
}

.recruitment-empty-content p {
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
}

/* Indicador de oro */
.recruitment-gold-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 15px;
  border-top: 1px solid rgba(139, 90, 43, 0.3);
  color: #ffd700;
  font-size: 0.9rem;
  font-weight: 600;
}

.recruitment-gold-indicator i {
  font-size: 0.85rem;
}

/* Footer con botones */
.recruitment-footer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding-top: 12px;
  margin-left: 120px;
}

.recruitment-action-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(139, 90, 43, 0.6);
  border-radius: 4px;
  padding: 6px 16px;
  color: #d4c4a8;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recruitment-action-btn:hover:not(:disabled) {
  background: rgba(139, 90, 43, 0.3);
  border-color: #8b5a2b;
  color: #ffd700;
}

.recruitment-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.recruitment-cost {
  font-size: 0.75rem;
  opacity: 0.9;
}

.recruitment-cost i {
  font-size: 0.65rem;
}

.recruitment-footer-actions .merchant_back_to_menu {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(139, 90, 43, 0.6);
  padding: 6px 16px;
  font-size: 0.8rem;
}

/* Legacy classes - mantener para retrocompatibilidad */
.merchant-training {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.training-profile-selector {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.profile-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-card.selected {
  border-color: rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.1);
}

.profile-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-info {
  text-align: center;
  color: #fff;
}

.profile-info small {
  display: block;
  margin-top: 0.25rem;
}

.selected-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4CAF50;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.training-skills-list {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.skill-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.skill-card.already-known {
  opacity: 0.6;
  cursor: not-allowed;
}

.skill-card.already-known:hover {
  transform: none;
}

.skill-icon {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.skill-info {
  text-align: center;
  color: #fff;
  width: 100%;
}

.skill-description {
  font-size: 0.85rem;
  color: #ccc;
  margin: 0.5rem 0;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  font-size: 0.85rem;
}

.skill-price {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffd700;
  font-weight: bold;
}

.skill-stock {
  color: #bbb;
  font-size: 0.8rem;
}

.skill-known-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #4CAF50;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}

.marchand-footer {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 1rem;
}

.marchand-footer strong {
  color: #ffd700;
}

.quest-item-list .inventory-item {
  cursor: default; /* Pas de drag pour objets de quête */
  height: auto;
  flex-direction: row;
  justify-content: flex-start;
}

.quest-item-list .inventory-item-icon {
  max-width: 32px;
  max-height: 32px;
  margin-bottom: 0;
  margin-right: 8px;
}

.quest-item-list .inventory-item-name {
  white-space: normal;
  text-align: left;
}

body, .game-container, .combat-screen {
  user-select: none; /* Standard */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
}

img {
  -webkit-user-drag: none; /* Safari/Chrome pour les images */
  user-drag: none; /* Standard (moins supporté pour l'instant) */
  /* draggable="false" en HTML est plus fiable pour les images */
}

/* Glossary screen */
#glossary-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
  z-index: 8000;
  display: none;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 0 20px 20px;
  font-family: var(--police-glossaire, "DejaVuSansCondensed"), sans-serif;
}
#glossary-screen.opening {
  display: flex;
  animation: glossary-fade-in 0.3s ease-out forwards;
}
#glossary-screen.closing {
  display: flex;
  animation: glossary-fade-out 0.3s ease-out forwards;
}

#close-glossary-btn {
  top: 10vh !important;
  right: unset !important;
  left: unset !important;
  background: rgba(255, 255, 255, 0.5);
}

.glossary-window {
  right: 0;
  position: fixed;
  background: url("../assets/UI/encyclopedie.webp") no-repeat left center/contain;
  max-width: 1400px;
  width: 1400px;
  margin-right: -200px;
  height: 100%;
  display: flex;
  transform: translateX(100%);
  transition: transform 0.5s ease-in-out;
}

#glossary-screen.opening .glossary-window,
#glossary-screen.open .glossary-window {
  animation: glossary-slide-in 0.5s ease-in-out forwards;
  transform: translateX(0);
}

#glossary-screen.closing .glossary-window {
  animation: glossary-slide-out 0.5s ease-in-out forwards;
}

@keyframes glossary-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes glossary-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes glossary-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes glossary-slide-out {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}
.glossary-tabs {
  margin-top: 20vh;
  margin-bottom: 10vh;
  padding-left: 30px;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
}

.glossary-tab {
  line-height: 100px;
  background-position: center center;
  background-color: transparent;
  background-image: url("../assets/UI/Intercalaire-1.webp");
  background-repeat: no-repeat;
  background-size: contain;
  border: none;
  color: #000;
  height: 175px;
  width: 80px;
  padding: 10px 0;
  writing-mode: sideways-lr;
  text-orientation: mixed;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.glossary-tab:nth-child(2) {
  background-image: url("../assets/UI/Intercalaire-2.webp");
}

.glossary-tab:nth-child(3) {
  background-image: url("../assets/UI/Intercalaire-3.webp");
}

.glossary-tab:nth-child(4) {
  background-image: url("../assets/UI/Intercalaire-4.webp");
}

.glossary-tab:nth-child(5) {
  background-image: url("../assets/UI/Intercalaire-1.webp");
}

.glossary-tab.active {
  filter: hue-rotate(250deg) brightness(1.1);
}

.glossary-content {
  flex: 1;
  margin-left: 70px;
  margin-top: 10vh;
  margin-bottom: 10vh;
  overflow-y: auto;
}

.glossary-search {
  width: 100%;
  padding: 6px 8px !important;
  border: 1px solid #3d1f00 !important;
  border-radius: 4px !important;
  background-color: #673700 !important;
  color: #e2e8f0 !important;
  height: 34px !important;
  line-height: 20px !important;
  box-sizing: border-box !important;
}

.glossary-filter {
  padding: 6px 8px !important;
  border: 1px solid #3d1f00 !important;
  border-radius: 4px !important;
  background-color: #673700 !important;
  color: #e2e8f0 !important;
  height: 34px !important;
  line-height: 20px !important;
  box-sizing: border-box !important;
  margin-bottom: 0 !important;
}

.glossary-items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.glossary-item-slot {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.glossary-item-slot.unknown {
  background-color: #673700;
  color: #718096;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

#glossary-bestiary {
  color: #000;
}
#glossary-bestiary .bestiary-book {
  display: flex;
  height: 100%;
  padding: 50px 10px 20px 20px;
}
#glossary-bestiary .bestiary-left,
#glossary-bestiary .bestiary-right {
  flex: 1;
  box-sizing: border-box;
}
#glossary-bestiary .bestiary-right h3 {
  text-align: center;
}
#glossary-bestiary .bestiary-left {
  width: 550px;
  max-width: 550px;
  padding-right: 40px;
  padding-left: 20px;
  padding-bottom: 60px;
}
#glossary-bestiary .bestiary-right {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 450px;
  padding-left: 70px;
  padding-right: 20px;
}
#glossary-bestiary .carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
}
#glossary-bestiary .carousel-wrapper .carousel-arrow {
  background: url("../assets/UI/fleche.webp") no-repeat center/contain;
  width: 48px;
  height: 48px;
  border: none;
  cursor: pointer;
  min-width: 48px;
  flex-shrink: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  opacity: 1 !important;
  display: block !important;
}
#glossary-bestiary .carousel-wrapper .carousel-arrow.left {
  left: 0;
  transform: translateY(-50%) rotate(180deg);
}
#glossary-bestiary .carousel-wrapper .carousel-arrow.right {
  right: 0;
}
#glossary-bestiary #bestiary-enemy-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  margin-top: 30px;
  overflow-x: hidden;
  padding: 10px 0;
}
#glossary-bestiary #bestiary-enemy-list .bestiary-enemy-item {
  color: #000000;
  border-color: #4a5568;
  width: 100%;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}
#glossary-bestiary #bestiary-enemy-list .bestiary-enemy-item:hover, #glossary-bestiary #bestiary-enemy-list .bestiary-enemy-item:focus {
  color: #ffb866;
}
#glossary-bestiary #bestiary-enemy-list .bestiary-enemy-item.active {
  color: #ffb866;
}
#glossary-bestiary #bestiary-enemy-list p.text-muted {
  color: #000 !important;
  font-size: 1.5rem;
}
#glossary-bestiary #bestiary-enemy-detail {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
#glossary-bestiary #bestiary-enemy-detail p.text-muted {
  color: #000 !important;
  font-size: 1.5rem;
}
#glossary-bestiary #bestiary-enemy-detail h4 {
  text-align: center;
  margin-top: 10px;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-main-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-enemy-portrait {
  width: 150px;
  height: 150px;
  min-width: 150px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-enemy-name-container {
  width: 100%;
  text-align: center;
  margin-bottom: 15px;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-enemy-name-container h3 {
  font-size: 2.2rem;
  font-weight: 500;
  margin: 0;
  color: #000;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-info-line {
  font-size: 0.9em;
  color: #000;
  line-height: 1.4;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-stats-inline {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 0.9em;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-stats-inline .bestiary-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #000;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-stats-inline .bestiary-stat-item i {
  font-size: 1em;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-rewards-inline {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 0.9em;
  color: #000;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-rewards-inline .bestiary-gold-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-rewards-inline .bestiary-gold-item i {
  font-size: 1em;
}
#glossary-bestiary #bestiary-enemy-detail .bestiary-enemy-description {
  font-size: 0.9em;
  color: #000;
  text-align: left;
  margin: 20px 0;
}
#glossary-bestiary #bestiary-enemy-detail .arrow-list {
  list-style: none;
  padding-left: 0;
}
#glossary-bestiary #bestiary-enemy-detail .arrow-list li {
  background: url("../assets/UI/fleche.webp") no-repeat left center;
  padding-left: 20px;
  margin-bottom: 4px;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  padding: 10px 60px;
  height: 300px;
  width: 100%;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel .bestiary-skill-card {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: start;
  height: 300px;
  overflow-y: auto;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel .bestiary-skill-card img {
  grid-column: 1;
  grid-row: 1/3;
  width: 150px;
  height: auto;
  object-fit: cover;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel .bestiary-skill-card .bestiary-skill-info {
  grid-column: 2;
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel .bestiary-skill-card .bestiary-skill-info strong {
  margin-bottom: 0;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel .bestiary-skill-card .bestiary-skill-info p {
  overflow-wrap: anywhere;
  font-size: 0.8em;
  margin: 0;
}
#glossary-bestiary #bestiary-enemy-detail .carousel-wrapper .bestiary-skills-carousel p.text-muted {
  text-align: center;
  font-size: 0.85em;
  color: #000 !important;
  width: 100%;
}

#glossary-items {
  color: #000;
  height: 100%;
  overflow: hidden;
}
#glossary-items .items-book {
  display: flex;
  height: 100%;
  padding: 50px 10px 20px 20px;
}
#glossary-items .items-left,
#glossary-items .items-right {
  flex: 1;
  box-sizing: border-box;
  min-height: 0;
}
#glossary-items .items-left {
  width: 550px;
  max-width: 550px;
  padding-right: 40px;
  display: flex;
  padding-left: 20px;
  flex-direction: column;
}
#glossary-items #items-encyclopedia-detail {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 70px;
}
#glossary-items #items-encyclopedia-detail strong:first-of-type,
#glossary-items #items-encyclopedia-detail > strong:first-child {
  font-size: 1.5em;
}
#glossary-items #items-encyclopedia-detail .bestiary-enemy-type {
  font-size: 1.2em;
}
#glossary-items #items-encyclopedia-detail h6 {
  font-size: 1.2em;
}
#glossary-items #items-encyclopedia-detail .glossary-no-effects {
  font-size: 1.5em;
}
#glossary-items .items-right {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 445px;
  padding-left: 60px;
}
#glossary-items #items-encyclopedia-list {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 80px;
  margin-top: 20px;
  scrollbar-width: thin;
  scrollbar-color: #673700 transparent;
}
#glossary-items #items-encyclopedia-list::-webkit-scrollbar {
  width: 6px;
}
#glossary-items #items-encyclopedia-list::-webkit-scrollbar-track {
  background: transparent;
}
#glossary-items #items-encyclopedia-list::-webkit-scrollbar-thumb {
  background-color: #673700;
  border-radius: 3px;
}
#glossary-items #items-encyclopedia-list::-webkit-scrollbar-thumb:hover {
  background-color: #8a4c00;
}

#glossary-recipes {
  color: #000;
  height: 100%;
  overflow: hidden;
}
#glossary-recipes .recipes-book {
  display: flex;
  height: 100%;
  padding: 50px 10px 20px 20px;
}
#glossary-recipes .recipes-left,
#glossary-recipes .recipes-right {
  flex: 1;
  box-sizing: border-box;
  min-height: 0;
}
#glossary-recipes .recipes-left {
  width: 550px;
  max-width: 550px;
  padding-right: 40px;
  padding-left: 20px;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
}
#glossary-recipes #recipes-detail {
  flex: 1;
  overflow-y: auto;
}
#glossary-recipes #recipes-detail h4 {
  margin-top: 20px;
}
#glossary-recipes .recipes-right {
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: 400px;
  padding-left: 60px;
}
#glossary-recipes #recipes-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
}
#glossary-recipes #recipes-list .recipes-item {
  background-color: transparent;
  color: #000000;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
  border: none;
  padding: 0;
}
#glossary-recipes #recipes-list .recipes-item:hover, #glossary-recipes #recipes-list .recipes-item:focus {
  background-color: transparent;
  color: #ffb866;
}
#glossary-recipes #recipes-list .recipes-item.active {
  background-color: transparent;
  color: #ffb866;
}
#glossary-recipes #recipes-list p.text-muted {
  color: #000 !important;
  font-size: 1.5rem;
}
#glossary-recipes .recipes-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
#glossary-recipes .recipe-resource,
#glossary-recipes .recipe-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* border: 2px solid #4a5568; */
  /* border-radius: 4px; */
  padding: 4px;
  /* background: rgba(255,255,255,0.5); */
}
#glossary-recipes .recipe-resource img,
#glossary-recipes .recipe-result img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
#glossary-recipes .recipe-result {
  width: fit-content;
}

.hidden {
  display: none !important;
}

.class-carousel {
  gap: 1rem;
}

.class-cards {
  display: flex;
  gap: 1rem;
}

.class-card {
  width: 260px;
  height: 380px;
  background: #2c2c2c;
  border: 2px solid #555;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.class-card.locked {
  opacity: 0.5;
}

.class-card.selected {
  border-color: #fff;
  transform: scale(1.05);
}

.class-card .class-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
}

.class-card .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 7000;
  display: flex;
  padding: 0;
  overflow-y: auto;
}

.deck-manager-content {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: #1c1c1c;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.deck-manager-content .overflow-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 7, 0.3) rgba(255, 255, 255, 0.05);
}
.deck-manager-content .overflow-auto::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.deck-manager-content .overflow-auto::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.deck-manager-content .overflow-auto::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}
.deck-manager-content .overflow-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 193, 7, 0.5);
}

.deck-manager-content .lateral-power-bars {
  display: none;
}

.deck-manager-content .nav-tabs .nav-link {
  background-color: #222;
  border: 1px solid #555;
  color: #ccc;
}

.deck-manager-content .nav-tabs .nav-link.active {
  background-color: #333;
  color: #fff;
  border-color: #d5b778 #555 #222;
}

.deck-manager-content .pile-cards-display {
  background: #111;
  border: 1px solid #444;
  border-radius: 8px;
}

.deck-manager-content .player-card .card-header,
.deck-manager-content .resolution-display-card .card-header {
  width: 70% !important;
  margin-top: 9px !important;
  padding: 6px !important;
}
.deck-manager-content .player-card .card-name,
.deck-manager-content .resolution-display-card .card-name {
  font-size: 0.5em !important;
}
.deck-manager-content .player-card .card-description-preview,
.deck-manager-content .resolution-display-card .card-description-preview {
  font-size: 0.5em !important;
  line-height: 0.9 !important;
  width: 66% !important;
  margin: -2px auto -2px !important;
  height: 82px !important;
}
.deck-manager-content .player-card .lateral-power-bars-dual,
.deck-manager-content .resolution-display-card .lateral-power-bars-dual {
  right: 6px !important;
  left: auto !important;
  top: 70% !important;
  width: 80px !important;
  align-items: flex-end !important;
}
.deck-manager-content .player-card .dual-bar-zone,
.deck-manager-content .resolution-display-card .dual-bar-zone {
  height: 16px !important;
  max-width: 80px !important;
}
.deck-manager-content .player-card .bar-value,
.deck-manager-content .resolution-display-card .bar-value {
  font-size: 10px !important;
}

.deckbuilder-cards .player-card .card-cost {
  font-size: 0.5em !important;
  width: 24px !important;
  height: 24px !important;
  top: 20px !important;
  right: -7px !important;
}

.deckbuilder-cards .player-card {
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.deckbuilder-cards .player-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.start-menu-overlay .start-menu-content, .start-menu-overlay .slot-select-content, .start-menu-overlay .mode-select-content, .start-menu-overlay .difficulty-select-content, .slot-select-overlay .start-menu-content, .slot-select-overlay .slot-select-content, .slot-select-overlay .mode-select-content, .slot-select-overlay .difficulty-select-content, .mode-select-overlay .start-menu-content, .mode-select-overlay .slot-select-content, .mode-select-overlay .mode-select-content, .mode-select-overlay .difficulty-select-content, .difficulty-select-overlay .start-menu-content, .difficulty-select-overlay .slot-select-content, .difficulty-select-overlay .mode-select-content, .difficulty-select-overlay .difficulty-select-content {
  width: 80vw;
  top: 12vh;
  position: inherit;
}
.start-menu-overlay .start-menu-content .btn, .start-menu-overlay .slot-select-content .btn, .start-menu-overlay .mode-select-content .btn, .start-menu-overlay .difficulty-select-content .btn, .slot-select-overlay .start-menu-content .btn, .slot-select-overlay .slot-select-content .btn, .slot-select-overlay .mode-select-content .btn, .slot-select-overlay .difficulty-select-content .btn, .mode-select-overlay .start-menu-content .btn, .mode-select-overlay .slot-select-content .btn, .mode-select-overlay .mode-select-content .btn, .mode-select-overlay .difficulty-select-content .btn, .difficulty-select-overlay .start-menu-content .btn, .difficulty-select-overlay .slot-select-content .btn, .difficulty-select-overlay .mode-select-content .btn, .difficulty-select-overlay .difficulty-select-content .btn {
  color: white !important;
  display: block;
  text-align: left;
  margin: 0.5rem auto 0.5rem 0;
  width: auto !important;
  padding-left: 40px;
  padding-right: 40px;
  font-size: 250%;
  text-transform: uppercase;
  line-height: 20px;
  font-weight: 400;
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: black;
  transition: 0.4s all;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: none;
}
.start-menu-overlay .start-menu-content .btn::before, .start-menu-overlay .slot-select-content .btn::before, .start-menu-overlay .mode-select-content .btn::before, .start-menu-overlay .difficulty-select-content .btn::before, .slot-select-overlay .start-menu-content .btn::before, .slot-select-overlay .slot-select-content .btn::before, .slot-select-overlay .mode-select-content .btn::before, .slot-select-overlay .difficulty-select-content .btn::before, .mode-select-overlay .start-menu-content .btn::before, .mode-select-overlay .slot-select-content .btn::before, .mode-select-overlay .mode-select-content .btn::before, .mode-select-overlay .difficulty-select-content .btn::before, .difficulty-select-overlay .start-menu-content .btn::before, .difficulty-select-overlay .slot-select-content .btn::before, .difficulty-select-overlay .mode-select-content .btn::before, .difficulty-select-overlay .difficulty-select-content .btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../assets/UI/bouton-menu-ecran-principal.webp") no-repeat center;
  background-size: 100% 35%;
  transform-origin: 50% 50%;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}
.start-menu-overlay .start-menu-content .btn:hover, .start-menu-overlay .slot-select-content .btn:hover, .start-menu-overlay .mode-select-content .btn:hover, .start-menu-overlay .difficulty-select-content .btn:hover, .slot-select-overlay .start-menu-content .btn:hover, .slot-select-overlay .slot-select-content .btn:hover, .slot-select-overlay .mode-select-content .btn:hover, .slot-select-overlay .difficulty-select-content .btn:hover, .mode-select-overlay .start-menu-content .btn:hover, .mode-select-overlay .slot-select-content .btn:hover, .mode-select-overlay .mode-select-content .btn:hover, .mode-select-overlay .difficulty-select-content .btn:hover, .difficulty-select-overlay .start-menu-content .btn:hover, .difficulty-select-overlay .slot-select-content .btn:hover, .difficulty-select-overlay .mode-select-content .btn:hover, .difficulty-select-overlay .difficulty-select-content .btn:hover {
  color: #ffdb85 !important;
  transform: scale(1.2);
}
.start-menu-overlay .start-menu-content .btn:hover::before, .start-menu-overlay .start-menu-content .btn:focus-visible::before, .start-menu-overlay .slot-select-content .btn:hover::before, .start-menu-overlay .slot-select-content .btn:focus-visible::before, .start-menu-overlay .mode-select-content .btn:hover::before, .start-menu-overlay .mode-select-content .btn:focus-visible::before, .start-menu-overlay .difficulty-select-content .btn:hover::before, .start-menu-overlay .difficulty-select-content .btn:focus-visible::before, .slot-select-overlay .start-menu-content .btn:hover::before, .slot-select-overlay .start-menu-content .btn:focus-visible::before, .slot-select-overlay .slot-select-content .btn:hover::before, .slot-select-overlay .slot-select-content .btn:focus-visible::before, .slot-select-overlay .mode-select-content .btn:hover::before, .slot-select-overlay .mode-select-content .btn:focus-visible::before, .slot-select-overlay .difficulty-select-content .btn:hover::before, .slot-select-overlay .difficulty-select-content .btn:focus-visible::before, .mode-select-overlay .start-menu-content .btn:hover::before, .mode-select-overlay .start-menu-content .btn:focus-visible::before, .mode-select-overlay .slot-select-content .btn:hover::before, .mode-select-overlay .slot-select-content .btn:focus-visible::before, .mode-select-overlay .mode-select-content .btn:hover::before, .mode-select-overlay .mode-select-content .btn:focus-visible::before, .mode-select-overlay .difficulty-select-content .btn:hover::before, .mode-select-overlay .difficulty-select-content .btn:focus-visible::before, .difficulty-select-overlay .start-menu-content .btn:hover::before, .difficulty-select-overlay .start-menu-content .btn:focus-visible::before, .difficulty-select-overlay .slot-select-content .btn:hover::before, .difficulty-select-overlay .slot-select-content .btn:focus-visible::before, .difficulty-select-overlay .mode-select-content .btn:hover::before, .difficulty-select-overlay .mode-select-content .btn:focus-visible::before, .difficulty-select-overlay .difficulty-select-content .btn:hover::before, .difficulty-select-overlay .difficulty-select-content .btn:focus-visible::before {
  transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .start-menu-overlay .start-menu-content .btn::before, .start-menu-overlay .slot-select-content .btn::before, .start-menu-overlay .mode-select-content .btn::before, .start-menu-overlay .difficulty-select-content .btn::before, .slot-select-overlay .start-menu-content .btn::before, .slot-select-overlay .slot-select-content .btn::before, .slot-select-overlay .mode-select-content .btn::before, .slot-select-overlay .difficulty-select-content .btn::before, .mode-select-overlay .start-menu-content .btn::before, .mode-select-overlay .slot-select-content .btn::before, .mode-select-overlay .mode-select-content .btn::before, .mode-select-overlay .difficulty-select-content .btn::before, .difficulty-select-overlay .start-menu-content .btn::before, .difficulty-select-overlay .slot-select-content .btn::before, .difficulty-select-overlay .mode-select-content .btn::before, .difficulty-select-overlay .difficulty-select-content .btn::before {
    transition: none;
    transform: none;
  }
}
.start-menu-overlay .start-menu-content br, .start-menu-overlay .slot-select-content br, .start-menu-overlay .mode-select-content br, .start-menu-overlay .difficulty-select-content br, .slot-select-overlay .start-menu-content br, .slot-select-overlay .slot-select-content br, .slot-select-overlay .mode-select-content br, .slot-select-overlay .difficulty-select-content br, .mode-select-overlay .start-menu-content br, .mode-select-overlay .slot-select-content br, .mode-select-overlay .mode-select-content br, .mode-select-overlay .difficulty-select-content br, .difficulty-select-overlay .start-menu-content br, .difficulty-select-overlay .slot-select-content br, .difficulty-select-overlay .mode-select-content br, .difficulty-select-overlay .difficulty-select-content br {
  display: none;
}
.start-menu-overlay .start-menu-content h1, .slot-select-overlay .start-menu-content h1, .mode-select-overlay .start-menu-content h1, .difficulty-select-overlay .start-menu-content h1 {
  text-align: center;
  color: transparent;
  margin-bottom: 0 !important;
}
.start-menu-overlay .mode-select-content h1, .start-menu-overlay .slot-select-content h1, .start-menu-overlay .difficulty-select-content h1, .slot-select-overlay .mode-select-content h1, .slot-select-overlay .slot-select-content h1, .slot-select-overlay .difficulty-select-content h1, .mode-select-overlay .mode-select-content h1, .mode-select-overlay .slot-select-content h1, .mode-select-overlay .difficulty-select-content h1, .difficulty-select-overlay .mode-select-content h1, .difficulty-select-overlay .slot-select-content h1, .difficulty-select-overlay .difficulty-select-content h1 {
  text-shadow: 6px 6px 9px #000000;
  text-align: left;
  padding-left: 40px;
  font-size: 3.5rem !important;
  margin-bottom: 0 !important;
}

.load-save-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.load-save-overlay .load-save-content {
  width: 80vw;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(20, 20, 30, 0.95);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.load-save-overlay .load-save-content .slot-logo {
  max-width: 200px;
  margin: 0 auto 1rem;
  display: block;
}
.load-save-overlay .load-save-content h2 {
  color: #ffdb85;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
.load-save-overlay .saves-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.load-save-overlay .save-card {
  position: relative;
  background: rgba(45, 55, 72, 0.8);
  border: 2px solid #4a5568;
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.load-save-overlay .save-card:hover {
  background: rgba(66, 153, 225, 0.3);
  border-color: #4299e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}
.load-save-overlay .save-card .delete-save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(220, 38, 38, 0.8);
  border: 2px solid rgb(220, 38, 38);
  border-radius: 4px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  transition: all 0.2s ease;
  z-index: 10;
}
.load-save-overlay .save-card .delete-save-btn:hover {
  background: rgb(239, 68, 68);
  border-color: rgb(239, 68, 68);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.6);
}
.load-save-overlay .save-card .delete-save-btn:active {
  transform: scale(0.95);
}
.load-save-overlay .save-card .save-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.load-save-overlay .save-card .save-card-header h4 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.2em;
}
.load-save-overlay .save-card .save-card-header .save-date {
  color: #a0aec0;
  font-size: 0.9em;
}
.load-save-overlay .save-card .save-card-body p {
  margin: 0.5rem 0;
  color: #cbd5e0;
}
.load-save-overlay .text-muted {
  color: #a0aec0;
  text-align: center;
  padding: 2rem;
}

.options-menu-overlay .options-menu-content {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(20, 20, 30, 0.95);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.options-menu-overlay .options-title {
  color: #fff;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}
.options-menu-overlay .options-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.options-menu-overlay .options-section {
  background: rgba(40, 40, 50, 0.6);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}
.options-menu-overlay .options-section:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(45, 45, 55, 0.7);
}
.options-menu-overlay .options-section.options-section-wide {
  grid-column: 1/-1;
}
.options-menu-overlay .options-section-title {
  color: #ffdb85;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(255, 219, 133, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.options-menu-overlay .options-section-content .btn {
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.options-menu-overlay .options-section-content .btn i {
  margin-right: 0.5rem;
}
.options-menu-overlay .options-section-content .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.options-menu-overlay .options-section-content .btn.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
}
.options-menu-overlay .options-section-content .btn.btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}
.options-menu-overlay .options-section-content .btn.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  border: none;
  color: #000 !important;
}
.options-menu-overlay .options-section-content .btn.btn-warning:hover {
  background: linear-gradient(135deg, #e0a800 0%, #e68900 100%);
}
.options-menu-overlay .options-section-content .btn.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border: none;
}
.options-menu-overlay .options-section-content .btn.btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}
.options-menu-overlay .option-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.options-menu-overlay .option-label {
  color: #ddd;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0;
}
.options-menu-overlay .volume-value {
  color: #ffdb85;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 45px;
  text-align: right;
}
.options-menu-overlay .form-range {
  accent-color: #ffdb85;
  height: 6px;
}
.options-menu-overlay .form-range::-webkit-slider-thumb {
  background: #ffdb85;
  border: 2px solid rgba(255, 219, 133, 0.5);
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}
.options-menu-overlay .form-range::-webkit-slider-thumb:hover {
  background: #ffecb8;
  transform: scale(1.2);
}
.options-menu-overlay .form-range::-moz-range-thumb {
  background: #ffdb85;
  border: 2px solid rgba(255, 219, 133, 0.5);
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}
.options-menu-overlay .form-range::-moz-range-thumb:hover {
  background: #ffecb8;
  transform: scale(1.2);
}
.options-menu-overlay .form-check-input {
  width: 3rem;
  height: 1.5rem;
  cursor: pointer;
  background-color: rgba(100, 100, 110, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.options-menu-overlay .form-check-input:checked {
  background-color: #ffdb85;
  border-color: #ffdb85;
}
.options-menu-overlay .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 219, 133, 0.25);
}
.options-menu-overlay .form-check-label {
  color: #ddd;
  font-size: 0.95rem;
  margin-left: 0.5rem;
  cursor: pointer;
}
.options-menu-overlay .form-select {
  background-color: rgba(40, 40, 50, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.options-menu-overlay .form-select:focus {
  background-color: rgba(45, 45, 55, 0.9);
  border-color: #ffdb85;
  box-shadow: 0 0 0 0.2rem rgba(255, 219, 133, 0.25);
  outline: none;
}
.options-menu-overlay .form-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.options-menu-overlay .form-select option {
  background-color: #2a2a35;
  color: #fff;
}
.options-menu-overlay #bindings-options {
  color: #ddd;
  font-size: 0.9rem;
}
.options-menu-overlay #bindings-options .binding-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: rgba(30, 30, 40, 0.5);
  border-radius: 6px;
  transition: background 0.2s ease;
}
.options-menu-overlay #bindings-options .binding-item:hover {
  background: rgba(40, 40, 50, 0.6);
}
.options-menu-overlay .options-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.options-menu-overlay .options-footer .btn {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
}
.options-menu-overlay .options-footer .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.options-menu-overlay .options-menu-content::-webkit-scrollbar {
  width: 10px;
}
.options-menu-overlay .options-menu-content::-webkit-scrollbar-track {
  background: rgba(20, 20, 30, 0.5);
  border-radius: 10px;
}
.options-menu-overlay .options-menu-content::-webkit-scrollbar-thumb {
  background: rgba(255, 219, 133, 0.4);
  border-radius: 10px;
  transition: background 0.2s ease;
}
.options-menu-overlay .options-menu-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 219, 133, 0.6);
}

/* Achievements screen */
#achievements-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  z-index: 8000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--police-glossaire, "DejaVuSansCondensed"), sans-serif;
}
#achievements-screen .glossary-window {
  position: relative;
  background: url("../assets/UI/encyclopedie.webp") no-repeat center center/contain;
  max-width: 900px;
  width: 90%;
  height: 80%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  padding: 20px;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.3s ease-out;
}
#achievements-screen:not(.hidden) .glossary-window {
  transform: scale(1);
  opacity: 1;
}
#achievements-screen .glossary-tabs {
  position: relative;
  margin-bottom: 20px;
}
#achievements-screen .glossary-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  margin: 0;
}
#achievements-screen #achievements-screen-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#achievements-screen #achievements-screen-list .list-group-item {
  background-color: rgba(45, 55, 72, 0.9);
  border: 1px solid #4a5568;
  border-radius: 4px;
  padding: 15px;
  color: #e2e8f0;
  font-size: 1.1em;
  transition: background-color 0.2s ease;
}
#achievements-screen #achievements-screen-list .list-group-item:hover {
  background-color: rgba(66, 153, 225, 0.3);
}
#achievements-screen #achievements-screen-list .text-muted {
  text-align: center;
  font-size: 1.2em;
  padding: 40px 20px;
  color: #a0aec0;
}
#achievements-screen #close-achievements-btn {
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
}
#achievements-screen #close-achievements-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Toast Notifications System */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(20, 20, 20, 0.95);
  border-radius: 8px;
  border-left: 4px solid;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
  min-width: 250px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
}
.toast-show {
  opacity: 1;
  transform: translateX(0);
}
.toast-hide {
  opacity: 0;
  transform: translateX(400px);
}
.toast-icon {
  font-size: 20px;
  font-weight: bold;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.toast-message {
  flex: 1;
  line-height: 1.4;
}
.toast-success {
  border-left-color: #10b981;
}
.toast-success .toast-icon {
  background: #10b981;
  color: white;
}
.toast-error {
  border-left-color: #ef4444;
}
.toast-error .toast-icon {
  background: #ef4444;
  color: white;
}
.toast-warning {
  border-left-color: #f59e0b;
}
.toast-warning .toast-icon {
  background: #f59e0b;
  color: white;
}
.toast-info {
  border-left-color: #3b82f6;
}
.toast-info .toast-icon {
  background: #3b82f6;
  color: white;
}

@media (max-width: 640px) {
  .toast-container {
    right: 10px;
    left: 10px;
    top: 10px;
  }
  .toast {
    min-width: auto;
    max-width: none;
  }
}
/* Debug Menu Styles */
.debug-menu-toggle {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 50px;
  height: 50px;
  background: rgba(220, 38, 38, 0.9);
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10020 !important;
  color: white;
  font-size: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto !important;
}
.debug-menu-toggle:hover {
  background: rgb(220, 38, 38);
  transform: scale(1.1);
}

.debug-menu {
  position: fixed;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid rgba(220, 38, 38, 0.5);
  border-radius: 12px;
  z-index: 10001;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.debug-menu-hidden {
  display: none !important;
}

.debug-menu-header {
  background: rgba(220, 38, 38, 0.8);
  padding: 15px 20px;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-menu-content {
  padding: 20px;
  max-height: calc(80vh - 120px);
  overflow-y: auto;
}

.debug-section {
  color: white;
}
.debug-section label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.debug-section .form-control,
.debug-section .form-select {
  background: rgba(50, 50, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}
.debug-section .form-control:focus,
.debug-section .form-select:focus {
  background: rgba(60, 60, 60, 0.9);
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.25);
  color: white;
}
.debug-section .form-control::placeholder,
.debug-section .form-select::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.debug-section option {
  background: rgb(30, 30, 30);
  color: white;
}

.debug-quick-items .form-text {
  color: rgba(255, 255, 255, 0.7);
}

/* Debug Menu Cards */
.debug-card {
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: visible;
}
.debug-card-header {
  background: rgba(60, 60, 60, 0.9);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.debug-card-body {
  padding: 12px;
}

/* Debug Tabs Styling */
.debug-tabs {
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  display: flex;
  justify-content: space-around;
}
.debug-tabs .nav-item {
  flex: 1;
}
.debug-tabs .nav-link {
  color: rgba(255, 255, 255, 0.5);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 1rem;
  text-align: center;
  width: 100%;
  transition: all 0.2s ease;
  padding: 10px 8px !important;
}
.debug-tabs .nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}
.debug-tabs .nav-link.active {
  color: #DC2626;
  background: rgba(220, 38, 38, 0.1);
  border-bottom-color: #DC2626;
}

/* Debug Autocomplete - using inline display instead of dropdown */
.debug-autocomplete-results {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
}
.debug-autocomplete-results::-webkit-scrollbar {
  width: 6px;
}
.debug-autocomplete-results::-webkit-scrollbar-thumb {
  background: #DC2626;
  border-radius: 3px;
}
.debug-autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s ease;
  color: #fff;
}
.debug-autocomplete-item:last-child {
  border-bottom: none;
}
.debug-autocomplete-item:hover {
  background: #DC2626;
}
.debug-autocomplete-item .fw-bold {
  color: #fff;
  font-size: 0.9rem;
}
.debug-autocomplete-item .text-muted {
  color: #999 !important;
  font-size: 0.75rem;
}
.debug-autocomplete-item .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
}
.debug-autocomplete-item img {
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}

/* Debug Menu Responsive */
@media (max-width: 600px) {
  .debug-menu {
    width: 95vw !important;
    max-width: 95vw !important;
  }
  .debug-tabs .nav-link {
    font-size: 0.75rem;
    padding: 6px 8px !important;
  }
  .debug-tabs .nav-link i {
    display: none;
  }
}

.combat-slot-editor-preview {
  position: relative;
}
.combat-slot-editor-preview .slot-frame {
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  transform-origin: bottom center;
}
.combat-slot-editor-preview .slot-marker {
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.combat-slot-editor-preview .slot-marker:hover {
  transform: translate(-50%, 0) scale(1.15);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.profile-create-content {
  max-width: 500px;
  background: rgba(20, 20, 30, 0.95);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.profile-create-content .slot-logo {
  max-width: 150px;
  margin: 0 auto 1rem;
  display: block;
}
.profile-create-content h1 {
  color: #ffdb85;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
.profile-create-content p {
  color: #cbd5e0;
}
.profile-create-content .profile-form .form-label {
  color: #e2e8f0;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.profile-create-content .profile-form .form-control {
  background: rgba(45, 55, 72, 0.8);
  border: 2px solid #4a5568;
  color: #e2e8f0;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
}
.profile-create-content .profile-form .form-control:focus {
  background: rgba(45, 55, 72, 0.95);
  border-color: #4299e1;
  box-shadow: 0 0 0 0.25rem rgba(66, 153, 225, 0.3);
  color: white;
}
.profile-create-content .profile-form .form-control::placeholder {
  color: #a0aec0;
}
.profile-create-content .profile-form .error-message {
  color: #fc8181;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

.profile-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.profile-slot-item {
  display: flex;
  justify-content: center;
}

.profile-card {
  position: relative;
  width: 200px;
  background: rgba(45, 55, 72, 0.8);
  border: 2px solid #4a5568;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.profile-card:hover {
  background: rgba(66, 153, 225, 0.3);
  border-color: #4299e1;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(66, 153, 225, 0.4);
}
.profile-card.profile-empty {
  border-style: dashed;
  border-color: #718096;
  background: rgba(45, 55, 72, 0.4);
}
.profile-card.profile-empty:hover {
  background: rgba(66, 153, 225, 0.2);
  border-color: #4299e1;
}
.profile-card.profile-empty .profile-avatar {
  color: #a0aec0;
}
.profile-card.profile-empty .profile-avatar:hover {
  color: #4299e1;
}
.profile-card .profile-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(220, 38, 38, 0.8);
  border: 2px solid rgb(220, 38, 38);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  z-index: 10;
}
.profile-card .profile-delete-btn:hover {
  background: rgb(239, 68, 68);
  border-color: rgb(239, 68, 68);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.6);
}
.profile-card .profile-delete-btn:active {
  transform: scale(0.95);
}
.profile-card .profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(66, 153, 225, 0.2);
  border: 3px solid #4299e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4299e1;
  transition: all 0.3s ease;
}
.profile-card .profile-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  word-break: break-word;
}
.profile-card .profile-meta {
  font-size: 0.9rem;
  color: #a0aec0;
  text-align: center;
}

.slot-select-content,
.profile-select-content {
  max-width: 1400px;
  width: 90%;
}

/* Companion Recruitment Grid */
.companions-recruitment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 38, 21, 0.5) rgba(0, 0, 0, 0.2);
}
.companions-recruitment-grid::-webkit-scrollbar {
  width: 8px;
}
.companions-recruitment-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.companions-recruitment-grid::-webkit-scrollbar-thumb {
  background: rgba(59, 38, 21, 0.5);
  border-radius: 4px;
}
.companions-recruitment-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 38, 21, 0.7);
}

.recruitment-companion-card {
  position: relative;
  border: 2px solid rgba(255, 193, 7, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recruitment-companion-card:hover {
  border-color: rgba(255, 193, 7, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.recruitment-companion-card.already-recruited {
  opacity: 0.6;
  border-color: rgba(108, 117, 125, 0.3);
}

.recruitment-companion-card .companion-portrait {
  display: flex;
  justify-content: center;
  align-items: center;
}

.recruitment-companion-card .companion-name,
.recruitment-companion-card .companion-description {
  text-align: center;
}

/* Companion Management Screen */
.companion-management-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 30, 0.1);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.companion-management-content {
  width: 95%;
  max-width: 1350px;
  height: 75vh;
  border: 10px solid #3b2615;
  border-radius: 35px;
  box-shadow: 0 0 0 2px #a67c52, inset 0 0 0 4px #2c1a0f, 0 0 0 8px #d4a76a, 0 0 0 11px #8b5e2b, 0 0 0 14px #c49a6c, 0 0 0 16px #6b4423, 0 0 0 18px rgba(212, 167, 106, 0.4), 0 2px 4px rgba(212, 167, 106, 0.5), 0 -2px 4px rgba(139, 94, 43, 0.4), 0 8px 30px rgba(0, 0, 0, 0.7) !important;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0;
  overflow: hidden;
}
.companion-management-content .card-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(253, 241, 208, 0.3) rgba(253, 241, 208, 0.1);
}
.companion-management-content .card-body::-webkit-scrollbar {
  width: 8px;
}
.companion-management-content .card-body::-webkit-scrollbar-track {
  background: rgba(253, 241, 208, 0.1);
  border-radius: 4px;
}
.companion-management-content .card-body::-webkit-scrollbar-thumb {
  background: rgba(253, 241, 208, 0.3);
  border-radius: 4px;
}
.companion-management-content .card-body::-webkit-scrollbar-thumb:hover {
  background: rgba(253, 241, 208, 0.5);
}

.companion-management-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 35px;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, rgba(59, 38, 21, 0.3) 0%, transparent 25%), radial-gradient(circle at 80% 70%, rgba(107, 68, 35, 0.25) 0%, transparent 30%), radial-gradient(circle at 50% 90%, rgba(139, 94, 43, 0.2) 0%, transparent 20%), radial-gradient(circle at 10% 80%, rgba(59, 38, 21, 0.25) 0%, transparent 25%), radial-gradient(circle at 90% 20%, rgba(107, 68, 35, 0.2) 0%, transparent 30%), radial-gradient(ellipse at 40% 50%, rgba(212, 167, 106, 0.15) 0%, transparent 40%), radial-gradient(ellipse at 70% 40%, rgba(166, 124, 82, 0.1) 0%, transparent 35%), linear-gradient(135deg, rgba(212, 167, 106, 0.05) 0%, transparent 50%, rgba(59, 38, 21, 0.08) 100%);
  opacity: 0.7;
  z-index: 1;
}

.companion-management-content .row {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 2;
  flex: 1;
}

.companion-list-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  border-right: 2px solid rgba(166, 124, 82, 0.3);
}

.companion-list-item {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.companion-list-item:hover {
  background: rgba(255, 193, 7, 0.1);
  transform: translateX(5px);
}

.companion-list-item.active {
  background: #fdf1d0 !important;
  background-color: #fdf1d0 !important;
  border: 2px solid rgba(255, 193, 7, 0.5);
}
.companion-list-item.active *,
.companion-list-item.active h6,
.companion-list-item.active small,
.companion-list-item.active span {
  color: #28333d !important;
}
.companion-list-item.active .text-muted {
  color: #28333d !important;
}
.companion-list-item.active .text-danger {
  color: #dc3545 !important;
}

.companion-basic-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.companion-basic-info p {
  font-size: 1.3rem !important;
}

.companion-stats-inline {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.companion-stats-inline .combat-stat-item-inline i {
  cursor: help;
  transition: transform 0.2s ease;
}
.companion-stats-inline .combat-stat-item-inline i:hover {
  transform: scale(1.2);
}
.companion-stats-inline .combat-stat-item-inline .text-primary {
  color: #007bff !important;
}
.companion-stats-inline .combat-stat-item-inline .text-success {
  color: #28a745 !important;
}
.companion-stats-inline .combat-stat-item-inline .text-danger {
  color: #dc3545 !important;
}
.companion-stats-inline .combat-stat-item-inline .text-warning {
  color: #ffc107 !important;
}

.companion-management-content .card {
  background-color: #28333d !important;
}
.companion-management-content .card * {
  color: #fdf1d0 !important;
}
.companion-management-content .card i {
  color: #E6E6E6 !important;
}
.companion-management-content .card .card-header {
  background-color: #28333d !important;
}
.companion-management-content .card .card-body {
  background-color: #28333d !important;
  display: flex;
  flex-direction: column;
}
.companion-management-content .card strong {
  color: #fdf1d0 !important;
}

.companion-action-buttons {
  margin-top: auto;
  padding-top: 1rem;
}
.companion-action-buttons .btn {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
}

.companion-details-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px;
}

.companion-details-portrait {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.transition {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-300 {
  transition-duration: 300ms;
}

.duration-200 {
  transition-duration: 200ms;
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

.scale-90 {
  transform: scale(0.9);
}

.scale-100 {
  transform: scale(1);
}

@keyframes skillManagerEnter {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-30px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05) translateY(5px);
  }
  75% {
    transform: scale(0.98) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes skillManagerLeave {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}
.skill-manager-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px;
  opacity: 0.7;
}
.skill-manager-close-btn:hover {
  opacity: 1;
  transform: rotate(90deg);
}
.skill-manager-close-btn:active {
  transform: rotate(90deg) scale(0.9);
}

.companion-skill-manager-content {
  background-color: rgb(33, 37, 41) !important;
}
.companion-skill-manager-content.animate-enter {
  animation: skillManagerEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.companion-skill-manager-content .form-control {
  width: 98%;
}
.companion-skill-manager-content .overflow-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 7, 0.3) rgba(255, 255, 255, 0.05);
}
.companion-skill-manager-content .overflow-auto::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.companion-skill-manager-content .overflow-auto::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.companion-skill-manager-content .overflow-auto::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}
.companion-skill-manager-content .overflow-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 193, 7, 0.5);
}
.companion-skill-manager-content .list-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.companion-skill-manager-content .list-group-item {
  background-color: rgba(0, 0, 0, 0.1) !important;
  border: none !important;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: #fdf1d0;
  font-size: 15px;
  width: 98%;
}
.companion-skill-manager-content .list-group-item:hover {
  background: rgba(255, 193, 7, 0.1) !important;
  transform: translateX(5px);
}
.companion-skill-manager-content .list-group-item span:not(.badge), .companion-skill-manager-content .list-group-item small {
  color: #fdf1d0 !important;
}
.companion-skill-manager-content .list-group-item .text-muted {
  color: #a0a0a0 !important;
}
.companion-skill-manager-content .list-group-item .badge.bg-info {
  --bs-bg-opacity: 1;
  background-color: rgb(243, 232, 201) !important;
  color: #1e2125 !important;
}
.companion-skill-manager-content .list-group-item .badge.bg-info.skill-type-attack {
  background-color: #dc3545 !important;
  color: #fff !important;
}
.companion-skill-manager-content .list-group-item .badge.bg-info.skill-type-defense {
  background-color: #28a745 !important;
  color: #fff !important;
}
.companion-skill-manager-content .player-card .card-header,
.companion-skill-manager-content .resolution-display-card .card-header {
  width: 70% !important;
  margin-top: 9px !important;
  padding: 6px !important;
}
.companion-skill-manager-content .player-card .card-name,
.companion-skill-manager-content .resolution-display-card .card-name {
  font-size: 0.5em !important;
}
.companion-skill-manager-content .player-card .card-description-preview,
.companion-skill-manager-content .resolution-display-card .card-description-preview {
  font-size: 0.5em !important;
  line-height: 0.9 !important;
  width: 66% !important;
  margin: -2px auto -2px !important;
  height: 82px !important;
}
.companion-skill-manager-content .player-card .lateral-power-bars-dual {
  right: 0px !important;
  left: auto !important;
  top: 70% !important;
  width: 80px !important;
  align-items: flex-end !important;
}
.companion-skill-manager-content .player-card .dual-bar-zone {
  height: 16px !important;
  max-width: 80px !important;
}
.companion-skill-manager-content .player-card .bar-value {
  font-size: 10px !important;
}

.tippy-box[data-theme~=card-preview-with-tooltip] {
  background-color: transparent;
  box-shadow: none;
  max-width: none !important;
}
.tippy-box[data-theme~=card-preview-with-tooltip] .tippy-content {
  padding: 0;
  background: transparent;
}
.tippy-box[data-theme~=card-preview-with-tooltip] .tippy-arrow {
  display: none;
}

/* ============================================
   SYSTÈME DE TAGS DYNAMIQUES
   Tags utilisables dans les descriptions : {{joueur}}, {{classe}}, {{niveau}}, etc.
   ============================================ */

/* Style de base pour tous les tags dynamiques */
.dynamic-tag {
  display: inline;
  font-weight: 600;
  padding: 0 0.15em;
  border-radius: 3px;
  transition: all 0.2s ease;
}

/* Tags textuels (nom du joueur, classe, zone) */
.dynamic-tag-text {
  color: #f0c040;
  text-shadow: 0 0 4px rgba(240, 192, 64, 0.4);
}

/* Tags numériques (niveau, or, pv) */
.dynamic-tag-number {
  color: #5fd4ff;
  font-family: var(--police-nom-cartes), monospace;
  text-shadow: 0 0 4px rgba(95, 212, 255, 0.4);
}

/* Styles spécifiques par type de tag */
.dynamic-tag[data-tag="joueur"] {
  color: #ffd700;
  font-style: italic;
}

.dynamic-tag[data-tag="classe"] {
  color: #c9a0dc;
}

.dynamic-tag[data-tag="or"] {
  color: #ffd700;
}

.dynamic-tag[data-tag="or"]::before {
  content: "💰 ";
  font-size: 0.85em;
}

.dynamic-tag[data-tag="pv"],
.dynamic-tag[data-tag="pv_max"] {
  color: #ff6b6b;
}

.dynamic-tag[data-tag="niveau"] {
  color: #7fff7f;
}

.dynamic-tag[data-tag="xp"] {
  color: #a0a0ff;
}

.dynamic-tag[data-tag="zone_actuelle"] {
  color: #80d4ff;
  font-style: italic;
}

/* Animation subtile au survol en jeu */
.dynamic-tag:hover {
  filter: brightness(1.2);
}

/* ============================================
   ICÔNES DYNAMIQUES (Stats et Status)
   Icônes insérées via [[stat:X]] et [[status:X]]
   ============================================ */

/* Style de base pour les icônes dynamiques */
.dynamic-icon {
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.15em;
  transition: transform 0.15s ease, filter 0.15s ease;
}

/* Icônes de stats (Font Awesome) */
.dynamic-icon-stat {
  font-size: 1.1em;
  text-shadow: 0 0 4px currentColor;
}

/* Icônes de status (images) */
.dynamic-icon-status {
  width: 1.2em;
  height: 1.2em;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* Animation au survol */
.dynamic-icon:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

.dynamic-icon-status:hover {
  filter: brightness(1.2) drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* Wrapper pour icône + valeur en indice */
.dynamic-icon-wrapper {
  display: inline-flex;
  align-items: baseline;
  vertical-align: middle;
  margin: 0 0.1em;
}

.dynamic-icon-wrapper .dynamic-icon {
  margin: 0;
}

/* Valeur en indice à côté de l'icône */
.dynamic-icon-value {
  font-size: 0.75em;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8), 1px 1px 1px #000;
  margin-left: 0.05em;
  vertical-align: sub;
}
