body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #000;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 0;
}

#orientation-screen {
    display: none !important; /* Always hidden */
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#start-audio {
    display: none;
}

#start-screen h1 {
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    font-size: 48px;
    text-shadow: 3px 3px #ff0000;
    margin-bottom: 40px;
    text-align: center;
}

#start-screen h1 span {
    display: block; /* Each word on a new line */
}

.wavy {
    animation: wave 2s infinite;
}

@keyframes wave {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

#start-button {
    padding: 20px 40px;
    font-size: 24px;
    cursor: pointer;
    background: #00ff00;
    border: 3px solid #fff;
    border-radius: 10px;
    font-family: 'Press Start 2P', cursive;
    z-index: 15;
    position: relative;
    transition: background 0.3s ease;
}

#start-button:hover {
    background: #00cc00;
}

#game {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: #87CEEB;
    z-index: 1;
}

#background {
    width: 200%;
    height: 100%;
    position: absolute;
    background: linear-gradient(to bottom, #87CEEB 0%, #ffffff 70%);
    z-index: 1;
}

#player {
    width: 100px;
    height: 200px;
    background-image: url('player_back_t.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    bottom: 10px; /* Moved closer to the bottom on desktop */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.obstacle {
    width: 200px;
    height: 200px;
    background-image: url('brick_wall_t.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    z-index: 2;
}

.wide-obstacle {
    width: 200px;
    height: 75px;
    background-image: url('log.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    z-index: 2;
}

.green-box {
    width: 150px;
    height: 150px;
    background-image: url('treasurebox.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    z-index: 2;
}

.bad-guy {
    width: 150px;
    height: 150px;
    background-image: url('badguy.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    z-index: 2;
}

.treasure {
    width: 100px;
    height: 100px;
    background-image: url('bagofcoins.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    z-index: 2;
}

.special-treasure {
    width: 40px;
    height: 40px;
    background: #00ffff;
    position: absolute;
    z-index: 2;
    border-radius: 50%;
}

/* Mobile-specific styles for portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
    #start-screen h1 {
        font-size: 24px; /* Smaller title on start screen */
        margin-bottom: 20px;
    }

    #start-screen h1 span {
        display: block; /* Each word on a new line */
    }

    #start-button {
        padding: 10px 20px;
        font-size: 16px; /* Smaller start button */
    }

    #player {
        width: 50px;
        height: 100px;
        bottom: 50px; /* Moved up on mobile to ensure visibility */
    }

    .obstacle {
        width: 100px;
        height: 100px;
    }

    .wide-obstacle {
        width: 100px;
        height: 37.5px;
    }

    .green-box {
        width: 75px;
        height: 75px;
    }

    .bad-guy {
        width: 75px;
        height: 75px;
    }

    .treasure {
        width: 50px;
        height: 50px;
    }

    .special-treasure {
        width: 20px;
        height: 20px;
    }

    #score, #level {
        font-size: 14px;
        top: 5px;
        background: rgba(0, 0, 0, 0.7);
        padding: 2px 5px;
        border-radius: 3px;
        color: #fff;
        text-shadow: 1px 1px 1px #000;
    }

    #score { left: 5px; }
    #level { right: 5px; }

    #level-up {
        font-size: 20px;
    }

    #smash-button {
        padding: 8px 16px;
        font-size: 12px;
        bottom: 50px;
    }

    #win-screen {
        padding-top: 50px;
    }

    #win-screen h1 {
        font-size: 24px;
    }

    #win-screen p {
        font-size: 16px;
    }

    #player-name {
        width: 150px;
        padding: 5px;
    }

    #submit-score {
        padding: 8px 16px;
        font-size: 14px;
    }

    #game-over-screen h1 {
        font-size: 30px;
        display: flex; /* Use flex to stack words */
        flex-direction: column; /* Stack "Game" and "Over" vertically */
        align-items: center; /* Center horizontally */
    }

    #game-over-screen h1 span {
        display: block; /* Each word on a new line */
    }

    #game-over-screen p {
        font-size: 18px;
    }
}

#score, #level {
    position: absolute;
    top: 10px;
    color: white;
    font-size: 24px;
    z-index: 4;
}

#score { left: 10px; }
#level { right: 10px; }

#level-up {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #00ff00;
    text-shadow: 2px 2px #000;
    z-index: 5;
    font-family: 'Press Start 2P', cursive;
}

#smash-button {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    font-size: 20px;
    background: #ff4444;
    border: 3px solid #fff;
    border-radius: 10px;
    cursor: pointer;
    z-index: 5;
    font-family: 'Press Start 2P', cursive;
}

#win-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding-top: 100px;
    z-index: 10;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 15;
}

#game-over-screen h1 {
    margin: 0;
}

#game-over-screen p {
    margin: 10px 0;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 1s ease-out;
}

.hidden {
    display: none !important;
}