/* второстепенный текст приглушаем прозрачностью, а не цветом */
.live-case-row .live-case-sub,
.live-case-row .live-case-time {
    color: #FFFFFF;
    opacity: 0.65;
}

.live-case-row .live-case-prize,
.live-case-row .live-case-nick,
.live-case-row .live-case-user {
    color: #FFFFFF;
}

/* Виджет «Последние открытые кейсы».
   Карточка: сверху бейдж кейса, крупно приз, снизу игрок.
   Цвета берутся из темы через currentColor, акценты — по редкости приза. */

.live-cases-feed {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 10px;
    margin: 0 -2px;
    scroll-snap-type: x proximity;

    scrollbar-width: thin;
    scrollbar-color: #4d86d1 rgba(77, 134, 209, 0.15);
}

.live-cases-feed::-webkit-scrollbar {
    height: 8px;
}

.live-cases-feed::-webkit-scrollbar-track {
    background: rgba(77, 134, 209, 0.15);
    border-radius: 4px;
}

.live-cases-feed::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #4d86d1, #7aa9e6);
    border-radius: 4px;
}

/* --- карточка --- */
/* Цвет редкости лежит в переменной: из неё делаются фон, рамка, свечение
   и плашка кейса. Текст всегда белый, чтобы читался на любой заливке. */
.live-case-row {
    --rarity: #6b9bff;

    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 170px;
    width: 170px;
    padding: 16px 12px 12px;
    border: 1px solid var(--rarity);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    color: #FFFFFF;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--rarity) 55%, transparent) 0%,
            color-mix(in srgb, var(--rarity) 12%, transparent) 45%,
            color-mix(in srgb, var(--rarity) 45%, transparent) 100%),
        rgba(0, 0, 0, 0.35);
    scroll-snap-align: start;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.live-case-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px -6px var(--rarity);
}

/* --- бейдж с названием кейса --- */
.live-case-name {
    display: block;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 5px 14px;
    border: 1px solid color-mix(in srgb, var(--rarity) 80%, white);
    border-radius: 20px;
    background: color-mix(in srgb, var(--rarity) 65%, transparent);
    box-shadow: 0 0 14px -3px var(--rarity);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-case-name:hover {
    color: #FFFFFF;
    text-decoration: none;
    background: color-mix(in srgb, var(--rarity) 85%, transparent);
}

/* --- приз --- */
.live-case-prize {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.live-case-sub {
    font-size: 11px;
    opacity: 0.6;
    line-height: 1.3;
}

/* --- игрок --- */
.live-case-user {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px 8px;
    width: 100%;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(119, 119, 119, 0.2);
    text-align: center;
    min-width: 0;
}

.live-case-user:hover {
    text-decoration: none;
}

.live-case-user img {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
}

/* ник справа от аватара, дата — строкой ниже на всю ширину */
.live-case-nick {
    max-width: calc(100% - 38px);
}

.live-case-time {
    flex: 0 0 100%;
    margin-top: 1px;
}

.live-case-nick {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* дата — отдельной строкой под ником */
.live-case-time {
    display: block;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    color: inherit;
    opacity: 0.55;
}

/* цвет редкости */
.live-case-row.gold { --rarity: #e0a83a; }
.live-case-row.mythic { --rarity: #7d5cff; }
.live-case-row.legendary { --rarity: #e8873a; }
.live-case-row.orange { --rarity: #e0703a; }
.live-case-row.pink { --rarity: #d94d9e; }
.live-case-row.red { --rarity: #d64545; }
.live-case-row.yellow { --rarity: #d4b53a; }
.live-case-row.purple { --rarity: #7d5cd6; }
.live-case-row.blue { --rarity: #4d7dd6; }
.live-case-row.green { --rarity: #46b062; }
.live-case-row.teal { --rarity: #35a89f; }
.live-case-row.military { --rarity: #3a6bc4; }

/* появление новых записей */
@keyframes liveCaseIn {
    from { opacity: 0; transform: translateX(-16px) scale(0.94); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.live-case-row.is-new {
    animation: liveCaseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.live-cases-feed.is-fresh .live-case-row {
    animation: liveCaseIn 0.4s ease both;
}

.live-cases-feed.is-fresh .live-case-row:nth-child(1) { animation-delay: 0.02s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(2) { animation-delay: 0.06s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(3) { animation-delay: 0.10s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(4) { animation-delay: 0.14s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(5) { animation-delay: 0.18s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(6) { animation-delay: 0.22s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(7) { animation-delay: 0.26s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(8) { animation-delay: 0.30s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(9) { animation-delay: 0.34s; }
.live-cases-feed.is-fresh .live-case-row:nth-child(10) { animation-delay: 0.38s; }

@media (max-width: 575px) {
    .live-case-row {
        flex-basis: 150px;
        width: 150px;
    }
}
