/* ═══════════════════════════════════════════
   BOOSTER PACK OPENER — Premium Experience
   ═══════════════════════════════════════════ */

/* Page & Ambient */
.booster-page { position: relative; overflow: hidden; min-height: 80vh; }

.ambient-particles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.ambient-dot {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.6), transparent);
    animation: ambientFloat 6s ease-in-out infinite alternate;
    opacity: 0;
}
@keyframes ambientFloat {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: translateY(-40px) scale(1.2); opacity: 0; }
}

/* Summoning Chamber */
.summoning-chamber { position: relative; z-index: 1; }

.chamber-icon {
    position: relative; display: inline-block; margin-bottom: 1rem;
    font-size: 2.5rem; color: var(--accent-gold);
}
.chamber-icon-ring {
    position: absolute; inset: -12px; border: 2px solid rgba(212,175,55,0.3);
    border-radius: 50%; animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%,100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.8; }
}
.chamber-subtitle { max-width: 500px; margin: 0 auto; font-style: italic; }

/* Ritual Button */
.btn-ritual-lg {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 50%, #ffd700 100%);
    background-size: 200% 200%;
    color: #000 !important; border: none; padding: 14px 32px;
    border-radius: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; cursor: pointer; transition: all 0.4s;
    font-size: 1rem;
}
.btn-ritual-lg:hover {
    transform: translateY(-3px); box-shadow: 0 8px 30px rgba(212,175,55,0.5);
    background-position: right center;
}
.btn-ritual-content { position: relative; z-index: 2; }
.btn-ritual-shimmer {
    position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
    background-size: 300% 100%; animation: shimmer 3s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -100% 0; } }

/* ── SEALED PACK SCENE ── */
.sealed-pack-scene {
    position: relative; width: 320px; height: 460px;
    margin: 0 auto; perspective: 2000px;
}

/* Energy Orbs */
.energy-orb {
    position: absolute; border-radius: 50%; filter: blur(30px);
    animation: orbFloat 5s ease-in-out infinite alternate;
    pointer-events: none; z-index: 0;
}
.energy-orb-1 { width: 120px; height: 120px; background: rgba(138,43,226,0.3); top: -30px; left: -40px; }
.energy-orb-2 { width: 80px; height: 80px; background: rgba(212,175,55,0.3); bottom: -20px; right: -30px; animation-delay: 1.5s; }
.energy-orb-3 { width: 60px; height: 60px; background: rgba(0,210,255,0.2); top: 50%; left: -20px; animation-delay: 3s; }
@keyframes orbFloat {
    0% { transform: translate(0,0) scale(1); }
    100% { transform: translate(15px,-20px) scale(1.3); }
}

/* Floating card previews behind pack */
.floating-card-preview {
    position: absolute; width: 80px; height: 112px;
    background: url('/images/backgroundcard.jpg') center/cover;
    border-radius: 6px; border: 1px solid rgba(212,175,55,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.6); opacity: 0.4;
    animation: floatCard 4s ease-in-out infinite alternate;
    pointer-events: none;
}
.fc-1 { top: 40px; left: -50px; animation-delay: 0s; transform: rotate(-12deg); }
.fc-2 { top: 80px; right: -50px; animation-delay: 1.2s; transform: rotate(8deg); }
.fc-3 { bottom: 30px; left: -30px; animation-delay: 2.4s; transform: rotate(-5deg); }
@keyframes floatCard {
    0% { transform: translateY(0) rotate(var(--rot, -12deg)); }
    100% { transform: translateY(-10px) rotate(var(--rot, -12deg)); }
}

/* Sealed Pack */
.sealed-pack {
    position: relative; width: 300px; height: 420px;
    margin: 20px auto 0; cursor: pointer; z-index: 5;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 40px rgba(212,175,55,0.15);
    border: 2px solid rgba(212,175,55,0.4);
    transition: transform 0.6s cubic-bezier(0.175,0.885,0.32,1.275), box-shadow 0.4s;
    transform-style: preserve-3d;
}
.sealed-pack:hover {
    transform: scale(1.06) rotateY(8deg) rotateX(-3deg);
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), 0 0 60px rgba(212,175,55,0.3);
}

.pack-foil-layer {
    position: absolute; inset: 0; z-index: 3;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.08) 45%, transparent 55%);
    pointer-events: none;
}

.pack-art { position: absolute; inset: 0; }
.pack-art img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6) saturate(1.3); }

.pack-seal {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
}
.seal-line {
    position: absolute; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}
.seal-line-top { top: 6px; }
.seal-line-bottom { bottom: 6px; }

.pack-content-overlay {
    position: absolute; inset: 0; z-index: 4;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.75) 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 2rem; text-align: center;
}
.pack-set-icon { color: #fff; filter: drop-shadow(0 0 15px rgba(255,255,255,0.5)); }
.pack-set-name {
    font-family: 'Marcellus', serif; font-size: 1.4rem; color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); margin: 0.5rem 0 0.3rem;
}
.pack-set-code {
    font-size: 0.8rem; letter-spacing: 3px; color: var(--accent-gold);
    background: rgba(0,0,0,0.4); padding: 4px 14px; border-radius: 20px;
    border: 1px solid rgba(212,175,55,0.3);
}
.pack-cta {
    position: relative; margin-top: 2rem;
}
.pack-cta-text {
    font-size: 0.8rem; letter-spacing: 3px; color: var(--accent-gold);
    animation: boosterPulse 2s infinite;
}
.pack-cta-glow {
    position: absolute; inset: -10px -20px; border-radius: 20px;
    background: radial-gradient(ellipse, rgba(212,175,55,0.15), transparent);
    animation: boosterPulse 2s infinite;
}
@keyframes boosterPulse {
    0%,100% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 15px var(--accent-gold); }
}

/* Pack Animations */
.pack-charging {
    animation: packCharge 0.6s ease-out forwards;
}
@keyframes packCharge {
    0% { transform: scale(1); box-shadow: 0 20px 60px rgba(0,0,0,0.9); }
    50% { transform: scale(1.08); box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 50px rgba(212,175,55,0.5); }
    100% { transform: scale(1.12); box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 80px rgba(212,175,55,0.8); }
}
.pack-tearing {
    animation: packTear 0.5s ease-in forwards;
}
@keyframes packTear {
    0% { transform: scale(1.12); clip-path: inset(0); filter: brightness(1); }
    40% { filter: brightness(3); }
    100% { transform: scale(1.5); clip-path: inset(50% 0); opacity: 0; filter: brightness(5); }
}

.tear-effect {
    position: absolute; inset: 0; z-index: 10; pointer-events: none;
    background: linear-gradient(0deg, transparent 45%, rgba(255,255,255,0.9) 50%, transparent 55%);
    opacity: 0; transition: opacity 0.2s;
}
.tear-effect.active { opacity: 1; animation: tearFlash 0.4s forwards; }
@keyframes tearFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Explosion Overlay */
.explosion-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(212,175,55,0.3));
    opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.explosion-overlay.active {
    opacity: 1; animation: explosionFade 0.4s ease-out forwards;
}
@keyframes explosionFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ── PULL SUMMARY ── */
.pull-summary-inner {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1.5rem;
}
.pull-summary-set {
    display: flex; align-items: center; color: var(--accent-gold);
}
.pull-summary-set h3 {
    font-family: 'Marcellus', serif; color: #fff; font-size: 1.3rem;
}
.pull-summary-stats { display: flex; gap: 1rem; }
.pull-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 16px; border-radius: 10px; min-width: 70px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
}
.pull-stat-count { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.pull-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.pull-stat.mythic { border-color: rgba(255,69,0,0.4); }
.pull-stat.mythic .pull-stat-count { color: #ff4500; text-shadow: 0 0 10px rgba(255,69,0,0.5); }
.pull-stat.rare { border-color: rgba(212,175,55,0.4); }
.pull-stat.rare .pull-stat-count { color: var(--accent-gold); text-shadow: 0 0 10px rgba(212,175,55,0.5); }
.pull-stat.uncommon .pull-stat-count { color: #a0a0a0; }
.pull-stat.common .pull-stat-count { color: #666; }

/* Reveal Buttons */
.btn-reveal-action {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
    color: #ccc; padding: 10px 22px; border-radius: 8px;
    transition: all 0.3s; cursor: pointer;
}
.btn-reveal-action:hover {
    background: rgba(255,255,255,0.1); border-color: var(--accent-gold);
    color: var(--accent-gold); transform: translateY(-2px);
}
.btn-reveal-action-gold {
    background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.05));
    border: 1px solid rgba(212,175,55,0.4); color: var(--accent-gold);
    padding: 10px 22px; border-radius: 8px; transition: all 0.3s; cursor: pointer;
}
.btn-reveal-action-gold:hover {
    background: linear-gradient(135deg, rgba(212,175,55,0.4), rgba(212,175,55,0.1));
    box-shadow: 0 0 20px rgba(212,175,55,0.3); transform: translateY(-2px);
}

/* ── BOOSTER CARDS GRID ── */
.booster-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem; justify-items: center;
}

/* Card Slot */
.booster-card-slot {
    width: 230px; height: 340px; perspective: 1200px;
    opacity: 0; transform: translateY(40px) scale(0.9);
    transition: opacity 0.5s, transform 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
    position: relative;
}
.booster-card-slot.entered {
    opacity: 1; transform: translateY(0) scale(1);
}
.booster-card-slot.hero-slot { order: -1; }

/* Flipper */
.booster-card-flipper {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.9s cubic-bezier(0.175,0.885,0.32,1.275);
    transform-style: preserve-3d; cursor: pointer;
}
.booster-card-flipper.is-flipped { transform: rotateY(180deg); }

.booster-card-back, .booster-card-front {
    position: absolute; inset: 0;
    backface-visibility: hidden; border-radius: 14px; overflow: hidden;
}

/* Card Back */
.booster-card-back {
    background: #0a0a0a; border: 2px solid rgba(212,175,55,0.2);
    border-radius: 14px;
}
.card-back-design { position: relative; width: 100%; height: 100%; }
.card-back-design img { width: 100%; height: 100%; object-fit: cover; }
.card-back-vignette {
    position: absolute; inset: 0;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}
.card-back-number {
    position: absolute; bottom: 8px; right: 10px;
    font-size: 0.7rem; color: rgba(255,255,255,0.3);
    font-weight: 600;
}
.card-back-rarity-hint {
    position: absolute; top: 10px; right: 10px;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; animation: hintPulse 2s infinite;
}
.card-back-rarity-hint.mythic { color: #ff4500; background: rgba(255,69,0,0.15); }
.card-back-rarity-hint.rare { color: var(--accent-gold); background: rgba(212,175,55,0.15); }
@keyframes hintPulse {
    0%,100% { box-shadow: 0 0 5px currentColor; }
    50% { box-shadow: 0 0 15px currentColor; }
}

/* Card Front */
.booster-card-front { transform: rotateY(180deg); }

.booster-card-inner-front {
    position: relative; width: 100%; height: 100%;
    background: rgba(15,18,25,0.95); border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
    border: 2px solid rgba(255,255,255,0.1);
    transition: box-shadow 0.4s;
}

/* Rarity borders */
.mythic-border {
    border-color: #ff4500 !important;
    box-shadow: 0 0 25px rgba(255,69,0,0.5), 0 0 60px rgba(255,69,0,0.2),
                inset 0 0 20px rgba(255,69,0,0.1);
}
.rare-border {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 20px rgba(212,175,55,0.4), 0 0 50px rgba(212,175,55,0.15);
}
.uncommon-border { border-color: rgba(160,160,160,0.5) !important; }

/* Prismatic & Golden BGs */
.mythic-prismatic-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(135deg,
        rgba(255,69,0,0.1) 0%, rgba(255,165,0,0.05) 25%,
        rgba(255,69,0,0.08) 50%, rgba(255,0,100,0.05) 75%, rgba(255,69,0,0.1) 100%);
    animation: prismaticShift 4s ease-in-out infinite alternate;
}
@keyframes prismaticShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(30deg); }
}
.rare-golden-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(135deg, rgba(212,175,55,0.05) 0%, transparent 50%, rgba(212,175,55,0.05) 100%);
}

/* Card Art */
.card-art-wrapper {
    position: relative; flex: 1; overflow: hidden; z-index: 1;
}
.booster-card-art {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.booster-card-slot:hover .booster-card-art { transform: scale(1.05); }

.card-art-overlay-badges {
    position: absolute; top: 8px; left: 8px; right: 8px;
    display: flex; justify-content: space-between; pointer-events: none;
}
.booster-lang-badge {
    background: rgba(0,0,0,0.7); color: #fff; padding: 2px 8px;
    border-radius: 4px; font-size: 0.65rem; font-weight: 700;
    border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(4px);
}
.booster-rarity-gem {
    width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.7rem; font-weight: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.booster-rarity-gem.mythic { background: linear-gradient(135deg,#d45c1a,#ff6b35); color: #fff; box-shadow: 0 0 12px rgba(255,69,0,0.5); }
.booster-rarity-gem.rare { background: linear-gradient(135deg,#c5a14d,#e8c84a); color: #000; box-shadow: 0 0 12px rgba(212,175,55,0.5); }
.booster-rarity-gem.uncommon { background: linear-gradient(135deg,#707883,#a8b0b8); color: #fff; }
.booster-rarity-gem.common { background: #1a1718; color: #fff; border: 1px solid #888; }

.no-art-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: var(--text-muted);
}

/* Card Info Strip */
.card-info-strip {
    padding: 10px 12px; background: rgba(0,0,0,0.5); z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.card-reveal-name {
    font-size: 0.9rem; color: #fff; margin: 0 0 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Inter', sans-serif; font-weight: 600;
    text-transform: none; letter-spacing: 0;
}
.card-reveal-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.7rem;
}
.card-reveal-set { color: var(--accent-gold); font-weight: 600; }
.card-reveal-number { color: var(--text-muted); }

/* Holographic Overlay */
.card-holographic-overlay {
    position: absolute; inset: 0; z-index: 5; pointer-events: none;
    background: linear-gradient(135deg,
        transparent 20%, rgba(255,255,255,0.03) 30%,
        rgba(255,200,100,0.06) 40%, rgba(100,200,255,0.06) 50%,
        rgba(255,100,200,0.04) 60%, transparent 70%);
    background-size: 250% 250%; opacity: 0;
    transition: opacity 0.4s;
}
.booster-card-flipper.is-flipped .card-holographic-overlay {
    opacity: 1; animation: holoShift 4s ease-in-out infinite;
}
@keyframes holoShift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* ── REVEAL EFFECTS ── */
.reveal-spark {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    top: 50%; left: 50%; z-index: 20; pointer-events: none;
    animation: sparkBurst 0.8s ease-out var(--delay, 0s) forwards;
}
.mythic-spark { background: #ff4500; box-shadow: 0 0 8px #ff4500; }
.rare-spark { background: var(--accent-gold); box-shadow: 0 0 8px var(--accent-gold); }

@keyframes sparkBurst {
    0% { transform: translate(-50%,-50%) translateX(0) translateY(0) scale(1); opacity: 1; }
    100% {
        transform: translate(-50%,-50%)
            translateX(calc(cos(var(--angle, 0deg)) * var(--dist, 60px)))
            translateY(calc(sin(var(--angle, 0deg)) * var(--dist, 60px)))
            scale(0);
        opacity: 0;
    }
}

.mythic-reveal-active .booster-card-inner-front {
    animation: mythicGlow 1s ease-out;
}
@keyframes mythicGlow {
    0% { box-shadow: 0 0 30px rgba(255,69,0,0.8), 0 0 80px rgba(255,69,0,0.4); }
    100% { box-shadow: 0 0 25px rgba(255,69,0,0.5), 0 0 60px rgba(255,69,0,0.2); }
}
.rare-reveal-active .booster-card-inner-front {
    animation: rareGlow 1s ease-out;
}
@keyframes rareGlow {
    0% { box-shadow: 0 0 25px rgba(212,175,55,0.8), 0 0 60px rgba(212,175,55,0.4); }
    100% { box-shadow: 0 0 20px rgba(212,175,55,0.4), 0 0 50px rgba(212,175,55,0.15); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .booster-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .booster-card-slot { width: 170px; height: 250px; }
    .sealed-pack-scene { width: 260px; height: 380px; }
    .sealed-pack { width: 240px; height: 340px; }
    .pull-summary-inner { flex-direction: column; text-align: center; }
    .pull-summary-stats { justify-content: center; }
    .floating-card-preview { display: none; }
}
