.item-slot{
    position:relative;
    z-index:0;
    width:32px;
    height:32px;
    display:inline-block;
    box-sizing:border-box;
    margin:2px;
    overflow:visible;
}
.item-slot img{
    position:relative;
    z-index:1;
    width:100%;
    height:100%;
    display:block;
    pointer-events:none;
}

/* liczba ulepszenia */
.upgrade{
    position:absolute;
    top:-1px;
    right:0;
    margin-top:1px;
    margin-right:2px;
    z-index:2;
    color:#fff;
    font-weight:900;
    line-height:1;
    letter-spacing:0;
    padding:0;

    /* ostra, pikselowa obwódka */
    text-shadow:
        -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000,
        -1px -1px #000, 1px -1px #000, -1px 1px #000, 1px 1px #000;

    -webkit-font-smoothing:none;
    text-rendering:optimizeSpeed;
}

/* cały badge na zielono gdy corrupted */
.upgrade.corrupt{ color:#00ff2a; }

/* literka C pod liczbą – dziedziczy kolor i stroke */
.corrupt-flag{
    display:block;
    font-weight:900;
    font-size:0.85em;  /* skaluje się względem liczby */
    line-height:1;
    margin-top:-1px;   /* lekko podsuwa pod +10 */
    color:inherit;
    text-shadow:
        -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000,
        -1px -1px #000, 1px -1px #000, -1px 1px #000, 1px 1px #000;
}

.rarity-0{box-shadow:none}
.rarity-1{box-shadow:0 0 6px 2px #00cc00}
.rarity-2{box-shadow:0 0 6px 2px #0070dd}
.rarity-3{box-shadow:0 0 6px 2px #a335ee}
.rarity-4{box-shadow:0 0 6px 2px #ffcc00}
.rarity-5{box-shadow:0 0 6px 2px rgba(255,0,0,.7)}
.rarity-6{
    position:relative;
    border-width:1px;
    border-style:solid;
    border-color:transparent;
    border-image: conic-gradient(from 0deg,#0070dd,#ff0000,#ffcc00,#a335ee,#00cc00,#0070dd) 1/1/0 stretch;
    border-radius:1px;
    background-image:url(/images/items/no_necklace.gif);
    z-index:0; /* stacking context dla ::before */
}

/* Poświata ZA elementem */
.rarity-6::before{
    content:"";
    position:absolute;
    top:-2px;
    left:-2px;
    right:-2px;
    bottom:-2px;
    background: conic-gradient(from 0deg,#0070dd,#ff0000,#ffcc00,#a335ee,#00cc00,#0070dd);
    filter: blur(2px);
    z-index:-1;         /* pod ramką i ikoną */
    pointer-events:none;
}

/* Ramka graficzna nakładana NAD glowem, POD ikoną */
.item-slot::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("/images/equipment-frame.png") no-repeat center center / 40px 40px;
    z-index: 0;           /* nad glowem (który ma -1), pod obrazkiem */
    pointer-events: none;
}

.item-tooltip-body .item-owner {
    color: #FFA500 !important;
}

.tooltip.tooltip-item .tooltip-arrow{display:none}
.tooltip.tooltip-item .tooltip-inner{
    display:inline-block;
    width:auto;
    min-width: 260px;
    max-width: min(600px, 90vw);
    padding:2px 2px 6px 2px;
    background: transparent;
    backdrop-filter: none;
    color:#fff;

    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: -0.15px;
    line-height: 1.15;

    text-align:left;
    border-width:16px;
    border-style:solid;
    border-image-source:url('/images/item_tooltip_frame.png');
    border-image-slice:16 fill;
    border-image-repeat:stretch;

    text-shadow:-0.5px -0.5px 0 #000,
                0.5px -0.5px 0 #000,
                -0.5px 0.5px 0 #000,
                0.5px 0.5px 0 #000;

    max-height:calc(100vh - 40px);
    overflow-y:auto;

    font-smooth: never;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    image-rendering: pixelated;
}

.item-tooltip-header{
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0 10px;
}

.item-tooltip-header::before{
    display: none;
}

.item-tooltip-header-left,
.item-tooltip-header-center,
.item-tooltip-header-right{
    white-space:nowrap
}

.item-tooltip-header-left{
    grid-column: 1;
    font-size: 11px;
    text-align: left;
    white-space: nowrap;
    position: static;
}
.item-tooltip-header-center{
    grid-column: 2;
    text-align: center;
    font-weight: bold;
    align-self: flex-start;
    white-space: normal;
    min-width: 0;
}
.item-tooltip-header-right{
    grid-column: 3;
    position: static;
}

.item-icon{ display:block; width:32px; height:32px; }
.item-icon img{ display:block; width:32px; height:32px; }

.item-tooltip-body{margin-top:4px;text-align:center;line-height:1.2}
.item-stat{display:block;color:#fff;margin:1px 0}

.rarity-text-0{color:#fff}
.rarity-text-1{color:#0f0}
.rarity-text-2{color:#0070dd}
.rarity-text-3{color:#a335ee}
.rarity-text-4{color:#ffcc00}
.rarity-text-5{color:#f00}
.rarity-text-6{color:#FF69B4}

.item-name-wrapper {
    display: inline-block;
    text-align: center;
    width: 100%;
}
.item-name{display:block;margin:0;padding:0;line-height:1}

.item-require{color:#abface;text-align:center;margin-top:2px}
.item-tooltip-separator{height:1px;background:#fff;margin:6px auto;width:100px}
.item-weight{color:#fff}

.item-corruption-block{margin-top:2px;text-align:center;line-height:1.2}
.item-corruption-title{color:#008000}
.item-corruption-positive{color:#32CD32}
.item-corruption-negative{color:#D0312D}

.item-description{color:#AF9CFF;text-align:center;margin-top:4px}

.item-bonuses { margin-top:4px; text-align:center; line-height:1.2; }
.item-bonus    { display:block; color:#ffbb22; }
.item-bonus-max{ display:block; color:#22ffbb; }

.tooltip.tooltip-item {
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
  pointer-events: none;           /* nie "kradnie" hovera ze slotu */
  z-index: 2147483647 !important; /* ponad wszystko */
}