/* =========================================================
   Inventaire des modules — version complète optimisée
   ========================================================= */

#inventoryContent {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: clamp(8px, 0.55vw, 12px);
    min-height: 0;
}

#inventoryContent,
#inventoryContent *,
#moduleInventoryPanel,
#moduleInventoryPanel * {
    box-sizing: border-box;
}

#inventoryContent .stock-panel.stock_loot,
#moduleInventoryPanel {
    flex: 0 0 auto;
    min-height: 0;
}

#inventoryContent[data-inventory-view="modules"] .stock-panel.stock_loot,
#inventoryContent[data-inventory-view="items"] #moduleInventoryPanel,
#moduleInventoryPanel[hidden] {
    display: none !important;
}

/* Vue Objets : le switch est injecté directement après #inventoryGrid. */
#inventoryContent[data-inventory-view="items"] .stock-panel.stock_loot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: visible !important;
}

#inventoryContent[data-inventory-view="items"] .stock-panel.stock_loot > #inventoryGrid {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    align-self: flex-start;
}

#inventoryContent[data-inventory-view="items"] .stock-panel.stock_loot > .inventory-view-switcher {
    flex: 0 0 auto;
    align-self: center;
    margin-top: clamp(8px, 0.6vw, 12px) !important;
    margin-bottom: 0 !important;
}

/* Vue Modules : largeur calée sur la grille 5 colonnes de l'inventaire objets. */
#inventoryContent[data-inventory-view="modules"] {
    --module-inventory-column-width: calc((var(--inv-cell, 64px) * 5) + (var(--inv-gap, 6px) * 4) + 12px);
    flex: 0 0 var(--module-inventory-column-width) !important;
    width: var(--module-inventory-column-width) !important;
    min-width: var(--module-inventory-column-width) !important;
    max-width: var(--module-inventory-column-width) !important;
    overflow: visible;
}

#inventoryContent[data-inventory-view="modules"] #moduleInventoryPanel,
#inventoryContent[data-inventory-view="modules"] .module-inventory-panel,
#inventoryContent[data-inventory-view="modules"] .inventory-view-switcher {
    width: 100%;
    max-width: 100%;
}

/* =========================================================
   Panneau Modules
   ========================================================= */

.module-inventory-panel {
    container-type: inline-size;
    position: relative;
    width: 100%;
    height: min(var(--module-inventory-target-height, clamp(320px, 43vh, 560px)), calc(100vh - 250px));
    min-height: min(var(--module-inventory-target-height, clamp(320px, 43vh, 560px)), calc(100vh - 250px));
    max-height: min(var(--module-inventory-target-height, min(58vh, 620px)), calc(100vh - 250px));
    display: flex;
    flex-direction: column;
    padding: clamp(7px, 0.5vw, 10px);
    border: 1px solid rgba(124, 231, 255, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(9, 42, 55, 0.82), rgba(3, 18, 26, 0.68)),
        radial-gradient(circle at 20% 0%, rgba(65, 201, 255, 0.14), transparent 42%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -18px 40px rgba(0, 0, 0, 0.18),
        0 10px 24px rgba(0, 0, 0, 0.20);
    overflow: hidden;
}

.module-inventory-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 26%, transparent 74%, rgba(124, 231, 255, 0.05));
    opacity: 0.75;
}

.module-inventory-tools {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: end;
    column-gap: clamp(18px, 1.35vw, 26px);
    row-gap: 7px;
    margin-bottom: clamp(7px, 0.5vw, 10px);
}

.module-inventory-search-wrap {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(9px, 0.55vw, 11px);
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(136, 229, 255, 0.78);
}

.module-inventory-search-field {
    position: relative;
    display: block;
    min-width: 0;
    width: 100%;
}

.module-inventory-search {
    appearance: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: clamp(30px, 1.9vw, 36px);
    padding: 0 34px 0 11px;
    border: 1px solid rgba(106, 221, 255, 0.24);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(5, 29, 39, 0.86), rgba(0, 11, 17, 0.78)),
        radial-gradient(circle at 0% 50%, rgba(80, 215, 255, 0.10), transparent 55%);
    color: rgba(242, 252, 255, 0.96);
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(12px, 0.75vw, 14px);
    font-weight: 800;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 14px rgba(0, 0, 0, 0.18);
}

.module-inventory-search::placeholder {
    color: rgba(191, 224, 233, 0.40);
}

.module-inventory-search:focus {
    border-color: rgba(114, 231, 255, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 0 0 1px rgba(114, 231, 255, 0.12),
        0 0 18px rgba(56, 199, 255, 0.10);
}

.module-inventory-search-clear {
    appearance: none;
    position: absolute;
    top: 50%;
    right: 7px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(130, 231, 255, 0.25);
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.24), transparent 35%),
        linear-gradient(180deg, rgba(18, 78, 104, 0.92), rgba(4, 25, 37, 0.95));
    color: rgba(235, 252, 255, 0.92);
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.86);
    transition:
        opacity 0.14s ease,
        transform 0.14s ease,
        border-color 0.14s ease,
        box-shadow 0.14s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 4px 10px rgba(0, 0, 0, 0.25);
}

.module-inventory-search-clear.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.module-inventory-search-clear:hover {
    border-color: rgba(148, 235, 255, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 12px rgba(78, 213, 255, 0.18),
        0 5px 12px rgba(0, 0, 0, 0.28);
}

.module-inventory-search-clear:active {
    transform: translateY(-50%) scale(0.94);
}

.module-inventory-owned-filter {
    justify-self: end;
    width: max-content;
    min-width: max-content;
    max-width: max-content;
    height: clamp(30px, 1.9vw, 36px);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px 0 9px;
    border: 1px solid rgba(106, 221, 255, 0.22);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(5, 35, 47, 0.82), rgba(1, 15, 23, 0.72)),
        radial-gradient(circle at 0% 50%, rgba(80, 215, 255, 0.12), transparent 58%);
    color: rgba(230, 247, 252, 0.88);
    cursor: pointer;
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(10px, 0.60vw, 12px);
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 14px rgba(0, 0, 0, 0.16);
}

.module-inventory-owned-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.module-inventory-checkmark {
    width: 15px;
    height: 15px;
    border: 1px solid rgba(122, 232, 255, 0.42);
    border-radius: 5px;
    background: rgba(0, 10, 15, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.module-inventory-owned-filter input:checked + .module-inventory-checkmark {
    border-color: rgba(111, 232, 255, 0.78);
    background: linear-gradient(180deg, rgba(44, 201, 255, 0.95), rgba(9, 103, 135, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 0 12px rgba(71, 209, 255, 0.22);
}

.module-inventory-owned-filter input:checked + .module-inventory-checkmark::after {
    content: "";
    display: block;
    width: 7px;
    height: 4px;
    margin: 4px 0 0 3px;
    border-left: 2px solid rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.95);
    transform: rotate(-45deg);
}

.module-inventory-drag-hint {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: -2px;
    padding: 2px 3px 0 3px;
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(9px, 0.58vw, 11px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.035em;
    color: rgba(148, 226, 246, 0.62);
    text-transform: uppercase;
    pointer-events: none;
}

.module-inventory-list {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 0.42vw, 9px);
    padding: 1px clamp(3px, 0.25vw, 5px) 1px 1px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 214, 255, 0.65) rgba(0, 10, 14, 0.35);
}

.module-inventory-list::-webkit-scrollbar,
#inventoryContent::-webkit-scrollbar {
    width: 8px;
}

.module-inventory-list::-webkit-scrollbar-track,
#inventoryContent::-webkit-scrollbar-track {
    background: rgba(0, 10, 14, 0.35);
    border-radius: 999px;
}

.module-inventory-list::-webkit-scrollbar-thumb,
#inventoryContent::-webkit-scrollbar-thumb {
    background: rgba(100, 214, 255, 0.65);
    border-radius: 999px;
}

/* =========================================================
   Lignes de modules
   ========================================================= */

.module-inventory-row {
    --module-row-accent: rgba(110, 222, 255, 0.72);
    position: relative;
    display: grid;
    grid-template-columns: clamp(42px, 3.1vw, 52px) minmax(0, 1fr) max-content;
    align-items: center;
    gap: clamp(7px, 0.5vw, 10px);
    min-width: 0;
    min-height: clamp(54px, 3.7vw, 66px);
    padding: clamp(6px, 0.45vw, 8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: rgba(245, 252, 255, 0.94);
    background:
        linear-gradient(90deg, rgba(12, 51, 65, 0.76), rgba(2, 18, 26, 0.46)),
        radial-gradient(circle at 0% 50%, rgba(70, 218, 255, 0.10), transparent 52%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 18px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    user-select: none;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.module-inventory-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: var(--module-row-accent);
    opacity: 0.55;
}

.module-inventory-row:hover,
.module-inventory-row:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(126, 235, 255, 0.36);
    background:
        linear-gradient(90deg, rgba(18, 70, 88, 0.86), rgba(4, 27, 38, 0.58)),
        radial-gradient(circle at 0% 50%, rgba(70, 218, 255, 0.18), transparent 52%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 10px 22px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(70, 218, 255, 0.10);
    outline: none;
}

.module-inventory-row.is-selected {
    border-color: rgba(255, 224, 122, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 10px 24px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(255, 224, 122, 0.18),
        0 0 18px rgba(255, 224, 122, 0.10);
}

.module-inventory-row.is-not-owned {
    color: rgba(205, 224, 230, 0.64);
    background:
        linear-gradient(90deg, rgba(15, 34, 42, 0.62), rgba(3, 14, 20, 0.42)),
        radial-gradient(circle at 0% 50%, rgba(135, 170, 180, 0.06), transparent 52%);
}

.module-inventory-row.is-equipped {
    --module-row-accent: rgba(255, 190, 78, 0.92);
    border-color: rgba(255, 196, 93, 0.40);
    background:
        linear-gradient(90deg, rgba(55, 42, 14, 0.78), rgba(5, 23, 29, 0.52)),
        radial-gradient(circle at 0% 50%, rgba(255, 184, 70, 0.14), transparent 54%);
}

.module-inventory-row.is-equipped.is-selected {
    border-color: rgba(255, 224, 122, 0.74);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 10px 24px rgba(0, 0, 0, 0.24),
        0 0 0 1px rgba(255, 224, 122, 0.24),
        0 0 20px rgba(255, 184, 70, 0.16);
}

.module-inventory-row.is-draggable,
.module-inventory-rarity.is-draggable {
    cursor: grab;
}

.module-inventory-row.is-draggable:active,
.module-inventory-rarity.is-draggable:active {
    cursor: grabbing;
}

.module-inventory-icon-wrap {
    width: clamp(42px, 3.1vw, 52px);
    height: clamp(42px, 3.1vw, 52px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    background:
        radial-gradient(circle at 45% 35%, rgba(255, 255, 255, 0.12), transparent 46%),
        rgba(0, 12, 18, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -10px 18px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.module-inventory-icon-wrap img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    transform: translateZ(0);
}

.module-inventory-row.is-not-owned .module-inventory-icon-wrap img {
    filter: grayscale(1) saturate(0.15) brightness(0.62) opacity(0.70);
}

.module-inventory-texts {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.module-inventory-name,
.module-inventory-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Oxanium", Arial, sans-serif;
}

.module-inventory-name {
    font-size: clamp(12px, 0.78vw, 15px);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.module-inventory-status-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.module-inventory-status-line .module-inventory-status {
    flex: 0 1 auto;
}

.module-inventory-status {
    font-size: clamp(10px, 0.62vw, 12px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(135, 232, 255, 0.82);
}

.module-inventory-row.is-not-owned .module-inventory-status {
    color: rgba(210, 225, 230, 0.48);
}

.module-inventory-equipped-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 17px;
    padding: 0 7px;
    border: 1px solid rgba(255, 203, 96, 0.44);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(105, 68, 13, 0.74), rgba(40, 22, 4, 0.58));
    color: rgba(255, 226, 154, 0.96);
    font-family: "Oxanium", Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        0 0 10px rgba(255, 184, 70, 0.12);
}

/* =========================================================
   Pastilles de rareté
   ========================================================= */

.module-inventory-rarities {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: clamp(5px, 0.32vw, 7px);
    min-width: max-content;
}

.module-inventory-rarity {
    --rarity-color: rgba(210, 220, 225, 0.72);
    position: relative;
    appearance: none;
    width: clamp(17px, 0.95vw, 21px);
    min-width: clamp(17px, 0.95vw, 21px);
    height: clamp(29px, 1.65vw, 34px);
    min-height: clamp(29px, 1.65vw, 34px);
    flex: 0 0 clamp(17px, 0.95vw, 21px);
    padding: 0;
    border: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    overflow: visible;
    transition: transform 110ms ease, filter 110ms ease, opacity 110ms ease;
}

.module-inventory-rarity:hover,
.module-inventory-rarity:focus-visible {
    transform: translateY(-1px) scale(1.08);
    filter: brightness(1.16);
    outline: none;
}

.module-inventory-rarity.common {
    --rarity-color: #d7dde2;
}

.module-inventory-rarity.uncommon {
    --rarity-color: #43d577;
}

.module-inventory-rarity.rare {
    --rarity-color: #45a9ff;
}

.module-inventory-rarity.epic {
    --rarity-color: #b266ff;
}

.module-inventory-rarity.legendary {
    --rarity-color: #ff4e4e;
}

.module-inventory-rarity.unique {
    --rarity-color: #ff9f2d;
}

.module-inventory-rarity-dot {
    flex: 0 0 auto;
    width: clamp(13px, 0.78vw, 17px);
    height: clamp(13px, 0.78vw, 17px);
    border: 1px solid color-mix(in srgb, var(--rarity-color) 72%, rgba(255, 255, 255, 0.22));
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.56), transparent 30%),
        linear-gradient(180deg, var(--rarity-color), rgba(0, 0, 0, 0.38));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 0 0 1px rgba(0, 0, 0, 0.30),
        0 0 8px rgba(255, 255, 255, 0.08);
}

.module-inventory-rarity-count {
    min-height: 9px;
    margin-top: 2px;
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(8px, 0.50vw, 10px);
    font-weight: 900;
    line-height: 1;
    color: rgba(232, 251, 255, 0.92);
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.90),
        0 0 6px rgba(84, 218, 255, 0.22);
    pointer-events: none;
}

.module-inventory-rarity.is-missing:not(.is-selected) {
    --rarity-color: rgba(142, 160, 166, 0.72) !important;
    opacity: 0.68;
    filter: grayscale(1) saturate(0.12) brightness(0.72);
}

.module-inventory-rarity.is-missing.is-selected {
    opacity: 1;
    filter: brightness(1.08) saturate(1.05);
}

.module-inventory-rarity.is-selected .module-inventory-rarity-dot {
    border-color: rgba(255, 244, 190, 0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 0 0 2px rgba(255, 228, 128, 0.38),
        0 0 14px var(--rarity-color);
}

.module-inventory-rarity.is-equipped .module-inventory-rarity-dot {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        0 0 0 1px rgba(255, 214, 112, 0.72),
        0 0 12px rgba(255, 184, 70, 0.28);
}

.module-inventory-rarity.is-equipped::after {
    content: "";
    position: absolute;
    right: 1px;
    top: 0;
    z-index: 2;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #ffd56b;
    box-shadow: 0 0 8px rgba(255, 213, 107, 0.85);
}

/* =========================================================
   Switch Objets / Modules
   ========================================================= */

.inventory-view-switcher {
    position: relative;
    z-index: 80;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: clamp(34px, 2.15vw, 42px) minmax(94px, 1fr) clamp(34px, 2.15vw, 42px);
    align-items: center;
    gap: clamp(6px, 0.42vw, 9px);
    width: min(100%, 260px);
    max-width: calc(100% - 10px);
    margin: clamp(4px, 0.35vw, 8px) auto 0 auto;
    padding: 5px;
    border: 1px solid rgba(110, 225, 255, 0.20);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(11, 60, 77, 0.88), rgba(3, 22, 32, 0.80)),
        radial-gradient(circle at 50% 0%, rgba(110, 225, 255, 0.16), transparent 56%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.22);
}

#inventoryContent[data-inventory-view="items"] .inventory-view-switcher,
#inventoryContent[data-inventory-view="items"] .inventory-view-switcher.is-floating {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.inventory-view-arrow,
.inventory-view-label {
    appearance: none;
    height: clamp(30px, 1.95vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(0, 13, 20, 0.44);
    color: rgba(239, 252, 255, 0.96);
    cursor: pointer;
    font-family: "Oxanium", Arial, sans-serif;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.inventory-view-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: clamp(24px, 1.55vw, 31px);
    line-height: 1;
}

.inventory-view-label {
    min-width: 0;
    padding: 0 12px;
    font-size: clamp(11px, 0.72vw, 14px);
    white-space: nowrap;
}

.inventory-view-arrow:hover,
.inventory-view-label:hover,
.inventory-view-arrow:focus-visible,
.inventory-view-label:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(111, 226, 255, 0.44);
    background: rgba(11, 75, 96, 0.68);
    color: #ffffff;
    outline: none;
}

/* =========================================================
   Détails et états vides
   ========================================================= */

.module-inventory-empty-list,
.module-inventory-empty-details {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 18px;
    text-align: center;
    font-family: "Oxanium", Arial, sans-serif;
    color: rgba(226, 244, 250, 0.72);
}

.module-inventory-empty-title {
    font-size: clamp(18px, 1.2vw, 24px);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.module-inventory-empty-desc {
    max-width: 360px;
    margin-top: 8px;
    font-size: clamp(12px, 0.75vw, 14px);
    line-height: 1.4;
    color: rgba(180, 225, 238, 0.72);
}

.module-inventory-owned-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 8px 0 10px 0;
    padding: 6px 10px;
    border: 1px solid rgba(255, 92, 92, 0.40);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(82, 12, 18, 0.64), rgba(25, 3, 7, 0.50)),
        radial-gradient(circle at 0% 50%, rgba(255, 92, 92, 0.18), transparent 54%);
    color: rgba(255, 185, 185, 0.96);
    font-family: "Oxanium", Arial, sans-serif;
    font-size: clamp(11px, 0.68vw, 13px);
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 0 16px rgba(255, 72, 72, 0.10);
}

.module-inventory-owned-banner.is-equipped {
    border-color: rgba(255, 203, 96, 0.44);
    background:
        linear-gradient(180deg, rgba(98, 64, 12, 0.66), rgba(32, 18, 4, 0.52)),
        radial-gradient(circle at 0% 50%, rgba(255, 190, 72, 0.18), transparent 54%);
    color: rgba(255, 226, 154, 0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 0 16px rgba(255, 184, 70, 0.12);
}

.module-inventory-owned-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ff4b4b;
    box-shadow: 0 0 10px rgba(255, 75, 75, 0.72);
}

.module-inventory-owned-banner.is-equipped .module-inventory-owned-dot {
    background: #ffd56b;
    box-shadow: 0 0 10px rgba(255, 213, 107, 0.78);
}

#itemDetails.module-inventory-details-preview .item-card {
    opacity: 0.98;
}

#itemDetails.is-module-not-owned > img {
    filter: grayscale(0.75) saturate(0.45) brightness(0.76);
}

/* =========================================================
   Drag & drop / surbrillance des slots équipés
   ========================================================= */

.equipment-slot.module-inventory-drag-over,
.equipment-slot.highlight.module-inventory-drag-over {
    box-shadow:
        inset 0 0 0 2px rgba(108, 229, 255, 0.78),
        0 0 16px rgba(76, 213, 255, 0.34),
        0 0 28px rgba(76, 213, 255, 0.16);
}

.equipment-slot.module-inventory-equipped-hover::after {
    content: none !important;
}

.equipment-slot.active-weapon.module-inventory-equipped-hover::after {
    content: "" !important;
    position: absolute !important;
    inset: auto !important;
    width: 90% !important;
    height: 90% !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(26, 31, 34, 1) !important;
    box-shadow: none !important;
    z-index: 2 !important;
}

.equipment-slot.module-inventory-equipped-hover,
.equipment-slot.highlight.module-inventory-equipped-hover {
    outline: 2px solid rgba(255, 230, 140, 0.90) !important;
    outline-offset: 3px !important;
    box-shadow:
        0 0 0 1px rgba(255, 230, 140, 0.42),
        0 0 16px rgba(255, 203, 83, 0.62),
        0 0 34px rgba(255, 170, 45, 0.34) !important;
    filter: brightness(1.15) saturate(1.10);
    animation: none !important;
    transform: none !important;
}

/* =========================================================
   Responsive
   ========================================================= */

@container (max-width: 405px) {
    .module-inventory-tools {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .module-inventory-owned-filter {
        justify-self: start;
        width: fit-content;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 1700px), (max-height: 900px) {
    .module-inventory-panel {
        height: var(--module-inventory-target-height, clamp(270px, 38vh, 450px));
        min-height: var(--module-inventory-target-height, clamp(270px, 38vh, 450px));
        max-height: var(--module-inventory-target-height, min(51vh, 520px));
    }

    .module-inventory-row {
        min-height: 50px;
    }

    .module-inventory-icon-wrap {
        width: 40px;
        height: 40px;
    }
}

@media (max-height: 760px) {
    #inventoryContent {
        gap: 6px;
    }

    .module-inventory-panel {
        height: min(var(--module-inventory-target-height, 360px), calc(100vh - 220px));
        min-height: min(var(--module-inventory-target-height, 360px), calc(100vh - 220px));
        max-height: min(var(--module-inventory-target-height, 430px), calc(100vh - 220px));
        padding: 6px;
        border-radius: 13px;
    }

    .module-inventory-tools {
        row-gap: 6px;
        margin-bottom: 6px;
    }

    .module-inventory-search,
    .module-inventory-owned-filter {
        height: 28px;
    }

    .module-inventory-row {
        grid-template-columns: 36px minmax(0, 1fr) max-content;
        min-height: 44px;
        gap: 6px;
        padding: 5px;
        border-radius: 11px;
    }

    .module-inventory-icon-wrap {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .module-inventory-name {
        font-size: 12px;
    }

    .module-inventory-status {
        font-size: 10px;
    }

    .inventory-view-switcher {
        margin-top: 4px;
        padding: 4px;
    }

    .inventory-view-arrow,
    .inventory-view-label {
        height: 28px;
    }
}

@media (max-width: 1050px), (max-height: 600px) {
    #inventoryContent {
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 214, 255, 0.65) rgba(0, 10, 14, 0.35);
    }

    #inventoryContent[data-inventory-view="modules"] {
        --module-inventory-column-width: calc((var(--inv-cell, 50px) * 5) + (var(--inv-gap, 5px) * 4) + 12px);
    }

    .module-inventory-panel {
        height: min(var(--module-inventory-target-height, 330px), calc(100vh - 168px));
        min-height: min(210px, calc(100vh - 168px));
        max-height: min(var(--module-inventory-target-height, 430px), calc(100vh - 168px));
        padding: 5px;
    }

    .module-inventory-list {
        gap: 5px;
        padding-right: 3px;
    }

    .module-inventory-row {
        grid-template-columns: 32px minmax(0, 1fr) max-content;
        min-height: 42px;
        gap: 5px;
        padding: 5px;
        border-radius: 10px;
    }

    .module-inventory-icon-wrap {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .module-inventory-name {
        font-size: 11px;
    }

    .module-inventory-status {
        font-size: 9px;
    }

    .module-inventory-rarities {
        gap: 3px;
    }

    .module-inventory-rarity {
        width: 15px;
        min-width: 15px;
        height: 27px;
        min-height: 27px;
        flex-basis: 15px;
    }

    .module-inventory-rarity-dot {
        width: 11px;
        height: 11px;
    }

    .module-inventory-rarity-count {
        min-height: 8px;
        margin-top: 2px;
        font-size: 8px;
    }

    .inventory-view-switcher {
        margin-top: 8px !important;
    }

    #inventoryContent[data-inventory-view="items"] .inventory-view-switcher {
        width: 100% !important;
        max-width: 100% !important;
    }

    #inventoryContent[data-inventory-view="items"] .inventory-view-arrow,
    #inventoryContent[data-inventory-view="items"] .inventory-view-label {
        height: 30px;
    }
}

@media (max-width: 760px), (max-height: 560px) {
    #inventoryContent[data-inventory-view="modules"] {
        --module-inventory-column-width: calc((var(--inv-cell, 44px) * 5) + (var(--inv-gap, 4px) * 4) + 12px);
    }

    .module-inventory-tools {
        column-gap: 14px;
        row-gap: 6px;
    }

    .module-inventory-drag-hint,
    .module-inventory-equipped-badge {
        display: none;
    }
}

@media (max-width: 430px), (max-height: 560px) {
    .module-inventory-row {
        grid-template-columns: 30px minmax(0, 1fr) max-content;
        gap: 4px;
    }

    .module-inventory-icon-wrap {
        width: 30px;
        height: 30px;
    }

    .module-inventory-rarities {
        gap: 2px;
    }

    .module-inventory-rarity {
        width: 14px;
        min-width: 14px;
        flex-basis: 14px;
    }
}

@media (max-width: 1050px), (max-height: 600px) {
    .module-inventory-search-clear {
        right: 5px;
        width: 20px;
        height: 20px;
        font-size: 14px;
        line-height: 16px;
    }

    .module-inventory-search {
        padding-right: 30px;
    }
}
