/* Стили для страницы кейса */

.case-page {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--accent-primary);
}

/* Шапка кейса */
.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.case-main-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.case-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-primary);
}

.case-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.case-price-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-open-now {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-open-now:hover:not(:disabled) {
    background-color: #00a8cc;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.btn-open-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Рулетка */
.roulette-container {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 0;
    margin-bottom: 40px;
    overflow: hidden;
}

.roulette-arrow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: var(--accent-primary);
    z-index: 10;
    box-shadow: 0 0 20px var(--accent-primary);
}

.roulette-arrow::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid var(--accent-primary);
}

.roulette-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 0 50px;
}

.roulette-items {
    display: flex;
    gap: 10px;
    transition: transform 0s;
}

.roulette-item {
    min-width: 140px;
    height: 140px;
    background-color: var(--bg-secondary);
    border: 2px solid;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.roulette-item img {
    width: 80px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.roulette-item .item-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-primary);
}

/* Результат открытия */
.opening-result {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
}

.opening-result h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--accent-primary);
}

.won-item {
    max-width: 400px;
    margin: 0 auto;
}

.won-item-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.won-item-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.won-item-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.won-item h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.won-item-price {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 30px;
}

.won-item-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-sell,
.btn-open-again {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sell {
    background-color: var(--accent-green);
    color: var(--bg-primary);
    border: none;
}

.btn-sell:hover {
    background-color: #33cc33;
}

.btn-open-again {
    background-color: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.btn-open-again:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* Предметы кейса */
.case-items {
    margin-bottom: 40px;
}

.case-items h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.item-card {
    background-color: var(--bg-card);
    border: 2px solid;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: transform 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
}

.item-chance {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.item-image {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-primary);
}

/* История открытий */
.opening-history {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

.opening-history h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.history-item:hover {
    background-color: var(--hover-color);
}

.history-item .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.history-item .username {
    min-width: 150px;
    font-weight: bold;
}

.history-item .item-won {
    flex: 1;
    font-weight: bold;
}

.history-item .item-price {
    min-width: 100px;
    text-align: right;
    font-weight: bold;
}

.history-item .item-price.profit {
    color: var(--accent-green);
}

.history-item .item-price.loss {
    color: var(--accent-secondary);
}

.history-item .time-ago {
    min-width: 100px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Анимация пульсации для ценных предметов */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.item-card[style*="ffd700"] {
    animation: pulse 2s infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .case-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .case-actions {
        align-items: stretch;
    }
    
    .case-stats {
        flex-wrap: wrap;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .history-item {
        flex-wrap: wrap;
    }
    
    .history-item .username,
    .history-item .item-won {
        min-width: unset;
    }
}