/* ==========================================================================
   Classement — pseudo cliquable et panoplie complète
   ========================================================================== */

/* Le pseudo devient un bouton : il doit garder EXACTEMENT l'allure du texte qu'il
   remplaçait (couleur du pseudo, style de nom personnalisé), et ne montrer qu'au
   survol qu'il y a quelque chose à ouvrir. */
.loadout-board-name-btn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  border-bottom: 1px dashed transparent;
}
.loadout-board-name-btn:hover,
.loadout-board-name-btn:focus-visible {
  border-bottom-color: currentColor;
}

/* La bande d'armes devient un bouton, sans rien changer à sa mise en page. */
button.loadout-board-items {
  background: none; border: 0; padding: 2px 4px; margin: 0 -4px;
  font: inherit; color: inherit; cursor: pointer;
  border-radius: 10px; transition: background .14s ease;
}
button.loadout-board-items:hover,
button.loadout-board-items:focus-visible {
  background: rgba(255, 255, 255, .06);
}
.loadout-board-more { pointer-events: none; }

/* ---- la fenêtre ---- */
.loadout-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4, 6, 10, .78);
  backdrop-filter: blur(3px);
}
.loadout-modal-overlay[hidden] { display: none !important; }

.loadout-modal {
  position: relative;
  width: min(1040px, 100%); max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden;
  background: var(--panel, #141821);
  border: 1px solid var(--border, #232a37);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.loadout-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: none; border: 0; color: var(--text-muted, #a7adb5);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.loadout-modal-close:hover { color: var(--accent, #ff8a00); }

.loadout-modal-head {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 52px 14px 18px;
  border-bottom: 1px solid var(--border, #232a37);
}
.loadout-modal-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #0b0d10; border: 1px solid var(--border, #232a37);
}
.loadout-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.loadout-modal-head h3 { margin: 0; font-size: 18px; }
.loadout-modal-sub { font-size: 12px; color: var(--text-muted, #a7adb5); margin-top: 3px; }
.loadout-modal-sub b { color: var(--text, #e9edf1); }

.loadout-modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  display: grid; gap: 11px;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  align-content: start;
}
.loadout-modal-loading {
  grid-column: 1 / -1; text-align: center; padding: 40px 10px;
  color: var(--text-muted, #a7adb5); font-size: 13px;
}

/* ---- une arme ---- */
.loadout-modal-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px 0; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  border-radius: 11px; overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color) 15%, transparent), transparent 58%),
    var(--card, #0f131a);
  border: 1px solid var(--border, #232a37);
  border-top: 2px solid var(--rarity-color);
  transition: transform .14s ease, border-color .14s ease, box-shadow .18s ease;
}
.loadout-modal-item:hover,
.loadout-modal-item:focus-visible {
  transform: translateY(-3px);
  border-color: var(--rarity-color);
  box-shadow: 0 14px 32px -16px var(--rarity-color);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .loadout-modal-item { background: var(--card, #0f131a); }
}

.lmi-slot {
  font-size: 9.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-faint, #7d858f);
}
.lmi-art { display: block; margin: 2px 0 4px; }
.lmi-art .item-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.lmi-art .item-thumb img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 8px 13px rgba(0, 0, 0, .55));
}
.lmi-name {
  font-weight: 800; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere;
}
.lmi-meta { font-size: 10.5px; color: var(--text-faint, #7d858f); }
.lmi-st { color: #ffcf4d; }
.lmi-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: 7px -10px 0; padding: 5px 10px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  border-top: 1px solid var(--border, #232a37);
  background: color-mix(in srgb, var(--rarity-color) 12%, transparent);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .lmi-foot { background: #0b0d10; }
}
.lmi-rarity { color: var(--rarity-color); }
.lmi-value { color: var(--text-muted, #a7adb5); letter-spacing: 0; }

@media (max-width: 560px) {
  .loadout-modal-overlay { padding: 10px; }
  .loadout-modal-body { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .loadout-modal-item:hover { transform: none; }
}
