/* Стили для системы кейсов */

/* Стили карточек кейсов */
.case-item {
    position: relative;
    margin-bottom: 10px;
}

.case-item .btn-preview {
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.case-item .btn-preview:hover {
    background-color: #555;
}

.case-item .btn-preview:active {
    transform: scale(0.95);
}

/* Модальное окно предпросмотра содержимого кейса */
.case-preview-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.case-preview-modal .modal-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.case-preview-modal h3 {
    text-align: center;
    margin-top: 0;
    color: #fff;
    font-size: 20px;
    margin-bottom: 20px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #fff;
}

/* Стили для предпросмотра предметов в кейсе */
.case-items-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.case-item-preview {
    position: relative;
    width: 80px;
    height: 80px;
    background-color: #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.case-item-preview:hover {
    transform: translateY(-5px);
}

.case-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.case-item-preview .chance {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 0;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* Цвета редкости */
.chance.common {
    background-color: #7e7e7e;
}

.chance.uncommon {
    background-color: #33a02c;
}

.chance.rare {
    background-color: #1f78b4;
}

.chance.epic {
    background-color: #6a3d9a;
}

.chance.legendary {
    background-color: #e31a1c;
}

/* Стили для модального окна открытия кейса */
.case-opening-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.opening-modal-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.case-roulette {
    position: relative;
    height: 100px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid #333;
    border-radius: 8px;
}

.roulette-items {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
}

.roulette-item {
    flex: 0 0 150px;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.roulette-item img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.roulette-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Окрашивание предметов по редкости */
.roulette-item.common::after {
    background-color: rgba(126, 126, 126, 0.3);
}

.roulette-item.uncommon::after {
    background-color: rgba(51, 160, 44, 0.3);
}

.roulette-item.rare::after {
    background-color: rgba(31, 120, 180, 0.3);
}

.roulette-item.epic::after {
    background-color: rgba(106, 61, 154, 0.3);
}

.roulette-item.legendary::after {
    background-color: rgba(227, 26, 28, 0.3);
}

.roulette-pointer {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 2;
    transform: translateX(-50%);
}

.result-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    transition: opacity 0.5s ease;
}

.result-container.hidden {
    display: none;
    opacity: 0;
}

.result-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #fff;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.result-item-image {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 5px;
}

.result-item-image.common {
    background-color: rgba(126, 126, 126, 0.3);
    box-shadow: 0 0 15px rgba(126, 126, 126, 0.5);
}

.result-item-image.uncommon {
    background-color: rgba(51, 160, 44, 0.3);
    box-shadow: 0 0 15px rgba(51, 160, 44, 0.5);
}

.result-item-image.rare {
    background-color: rgba(31, 120, 180, 0.3);
    box-shadow: 0 0 15px rgba(31, 120, 180, 0.5);
}

.result-item-image.epic {
    background-color: rgba(106, 61, 154, 0.3);
    box-shadow: 0 0 15px rgba(106, 61, 154, 0.5);
}

.result-item-image.legendary {
    background-color: rgba(227, 26, 28, 0.3);
    box-shadow: 0 0 15px rgba(227, 26, 28, 0.8);
}

.result-item-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.result-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.result-item-rarity {
    font-size: 14px;
}

.result-item-rarity.common {
    color: #7e7e7e;
}

.result-item-rarity.uncommon {
    color: #33a02c;
}

.result-item-rarity.rare {
    color: #1f78b4;
}

.result-item-rarity.epic {
    color: #6a3d9a;
}

.result-item-rarity.legendary {
    color: #e31a1c;
}

.btn-take {
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-take:hover {
    background-color: #3d8b40;
}

.btn-take:active {
    transform: scale(0.95);
}

/* Анимация для карточек кейсов */
.donate-item.case-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.donate-item.case-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.donate-item.case-item .donate-item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff9500, #ff5e3a);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}

/* Стили для уведомлений
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-width: 90%;
    text-align: center;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
} */

/* Анимация нажатия на кнопку */
.btn-pressed {
    transform: scale(0.95);
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .case-items-preview {
        gap: 8px;
    }
    
    .case-item-preview {
        width: 70px;
        height: 70px;
    }
    
    .opening-modal-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .case-item-preview {
        width: 60px;
        height: 60px;
    }
    
    .result-item-image {
        width: 80px;
        height: 80px;
    }
}