@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    background: linear-gradient(to bottom, #a18cd1, #fbc2eb);
    background-repeat: no-repeat;
    background-attachment: fixed;
    text-align: center;
    /* background-color: black; */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0; 
    padding: 0;
}

canvas {
    border: 2px solid white;
}


.hidden {
    display: none;
}

#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    color: white;
}

#gameOverScreen button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}


body, html {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrollbars */
    height: 100%;
    position: relative;
}


.cloud {
    position: absolute;
    opacity: 0.5; /* 50% opacity */
    z-index: 2; /* Ensure clouds are above the canvas */
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.cloud img {
    width: 100%;
    height: auto;
}

.cloud1, .cloud2, .cloud3, .cloud4 {
    width: 350px; /* Set a specific width */
    height: auto; /* Maintain aspect ratio */
}

/* Define animations for each cloud */
.cloud1 {
    animation-name: floatRightToLeft;
    animation-duration: 20s;
    animation-iteration-count: infinite;

    top: 10%;
    left: 0;
}

.cloud2 {
    animation-name: floatLeftToRight;
    animation-duration: 25s;
    animation-iteration-count: infinite;

    top: 30%;
    left: 50%;
}

.cloud3 {
    animation-name: floatRightToLeft;
    animation-duration: 30s;
    animation-iteration-count: infinite;

    top: 50%;
    left: 0;
}

.cloud4 {
    animation-name: floatLeftToRight;
    animation-duration: 35s;
    animation-iteration-count: infinite;

    top: 70%;
    left: 50%;
}

.cloud5 {
    animation-name: floatRightToLeft;
    animation-duration: 20s;
    animation-iteration-count: infinite;

    top: 80%;
    left: 20%;
}

.cloud6 {
    animation-name: floatLeftToRight;
    animation-duration: 25s;
    animation-iteration-count: infinite;

    top: 60%;
    left: 33%;
}

.cloud7 {
    animation-name: floatRightToLeft;
    animation-duration: 30s;
    animation-iteration-count: infinite;

    top: 40%;
    left:77%;
}

.cloud8 {
    animation-name: floatLeftToRight;
    animation-duration: 35s;
    animation-iteration-count: infinite;

    top: 20%;
    left: 90%;
}

/* Keyframes for left to right movement */
@keyframes floatLeftToRight {
    0% {
        transform: translateX(-100%);
        opacity: 0; /* Start with 0 opacity */
    }
    10% {
        opacity: 0.5; /* Fade in quickly */
    }
    90% {
        opacity: 0.5; /* Stay visible for most of the animation */
    }
    100% {
        transform: translateX(100vw);
        opacity: 0; /* Fade out at the end */
    }
}

/* Keyframes for right to left movement with fade-out */
@keyframes floatRightToLeft {
    0% {
        transform: translateX(100vw);
        opacity: 0; /* Start with 0 opacity */
    }
    10% {
        opacity: 0.5; /* Fade in quickly */
    }
    90% {
        opacity: 0.5; /* Stay visible for most of the animation */
    }
    100% {
        transform: translateX(-100%);
        opacity: 0; /* Fade out at the end */
    }
}
#gameCanvas {
    opacity: 0.2;
}

img {
    width: 30px;
}


#startpage {
    color: yellow;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    gap: 25px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#startpage img {
    width: 60px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px yellow);
}

#winScreen {
    color: #00ff00;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
    text-align: center;
    z-index: 1000;
}

#winScreen h1 {
    margin: 0;
    font-size: 2rem;
    animation: glow 1s ease-in-out infinite alternate;
}

.hidden {
    display: none !important;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #fbed2b;
    }
    to {
        text-shadow: 0 0 20px #faf328, 0 0 30px #e2f71e;
    }
}body {
    text-align: center;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0; 
}

canvas {
    border: 2px solid white;
}

#gameCanvas {
    opacity: 0.2;
}

img {
    width: 30px;
}


#startpage {
    color: yellow;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    gap: 25px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#startpage img {
    width: 60px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px yellow);
}

#winScreen {
    color: #fce813;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #f3f639;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(245, 170, 19, 0.4);
    text-align: center;
    z-index: 1000;
}

#winScreen h1 {
    margin: 0;
    font-size: 2rem;
    animation: glow 1s ease-in-out infinite alternate;
}

.hidden {
    display: none !important;
}

#playAgain {
    background: #f8c11b;
    border: 2px solid #000;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
}

#playAgain:hover {
    background: #ffe734;
    box-shadow: 0 0 15px #f7eb08;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #f4ed21;
    }
    to {
        text-shadow: 0 0 20px #f8ff2d, 0 0 30px #fff83e;
    }
}
