/* Background Gradient */
body {
    background: linear-gradient(135deg, #1a1a1a, #2a4066, #4a2555);
    background-size: 400% 400%; /* Increased size to prevent visible repetition */
    animation: bgGradient 10s ease infinite;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
    cursor: none; /* Hide default cursor */
}

@keyframes bgGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Swiper Carousel */
.swiper {
    width: 80%;
    margin: 0 auto;
    padding: 50px 0;
    height: 600px;
    z-index: 0; /* Ensure carousel is behind the game container */
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px;
    height: 600px;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: none; /* Ensure no default cursor on slides */
}

.card {
    position: relative;
    height: 600px;
    width: 400px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8), 0 15px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.card p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    font-size: 1.2rem;
    margin: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.swiper-slide:hover .card {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 25px 60px rgba(0, 0, 0, 0.6);
}

.swiper-slide:hover .card img {
    opacity: 0.9;
}

.swiper-slide:hover .card p {
    opacity: 1;
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
}

/* Custom Cursor Styles */
.cursor {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
}

.circle {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.circle.glow {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.center-circle.glow {
    background: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    animation: pulse 1s infinite;
}

.visit-prompt {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.swiper-slide-active .card:hover .visit-prompt {
    opacity: 1;
}

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

/* Game Container for Pixel Man and Wall */
#game-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px; /* Adjust height based on your layout */
    z-index: 1; /* Ensure it's above the carousel */
    background-color: transparent; /* Transparent background */
}

/* Wall Container */
#wall {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0; /* Starts empty, grows as bricks are added */
    background-color: #8B8682; /* Mortar color for the wall */
    z-index: 0; /* Behind the man */
    overflow: visible; /* Allow bricks to be visible as they are placed */
}

/* Brick Styling */
.brick {
    width: 50px;
    height: 25px;
    background: linear-gradient(
        45deg,
        #922820 0%,
        #be4032 20%,
        #922820 30%,
        #be4032 40%,
        #922820 50%,
        #be4032 60%,
        #922820 70%,
        #be4032 80%,
        #922820 100%
    );
    position: absolute;
    box-shadow: 
        inset 2px 2px 5px rgba(255, 255, 255, 0.15),
        inset -2px -2px 5px rgba(0, 0, 0, 0.15),
        5px 5px 10px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.brick::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 1%,
            transparent 2%,
            rgba(0, 0, 0, 0.05) 3%
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 1%,
            transparent 2%,
            rgba(0, 0, 0, 0.05) 3%
        );
    mix-blend-mode: overlay;
    border-radius: 2px;
}

/* Pixel Man */
#man {
    position: absolute;
    width: 160px; /* 16px * 10 scale */
    height: 240px; /* 24px * 10 scale */
    left: 0;
    bottom: 0;
    z-index: 1; /* In front of the wall */
    image-rendering: pixelated; /* Keeps pixel art crisp */
}

/* Smoke and Crumbling Animation for Wall Tear Down */
.debris {
    position: absolute;
    background-color: #A0522D;
    width: 20px;
    height: 20px;
    opacity: 1;
    animation: explode 1.5s ease-out forwards;
}

@keyframes explode {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(100px * (var(--dx, 1))),
            calc(200px * (var(--dy, 1)))
        ) rotate(720deg);
    }
}