/* Token Display */
.token-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(245, 245, 255, 0.2));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(104, 120, 238, 0.3);
}

.token-icon {
    font-size: 1.5rem;
}

.token-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Cases Button */
.cases-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #ff6b9a, #ff9ec8);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(255, 107, 154, 0.4);
    transition: all 0.3s ease;
}

.cases-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 107, 154, 0.6);
}

.cases-button:active {
    transform: translateY(-1px);
}

.cases-icon {
    font-size: 1.8rem;
    animation: casesBounce 2s ease-in-out infinite;
}

@keyframes casesBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.cases-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Cases Modal */
.cases-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.cases-modal.show {
    opacity: 1;
    pointer-events: all;
}

.cases-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(138, 108, 251, 0.98), rgba(168, 108, 251, 0.95));
    padding: 2.5rem;
    border-radius: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(138, 108, 251, 0.5), 0 0 60px rgba(255, 107, 154, 0.3);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cases-modal.show .cases-modal-content {
    transform: scale(1);
}

.cases-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cases-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.cases-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 4px 20px rgba(255, 107, 154, 0.5), 0 0 30px rgba(138, 108, 251, 0.4);
}

/* Cases Grid - CS2 Style */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

/* CS2-Style Case Card - More subtle */
.case-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.case-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.case-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.case-card:hover::before {
    opacity: 1;
}

.case-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.case-card.disabled:hover {
    transform: none;
}

.case-emoji {
    font-size: 5rem;
    margin-bottom: 1.2rem;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
}

.case-card:hover .case-emoji {
    transform: scale(1.05);
}

.case-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
}

.case-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

.case-cost {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    position: relative;
    z-index: 1;
}

/* Unboxing History */
.unboxing-history {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.unboxing-history h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.history-item-name {
    font-size: 1rem;
    color: white;
    font-weight: 600;
}

.history-item-rarity {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Unboxing Animation Modal - Enhanced CS2 Style */
.unboxing-modal {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.98), rgba(20, 15, 35, 0.98));
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.unboxing-modal.show {
    opacity: 1;
    pointer-events: all;
}

.unboxing-content {
    width: 100%;
    max-width: 1400px;
    position: relative;
    padding: 2rem;
}

/* CS2-Style Reel Container - Darker, more minimal */
.case-reel-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    margin: 2rem 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.9),
        inset 0 2px 4px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* CS2-style center indicator line - behind items */
.reel-indicator {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 70%,
        transparent 100%);
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Scrolling reel */
.case-reel {
    display: flex;
    gap: 20px;
    padding: 30px;
    position: absolute;
    left: 50%;
    transition: transform 5s cubic-bezier(0.15, 0.8, 0.3, 1);
}

/* CS2-style item card in reel - Darker, more minimal */
.reel-item {
    min-width: 180px;
    height: 220px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.2rem;
    border: 2px solid;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 3;
}

.reel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%);
}

/* Subtle highlight for centered item - CS2 style */
.case-reel-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 240px;
    background: radial-gradient(ellipse, 
        rgba(255, 255, 255, 0.03) 0%, 
        transparent 70%);
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
}

.reel-item-emoji {
    font-size: 4rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.reel-item-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.reel-item-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Result Display - Enhanced */
.unboxing-result {
    opacity: 0;
    transform: scale(0.5) translateY(50px) rotateX(90deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    margin-left: -250px;
    margin-top: -300px;
    perspective: 1000px;
}

.unboxing-result.show {
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0deg);
    margin-left: -250px;
    margin-top: -300px;
}

.result-card {
    background: linear-gradient(135deg, 
        rgba(138, 108, 251, 0.3), 
        rgba(168, 108, 251, 0.25));
    backdrop-filter: blur(20px);
    border: 3px solid;
    border-radius: 16px;
    padding: 3.5rem 2.5rem;
    width: 450px;
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
    opacity: 0.5;
    border-radius: 16px;
}

.result-emoji {
    font-size: 8rem;
    margin-bottom: 1.5rem;
    display: block;
    animation: resultPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
    position: relative;
    z-index: 1;
}

@keyframes resultPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.result-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.result-tier-badge {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.result-button {
    background: linear-gradient(135deg, #ff6b9a, #ff9ec8);
    border: none;
    color: white;
    padding: 1.4rem 3.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 40px rgba(255, 107, 154, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.result-button:hover {
    background: linear-gradient(135deg, #ff9ec8, #ff6b9a);
    transform: translateY(-4px);
    box-shadow: 
        0 15px 50px rgba(255, 107, 154, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.result-button:active {
    transform: translateY(-2px);
}

/* Flying Hearts Animation */
.flying-heart {
    position: absolute;
    bottom: 0;
    font-size: 2.5rem;
    animation: flyUp 3s ease-out forwards;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    filter: drop-shadow(0 4px 8px rgba(255, 107, 154, 0.6));
}

@keyframes flyUp {
    0% {
        bottom: 0;
        left: var(--start-x, 50%);
        opacity: 0;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translateY(-40vh) scale(1.1) rotate(180deg);
    }
    100% {
        bottom: 100%;
        left: var(--end-x, 50%);
        opacity: 0;
        transform: translateY(-80vh) scale(0.3) rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .token-display {
        top: 15px;
        right: 15px;
        padding: 0.6rem 1.2rem;
    }

    .cases-button {
        bottom: 20px;
        right: 20px;
        padding: 0.8rem 1.5rem;
    }

    .cases-title {
        font-size: 2rem;
    }

    .cases-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .case-card {
        padding: 2rem 1.5rem;
    }

    .case-emoji {
        font-size: 4rem;
    }

    .result-card {
        width: 90vw;
        max-width: 400px;
        padding: 3rem 2rem;
    }

    .unboxing-result {
        margin-left: calc(-45vw + 0px);
        margin-top: -300px;
    }

    .unboxing-result.show {
        margin-left: calc(-45vw + 0px);
        margin-top: -300px;
    }

    .result-emoji {
        font-size: 7rem;
    }

    .result-name {
        font-size: 2rem;
    }

    .result-description {
        font-size: 1.1rem;
    }

    .result-tier-badge {
        font-size: 1.1rem;
        padding: 0.8rem 2rem;
    }

    .result-button {
        padding: 1.2rem 2.5rem;
        font-size: 1.1rem;
    }

    .case-reel-container {
        height: 240px;
    }

    .reel-item {
        min-width: 150px;
        height: 200px;
    }

    .reel-item-emoji {
        font-size: 3.5rem;
    }

    .reel-item-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cases-modal-content {
        padding: 1.5rem;
    }

    .token-icon {
        font-size: 1.2rem;
    }

    .token-count {
        font-size: 1.1rem;
    }

    .cases-text {
        font-size: 0.95rem;
    }

    .case-reel-container {
        height: 200px;
    }

    .reel-item {
        min-width: 120px;
        height: 180px;
        padding: 1rem;
    }

    .reel-item-emoji {
        font-size: 3rem;
    }

    .result-card {
        padding: 2.5rem 1.5rem;
    }

    .result-emoji {
        font-size: 6rem;
    }
}
