.item-quality-gray { --equipment-color: #999999; }
.equipment-enhancement-white, .item-quality-white { --equipment-color: #ffffff; }
.equipment-enhancement-green, .item-quality-green { --equipment-color: #00ff00; }
.equipment-enhancement-blue, .item-quality-blue { --equipment-color: #00ffff; }
.equipment-enhancement-purple, .item-quality-purple { --equipment-color: #ff00ff; }
.equipment-enhancement-orange, .item-quality-orange { --equipment-color: #ff7108; }
.equipment-enhancement-gold, .item-quality-gold { --equipment-color: #ffff00; }
.equipment-enhancement-five, .item-quality-five { --equipment-color: #ffff00; }
.equipment-name { color: var(--equipment-color, inherit); overflow-wrap: anywhere; text-shadow: 1px 1px 0 #000; }
/* Match the approved demo's five-color lettering without replacing the text's scroll animation. */
.equipment-name.equipment-enhancement-five, .equipment-name.item-quality-five {
  background-image: linear-gradient(90deg, #ff9dac, #ffe95a 26%, #87ffc1 50%, #82eaff 72%, #e0aaff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.equipment-icon { --item-icon-size: 22px; position: relative; display: inline-flex; flex: 0 0 auto; width: calc(var(--item-icon-size) + 4px); height: calc(var(--item-icon-size) + 4px); align-items: center; justify-content: center; box-sizing: border-box; vertical-align: middle; isolation: isolate; }
.equipment-tier-art { display: block; width: var(--item-icon-size, 22px); height: var(--item-icon-size, 22px); object-fit: contain; image-rendering: pixelated; }
.equipment-icon::after { content: ""; position: absolute; width: var(--item-icon-size); height: var(--item-icon-size); left: 2px; top: 2px; background-image: url('./assets/item-quality/frames.png?v=20261017'); background-repeat: no-repeat; background-size: calc(var(--item-icon-size) * 6) calc(var(--item-icon-size) * 5); background-position-x: 0; image-rendering: pixelated; pointer-events: none; z-index: 1; }
.item-frame-white::after { background-position-y: 0; }
.item-frame-green::after { background-position-y: calc(var(--item-icon-size) * -1); }
.item-frame-blue::after { background-position-y: calc(var(--item-icon-size) * -2); }
.item-frame-purple::after { background-position-y: calc(var(--item-icon-size) * -3); }
.item-frame-orange::after, .item-frame-gold::after { background-position-y: calc(var(--item-icon-size) * -4); }
.item-frame-five::after { background-position-y: calc(var(--item-icon-size) * -4); }
.equipment-sparkling::after { animation: item-native-frames 300ms steps(6, end) infinite; }
/* Use the native RGBA frame with a yellow hue for +15..+19. */
.item-frame-gold::after { filter: hue-rotate(33deg); }
/* User-confirmed+20: keep the native+12 RGBA flare and animate hue only, never an alpha mask. */
.item-frame-five.equipment-sparkling::after { opacity: 1; animation: item-native-frames 300ms steps(6, end) infinite, item-five-color-hues 2400ms linear infinite; }
.apk-item-detail h3.equipment-name, .apk-item-detail h3 .equipment-name { color: var(--equipment-color, inherit); }
@keyframes item-native-frames { to { background-position-x: calc(var(--item-icon-size) * -6); } }
@keyframes item-five-color-hues { 0% { filter: hue-rotate(-26deg); } 20% { filter: hue-rotate(34deg); } 40% { filter: hue-rotate(94deg); } 60% { filter: hue-rotate(174deg); } 80% { filter: hue-rotate(254deg); } 100% { filter: hue-rotate(334deg); } }
@media (prefers-reduced-motion: reduce) { .equipment-sparkling::after { animation: none; } }
@media (prefers-reduced-motion: reduce) { .item-frame-five.equipment-sparkling::after { animation: none; filter: hue-rotate(34deg); } }

/* Long Nhân keeps the original high-resolution bag art and the native purple frame animation. */
.item-long-nhan-bag > *{filter:hue-rotate(230deg) saturate(1.35);}
.item-long-nhan-bag::before{content:"";position:absolute;inset:2px;pointer-events:none;z-index:-1;box-shadow:0 0 5px 1px #c254ff;animation:long-nhan-bag-glow 1.6s ease-in-out infinite;}
@keyframes long-nhan-bag-glow{50%{box-shadow:0 0 9px 2px #df86ff;}}
@media(prefers-reduced-motion:reduce){.item-long-nhan-bag::before{animation:none;}}

.martial-manual-ink { color: #ff00ff; animation: martial-manual-ink 1.2s ease-in-out infinite; }
@keyframes martial-manual-ink { 50% { color: #ffa3ff; } }
@media (prefers-reduced-motion: reduce) { .martial-manual-ink { animation: none; } }
