/* ====================================
   СТРАНИЦА КЕЙСОВ - СТИЛИ
   ==================================== */

/* ========================================
   ТАЙМЕР ПРЕДМЕТОВ (инвентарь, cases.html)
   ======================================== */
.item-timer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    margin-top: 4px;
    transition: background 0.4s;
}
.item-timer--ok       { background: rgba(76,175,80,0.12);  color: #2e7d32; border: 1px solid rgba(76,175,80,0.25); }
.item-timer--warning  { background: rgba(255,152,0,0.13);  color: #e65100; border: 1px solid rgba(255,152,0,0.3);  animation: casesTimerWarn 2s ease-in-out infinite; }
.item-timer--critical { background: rgba(244,67,54,0.12);  color: #c62828; border: 1px solid rgba(244,67,54,0.3);  animation: casesTimerCrit 1s ease-in-out infinite; }
@keyframes casesTimerWarn { 0%,100%{opacity:1} 50%{opacity:0.7} }
@keyframes casesTimerCrit { 0%,100%{opacity:1} 50%{opacity:0.45} }
.item-timer__icon  { flex-shrink:0; display:block; }
.item-timer__label { opacity:.75; }
.item-timer__value { font-weight:700; }

/* Основные цвета для редкости */
:root {
    --rarity-common: linear-gradient(135deg, #95a5a6, #7f8c8d);
    --rarity-rare: linear-gradient(135deg, #3498db, #2980b9);
    --rarity-epic: linear-gradient(135deg, #9b59b6, #8e44ad);
    --rarity-legendary: linear-gradient(135deg, #f39c12, #e67e22);
    
    --glow-common: rgba(149, 165, 166, 0.3);
    --glow-rare: rgba(52, 152, 219, 0.4);
    --glow-epic: rgba(155, 89, 182, 0.5);
    --glow-legendary: rgba(243, 156, 18, 0.6);
}

/* Баннер кейсов */
.cases-banner {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 50%, #2E7D32 100%);
    padding: 60px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.cases-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="white" fill-opacity="0.05" width="50" height="50"/></svg>');
    animation: bannerPattern 20s linear infinite;
}

@keyframes bannerPattern {
    0% { transform: translateX(0); }
    100% { transform: translateX(100px); }
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.banner-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.banner-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.banner-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 150px;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Баланс пользователя (legacy, не используется в новом хедере) */
.header__balance {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.coins-display svg {
    animation: coinSpin 3s linear infinite;
}

@keyframes coinSpin {
    0%, 90% { transform: rotateY(0deg); }
    95% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

/* Кнопка инвентаря в шапке */
.cases-header-inventory-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 44px;
    border: none;
    background: #f8f9fa;
    color: #1a1a1a;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.cases-header-inventory-btn:hover {
    background: #e9ecef;
}

.inventory-count {
    background: #4CAF50;
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Лента дропов */
.drops-feed {
    background: #f8f9fa;
    padding: 30px 0;
    overflow: hidden;
}

.drops-ticker {
    overflow: hidden;
    padding: 20px 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
}

.ticker-content {
    display: flex;
    gap: 30px;
    animation: tickerScroll 60s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.drop-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.drop-item[data-rarity="common"]::before { background: #95a5a6; }
.drop-item[data-rarity="rare"]::before { background: #3498db; }
.drop-item[data-rarity="epic"]::before { background: #9b59b6; }
.drop-item[data-rarity="legendary"]::before { background: #f39c12; }

.drop-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #4CAF50;
}

.drop-user {
    font-weight: 600;
    color: var(--text-dark);
}

.drop-text {
    color: var(--text-light);
}

.drop-item-name {
    font-weight: 600;
    color: var(--primary-color);
}

.drop-case {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Сетка кейсов */
.cases-list {
    padding: 60px 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Карточка кейса */
.case-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.case-card[data-rarity="common"]::before { background: var(--rarity-common); }
.case-card[data-rarity="rare"]::before { background: var(--rarity-rare); }
.case-card[data-rarity="epic"]::before { background: var(--rarity-epic); }
.case-card[data-rarity="legendary"]::before { background: var(--rarity-legendary); }

.case-card__image {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f5;
}

.case-card[data-rarity="common"] .case-card__image { background: linear-gradient(135deg, #ecf0f1, #bdc3c7); }
.case-card[data-rarity="rare"] .case-card__image { background: linear-gradient(135deg, #d6eaf8, #85c1e9); }
.case-card[data-rarity="epic"] .case-card__image { background: linear-gradient(135deg, #e8daef, #c39bd3); }
.case-card[data-rarity="legendary"] .case-card__image { background: linear-gradient(135deg, #fdebd0, #f8c471); }

.case-card__image img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
    animation: caseFloat 4s ease-in-out infinite;
}

@keyframes caseFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(-2deg); }
}

/* Заглушка для отсутствующего изображения */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(0, 0, 0, 0.45);
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
    padding: 20px;
}

.image-placeholder svg {
    opacity: 0.5;
    stroke: currentColor;
}

.case-card__rarity {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    backdrop-filter: blur(10px);
}

.case-card[data-rarity="common"] .case-card__rarity { background: rgba(149, 165, 166, 0.9); }
.case-card[data-rarity="rare"] .case-card__rarity { background: rgba(52, 152, 219, 0.9); }
.case-card[data-rarity="epic"] .case-card__rarity { background: rgba(155, 89, 182, 0.9); }
.case-card[data-rarity="legendary"] .case-card__rarity { background: rgba(243, 156, 18, 0.9); }

.case-card__content {
    padding: 20px;
}

.case-card__name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.case-card__description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    min-height: 40px;
}

.case-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.case-card__price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.case-card__price svg {
    width: 28px;
    height: 28px;
}

.case-card__btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-card__btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.case-card__btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Модальное окно открытия кейса */
.case-modal .modal__content {
    max-width: 900px;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.case-opening__title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: var(--rarity-legendary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Рулетка — CS:GO тёмная тема */
.case-roulette {
    position: relative;
    height: 212px;
    margin: 28px 0;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(160deg, #0c1824 0%, #192636 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Градиентные заглушки по краям */
.case-roulette::before,
.case-roulette::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 180px;
    z-index: 15;
    pointer-events: none;
}
.case-roulette::before {
    left: 0;
    background: linear-gradient(to right, #0c1824 0%, transparent 100%);
}
.case-roulette::after {
    right: 0;
    background: linear-gradient(to left, #0c1824 0%, transparent 100%);
}

.roulette-pointer {
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 3px;
    background: #f39c12;
    transform: translateX(-50%);
    z-index: 20;
    box-shadow: 0 0 20px rgba(243,156,18,1), 0 0 44px rgba(243,156,18,0.35);
}
.roulette-pointer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 15px solid #f39c12;
}
.roulette-pointer::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 15px solid #f39c12;
}

.roulette-track {
    display: flex;
    gap: 10px;          /* ITEM_WIDTH = 150px + 10px gap = 160px (совпадает с JS) */
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -88px;  /* -половина высоты ячейки (176px) */
    will-change: transform;
    /* transition управляется через JS */
}

/* Ячейки рулетки — тёмные, с цветом по редкости */
.roulette-item {
    flex-shrink: 0;
    width: 150px;
    height: 176px;
    border-radius: 10px;
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1.5px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.roulette-item[data-rarity="common"]    { background: linear-gradient(150deg,#242424,#2d2d2d); border-color:rgba(149,165,166,0.2); }
.roulette-item[data-rarity="rare"]      { background: linear-gradient(150deg,#0b1e33,#102840); border-color:rgba(52,152,219,0.25); }
.roulette-item[data-rarity="epic"]      { background: linear-gradient(150deg,#1e0a2e,#2d1040); border-color:rgba(155,89,182,0.3); }
.roulette-item[data-rarity="legendary"] { background: linear-gradient(150deg,#281200,#3a1a00); border-color:rgba(243,156,18,0.35); }

/* Полоска редкости сверху */
.roulette-item__top-stripe {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 10px 10px 0 0;
}
.roulette-item[data-rarity="common"]    .roulette-item__top-stripe { background: #95a5a6; }
.roulette-item[data-rarity="rare"]      .roulette-item__top-stripe { background: #3498db; }
.roulette-item[data-rarity="epic"]      .roulette-item__top-stripe { background: #9b59b6; }
.roulette-item[data-rarity="legendary"] .roulette-item__top-stripe { background: linear-gradient(90deg,#f39c12,#e67e22,#f39c12); }

.roulette-item__img-wrap {
    width: 88px;
    height: 88px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}
.roulette-item img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

.roulette-item__icon {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.roulette-item__info {
    width: 100%;
    text-align: center;
}

.roulette-item__name {
    font-size: 0.73rem;
    font-weight: 600;
    text-align: center;
    color: rgba(255,255,255,0.9);
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.roulette-item__value {
    font-size: 0.68rem;
    color: #f39c12;
    font-weight: 700;
    margin-top: 2px;
}

/* Победитель — подсветка */
.roulette-item--winner {
    animation: winnerFlash 0.7s cubic-bezier(0.34,1.56,0.64,1);
}
.roulette-item[data-rarity="common"].roulette-item--winner     { border-color:#95a5a6; box-shadow:0 0 28px rgba(149,165,166,0.7); }
.roulette-item[data-rarity="rare"].roulette-item--winner       { border-color:#3498db; box-shadow:0 0 36px rgba(52,152,219,0.9); }
.roulette-item[data-rarity="epic"].roulette-item--winner       { border-color:#9b59b6; box-shadow:0 0 44px rgba(155,89,182,1); }
.roulette-item[data-rarity="legendary"].roulette-item--winner  { border-color:#f39c12; box-shadow:0 0 60px rgba(243,156,18,1), 0 0 100px rgba(243,156,18,0.3); }

@keyframes winnerFlash {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.13); }
    100% { transform: scale(1); }
}

/* Иконка загрузки в кнопке */
@keyframes cases-spin {
    to { transform: rotate(360deg); }
}
.cases-spin-icon {
    animation: cases-spin 0.75s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Частицы при выпадении epic/legendary */
.result-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: particleBurst linear forwards;
    opacity: 1;
}

@keyframes particleBurst {
    0%   { transform: translate(-50%, -50%) translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* Результат открытия */
.case-result {
    text-align: center;
    padding: 40px 0;
    position: relative;
}

.result-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

.case-result[data-rarity="common"] .result-glow {
    background: radial-gradient(circle, var(--glow-common), transparent);
}

.case-result[data-rarity="rare"] .result-glow {
    background: radial-gradient(circle, var(--glow-rare), transparent);
}

.case-result[data-rarity="epic"] .result-glow {
    background: radial-gradient(circle, var(--glow-epic), transparent);
}

.case-result[data-rarity="legendary"] .result-glow {
    background: radial-gradient(circle, var(--glow-legendary), transparent);
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

.result-card {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    margin: 0 auto 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: resultAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.result-card__rarity {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.case-result[data-rarity="common"] .result-card__rarity { background: var(--rarity-common); }
.case-result[data-rarity="rare"] .result-card__rarity { background: var(--rarity-rare); }
.case-result[data-rarity="epic"] .result-card__rarity { background: var(--rarity-epic); }
.case-result[data-rarity="legendary"] .result-card__rarity { background: var(--rarity-legendary); }

.result-card__image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 20px auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
    animation: prizeFloat 3s ease-in-out infinite;
}

@keyframes prizeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.result-card__name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.result-card__value {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Кнопки */
.btn-xl {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.pulse-animation {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Инвентарь */
.inventory-modal__content {
    max-width: 860px;
    max-height: 85vh;
    overflow-y: auto;
}

.inventory-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    background: rgba(76, 175, 80, 0.05);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.inventory-item {
    background: #f7f8fa;
    border-radius: 10px;
    border: 2px solid #e4e6ea;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.13);
}

.inventory-item[data-rarity="common"]   { border-color: var(--rarity-common); }
.inventory-item[data-rarity="rare"]     { border-color: var(--rarity-rare); box-shadow: 0 0 0 1px rgba(33,150,243,0.15); }
.inventory-item[data-rarity="epic"]     { border-color: var(--rarity-epic);  box-shadow: 0 0 0 1px rgba(156,39,176,0.18); }
.inventory-item[data-rarity="legendary"]{ border-color: var(--rarity-legendary); box-shadow: 0 0 0 1px rgba(255,152,0,0.25); }

/* Цветная полоска сверху */
.inventory-item::before {
    content: '';
    display: block;
    height: 3px;
    flex-shrink: 0;
}
.inventory-item[data-rarity="common"]::before    { background: var(--rarity-common); }
.inventory-item[data-rarity="rare"]::before      { background: var(--rarity-rare); }
.inventory-item[data-rarity="epic"]::before      { background: var(--rarity-epic); }
.inventory-item[data-rarity="legendary"]::before { background: var(--rarity-legendary); }

/* Квадратная зона фото */
.inventory-item__img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

.inventory-item__img-wrap img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    pointer-events: none;
}

.inventory-item__icon {
    font-size: 2.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Текстовый блок */
.inventory-item__info {
    padding: 7px 8px 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inventory-item__name {
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.inventory-item__value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.72rem;
}

.inventory-item__condition {
    font-size: 0.65rem;
    color: var(--text-light);
    line-height: 1.3;
}

/* Кнопка «Применить» — показывается при наведении */
.inventory-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.inventory-item:hover .inventory-item__overlay {
    opacity: 1;
    pointer-events: auto;
}

.inventory-item__btn {
    padding: 5px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.72rem;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.inventory-item__btn:hover {
    background: var(--primary-hover);
}

.inventory-item__btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.inventory-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.inventory-empty svg {
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ===================================================
   БЕСПЛАТНЫЕ КЕЙСЫ
   =================================================== */

.case-card--free {
    position: relative;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.25);
    border: 1.5px solid rgba(39, 174, 96, 0.35);
    animation: free-case-pulse 2.5s ease-in-out infinite;
}
@keyframes free-case-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(39, 174, 96, 0.25); }
    50% { box-shadow: 0 6px 32px rgba(39, 174, 96, 0.5); }
}
.case-card--free:hover {
    box-shadow: 0 8px 36px rgba(39, 174, 96, 0.45) !important;
    animation: none;
}

/* Лента "БЕСПЛАТНО" в левом верхнем углу */
.case-card__free-ribbon {
    position: absolute;
    top: 14px;
    left: -2px;
    z-index: 3;
    background: linear-gradient(135deg, #1e8449, #27ae60);
    color: #fff;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 4px 14px 4px 10px;
    border-radius: 0 20px 20px 0;
    box-shadow: 2px 2px 10px rgba(39, 174, 96, 0.45);
    pointer-events: none;
    white-space: nowrap;
}

/* Бейдж статуса (доступен / таймер) */
.case-card__free-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}
.case-card__free-badge--ready {
    background: rgba(39, 174, 96, 0.12);
    color: #1a7a42;
    border: 1.5px solid rgba(39, 174, 96, 0.3);
}
.case-card__free-badge--cd {
    background: linear-gradient(135deg, #ffb74d, #fb8c00);
    color: #fff;
    border: 1.5px solid rgba(251, 140, 0, 0.25);
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 10px rgba(251, 140, 0, 0.25);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Состояние "войти для открытия" */
.case-card__free-badge--login {
    background: rgba(39, 174, 96, 0.1);
    color: #1a7a42;
    border: 1.5px solid rgba(39, 174, 96, 0.3);
}

/* Зелёная кнопка для бесплатного кейса */
.case-card__btn--free {
    background: linear-gradient(135deg, #ffb74d, #fb8c00) !important;
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 10px rgba(251, 140, 0, 0.28);
}
.case-card__btn--free:hover {
    background: linear-gradient(135deg, #ffa726, #ef6c00) !important;
    box-shadow: 0 4px 16px rgba(251, 140, 0, 0.38);
    transform: scale(1.05);
}

/* Подсказка для гостей о периодичности */
.case-card__guest-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #888;
    margin: 0 0 6px;
    line-height: 1.3;
}

/* Кнопка "Войти и открыть" */
.case-card__btn--guest {
    background: linear-gradient(135deg, #ffb74d, #fb8c00) !important;
    color: #fff !important;
}

/* Метка периодичности "каждые X дн." */
.case-card__free-label {
    font-size: 0.72rem;
    color: #27ae60;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: 0.01em;
}

/* Заблокированная кнопка (на кулдауне) */
.case-card__btn--locked {
    background: linear-gradient(135deg, #ffb74d, #fb8c00) !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.72;
    transform: none !important;
}

.case-card__free-cd {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-empty p:first-of-type {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    /* Нижнее меню (аналогично главной) */
    .mobile-bottom-nav {
        display: block;
    }
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    /* Шапка на мобильных — аналогично главной */
    .user-info {
        display: none;
    }

    .cart-btn {
        padding: 8px 12px;
    }

    .cart-total {
        display: none;
    }

    .header__content {
        padding: 10px 0;
        gap: 10px;
    }

    .header__logo {
        height: 40px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .cases-inventory-label {
        display: none;
    }

    /* Баннер */
    .banner-title {
        font-size: 2rem;
    }

    .banner-subtitle {
        font-size: 1rem;
    }

    .banner-stats {
        gap: 20px;
    }

    .stat-item {
        min-width: 120px;
        padding: 15px;
    }

    .stat-value {
        font-size: 2rem;
    }

    /* Сетка кейсов */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Модал открытия кейса */
    .case-modal .modal__content {
        padding: 20px;
    }

    .case-roulette {
        height: 200px;
    }

    .roulette-item {
        min-width: 120px;
        width: 120px;
        height: 160px;
    }

    .result-card {
        padding: 30px 20px;
    }

    .result-card__image {
        width: 150px;
        height: 150px;
    }

    /* Инвентарь */
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .case-card__footer {
        gap: 8px;
    }

    .case-card__btn,
    .case-card__free-badge {
        min-width: 0;
        max-width: 100%;
    }

    .case-card__free-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .case-card__free-badge--cd {
        max-width: calc(100% - 4px);
    }

    .case-card__btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .banner-title {
        font-size: 1.5rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 7px;
    }

    .cart-btn {
        padding: 8px;
    }

    .cart-btn span {
        display: none;
    }

    .cart-count {
        display: flex !important;
    }
}
/* ===== КАРТОЧКА КЕЙСА ДЛЯ НОВИЧКОВ ===== */
.case-card--free-new {
    border: 2px solid rgba(74,222,128,.5) !important;
    box-shadow: 0 0 0 4px rgba(74,222,128,.08), 0 4px 24px rgba(0,0,0,.18);
    animation: freeNewPulse 3s ease-in-out infinite;
    order: -1;
}
@keyframes freeNewPulse {
    0%,100% { box-shadow: 0 0 0 4px rgba(74,222,128,.08), 0 4px 24px rgba(0,0,0,.18); }
    50%      { box-shadow: 0 0 0 8px rgba(74,222,128,.15), 0 6px 32px rgba(0,0,0,.22); }
}
.case-card__free-ribbon--new {
    background: linear-gradient(90deg,#15803d,#22c55e) !important;
    font-size: 11px;
}
.case-card__free-badge--new {
    background: linear-gradient(90deg,#15803d,#22c55e);
    color: #fff; font-weight: 700; font-size: 12px;
    padding: 4px 10px; border-radius: 20px;
    display: flex; align-items: center; gap: 5px;
    box-shadow: 0 2px 8px rgba(34,197,94,.4);
}
.case-card__free-badge--claimed {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.5); font-weight: 600; font-size: 12px;
    padding: 4px 10px; border-radius: 20px;
    display: flex; align-items: center; gap: 5px;
}
/* ===== END КАРТОЧКА ДЛЯ НОВИЧКОВ ===== */
