/* ═══════════════════════════════════════════════════════════════════
   PACK REVEAL ANIMATION
   ═══════════════════════════════════════════════════════════════════ */

/* Overlay */
.pack-reveal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pack-reveal-overlay.active {
    opacity: 1;
}

.pack-reveal-overlay.closing {
    opacity: 0;
}

.pack-reveal-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
}

/* Close button */
.pack-reveal-close {
    position: absolute;
    top: 0;
    right: 10px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
}

.pack-reveal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════════
   PACK ANIMATION
   ═══════════════════════════════════════════════════════════════════ */

.pack-animation {
    position: relative;
    width: 120px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pack-box {
    position: relative;
    width: 100px;
    height: 130px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border: 3px solid #3b82f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
}

.pack-glow {
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5) 0%, transparent 70%);
    border-radius: 20px;
    animation: pulse-glow 0.8s ease-in-out infinite;
}

.pack-icon {
    font-size: 56px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Shake */
.pack-box.shaking {
    animation: shake 0.08s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-6px) rotate(-3deg); }
    75% { transform: translateX(6px) rotate(3deg); }
}

/* Burst */
.pack-box.bursting {
    animation: burst 0.4s ease-out forwards;
}

@keyframes burst {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
    100% { transform: scale(2); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS REVEAL AREA
   ═══════════════════════════════════════════════════════════════════ */

.cards-reveal-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
}

.cards-reveal-area.appearing {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.cards-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   REVEAL CARD
   ═══════════════════════════════════════════════════════════════════ */

.reveal-card {
    position: relative;
    width: 90px;
    height: 130px;
    cursor: pointer;
    transform: scale(0) rotateY(180deg);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--delay, 0) * 0.12s);
}

.reveal-card.revealed {
    transform: scale(1) rotateY(0);
    opacity: 1;
}

.reveal-card:hover {
    transform: scale(1.08) rotateY(0);
    z-index: 10;
}

.reveal-card:active {
    transform: scale(0.95) rotateY(0);
}

.reveal-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #4a5568;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* Card image */
.reveal-card-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
}

.reveal-card-image img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Card name */
.reveal-card-name {
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: rgba(0,0,0,0.3);
}

/* Card rarity badge */
.reveal-card-rarity {
    font-size: 8px;
    text-align: center;
    padding: 3px 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reveal-card-rarity.common { background: #4a5568; color: #e2e8f0; }
.reveal-card-rarity.rare { background: #2563eb; color: #fff; }
.reveal-card-rarity.epic { background: #7c3aed; color: #fff; }
.reveal-card-rarity.legendary { background: linear-gradient(90deg, #f59e0b, #fbbf24); color: #1a1a2e; }

/* Sparkles for high rarity */
.reveal-card-sparkles {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    animation: sparkle 1s ease-in-out infinite;
    z-index: 5;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ═══════════════════════════════════════════════════════════════════
   RARITY GLOW EFFECTS
   ═══════════════════════════════════════════════════════════════════ */

.reveal-card-glow {
    position: absolute;
    inset: -3px;
    border-radius: 10px;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s;
}

.reveal-card.revealed .reveal-card-glow {
    opacity: 1;
}

.reveal-card-glow.common {
    box-shadow: 0 0 12px rgba(156, 163, 175, 0.4);
}

.reveal-card-glow.rare {
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.7);
    animation: glow-pulse 1.5s ease-in-out infinite;
}

.reveal-card-glow.epic {
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.8);
    animation: glow-pulse 1.2s ease-in-out infinite;
}

.reveal-card-glow.legendary {
    background: conic-gradient(from 0deg, #f59e0b, #fbbf24, #f59e0b);
    animation: legendary-spin 2s linear infinite;
    filter: blur(4px);
}

/* Legendary card border */
.reveal-card.legendary .reveal-card-inner {
    border-color: #f59e0b;
    box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Epic card border */
.reveal-card.epic .reveal-card-inner {
    border-color: #8b5cf6;
}

/* Rare card border */
.reveal-card.rare .reveal-card-inner {
    border-color: #3b82f6;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes legendary-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   REVEAL MESSAGE
   ═══════════════════════════════════════════════════════════════════ */

.reveal-message {
    text-align: center;
}

.reveal-icon {
    font-size: 40px;
    animation: bounce 0.6s ease;
}

.reveal-title {
    font-size: 24px;
    font-weight: bold;
    color: #10b981;
    margin: 6px 0;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.reveal-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    60% { transform: translateY(-4px); }
}

/* No cards fallback */
.reveal-no-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px;
}

.reveal-no-cards-icon {
    font-size: 48px;
}

.reveal-no-cards-text {
    font-size: 20px;
    font-weight: 600;
    color: #10b981;
}

.reveal-no-cards-hint {
    font-size: 13px;
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════
   PARTICLES
   ═══════════════════════════════════════════════════════════════════ */

.cards-burst-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.burst-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color, #f59e0b);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color, #f59e0b);
    animation: particle-fly 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

.burst-particle:nth-child(4n+1) { animation-name: fly-1; }
.burst-particle:nth-child(4n+2) { animation-name: fly-2; }
.burst-particle:nth-child(4n+3) { animation-name: fly-3; }
.burst-particle:nth-child(4n+4) { animation-name: fly-4; }

@keyframes fly-1 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(80px, -60px) scale(0); opacity: 0; }
}
@keyframes fly-2 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(-80px, -60px) scale(0); opacity: 0; }
}
@keyframes fly-3 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(60px, 70px) scale(0); opacity: 0; }
}
@keyframes fly-4 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(-60px, 70px) scale(0); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   CONTINUE BUTTON
   ═══════════════════════════════════════════════════════════════════ */

.pack-reveal-continue {
    margin-top: 10px;
    padding: 14px 50px;
    font-size: 18px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 500px) {
    .reveal-card {
        width: 65px;
        height: 95px;
    }

    .reveal-card-image img {
        max-height: 45px;
    }

    .reveal-card-name {
        font-size: 7px;
        padding: 1px 2px;
    }

    .reveal-card-rarity {
        font-size: 6px;
        padding: 2px;
    }

    .reveal-card-sparkles {
        font-size: 10px;
        top: 2px;
        right: 2px;
    }

    .cards-container {
        gap: 8px;
    }

    .reveal-title {
        font-size: 20px;
    }

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

@media (max-width: 350px) {
    .reveal-card {
        width: 55px;
        height: 80px;
    }

    .reveal-card-image img {
        max-height: 35px;
    }

    .cards-container {
        gap: 6px;
    }
}
