:root {
    --primary: #ff4e00;
    --primary-glow: rgba(255, 78, 0, 0.4);
    --secondary: #ec9f05;
    --dark-bg: #0d0907;
    --panel-bg: rgba(25, 17, 14, 0.85);
    --card-width: 320px;
    --card-height: 444px;
    --pack-width: 200px;
    --pack-height: 341px;
    --pack-selected-width: 300px;
    --pack-selected-height: 512px;
    --ring-radius: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

/* Body styles removed to prevent clashing with site header/footer */

/* Arena Background & Particle Canvas */
.arena-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.6s ease-in-out;
}

.arena-bg.standard {
    background-image: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.9)), url('images/standart-bg.png');
}

.arena-bg.premium {
    background-image: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.9)), url('images/premium-bg.png');
}

.arena-bg.store {
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.95)), url('images/standart-bg.png');
}
.arena-bg.store .bg-glow {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%) !important;
}

.carousel-pack.switching {
    opacity: 0 !important;
    /* transform set by JS with concrete pixel values */
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle, rgba(236, 159, 5, 0.08) 0%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.ambient-particle {
    position: absolute;
    background: radial-gradient(circle, #ff6a00 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.6;
    animation: floatAmbient 12s infinite linear;
}

@keyframes floatAmbient {
    0% {
        transform: translateY(105vh) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) translateX(50px) scale(0.5);
        opacity: 0;
    }
}

/* Main Layout */
.interaction-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 40px 20px;
}

/* Header Text styling */
.instruction-overlay {
    text-align: center;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.instruction-overlay.fade-out {
    opacity: 0;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #fff 30%, #ec9f05 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(236, 159, 5, 0.3);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

/* Carousel Section (3D Ring) */
.carousel-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    -webkit-perspective: 1500px;
    overflow: visible;
    touch-action: none;
}

.packs-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateX(-8deg) rotateY(0deg);
    -webkit-transform: rotateX(-8deg) rotateY(0deg);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-transition: -webkit-transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: grab;
    touch-action: none;
    will-change: transform;
}

.packs-carousel:active {
    cursor: grabbing;
}

/* Carousel Pack default 3D state */
.carousel-pack {
    position: absolute;
    width: var(--pack-width);
    height: var(--pack-height);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    touch-action: none;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s, filter 0.5s;
    -webkit-transition: -webkit-transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s, filter 0.5s;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

/* Pack ring angles - JS reads these and sets inline transforms directly */
.carousel-pack[data-index="1"] { --pack-angle-deg: 0; }
.carousel-pack[data-index="2"] { --pack-angle-deg: 72; }
.carousel-pack[data-index="3"] { --pack-angle-deg: 144; }
.carousel-pack[data-index="4"] { --pack-angle-deg: 216; }
.carousel-pack[data-index="5"] { --pack-angle-deg: 288; }

/* Hover highlights on unselected packs */
.carousel-pack:not(.selected) {
    opacity: 0.85;
    filter: brightness(0.7) blur(1px);
}

.carousel-pack.active-front {
    opacity: 1;
    filter: brightness(1.1) drop-shadow(0 0 15px rgba(255, 78, 0, 0.3));
}

.carousel-pack:not(.selected):hover {
    filter: brightness(1.2) drop-shadow(0 0 25px rgba(255, 78, 0, 0.5));
}

/* Hidden state for packs when one is selected - JS sets transform inline */
.carousel-pack.hidden {
    opacity: 0;
    pointer-events: none;
    /* transform set by JS with concrete pixel values */
}

/* Selected Pack zooms, centers, and retains its Y-angle alignment to face screen perfectly */
/* JS sets the transform inline with concrete pixel values for cross-browser 3D compat */
.carousel-pack.selected {
    width: var(--pack-selected-width);
    height: var(--pack-selected-height);
    z-index: 100;
    cursor: default;
    filter: brightness(1) !important;
    opacity: 1 !important;
}

/* Pack 3D Container */
.pack-3d-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    animation: floatPack 4s ease-in-out infinite alternate;
}

/* Stagger floating delays for each pack to make it look organic */
.carousel-pack[data-index="1"] .pack-3d-container { animation-delay: 0s; }
.carousel-pack[data-index="2"] .pack-3d-container { animation-delay: 0.8s; }
.carousel-pack[data-index="3"] .pack-3d-container { animation-delay: 1.6s; }
.carousel-pack[data-index="4"] .pack-3d-container { animation-delay: 2.4s; }
.carousel-pack[data-index="5"] .pack-3d-container { animation-delay: 3.2s; }

@keyframes floatPack {
    0% { transform: translateY(0px) rotateX(0deg); }
    100% { transform: translateY(-15px) rotateX(3deg); }
}

/* Glow line (Visible only when selected) */
.rip-glow-line {
    position: absolute;
    top: 12.1%;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ff7b00, #fff, #ff7b00, transparent);
    box-shadow: 0 0 15px #ff5100, 0 0 30px #ff5100;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.carousel-pack.selected .rip-glow-line {
    opacity: 0.9;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.6; filter: brightness(1); }
    100% { opacity: 1; filter: brightness(1.5); }
}

/* Pack Slices using clip-path */
.pack-part {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    overflow: hidden;
    border-radius: 16px;
    transform-style: preserve-3d;
}

.pack-image-slice {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-image: url('images/pack.png');
    background-size: 100% 100%;
    background-position: center;
    /* CSS Box Shadow Extrusion: Adds 4px of solid 3D edge depth */
    box-shadow: 0 1px 0 #2a1b14, 
                0 2px 0 #2a1b14, 
                0 3px 0 #221510, 
                0 4px 0 #1a0f0a, 
                0 15px 35px rgba(0,0,0,0.7);
}

/* Volumetric shine overlay on pack to make it look like thick glossy plastic */
.pack-part::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 40%, rgba(0,0,0,0.2) 60%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}

.pack-top {
    z-index: 12;
    clip-path: inset(0 0 87.9% 0);
}

.carousel-pack.selected .pack-top {
    cursor: grab;
}

.carousel-pack.selected .pack-top:active {
    cursor: grabbing;
}

.pack-bottom {
    z-index: 11;
    clip-path: inset(12.1% 0 0 0);
}

/* Drag indicator handle (Hidden by default, visible on selected pack) */
.drag-handle {
    position: absolute;
    top: 12.1%; 
    left: 6.4%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.5s;
}

.carousel-pack.selected .drag-handle {
    opacity: 1;
}

.drag-indicator {
    width: 8px;
    height: 20px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    position: relative;
    animation: bounceIndicatorHorizontal 1.5s infinite;
}

.drag-indicator::before, .drag-indicator::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid #fff;
    left: 11px;
    top: 6px;
}

@keyframes bounceIndicatorHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

/* Ripped/Torn Animation Classes (Horizontal tear, pulling top piece rightward) */
.pack-top.ripping {
    transition: transform 0.05s ease-out;
}

.pack-top.torn {
    animation: ripTopRight 0.8s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

.pack-bottom.torn {
    animation: ripBottomDown 0.8s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes ripTopRight {
    0% {
        transform: translateX(var(--drag-x, 0px)) rotate(0deg);
    }
    30% {
        transform: translate(120px, -20px) rotate(15deg) translateZ(50px);
        opacity: 1;
    }
    100% {
        transform: translate(450px, -100px) rotate(45deg) translateZ(200px);
        opacity: 0;
    }
}

@keyframes ripBottomDown {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    40% {
        transform: translateY(50px) rotate(5deg) scale(0.95);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(10deg) scale(0.8);
        opacity: 0;
    }
}

/* Sparks/Rip Particles */
.rip-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ff8800 70%);
    box-shadow: 0 0 10px #ff4e00;
    pointer-events: none;
    z-index: 100;
}

/* Single Card Reveal Container */
.single-card-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--card-width);
    height: var(--card-height);
    perspective: 1200px;
    pointer-events: none;
    z-index: 50;
}

.card {
    width: 100%;
    height: 100%;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(120px) scale(0.4) rotateY(0deg);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card.visible {
    opacity: 1;
    transform: translateY(0) scale(1) rotateY(0deg);
    pointer-events: auto;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-back, .card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 2px solid rgba(236, 159, 5, 0.2);
}

.card-back img, .card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    transform: rotateY(180deg);
    border: 2.5px solid rgba(236, 159, 5, 0.7);
    box-shadow: 0 15px 40px rgba(236, 159, 5, 0.35);
}

/* Holographic Shine effect on Card Front */
.holo-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 0, 128, 0.15) 30%,
        rgba(0, 230, 255, 0.2) 50%,
        transparent 80%
    );
    mix-blend-mode: color-dodge;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover .holo-shine {
    opacity: 1;
}

/* Fighter Info Overlay Styling on Card Front */
.fighter-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 75%, transparent);
    padding: 20px 15px 15px 15px;
    z-index: 10;
    text-align: center;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

.fighter-name {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(255, 78, 0, 0.5);
    margin-bottom: 2px;
}

.fighter-division {
    font-size: 0.75rem;
    color: var(--secondary);
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 12px;
}

.fighter-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-lbl {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
    font-weight: 600;
}

.stat-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

/* Control buttons style */
.controls-overlay {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
    z-index: 100;
}

.controls-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-reset {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 14px 36px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 78, 0, 0.4), inset 0 0 10px rgba(255,255,255,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-reset:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 78, 0, 0.6), inset 0 0 15px rgba(255,255,255,0.3);
}

.btn-reset:active {
    transform: scale(0.98);
}

/* Mobile responsive fixes */
@media (max-width: 900px) {
    .packs-carousel {
        transform: scale(0.8) rotateX(-8deg) !important;
    }
}

/* Sticky Footer Controls */
.sticky-footer-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(8, 6, 5, 0.97);
    border-top: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.footer-left, .footer-right {
    flex: 1;
    display: flex;
}
.footer-left {
    justify-content: flex-start;
    gap: 10px;
}
.footer-right {
    justify-content: flex-end;
}
.footer-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* ── da-nav-btn style applied to footer buttons ─────────── */
.footer-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
    padding: .6em 1.4em;
    cursor: pointer;
    background: #3F4147;
    border: none;
    border-radius: .35em;
    text-transform: uppercase;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #E8E8E8;
    perspective: 600px;
    transform-style: preserve-3d;
    text-decoration: none;
    transition: background 0.3s 0.08s, color 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
.footer-btn::before,
.footer-btn::after {
    --z: 0;
    position: absolute;
    top: 0; left: 0;
    display: block;
    content: '';
    width: 100%; height: 100%;
    opacity: 0;
    border-radius: inherit;
    transform-style: preserve-3d;
    transform: translate3d(
        calc(var(--z) * 0px),
        calc(var(--z) * 0px),
        calc(var(--z) * 0px)
    );
    pointer-events: none;
}
.footer-btn::after {
    background-color: transparent;
    border: 2px solid #D7B25C;
    box-shadow: 0 0 10px rgba(215, 178, 92, 0.5);
}
.footer-btn::before {
    background-color: transparent;
    border: 2px solid #DA4541;
    box-shadow: 0 0 10px rgba(218, 69, 65, 0.5);
}
.footer-btn:hover {
    background-color: #5F626A;
    color: #fff;
}
.footer-btn:hover::before {
    --z: 0.035;
    animation: footerWobble 2.2s ease forwards;
}
.footer-btn:hover::after {
    --z: -0.05;
    animation: footerWobble 2.2s ease forwards;
}
.footer-btn:active { transform: scale(0.97); }

@keyframes footerWobble {
    0%   { opacity:0; transform: translate3d(calc(var(--z)*0px),   calc(var(--z)*0px),   calc(var(--z)*0px)); }
    16%  {            transform: translate3d(calc(var(--z)*140px), calc(var(--z)*140px), calc(var(--z)*140px)); }
    28%  { opacity:1; transform: translate3d(calc(var(--z)*60px),  calc(var(--z)*60px),  calc(var(--z)*60px)); }
    44%  {            transform: translate3d(calc(var(--z)*110px), calc(var(--z)*110px), calc(var(--z)*110px)); }
    59%  {            transform: translate3d(calc(var(--z)*75px),  calc(var(--z)*75px),  calc(var(--z)*75px)); }
    73%  {            transform: translate3d(calc(var(--z)*95px),  calc(var(--z)*95px),  calc(var(--z)*95px)); }
    88%  { opacity:1; transform: translate3d(calc(var(--z)*82px),  calc(var(--z)*82px),  calc(var(--z)*82px)); }
    100% { opacity:1; transform: translate3d(calc(var(--z)*88px),  calc(var(--z)*88px),  calc(var(--z)*88px)); }
}

/* Spin button: crimson highlight */
.footer-btn.btn-spin {
    background: #DA4541;
    color: #fff;
    box-shadow: 0 0 18px rgba(218, 69, 65, 0.45), inset 0 1px 0 rgba(255,255,255,0.12);
}
.footer-btn.btn-spin::before { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.3); }
.footer-btn.btn-spin::after  { border-color: #D7B25C; }
.footer-btn.btn-spin:hover { background: #be123c; }

/* Active pack type badge in footer */
.pack-type-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: .35em;
    border: 1px solid rgba(215, 178, 92, 0.35);
    background: rgba(215, 178, 92, 0.08);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #D7B25C;
    transition: all 0.35s;
    white-space: nowrap;
}
.pack-type-indicator.standard { color: #e8e8e8; border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.pack-type-indicator.premium  { color: #D7B25C; border-color: rgba(215,178,92,0.35); background: rgba(215,178,92,0.08); }
.pack-type-indicator.store    { color: #10b981; border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.08); }

/* Revealed Multiple Cards Grid Styles */
.revealed-cards-container {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 40px 20px;
}

.cards-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    width: 100%;
    max-width: 1200px;
}

.action-buttons-wrap {
    display: flex;
    gap: 15px;
}

.btn-goto-store {
    background: #D7B25C;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-close-reveal {
    background: #27272a;
    color: #fff;
    border: 1px solid #3f3f46;
    padding: 12px 30px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-goto-store:hover, .btn-close-reveal:hover {
    transform: scale(1.05);
}

/* Card styles in grid */
.revealed-card-item {
    width: 200px;
    height: 277px;
    perspective: 1000px;
    opacity: 0;
    transform: translate(0, 50px) scale(0.3) rotate(0deg);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s;
}

.revealed-card-item.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
}

.revealed-card-item.flipped .card-inner {
    transform: rotateY(180deg);
}

.revealed-card-item .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.revealed-card-item .card-front, .revealed-card-item .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.1);
}

.revealed-card-item .card-back {
    background: #111;
}

.revealed-card-item .card-front {
    transform: rotateY(180deg);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    border: none !important;
}

.revealed-card-item .card-front.rarity-common { background-image: url('images/common.webp'); }
.revealed-card-item .card-front.rarity-uncommon { background-image: url('images/uncommon.webp'); }
.revealed-card-item .card-front.rarity-rare { background-image: url('images/rare.webp'); }
.revealed-card-item .card-front.rarity-epic { background-image: url('images/epic.webp'); }
.revealed-card-item .card-front.rarity-legendary { background-image: url('images/legendary.webp'); }

.revealed-card-item .fighter-body {
    position: absolute;
    left: 22.25%;
    top: 17.8%;
    width: 54.46%;
    height: 59.78%;
    background-size: contain;
    background-position: bottom center;
    background-repeat: no-repeat;
    z-index: 3;
}

.revealed-card-item .fighter-info-panel {
    position: absolute;
    left: 17.55%;
    top: 83.07%;
    width: 63.75%;
    height: 13.13%;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 2px;
    overflow: hidden;
}

.revealed-card-item .fighter-name {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    text-align: center;
}

.revealed-card-item .fighter-division {
    font-size: 0.45rem !important;
    margin: 0 !important;
}

.revealed-card-item .fighter-stats {
    padding: 4px;
    gap: 4px;
}

.revealed-card-item .stat-lbl {
    font-size: 0.5rem;
}

.revealed-card-item .stat-val {
    font-size: 0.75rem;
}

/* Explosion flash & screen shake */
.explosion-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}

.explosion-flash.active {
    animation: flashAnim 0.8s ease-out forwards;
}

@keyframes flashAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.shake {
    animation: shakeAnim 0.3s ease-in-out infinite;
}

@keyframes shakeAnim {
    0%, 100% { transform: translate(0, 0); }
    20%, 60% { transform: translate(-5px, 5px); }
    40%, 80% { transform: translate(5px, -5px); }
}

/* Pack image slice background updates */
.standard-img {
    background-image: url('images/standart-paket.webp') !important;
    background-color: #1a100a;
}
.premium-img {
    background-image: url('images/premium-paket.webp') !important;
    background-color: #2a1f0a;
}
.store-img {
    background-image: url('images/store-pack.webp') !important;
    background-color: #0c2014;
}

/* Package Type Selector Buttons */
.type-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: #aaa;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.type-btn.active {
    background: #e11d48;
    border-color: #e11d48;
    color: #fff;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.3);
}
.type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Hide site's sticky mobile navigation on this page */
@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Fly-down collection animation to simulate cards entering the pack */
.revealed-card-item {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s, box-shadow 0.3s;
}
.revealed-card-item.collecting {
    transform: translate(var(--collect-x, 0px), 800px) scale(0) rotate(15deg) !important;
    opacity: 0 !important;
    transition: transform 0.9s cubic-bezier(0.6, -0.28, 0.735, 0.045), opacity 0.8s ease-in !important;
}

.btn-goto-album {
    background: #eab308;
    border: none;
    color: #000;
    padding: 12px 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    font-size: 1.05rem;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-goto-album:hover {
    background: #ca8a04;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4);
}

/* =========================================
   MOBILE: Flat 2D Swipe Carousel (no 3D)
   iOS Safari's preserve-3d is unreliable.
   We switch to a horizontal scroll-snap carousel on mobile.
   ========================================= */
@media (max-width: 768px) {
    :root {
        --pack-width: 130px;
        --pack-height: 221px;
        --pack-selected-width: 200px;
        --pack-selected-height: 341px;
        --ring-radius: 150px;
    }

    .interaction-container {
        overflow: hidden !important;
        height: auto !important;
        min-height: 100vh !important;
        padding: 120px 0 100px 0 !important;
        justify-content: flex-start !important;
    }

    .title {
        font-size: 1.5rem !important;
        padding: 0 16px;
    }

    .subtitle {
        font-size: 0.75rem !important;
        padding: 0 16px;
    }

    /* 3D carousel on mobile (scaled down) */
    .carousel-container {
        position: absolute !important;
        top: 45% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 100vw !important;
        height: 380px !important;
        perspective: 1000px !important;
        -webkit-perspective: 1000px !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    .packs-carousel {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        transform-style: flat !important;
        -webkit-transform-style: flat !important;
        display: block !important;
        overflow: visible !important;
        padding: 0 !important;
        touch-action: none !important;
    }

    .carousel-pack {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: var(--pack-width) !important;
        height: var(--pack-height) !important;
        transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        -webkit-transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        touch-action: none !important;
        pointer-events: auto !important;
    }

    /* 2.5D Mobile Positioning States */
    /* Pos 0: Center front active pack */
    .carousel-pack[data-pos="0"] {
        transform: translate(-50%, -50%) scale(1.1) !important;
        z-index: 5 !important;
        opacity: 1 !important;
        filter: brightness(1.1) !important;
    }

    /* Pos -1: Left side pack */
    .carousel-pack[data-pos="-1"] {
        transform: translate(-112%, -50%) scale(0.88) !important;
        z-index: 4 !important;
        opacity: 0.6 !important;
        filter: brightness(0.6) blur(1px) !important;
    }

    /* Pos 1: Right side pack */
    .carousel-pack[data-pos="1"] {
        transform: translate(12%, -50%) scale(0.88) !important;
        z-index: 4 !important;
        opacity: 0.6 !important;
        filter: brightness(0.6) blur(1px) !important;
    }

    /* Pos -2: Far Left back (dimmed) */
    .carousel-pack[data-pos="-2"] {
        transform: translate(-155%, -50%) scale(0.72) !important;
        z-index: 3 !important;
        opacity: 0.15 !important;
        filter: brightness(0.4) blur(2px) !important;
        pointer-events: none !important;
    }

    /* Pos 2: Far Right back (dimmed) */
    .carousel-pack[data-pos="2"] {
        transform: translate(55%, -50%) scale(0.72) !important;
        z-index: 3 !important;
        opacity: 0.15 !important;
        filter: brightness(0.4) blur(2px) !important;
        pointer-events: none !important;
    }

    /* Bring the selected pack forward and scale it up */
    .carousel-pack.selected {
        transform: translate(-50%, -50%) scale(1.22) !important;
        width: var(--pack-selected-width) !important;
        height: var(--pack-selected-height) !important;
        z-index: 100 !important;
        cursor: default !important;
        filter: brightness(1) !important;
        opacity: 1 !important;
    }

    .carousel-pack.hidden {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translate(-50%, -50%) scale(0.2) !important;
    }

    .pack-3d-container {
        transform-style: flat !important;
        -webkit-transform-style: flat !important;
    }

    /* Cards reveal grid responsive */
    .cards-grid {
        gap: 12px !important;
        padding: 10px !important;
        justify-content: center !important;
        margin-bottom: 30px !important;
    }

    .revealed-card-item {
        width: 120px !important;
        height: 166px !important;
    }

    .revealed-card-item .fighter-name {
        font-size: 0.45rem !important;
    }

    .revealed-card-item .fighter-division {
        font-size: 0.3rem !important;
    }

    /* Sticky footer mobile scaling */
    .sticky-footer-controls {
        padding: 10px 12px !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .footer-left, .footer-right, .footer-center {
        flex: unset !important;
    }
    .footer-left { gap: 6px !important; }
    .footer-center { gap: 6px !important; }

    .footer-btn {
        padding: .5em 1em !important;
        font-size: 0.72rem !important;
        gap: 5px !important;
    }
    .footer-btn i { font-size: 0.85rem !important; }

    .pack-type-indicator {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }

    .footer-balance-badge {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .action-buttons-wrap {
        gap: 10px !important;
    }

    .action-buttons-wrap button {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
    }
}

/* =========================================
   PREMIUM GPU-ACCELERATED CARDS REVEAL EFFECTS
   ========================================= */

/* Shimmer/Holographic Light Sweep Sweep */
.card-front {
    position: relative;
    overflow: hidden;
}

.card-front::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 300%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 38%,
        rgba(255, 255, 255, 0.45) 45%,
        rgba(255, 255, 255, 0.05) 52%,
        transparent 60%
    );
    transform: rotate(-25deg);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    will-change: left, opacity;
}

.revealed-card-item.flipped .card-front::after {
    animation: holoSweep 1.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.8s; /* Fires right as card finishes flipping */
}

@keyframes holoSweep {
    0% {
        left: -150%;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        left: 50%;
        opacity: 0;
    }
}

/* Localized Shockwave Ring expansion (GPU accelerated, zero repaint cost) */
.explosion-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ec9f05;
    box-shadow: 0 0 25px #ff4e00, inset 0 0 25px #ff4e00;
    opacity: 1;
    pointer-events: none;
    z-index: 10;
    animation: shockwaveExpand 1.1s cubic-bezier(0.1, 0.8, 0.15, 1) forwards;
    will-change: transform, opacity;
}

@keyframes shockwaveExpand {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 1;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(9);
        opacity: 0;
        border-width: 1px;
    }
}

/* Localized Screen Shake (Applied only to cards grid, saves full screen repaint lag) */
.local-shake-anim {
    animation: localShake 0.45s cubic-bezier(.36,.07,.19,.97) both;
    will-change: transform;
}

@keyframes localShake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* GPU-accelerated CSS Shimmer Spark particles */
.card-shimmer-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--spark-color, #ff8800) 70%);
    box-shadow: 0 0 8px var(--spark-color, #ff4e00);
    pointer-events: none;
    z-index: 100;
    will-change: transform, opacity;
    animation: shimmerSparkFly 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes shimmerSparkFly {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--tx, 50px), var(--ty, -50px), 0) scale(0.1);
        opacity: 0;
    }
}

/* Mobile optimizations to eliminate shadows rendering overhead */
@media (max-width: 768px) {
    .revealed-card-item .card-front {
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4) !important;
    }
}


