/* ================================================================
   🎁 MYSTERY BOX COMPONENT STYLES
   Sunwell Midnight Theme (Void Purple + Sunwell Gold)
   Isolated styles - no conflicts with existing components
   Created: 2025
   ================================================================ */

/* ===== CONTAINER ===== */
.mystery-box-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

/* ===== BOX INDICATOR (when boxes available) ===== */
.box-indicator {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    backdrop-filter: blur(15px) saturate(180%);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    animation: indicatorPulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 15px;
}

@keyframes indicatorPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.6);
    }
}

.box-indicator-text {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.box-count {
    font-size: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    background: rgba(255, 179, 0, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(255, 179, 0, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ===== BOX INDICATOR SUB-ELEMENTS ===== */
.box-icon {
    font-size: 40px;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.box-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.box-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== BOX OPENING SECTION ===== */
.box-opening-section {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    backdrop-filter: blur(20px) saturate(180%);
    border: 3px solid rgba(153, 50, 204, 0.4);
    border-radius: 24px;
    padding: 40px 30px;
    margin-bottom: 25px;
    box-shadow:
        0 0 60px rgba(153, 50, 204, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: visible; /* Allow reward to overflow slightly */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    min-height: 450px; /* Ensure enough space for reward animation */
}

.box-front {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.box-symbol {
    font-size: inherit;
    font-weight: 900;
    color: rgba(255, 179, 0, 0.95);
    text-shadow:
        0 0 20px rgba(255, 179, 0, 0.8),
        0 0 40px rgba(255, 179, 0, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.5);
    animation: symbolFloat 3s ease-in-out infinite;
}

@keyframes symbolFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.box-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at center, rgba(255, 179, 0, 0.4), transparent 70%);
    filter: blur(30px);
    opacity: 0.8;
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ===== CHARGE CONTAINER ===== */
.charge-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.charge-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.charge-percentage {
    color: #FFB300;
    font-weight: 700;
    font-size: 16px;
}

.charge-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.charge-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FFB300, #FF8F00);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.6);
    transition: width 0.1s linear;
    position: relative;
}

.charge-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.charge-hint {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* ===== OPEN BUTTON ===== */
.open-button {
    background: linear-gradient(135deg, rgba(46, 8, 84, 0.9), rgba(13, 0, 26, 0.9));
    border: 2px solid rgba(153, 50, 204, 0.4);
    border-radius: 16px;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.open-button:not(:disabled) {
    background: linear-gradient(135deg, #FFB300, #FF8F00);
    border-color: rgba(255, 179, 0, 0.6);
    color: rgba(13, 0, 26, 1);
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(255, 179, 0, 0.4);
}

.open-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 179, 0, 0.6);
}

.open-button:not(:disabled):active {
    transform: translateY(0);
}

.open-button.charging {
    animation: chargeVibrate 0.1s infinite;
}

@keyframes chargeVibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.btn-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.6));
}

.btn-text {
    font-size: inherit;
}

/* ===== MYSTERY BOX SECTION ===== */
.mystery-box-section {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    backdrop-filter: blur(20px) saturate(180%);
    border: 3px solid rgba(153, 50, 204, 0.4);
    border-radius: 24px;
    padding: 40px 30px;
    margin-bottom: 25px;
    box-shadow:
        0 0 60px rgba(153, 50, 204, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.mystery-box-section .section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.mystery-box-section .section-subtitle {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    font-weight: 600;
}

/* ===== BOX CONTAINER ===== */
.box-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.mystery-box-wrapper {
    position: relative;
    perspective: 1200px;
}

/* ===== THE MYSTERY BOX ===== */
.mystery-box {
    position: relative;
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg,
        rgba(139, 90, 60, 0.7),
        rgba(109, 76, 65, 0.8)
    );
    backdrop-filter: blur(25px) saturate(180%);
    border: 4px solid rgba(255, 179, 0, 0.6);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 80px rgba(255, 179, 0, 0.5),
        0 25px 70px rgba(0, 0, 0, 0.7),
        inset 0 -30px 50px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 90px;
    user-select: none;
    transform-style: preserve-3d;
}

.mystery-box::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(255, 179, 0, 0.3) 50%,
        transparent 100%
    );
    border-radius: 30px;
    opacity: 0;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.mystery-box:hover {
    transform: translateY(-15px) scale(1.08) rotateX(5deg);
    box-shadow:
        0 0 100px rgba(255, 179, 0, 0.7),
        0 35px 90px rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 179, 0, 0.9);
}

/* ===== RARITY STATES ===== */
.mystery-box.rarity-common {
    border-color: rgba(0, 206, 209, 0.8);
    box-shadow: 0 0 60px rgba(0, 206, 209, 0.6), 0 25px 70px rgba(0, 0, 0, 0.7);
}

.mystery-box.rarity-uncommon {
    border-color: rgba(33, 150, 243, 0.8);
    box-shadow: 0 0 60px rgba(33, 150, 243, 0.6), 0 25px 70px rgba(0, 0, 0, 0.7);
}

.mystery-box.rarity-rare {
    border-color: rgba(156, 39, 176, 0.8);
    box-shadow: 0 0 80px rgba(156, 39, 176, 0.7), 0 25px 70px rgba(0, 0, 0, 0.7);
}

.mystery-box.rarity-legendary {
    border-color: rgba(255, 179, 0, 0.9);
    box-shadow: 0 0 120px rgba(255, 179, 0, 0.9), 0 25px 70px rgba(0, 0, 0, 0.7);
    animation: legendaryPulse 1s ease-in-out infinite;
}

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

.mystery-box.charging {
    animation: chargeShake 0.15s ease-in-out infinite;
}

@keyframes chargeShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-3px, -3px) rotate(-2deg); }
    75% { transform: translate(3px, -3px) rotate(2deg); }
}

.mystery-box.opening {
    animation: boxExplode 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes boxExplode {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    60% { transform: scale(1.4) rotate(15deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(90deg); opacity: 0; }
}

/* ===== CHARGE BAR ===== */
.charge-bar-container {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 179, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.charge-bar-container.visible {
    opacity: 1;
}

.charge-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FFB300, #FF6F00);
    border-radius: 10px;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.8);
}

.hint-text {
    position: absolute;
    bottom: -90px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    animation: bounce 2s ease-in-out infinite;
    text-align: center;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== LIGHT RAYS ===== */
.light-rays {
    position: absolute;
    inset: -100px;
    background: radial-gradient(ellipse at center, rgba(255, 179, 0, 0.3) 0%, transparent 60%);
    opacity: 0;
    pointer-events: none;
}

.light-rays.burst {
    animation: rayBurst 1s ease-out forwards;
}

@keyframes rayBurst {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(2); }
}

/* ===== REWARD REVEAL ===== */
.reward-reveal {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.reward-reveal.visible {
    animation: rewardAppear 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes rewardAppear {
    0% { opacity: 0; transform: scale(0) translateY(100px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== REWARD DISPLAY (used by JS) ===== */
.reward-display {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.reward-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 40px;
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.98), rgba(46, 8, 84, 0.98));
    backdrop-filter: blur(30px) saturate(200%);
    border: 3px solid rgba(255, 215, 0, 0.8);
    border-radius: 30px;
    box-shadow:
        0 0 80px rgba(255, 215, 0, 0.6),
        0 0 120px rgba(255, 215, 0, 0.4),
        0 20px 80px rgba(0, 0, 0, 0.8),
        inset 0 2px 15px rgba(255, 255, 255, 0.15);
    opacity: 0;
    transform: scale(0) translateY(150px);
    transition: none;
    position: relative;
}

/* Glow effect behind reward card */
.reward-card::before {
    content: '';
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(255, 179, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    animation: rewardGlowPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes rewardGlowPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.reward-card.show {
    animation: rewardCardAppear 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes rewardCardAppear {
    0% {
        opacity: 0;
        transform: scale(0) translateY(150px) rotate(-5deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05) translateY(-10px) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

.reward-rarity {
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.reward-icon {
    font-size: 120px;
    margin-bottom: 20px;
    animation: rewardFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 15px 40px rgba(255, 179, 0, 0.8));
    position: relative;
}

@keyframes rewardFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 15px 40px rgba(255, 179, 0, 0.8));
    }
    25% {
        transform: translateY(-15px) rotate(-3deg) scale(1.05);
        filter: drop-shadow(0 20px 50px rgba(255, 179, 0, 1));
    }
    50% {
        transform: translateY(-25px) rotate(3deg) scale(1.08);
        filter: drop-shadow(0 25px 60px rgba(255, 179, 0, 1));
    }
    75% {
        transform: translateY(-15px) rotate(-3deg) scale(1.05);
        filter: drop-shadow(0 20px 50px rgba(255, 179, 0, 1));
    }
}

.reward-name {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.reward-value {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 15px rgba(255, 179, 0, 0.5));
}

.reward-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 179, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: rewardGlowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes rewardGlowPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.reward-icon {
    font-size: 140px;
    margin-bottom: 20px;
    animation: rewardFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 15px 40px rgba(255, 179, 0, 0.8));
    z-index: 2;
}

@keyframes rewardFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(5deg); }
}

.rarity-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.rarity-common {
    background: linear-gradient(135deg, #00CED1, #20B2AA);
    color: white;
}

.rarity-uncommon {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.rarity-rare {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.rarity-legendary {
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    color: white;
    animation: legendaryBadge 1s ease-in-out infinite;
}

@keyframes legendaryBadge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 179, 0, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(255, 179, 0, 0.8);
    }
}

.reward-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    font-weight: 700;
    z-index: 2;
}

.reward-amount {
    font-size: clamp(52px, 15vw, 72px);
    font-weight: 900;
    background: linear-gradient(135deg, #FFB300 0%, #FF6F00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 35px;
    font-variant-numeric: tabular-nums;
    filter: drop-shadow(0 4px 20px rgba(255, 179, 0, 0.6));
    z-index: 2;
}

/* ===== ACTION BUTTON ===== */
.mystery-box-action-btn {
    padding: 18px 50px;
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    border: none;
    border-radius: 35px;
    color: white;
    font-weight: 900;
    font-size: 17px;
    cursor: pointer;
    box-shadow:
        0 10px 35px rgba(255, 179, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
    z-index: 2;
    min-height: 44px;
    min-width: 200px;
}

.mystery-box-action-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mystery-box-action-btn:hover {
    transform: translateY(-4px);
    box-shadow:
        0 15px 45px rgba(255, 179, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mystery-box-action-btn:active {
    transform: translateY(-2px);
}

/* ===== RECENT REWARDS ===== */
.recent-rewards {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    backdrop-filter: blur(15px) saturate(180%);
    border: 2px solid rgba(153, 50, 204, 0.3);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.recent-rewards h3 {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #9932CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rewards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.rewards-list::-webkit-scrollbar {
    width: 6px;
}

.rewards-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.rewards-list::-webkit-scrollbar-thumb {
    background: rgba(153, 50, 204, 0.4);
    border-radius: 10px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 179, 0, 0.2);
    transition: all 0.3s ease;
}

.reward-item:hover {
    border-color: rgba(153, 50, 204, 0.4);
    background: rgba(153, 50, 204, 0.05);
}

.reward-item-icon {
    font-size: 28px;
}

.reward-item-info {
    flex: 1;
}

.reward-item-type {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.reward-item-amount {
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #9932CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.reward-item-rarity {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ===== CONFETTI ===== */
.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFB300;
    opacity: 0;
}

.confetti-piece.fall {
    animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .mystery-box-container {
        padding: 10px;
    }

    .mystery-box-section {
        padding: 30px 20px;
    }

    .mystery-box {
        width: 180px;
        height: 180px;
        font-size: 75px;
    }

    .reward-icon {
        font-size: 110px;
    }

    .mystery-box-action-btn {
        padding: 16px 40px;
        font-size: 15px;
        min-width: 180px;
    }

    .charge-bar-container {
        width: 160px;
    }

    .box-indicator-text {
        font-size: 16px;
        flex-direction: column;
        gap: 5px;
    }

    .box-count {
        font-size: 28px;
        min-width: 45px;
        height: 45px;
    }
}

/* ===========================
   FREE BOX TIMER
   =========================== */

.free-box-timer {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    border: 2px solid rgba(153, 50, 204, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.free-box-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.free-box-timer.claim-success {
    animation: claimPulse 0.5s ease-out;
}

@keyframes claimPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(153, 50, 204, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(153, 50, 204, 0.6);
    }
}

.timer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(153, 50, 204, 0.2);
}

.timer-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(255, 179, 0, 0.6));
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.timer-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timer-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timer-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-ready {
    font-size: 20px;
    font-weight: 600;
    color: #FFB300;
    text-shadow: 0 0 10px rgba(255, 179, 0, 0.5);
    animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.timer-countdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.countdown-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-time {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #FFB300;
    text-shadow: 0 0 15px rgba(255, 179, 0, 0.4);
    letter-spacing: 2px;
}

.claim-free-box-btn {
    background: linear-gradient(135deg, rgba(46, 8, 84, 0.9), rgba(13, 0, 26, 0.9));
    border: 2px solid rgba(153, 50, 204, 0.4);
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.claim-free-box-btn .btn-icon {
    font-size: 22px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.claim-free-box-btn.ready {
    background: linear-gradient(135deg, #FFB300, #FF8F00);
    border-color: rgba(255, 179, 0, 0.6);
    color: rgba(13, 0, 26, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
    animation: btnReady 2s ease-in-out infinite;
}

.claim-free-box-btn.ready .btn-icon {
    filter: grayscale(0%);
}

@keyframes btnReady {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 179, 0, 0.5);
    }
}

.claim-free-box-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 179, 0, 0.6);
}

.claim-free-box-btn.ready:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 179, 0, 0.4);
}

.claim-free-box-btn:disabled {
    opacity: 0.6;
}

/* ===========================
   REWARD HISTORY
   =========================== */

.reward-history {
    background: linear-gradient(135deg, rgba(13, 0, 26, 0.85), rgba(46, 8, 84, 0.85));
    border: 2px solid rgba(153, 50, 204, 0.3);
    border-radius: 20px;
    padding: 20px;
    margin-top: 25px;
    backdrop-filter: blur(15px);
}

.history-title {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-empty {
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.history-item.rarity-common {
    border-left-color: #00CED1;
}

.history-item.rarity-uncommon {
    border-left-color: #2196F3;
}

.history-item.rarity-rare {
    border-left-color: #9C27B0;
}

.history-item.rarity-legendary {
    border-left-color: #FFB300;
    background: rgba(255, 179, 0, 0.1);
}

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

.history-icon {
    font-size: 32px;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.history-name {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}

.history-rarity {
    font-weight: 600;
}

.history-time {
    color: rgba(255, 255, 255, 0.5);
}

.history-value {
    font-size: 18px;
    font-weight: 700;
    color: #FFB300;
    text-shadow: 0 0 10px rgba(255, 179, 0, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===========================
   MYSTERY BOX ANIMATIONS
   =========================== */

/* Shaking animation when charging */
.mystery-box.shaking {
    animation: boxShake 0.15s infinite;
}

@keyframes boxShake {
    0%, 100% {
        transform: translateX(0) translateY(0) rotateZ(0);
    }
    25% {
        transform: translateX(-4px) translateY(2px) rotateZ(-2deg);
    }
    50% {
        transform: translateX(4px) translateY(-2px) rotateZ(2deg);
    }
    75% {
        transform: translateX(-4px) translateY(2px) rotateZ(-1deg);
    }
}

/* Exploding animation when opening */
.mystery-box.exploding {
    animation: boxExplodeDetailed 0.6s ease-out forwards;
}

@keyframes boxExplodeDetailed {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }
    60% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

/* Screen shake animation */
.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ===========================
   MOBILE RESPONSIVE
   =========================== */
@media (max-width: 640px) {
    /* Контейнер */
    .mystery-box-container {
        padding: 15px;
    }

    /* Box opening section - по-малък padding за mobile */
    .box-opening-section {
        padding: 30px 20px;
        gap: 20px;
        min-height: 400px; /* Slightly smaller but still enough space */
    }

    /* Mystery box wrapper - гарантира центриране */
    .mystery-box-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /* Mystery box size */
    .mystery-box {
        width: 180px;
        height: 180px;
        font-size: 70px;
    }

    /* Reward card - mobile responsive */
    .reward-card {
        padding: 25px 30px;
        max-width: 90%;
    }

    .reward-icon {
        font-size: 100px;
        margin-bottom: 15px;
    }

    .reward-value {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .reward-name {
        font-size: 14px;
        letter-spacing: 1.2px;
    }

    .reward-rarity {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    /* Mobile animation - smaller translateY but still dramatic */
    @keyframes rewardCardAppear {
        0% {
            opacity: 0;
            transform: scale(0) translateY(80px) rotate(-3deg);
        }
        50% {
            opacity: 0.8;
            transform: scale(1.03) translateY(-5px) rotate(1deg);
        }
        100% {
            opacity: 1;
            transform: scale(1) translateY(0) rotate(0deg);
        }
    }

    /* Timer */
    .countdown-time {
        font-size: 28px;
    }

    .timer-title {
        font-size: 16px;
    }

    /* History items */
    .history-item {
        padding: 12px;
    }

    .history-icon {
        font-size: 32px;
    }

    /* Buttons */
    .open-button,
    .claim-free-box-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .box-opening-section {
        padding: 25px 15px;
        gap: 15px;
        min-height: 380px;
    }

    .mystery-box {
        width: 160px;
        height: 160px;
        font-size: 65px;
    }

    .reward-card {
        padding: 20px 25px;
    }

    .reward-icon {
        font-size: 80px;
        margin-bottom: 10px;
    }

    .reward-value {
        font-size: 42px;
        margin-bottom: 12px;
    }

    .reward-name {
        font-size: 13px;
    }

    .countdown-time {
        font-size: 24px;
    }

    .timer-title {
        font-size: 14px;
    }

    /* Very small screens - even smaller animation */
    @keyframes rewardCardAppear {
        0% { opacity: 0; transform: scale(0) translateY(30px); }
        100% { opacity: 1; transform: scale(1) translateY(0); }
    }
}

/* ============================================
   🚀 AGGRESSIVE MOBILE PERFORMANCE
   ============================================ */

@media (max-width: 768px) {
    /* 🔥 REMOVE ALL BACKDROP FILTERS */
    .mystery-box-container,
    .mystery-box-container *,
    .box-indicator,
    .box-opening-section,
    .free-box-timer,
    .reward-history,
    .reward-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* 🔥 SIMPLIFY BOX SHADOWS */
    .mystery-box {
        box-shadow: 0 4px 16px rgba(255, 179, 0, 0.3) !important;
    }

    .mystery-box:hover {
        transform: translateY(-5px) scale(1.02) !important;
        box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4) !important;
    }

    /* 🔥 DISABLE SHIMMER ANIMATION */
    .mystery-box::before {
        animation: none !important;
        display: none !important;
    }

    /* 🔥 DISABLE INDICATOR PULSE */
    .box-indicator {
        animation: none !important;
        box-shadow: 0 2px 12px rgba(255, 179, 0, 0.3) !important;
    }

    /* 🔥 DISABLE GLOW PULSE */
    .box-glow {
        animation: none !important;
        display: none !important;
    }

    /* 🔥 SIMPLIFY SECTIONS */
    .box-opening-section,
    .free-box-timer,
    .reward-history {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
    }

    /* 🔥 CONTAIN LAYOUT */
    .mystery-box-container,
    .box-opening-section,
    .free-box-timer,
    .reward-history {
        contain: layout paint !important;
    }

    /* 🔥 SIMPLIFY REWARD CARD */
    .reward-card {
        box-shadow: 0 4px 20px rgba(255, 179, 0, 0.4) !important;
    }

    .reward-card::before {
        display: none !important;
    }

    /* 🔥 DISABLE FLOAT ANIMATION ON REWARD ICON */
    .reward-icon {
        animation: none !important;
        filter: drop-shadow(0 4px 12px rgba(255, 179, 0, 0.5)) !important;
    }

    /* 🔥 SIMPLIFY HISTORY ITEMS */
    .history-item {
        transition: none !important;
    }

    .history-item:hover {
        transform: none !important;
    }
}
