/* ========================================
   CASE OPENING OVERLAY - ОПТИМИЗИРОВАННАЯ ВЕРСИЯ
   ======================================== */

.case-opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.case-opening-overlay.active {
    display: flex;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Заголовок */
.case-opening-title {
    font-size: 24px;
    font-weight: bold;
    color: #00ffff;
    margin-top: 30px;
    text-align: center;
    letter-spacing: 1px;
}

/* Контейнер для кейса - упрощен */
.case-box-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Сам кейс - убрали сложные анимации */
.case-box {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s ease-out;
}

/* Убрали сложные эффекты свечения */
.case-box-icon {
    font-size: 100px;
    z-index: 1;
}

/* Упрощенные анимации */
@keyframes caseShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Область прокрутки */
.case-opening-scroll-area {
    position: relative;
    width: 480px;
    height: 480px;
    overflow: hidden;
    margin: auto 0;
    transition: transform 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Упростили градиентные маски */
.case-opening-scroll-area::before,
.case-opening-scroll-area::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0.9) 0%, 
        transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.case-opening-scroll-area::after {
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%, 
        transparent 100%);
}

/* Контейнер с предметами */
.case-opening-items-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 192px;
    padding-bottom: 192px;
    transition: transform 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Индикатор выбора - упрощен */
.case-opening-selector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 110px;
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 12px;
    background: rgba(0, 255, 255, 0.05);
    pointer-events: none;
    z-index: 5;
}

/* Убрали стрелки */
.case-opening-arrows {
    display: none;
}

/* Предмет в рулетке - упрощен */
.case-opening-item {
    width: 450px;
    height: 86px;
    margin: 5px auto;
    padding: 12px 24px;
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid rgba(60, 60, 80, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Убрали анимацию блика */
.case-opening-item::before {
    display: none;
}

.case-opening-item.winning {
    background: rgba(0, 60, 60, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.35);
}

.case-opening-item-icon {
    font-size: 48px;
    min-width: 55px;
    text-align: center;
}

.case-opening-item.winning .case-opening-item-icon {
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.7));
}

.case-opening-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-opening-item-name {
    font-size: 19px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.case-opening-item.winning .case-opening-item-name {
    color: #ffffff;
    font-weight: 700;
}

.case-opening-item-rarity {
    font-size: 11px;
    font-weight: 500;
    color: rgba(0, 255, 255, 0.6);
}

.case-opening-item.winning .case-opening-item-rarity {
    color: #00ffff;
}

/* Кнопка пропуска */
.case-opening-skip-btn {
    padding: 12px 35px;
    background: #1a1a1a;
    border: 2px solid rgba(0, 255, 255, 0.8);
    border-radius: 8px;
    color: #00ffff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 30px;
}

.case-opening-skip-btn:hover {
    background: #2a2a2a;
    transform: scale(1.05);
}

.case-opening-skip-btn:active {
    transform: scale(0.98);
}

/* Финальный экран с результатами */
.case-opening-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.case-opening-results.active {
    display: flex;
}

.case-opening-results-title {
    font-size: 28px;
    font-weight: bold;
    color: #00ffff;
    margin: 40px 0 30px 0;
    text-align: center;
}

.case-opening-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 340px;
    margin-bottom: 30px;
}

.case-opening-result-item {
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid rgba(0, 255, 255, 0.8);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    animation: resultItemAppear 0.4s ease-out forwards;
}

.case-opening-result-item:nth-child(1) { animation-delay: 0s; }
.case-opening-result-item:nth-child(2) { animation-delay: 0.15s; }
.case-opening-result-item:nth-child(3) { animation-delay: 0.3s; }
.case-opening-result-item:nth-child(4) { animation-delay: 0.45s; }
.case-opening-result-item:nth-child(5) { animation-delay: 0.6s; }

@keyframes resultItemAppear {
    to {
        opacity: 1;
    }
}

.case-opening-result-icon {
    font-size: 38px;
    min-width: 50px;
    text-align: center;
}

.case-opening-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.case-opening-result-name {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
}

.case-opening-result-rarity {
    font-size: 12px;
    font-weight: 500;
    color: #00ffff;
}

/* Убрали тяжелые анимации выигрышного предмета */
.case-opening-item.winning.highlight {
    animation: none;
}

.case-opening-item.winning.highlight::after {
    display: none;
}

/* Адаптивность */
@media (max-width: 560px) {
    .case-opening-scroll-area {
        width: 360px;
        height: 360px;
    }
    
    .case-opening-selector {
        width: 380px;
        height: 90px;
    }
    
    .case-opening-item {
        width: 340px;
        height: 66px;
        padding: 10px 18px;
    }
    
    .case-opening-items-container {
        padding-top: 142px;
        padding-bottom: 142px;
    }
    
    .case-opening-item-icon {
        font-size: 38px;
        min-width: 45px;
    }
    
    .case-opening-item-name {
        font-size: 16px;
    }
    
    .case-opening-title {
        font-size: 20px;
        margin-top: 20px;
    }
    
    .case-opening-results-title {
        font-size: 24px;
        margin: 30px 0 20px 0;
    }
}

/* Мобильные оптимизации */
@media (max-width: 768px) {
    .case-opening-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .case-opening-results {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .case-box {
        border: 2px solid rgba(0, 255, 255, 0.5);
    }
}

/* Отключение анимаций для слабых устройств */
@media (max-width: 480px) {
    .case-box {
        transition: none !important;
    }
    
    .case-opening-item {
        transition: none !important;
    }
}

