* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0e27 0%, #1a1042 50%, #2d1b3d 100%);
    height: 100vh;
    position: relative;
}

/* Moon */
.moon {
    position: absolute;
    top: 80px;
    right: 150px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #fff9e6, #f4e5c2);
    border-radius: 50%;
    box-shadow: 0 0 60px 20px rgba(255, 249, 230, 0.4),
        inset -10px -10px 20px rgba(0, 0, 0, 0.1);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 60px 20px rgba(255, 249, 230, 0.4);
    }

    50% {
        box-shadow: 0 0 80px 30px rgba(255, 249, 230, 0.6);
    }
}

/* Stars */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Ground */
.ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, #1a1a2e 0%, #0f0f1e 100%);
}

.grass {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, #8b7355 0%, #6b5a45 50%, #4a3f35 100%);
}

/* Earthworms */
.worm {
    position: absolute;
    width: 4px;
    height: 30px;
    background: linear-gradient(to bottom,
            #d4a574 0%,
            #c9956d 10%,
            #d4a574 20%,
            #c9956d 30%,
            #d4a574 40%,
            #c9956d 50%,
            #d4a574 60%,
            #c9956d 70%,
            #d4a574 80%,
            #c9956d 90%,
            #d4a574 100%);
    border-radius: 2px;
    bottom: -15px;
    animation: wiggle 3s ease-in-out infinite;
}

.worm1 {
    left: 15%;
    animation-delay: 0s;
}

.worm2 {
    left: 30%;
    animation-delay: 1s;
}

.worm3 {
    left: 50%;
    animation-delay: 2s;
}

.worm4 {
    left: 65%;
    animation-delay: 1.5s;
}

.worm5 {
    left: 85%;
    animation-delay: 0.5s;
}

@keyframes wiggle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-12px) rotate(15deg);
    }

    50% {
        transform: translateY(-8px) rotate(-10deg);
    }

    75% {
        transform: translateY(-15px) rotate(10deg);
    }
}

/* Haunted House */
.house {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 280px;
}

.house-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 180px;
    background: linear-gradient(to bottom, #2a1a3a, #1a0a2a);
    border: 2px solid #000;
}

.roof {
    position: absolute;
    bottom: 170px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 120px solid transparent;
    border-right: 120px solid transparent;
    border-bottom: 100px solid #1a0a1a;
    filter: drop-shadow(0 -5px 10px rgba(0, 0, 0, 0.5));
}

.roof::after {
    content: '';
    position: absolute;
    top: 100px;
    left: -120px;
    width: 240px;
    height: 10px;
    background: #0a0a0a;
}

/* Tower */
.tower {
    position: absolute;
    bottom: 0;
    right: 20px;
    width: 60px;
    height: 120px;
    background: linear-gradient(to bottom, #2a1a3a, #1a0a2a);
    border: 2px solid #000;
}

.tower-roof {
    position: absolute;
    top: 100px;
    left: 215px;
    width: 0;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid #1a0a1a;
}

/* Windows */
.window {
    position: absolute;
    width: 40px;
    height: 50px;
    background: #ff6600;
    border: 2px solid #000;
    animation: flicker 3s infinite;
}

.window1 {
    top: 40px;
    left: 30px;
}

.window2 {
    top: 40px;
    right: 30px;
}

.window3 {
    top: 110px;
    left: 80px;
}

.window-cross {
    position: absolute;
    background: #000;
}

.window-cross.horizontal {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.window-cross.vertical {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.tower-window {
    position: absolute;
    width: 25px;
    height: 35px;
    background: #ff6600;
    border: 2px solid #000;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 2.5s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    45%,
    55% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.8;
    }
}

/* Door */
.door {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 80px;
    background: linear-gradient(to right, #1a0a0a, #0a0a0a);
    border: 2px solid #000;
    border-bottom: none;
    border-radius: 25px 25px 0 0;
}

/* Ghosts */
.ghost {
    position: absolute;
    width: 60px;
    height: 80px;
    animation: float 3s ease-in-out infinite;
}

.ghost1 {
    top: 150px;
    left: 15%;
    animation-delay: 0s;
}

.ghost2 {
    top: 200px;
    right: 20%;
    animation-delay: 1s;
}

.ghost3 {
    top: 300px;
    left: 70%;
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.ghost-body {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border-radius: 50% 50% 0 0;
    position: relative;
}

.ghost-tail {
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.7);
}

.ghost-tail::before,
.ghost-tail::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 50% 0%, transparent 50%, rgba(255, 255, 255, 0.7) 50%);
}

.ghost-tail::before {
    left: 0;
}

.ghost-tail::after {
    right: 0;
}

.ghost-eye {
    position: absolute;
    width: 8px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    top: 20px;
}

.ghost-eye.left {
    left: 15px;
}

.ghost-eye.right {
    right: 15px;
}

.ghost-mouth {
    position: absolute;
    width: 20px;
    height: 15px;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 50% 50%;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
}

/* Bats */
.bat {
    position: absolute;
    width: 40px;
    height: 20px;
    animation: fly 8s linear infinite;
}

.bat1 {
    top: 100px;
    left: -50px;
    animation-duration: 12s;
}

.bat2 {
    top: 180px;
    left: -100px;
    animation-duration: 15s;
    animation-delay: 3s;
}

.bat3 {
    top: 250px;
    left: -80px;
    animation-duration: 10s;
    animation-delay: 6s;
}

@keyframes fly {
    0% {
        left: -50px;
    }

    100% {
        left: 110%;
    }
}

.bat-body {
    position: absolute;
    width: 12px;
    height: 8px;
    background: #1a1a1a;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.bat-wing {
    position: absolute;
    width: 18px;
    height: 12px;
    background: #1a1a1a;
    top: 4px;
    border-radius: 50% 50% 0 0;
    animation: flap 0.5s ease-in-out infinite;
}

.bat-wing.left {
    left: 0;
    transform-origin: right center;
}

.bat-wing.right {
    right: 0;
    transform-origin: left center;
}

@keyframes flap {

    0%,
    100% {
        transform: rotateY(0deg);
    }

    50% {
        transform: rotateY(30deg);
    }
}

/* Pumpkins */
.pumpkin {
    position: absolute;
    bottom: 200px;
    width: 70px;
    height: 60px;
    background: radial-gradient(ellipse at center, #ff8c00 0%, #ff6600 70%, #cc5500 100%);
    border-radius: 50%;
    animation: pumpkinGlow 2s ease-in-out infinite;
}

.pumpkin1 {
    left: 20%;
}

.pumpkin2 {
    right: 25%;
    animation-delay: 0.5s;
}

@keyframes pumpkinGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }
}

.pumpkin::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    background: #2d5016;
    border-radius: 50% 50% 0 0;
}

.pumpkin-eye {
    position: absolute;
    width: 12px;
    height: 15px;
    background: #ffdd00;
    top: 15px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 10px #ffdd00;
}

.pumpkin-eye.left {
    left: 12px;
}

.pumpkin-eye.right {
    right: 12px;
}

.pumpkin-mouth {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 15px;
    border: 3px solid #ffdd00;
    border-top: none;
    border-radius: 0 0 50% 50%;
    box-shadow: 0 0 8px #ffdd00;
}

/* Fence */
.fence {
    position: absolute;
    bottom: 190px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    gap: 10px;
    padding: 0 20px;
}

.fence-post {
    width: 20px;
    height: 60px;
    background: linear-gradient(to right, #2a2a2a, #1a1a1a);
    border: 1px solid #000;
    clip-path: polygon(20% 0%, 80% 0%, 100% 15%, 100% 100%, 0% 100%, 0% 15%);
}

/* Tombstones */
.tombstone {
    position: absolute;
    bottom: 200px;
    width: 50px;
    height: 70px;
    background: linear-gradient(to bottom, #4a4a4a, #2a2a2a);
    border: 2px solid #1a1a1a;
    border-radius: 50% 50% 0 0;
}

.tombstone1 {
    left: 10%;
    transform: rotate(-5deg);
}

.tombstone2 {
    left: 35%;
    transform: rotate(3deg);
}

.tombstone3 {
    right: 15%;
    transform: rotate(-4deg);
}

.tombstone::after {
    content: 'RIP';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a1a1a;
    font-family: serif;
    font-size: 14px;
    font-weight: bold;
}

/* Spider Web */
.spider-web {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-top: 1px solid #ddd;
    border-right: 1px solid #ddd;
    opacity: 0.4;
}

.spider-web::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 35px;
    height: 1px;
    background: #ddd;
    transform: rotate(135deg);
    transform-origin: top right;
}

.spider-web::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 1px;
    background: #ddd;
    transform: rotate(90deg);
    transform-origin: top right;
}

/* Hanging Spiders */
.hanging-spider {
    position: absolute;
    animation: swing 3s ease-in-out infinite;
    transform-origin: top center;
    width: 30px;
}

.hanging-spider .thread {
    width: 1px;
    background: #ddd;
    margin: 0 auto;
    opacity: 0.4;
}

.hanging-spider .spider-body {
    width: 12px;
    height: 8px;
    background: #111;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
}

.hanging-spider .spider-body::before,
.hanging-spider .spider-body::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 8px;
    height: 1px;
    background: #111;
}

.hanging-spider .spider-body::before {
    left: -6px;
    transform: rotate(45deg);
}

.hanging-spider .spider-body::after {
    right: -6px;
    transform: rotate(-45deg);
}

.hanging-spider.large .thread {
    height: 60px;
}

.hanging-spider.large .spider-body {
    width: 20px;
    height: 12px;
}

.hanging-spider.large .spider-body::before,
.hanging-spider.large .spider-body::after {
    width: 12px;
}

.hanging-spider.small .thread {
    height: 20px;
}

@keyframes swing {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}