/* --- Page header fixes --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.breadcrumbs {
    font-size: 13px;
    color: #9d9499;
    margin-bottom: 8px;
}
.breadcrumbs a {
    color: #9d9499;
    text-decoration: none;
}
.breadcrumbs a:hover { color: #ffd21c; }
.breadcrumbs a:after {
    content: ' › ';
    color: #555;
}
.notif-message {
    color: #9d9499;
    font-size: 14px;
    margin-bottom: 20px;
}

.upgrade-page {
    display: flex;
    gap: 20px;
    min-height: 700px;
}
.upgrade-panel {
    width: 380px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}
.upgrade-panel__title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffd21c;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.upgrade-panel__search {
    margin-bottom: 12px;
}
.upgrade-search {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}
.upgrade-search:focus {
    border-color: #ffd21c;
}
.upgrade-panel__items {
    flex: 1;
    overflow-y: auto;
    max-height: 550px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.upgrade-panel__items::-webkit-scrollbar { width: 6px; }
.upgrade-panel__items::-webkit-scrollbar-track { background: transparent; }
.upgrade-panel__items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.upgrade-panel__items::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Item cards --- */
.upgrade-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background .2s;
    border-left: 3px solid rgba(255,255,255,0.1);
    margin-bottom: 5px;
    background: rgba(0,0,0,0.25);
    position: relative;
}
/* Dota 2 rarity colors */
.upgrade-item.common    { border-left-color: #b0c3d9; }
.upgrade-item.uncommon  { border-left-color: #5e98d9; }
.upgrade-item.rare      { border-left-color: #4b69ff; }
.upgrade-item.mythical  { border-left-color: #8847ff; }
.upgrade-item.legendary { border-left-color: #d32ce6; }
.upgrade-item.immortal  { border-left-color: #e4ae33; }
.upgrade-item.arcana    { border-left-color: #ade55c; }
/* CS:GO fallback classes (not used in dota) */
.upgrade-item.milspec    { border-left-color: #4b69ff; }
.upgrade-item.restricted { border-left-color: #8847ff; }
.upgrade-item.classified { border-left-color: #d32ce6; }
.upgrade-item.covert     { border-left-color: #eb4b4b; }

.upgrade-item:hover { background: rgba(255,255,255,0.07); }

.upgrade-item.selected {
    background: rgba(255,210,28,0.1);
    border-left-width: 4px;
    padding-left: 9px;
}
.upgrade-item.hidden { display: none; }

.upgrade-item__image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    margin-right: 10px;
}
.upgrade-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.upgrade-item__info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.upgrade-item__name {
    font-size: 13px;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upgrade-item__name .stattrak { color: #cf6a32; font-weight: 700; }
.upgrade-item__desc {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upgrade-item__price {
    font-size: 14px;
    color: #ffd21c;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
}

/* --- Center zone --- */
.upgrade-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}
.upgrade-slot {
    width: 240px;
    height: 210px;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.upgrade-slot.filled { border-style: solid; }
.upgrade-slot--from.filled { border-color: #ffd21c; }
.upgrade-slot--to.filled   { border-color: #fff3d6; }

.upgrade-slot.slot-common    { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(176,195,217,.08)); }
.upgrade-slot.slot-uncommon  { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(94,152,217,.10)); }
.upgrade-slot.slot-milspec   { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(75,105,255,.10)); }
.upgrade-slot.slot-restricted { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(136,71,255,.10)); }
.upgrade-slot.slot-classified { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(211,44,230,.10)); }
.upgrade-slot.slot-covert    { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(235,75,75,.10)); }
.upgrade-slot.slot-rare      { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(255,215,0,.10)); }
.upgrade-slot.slot-immortal  { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(228,174,51,.10)); }
.upgrade-slot.slot-legendary { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(211,85,24,.10)); }
.upgrade-slot.slot-arcana    { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(173,229,92,.10)); }
.upgrade-slot.slot-mythical  { background: linear-gradient(180deg, rgba(0,0,0,.3) 40%, rgba(136,71,255,.10)); }

.upgrade-slot__placeholder { color: rgba(255,255,255,0.2); font-size: 15px; text-align: center; }
.upgrade-slot__item { text-align: center; padding: 14px; position: relative; }
.upgrade-slot__item img { width: 120px; height: 120px; object-fit: contain; position: relative; z-index: 1; }
.upgrade-slot__rarity-glow {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    width: 100px; height: 100px; border-radius: 50%;
    filter: blur(25px); opacity: .3; z-index: 0;
}
.upgrade-slot__rarity-glow.glow-common    { background: #b0c3d9; }
.upgrade-slot__rarity-glow.glow-uncommon  { background: #5e98d9; }
.upgrade-slot__rarity-glow.glow-milspec   { background: #4b69ff; }
.upgrade-slot__rarity-glow.glow-restricted { background: #8847ff; }
.upgrade-slot__rarity-glow.glow-classified { background: #d32ce6; }
.upgrade-slot__rarity-glow.glow-covert    { background: #eb4b4b; }
.upgrade-slot__rarity-glow.glow-rare      { background: #ffd700; }
.upgrade-slot__rarity-glow.glow-immortal  { background: #e4ae33; }
.upgrade-slot__rarity-glow.glow-legendary { background: #d35518; }
.upgrade-slot__rarity-glow.glow-arcana    { background: #ade55c; }
.upgrade-slot__rarity-glow.glow-mythical  { background: #8847ff; }

.upgrade-slot__item-name  { font-size: 13px; color: #ddd; margin-top: 6px; }
.upgrade-slot__item-price { font-size: 15px; color: #ffd21c; font-weight: 700; margin-top: 3px; }
.upgrade-slot__multi { text-align: center; padding: 10px; }
.upgrade-slot__multi-count { font-size: 13px; color: #aaa; margin-bottom: 6px; }
.upgrade-slot__multi-total { font-size: 17px; color: #ffd21c; font-weight: 700; }
.upgrade-slot__multi-images { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 6px; }
.upgrade-slot__multi-images img { width: 48px; height: 48px; object-fit: contain; }

/* --- Chance ring --- */
.upgrade-chance { position: relative; width: 150px; height: 150px; }
.upgrade-chance__ring { width: 100%; height: 100%; }
.upgrade-chance__fill { transition: stroke-dashoffset .5s ease, stroke .3s ease; }
.upgrade-chance__text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 26px; font-weight: 700; color: #fff; }

@keyframes upgrade-fill-spin {
    0%   { transform: rotate(-90deg); }
    50%  { transform: rotate(270deg); }
    100% { transform: rotate(630deg); }
}
.upgrade-chance.spinning .upgrade-chance__fill {
    animation: upgrade-fill-spin 2s cubic-bezier(.4,0,.2,1);
    transform-origin: 60px 60px;
}

/* --- Upgrade button --- */
.upgrade-btn {
    background: url(../images/btn-open.png) no-repeat center;
    background-size: 100% 100%;
    color: #fff3d6;
    border: none;
    padding: 0;
    width: 220px;
    height: 57px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1px;
    transition: filter .2s;
    font-family: inherit;
}
.upgrade-btn:disabled { opacity: .4; cursor: default; }
.upgrade-btn:not(:disabled):hover { filter: brightness(1.15); }
.upgrade-btn--repeat {
    background: url(../images/btn-profile.png) no-repeat center;
    background-size: 100% 100%;
    width: 139px;
    height: 57px;
}
.upgrade-btn--sell {
    background: url(../images/btn-profile.png) no-repeat center;
    background-size: 100% 100%;
    width: 139px;
    height: 57px;
    font-size: 12px;
}

/* --- Result overlay --- */
.upgrade-result {
    position: absolute;
    inset: 0;
    background: rgba(10,11,15,.95);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.upgrade-result__content { text-align: center; }
.upgrade-result__title { font-size: 28px; font-weight: 700; text-transform: uppercase; margin-bottom: 12px; }
.upgrade-result__title.win  { color: #ffd21c; }
.upgrade-result__title.lose { color: #9d9499; }
.upgrade-result__image img  { width: 160px; height: 160px; object-fit: contain; }
.upgrade-result__name  { font-size: 15px; color: #ddd; margin-top: 10px; }
.upgrade-result__price { font-size: 18px; color: #ffd21c; font-weight: 700; margin-top: 4px; }
.upgrade-result__autosold { font-size: 12px; color: #9d9499; margin-top: 6px; }
.upgrade-result__actions { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.upgrade-empty { color: #9d9499; text-align: center; padding: 20px; font-size: 14px; }
.upgrade-empty a { color: #ffd21c; }

/* --- Auth message --- */
.upgrade-auth-message { text-align: center; padding: 60px 20px; }
.upgrade-auth-message__text { font-size: 18px; color: #9d9499; margin-bottom: 20px; }
.upgrade-auth-message__buttons { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upgrade-auth-message__buttons a {
    display: block; width: 225px; height: 55px; line-height: 53px;
    color: #fff; text-decoration: none; font-size: 13px; font-weight: 600;
    text-transform: uppercase; font-family: inherit; padding-left: 60px;
    background-repeat: no-repeat; background-position: center;
}
.upgrade-auth-message__buttons .btn-steam {
    background-image: url(../images/btn-steam.png);
    background-size: 100% 100%;
    padding-left: 0; text-align: center;
}
.upgrade-auth-message__buttons .btn-vk {
    background-image: url(../images/btn-vk.png);
    background-size: 100% 100%;
    padding-left: 0; text-align: center;
}
.upgrade-auth-message__buttons .ico { display: none; }

@media (max-width: 1024px) {
    .upgrade-page { flex-direction: column; }
    .upgrade-panel { width: 100%; }
    .upgrade-panel__items { max-height: 300px; }
    .upgrade-center { gap: 15px; }
    .upgrade-slot { width: 80%; max-width: 280px; height: auto; min-height: 180px; overflow: visible; }
    .upgrade-slot__item img { width: 100px; height: 100px; }
    .upgrade-chance { width: 120px; height: 120px; }
    .upgrade-btn { width: 180px; font-size: 12px; }
}
