/* ============================================================
   Skills Loadout configurator — sklo-* prefix
   2026-06-05
   ============================================================ */

.sklo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: skloFadeIn .15s ease;
}
@keyframes skloFadeIn { from { opacity: 0; } to { opacity: 1; } }

.sklo-modal {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  background: linear-gradient(180deg, #1a1410, #0e0a08);
  border: 1px solid rgba(233, 185, 99, 0.30);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.80);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #e6d9c4;
  font-family: 'Inter', sans-serif;
}

/* HEADER */
.sklo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(233, 185, 99, 0.18);
}
.sklo-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: #e9b963;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sklo-title i { font-size: 20px; }
.sklo-sub {
  font-size: 12.5px;
  color: rgba(230, 217, 196, 0.65);
  margin-top: 4px;
  line-height: 1.4;
}
.sklo-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e6d9c4;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.sklo-close:hover { background: rgba(255,255,255,0.12); }

/* TABS */
.sklo-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 22px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sklo-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: rgba(230, 217, 196, 0.55);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.10em;
  padding: 10px 18px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}
.sklo-tab i { font-size: 14px; }
.sklo-tab:hover { color: #e6d9c4; background: rgba(255,255,255,0.04); }
.sklo-tab.is-active {
  color: #e9b963;
  background: rgba(233, 185, 99, 0.08);
  border-color: rgba(233, 185, 99, 0.30);
  border-bottom-color: transparent;
}

/* BODY */
.sklo-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sklo-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #e9b963;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.sklo-section-title i { font-size: 14px; }
.sklo-hint {
  margin-left: auto;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(230, 217, 196, 0.55);
  text-transform: none;
}

/* SLOTS GRID 1-9 */
.sklo-slots-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
}
.sklo-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: grab;
  transition: all .15s;
  text-align: center;
}
.sklo-slot:hover { border-color: rgba(233, 185, 99, 0.50); }
.sklo-slot.is-empty {
  background: rgba(255,255,255,0.02);
  border-style: dashed;
  cursor: default;
}
.sklo-slot.is-drop-over {
  border-color: #e9b963;
  background: rgba(233, 185, 99, 0.12);
  box-shadow: 0 0 0 2px rgba(233, 185, 99, 0.30);
}

.sklo-slot-num {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.70);
  border: 1px solid rgba(233, 185, 99, 0.45);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #e9b963;
  z-index: 2;
}
.sklo-slot-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.sklo-slot-icon img { width: 100%; height: 100%; object-fit: contain; }
.sklo-slot-icon i { font-size: 26px; color: rgba(230, 217, 196, 0.55); }
.sklo-slot-name {
  font-size: 9.5px;
  line-height: 1.1;
  color: rgba(230, 217, 196, 0.85);
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}
.sklo-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(230, 217, 196, 0.30);
  font-size: 10px;
}
.sklo-slot-empty i { font-size: 18px; }
.sklo-slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255, 100, 100, 0.40);
  color: #ff8090;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 3;
}
.sklo-slot.is-filled:hover .sklo-slot-remove { display: flex; }
.sklo-slot-remove:hover { background: rgba(255, 100, 100, 0.30); }

/* BANK */
.sklo-bank {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.sklo-bank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: grab;
  transition: all .12s;
}
.sklo-bank-item:hover {
  border-color: rgba(233, 185, 99, 0.40);
  background: rgba(233, 185, 99, 0.08);
}
.sklo-bank-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sklo-bank-icon img { width: 100%; height: 100%; object-fit: contain; }
.sklo-bank-icon i { font-size: 22px; color: rgba(230, 217, 196, 0.55); }
.sklo-bank-info { min-width: 0; }
.sklo-bank-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #e6d9c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sklo-bank-meta {
  font-size: 10.5px;
  color: rgba(230, 217, 196, 0.55);
  text-transform: capitalize;
  letter-spacing: 0.04em;
}
.sklo-bank-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: rgba(230, 217, 196, 0.50);
  font-style: italic;
  font-size: 13px;
}

/* FOOTER */
.sklo-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid rgba(233, 185, 99, 0.18);
  background: rgba(0,0,0,0.30);
  flex-shrink: 0;
}

/* MOBILE */
@media (max-width: 720px) {
  .sklo-overlay { padding: 8px; }
  .sklo-modal { max-height: 96vh; }
  .sklo-header { padding: 14px 14px 10px; }
  .sklo-title { font-size: 15px; }
  .sklo-sub { font-size: 11.5px; }
  .sklo-tabs { padding: 10px 14px 0; }
  .sklo-tab { padding: 8px 14px; font-size: 12px; }
  .sklo-body { padding: 14px 14px; gap: 16px; }
  .sklo-slots-grid { grid-template-columns: repeat(5, 1fr); }
  .sklo-slots-grid .sklo-slot:nth-child(n+10) { display: none; }
  /* En mobile mostramos slots de 5 en 5 — pero 9 slots no entran. Hacemos 2 filas */
  .sklo-slots-grid { grid-template-columns: repeat(5, 1fr); }
  .sklo-slot { aspect-ratio: 1 / 1.1; }
  .sklo-slot-icon { width: 32px; height: 32px; }
  .sklo-slot-icon i { font-size: 22px; }
  .sklo-slot-name { font-size: 9px; }
  .sklo-bank { grid-template-columns: 1fr; max-height: 220px; }
  .sklo-footer { padding: 10px 14px; }
  .sklo-hint { display: none; }
}
@media (max-width: 720px) {
  /* En mobile mostramos los 9 slots en 5 columnas (2 filas, último centrado) */
  .sklo-slots-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
  }
  .sklo-slots-grid .sklo-slot:nth-child(9) {
    grid-column: 3 / 4;
  }
  .sklo-slots-grid .sklo-slot:nth-child(n+10) { display: none; }
}

/* ============================================================
   Badges de slot (1-9) en botones de skill durante combate
   ============================================================ */
.ghc-skill-slot,
.cs-skill-slot,
.ghcv2-skill-slot {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(233, 185, 99, 0.55);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  color: #e9b963;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Asegurar que los botones tengan position relative para el badge absoluto */
.ghc-skill-btn,
.cs-skill-btn {
  position: relative;
}

/* Flash al usar hotkey */
.is-hotkey-flash {
  animation: skloHotkeyFlash 0.22s ease;
}
@keyframes skloHotkeyFlash {
  0%   { box-shadow: 0 0 0 0 rgba(233, 185, 99, 0.0), 0 0 0 0 rgba(233, 185, 99, 0.0); }
  50%  { box-shadow: 0 0 0 3px rgba(233, 185, 99, 0.55), 0 0 12px 4px rgba(233, 185, 99, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(233, 185, 99, 0.0), 0 0 0 0 rgba(233, 185, 99, 0.0); }
}

/* En mobile el badge es más chico (no hay teclado pero queremos consistencia visual) */
@media (max-width: 720px) {
  .ghc-skill-slot,
  .cs-skill-slot,
  .ghcv2-skill-slot {
    width: 14px;
    height: 14px;
    font-size: 9px;
    top: 1px;
    left: 2px;
  }
}
