/* ===== АНИМАЦИИ ===== */

/* Основные анимации */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 30px var(--accent-glow); }
}

@keyframes casePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 50px rgba(0, 200, 255, 0.4); 
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 70px rgba(0, 200, 255, 0.6); 
    }
}

@keyframes caseShake {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@keyframes countdownPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes prizeGlow {
    0%, 100% { 
        box-shadow: 0 0 60px rgba(255, 215, 105, 0.6); 
        transform: scale(1); 
    }
    50% { 
        box-shadow: 0 0 100px rgba(255, 215, 105, 0.9); 
        transform: scale(1.05); 
    }
}

@keyframes prizeBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes scrollItemHighlight {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
    }
    50% { 
        transform: scale(1.15); 
        box-shadow: 0 0 40px rgba(0, 200, 255, 0.8);
    }
}

/* Классы анимаций */
.floating {
    animation: float 3s ease-in-out infinite;
}

.glowing {
    animation: glow 2s ease-in-out infinite;
}

.scroll-highlight {
    animation: scrollItemHighlight 0.6s ease-in-out 3;
}

/* Анимации открытия кейсов */
.case-opening-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.case-opening-animation.active {
    display: flex;
}

.opening-case {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: casePulse 1.5s infinite;
    box-shadow: 0 0 50px rgba(0, 200, 255, 0.4);
    border: 3px solid var(--accent);
}

.opening-case img {
    max-width: 80%;
    max-height: 80%;
    animation: caseShake 0.4s ease-in-out infinite;
}

.countdown {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent);
    margin-bottom: 20px;
    animation: countdownPop 0.8s ease-out;
}

.opening-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    opacity: 0;
    animation: textFadeIn 0.5s ease-out 0.3s forwards;
}

.quick-opening {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    opacity: 0;
    animation: textFadeIn 0.5s ease-out 1s forwards;
    transition: all 0.3s;
}

.quick-opening:hover {
    background: var(--accent);
    color: white;
}

.prize-reveal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.prize-reveal.active {
    display: flex;
}

.reveal-prize {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #ffd769, #ffb347);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: prizeGlow 2s infinite;
    box-shadow: 0 0 80px rgba(255, 215, 105, 0.6);
}

.reveal-prize-icon {
    font-size: 80px;
    animation: prizeBounce 1s ease-in-out infinite;
}

.reveal-text {
    font-size: 32px;
    font-weight: 800;
    color: #ffd769;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 105, 0.8);
}

.reveal-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

.reveal-continue {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    animation: textFadeIn 0.5s ease-out 1s forwards;
    opacity: 0;
}

/* Модальное окно кейса */
.case-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.case-fullscreen.active {
    display: flex;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--panel);
}

.case-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.case-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.case-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.case-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.case-image {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.case-image img {
    max-width: 90%;
    max-height: 90%;
}

.case-price {
    font-size: 20px;
    font-weight: 700;
    color: #ffd769;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 215, 105, 0.3);
}

.case-open-btn {
    background: var(--main-gradient);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 18px 40px;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px var(--accent-glow);
    margin-bottom: 40px;
    width: 80%;
    max-width: 300px;
}

.case-open-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--accent-glow);
}

.case-open-btn:disabled {
    background: var(--muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Секция прокрутки призов */
.prize-scroll-section {
    width: 100%;
    margin: 30px 0;
}

.prize-scroll-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(42, 50, 60, 0.8), rgba(33, 40, 48, 0.6));
    border: 2px solid rgba(0, 200, 255, 0.3);
}

.scroll-track {
    display: flex;
    height: 100%;
    transition: transform 0.1s linear;
    will-change: transform;
}

.scroll-item {
    min-width: 120px;
    height: 160px;
    margin: 0 10px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.scroll-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: scale(1.1);
}

.scroll-item.main-prize {
    background: linear-gradient(135deg, #ffd769, #ffb347);
}

.scroll-item-icon {
    font-size: 40px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.scroll-item.active .scroll-item-icon {
    transform: scale(1.2);
}

.scroll-item-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
    padding: 0 5px;
}

.scroll-item-chance {
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
}

.center-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 180px;
    border: 3px solid var(--accent);
    border-radius: 18px;
    pointer-events: none;
    box-shadow: 0 0 40px var(--accent-glow);
    z-index: 10;
}

.center-indicator::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: conic-gradient(
        from 0deg at 50% 50%,
        var(--accent) 0%,
        rgba(0, 200, 255, 0.8) 25%,
        rgba(0, 200, 255, 0.4) 50%,
        rgba(0, 200, 255, 0.8) 75%,
        var(--accent) 100%
    );
    border-radius: 21px;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

.center-indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 16px;
    z-index: -1;
}

/* Секция призов */
.prizes-section {
    width: 100%;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
    text-align: center;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.prize-item {
    background: linear-gradient(135deg, #2d3740, #1a2229);
    border-radius: 15px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prize-item:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.prize-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #39464c, #2b373d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.prize-item.main-prize .prize-icon {
    width: 80px;
    height: 80px;
    font-size: 36px;
    background: linear-gradient(135deg, #ffd769, #ffb347);
    box-shadow: 0 6px 12px rgba(255, 215, 105, 0.3);
}

.prize-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

.prize-item.main-prize .prize-name {
    color: #ffd769;
    font-weight: 800;
}

.prize-chance {
    font-size: 11px;
    color: var(--muted);
}

.prize-item.main-prize .prize-chance {
    color: #ffb347;
    font-weight: 700;
}

/* ===== СТИЛИ ДЛЯ СООБЩЕНИЙ ОБ ОШИБКАХ ===== */
.error-message {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    max-width: 320px;
    width: 90%;
}

.error-icon {
    font-size: 22px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.error-text {
    font-size: 14px;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes errorSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}