* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Rounded MT Bold', 'Arial', sans-serif;
}

body {
    background: url('bg.svg') no-repeat center center fixed;
    background-size: cover;
    color: white;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#game-container {
    position: relative;
    width: 800px;
    max-width: 95vw;
    height: 500px;
    max-height: 80vh;
    margin: 0 auto;
    border: 4px solid #ff9800;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#game-canvas {
    background: linear-gradient(to bottom, #87CEEB, #1E90FF);
    width: 100%;
    height: 100%;
    display: block;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score-display {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
}

#lives-display {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
}

#level-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    animation: pulse 2s infinite;
    display: none;
}

#controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.control-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile .control-btn {
    opacity: 0.8;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('bg.svg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s;
}

#loader-text {
    font-size: 24px;
    margin-top: 20px;
    color: #fff;
}

#loader-bar {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

#loader-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ff9800, #ff5722);
    border-radius: 10px;
    transition: width 0.3s;
}

#start-screen,
#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;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#game-over-screen {
    display: none;
}

h1 {
    font-size: 48px;
    color: #ff9800;
    text-shadow: 3px 3px 0 #ff5722;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 36px;
    color: #4CAF50;
    margin-bottom: 20px;
    text-align: center;
}

p {
    font-size: 18px;
    margin-bottom: 30px;
    text-align: center;
    max-width: 80%;
}

.btn {
    background: linear-gradient(to bottom, #ff9800, #ff5722);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 0 #e65100;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #e65100;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #e65100;
}

.instructions {
    margin-top: 20px;
    font-size: 16px;
    color: #ccc;
    text-align: center;
}

.stars {
    display: flex;
    margin: 20px 0;
}

.star {
    font-size: 40px;
    color: #ccc;
    margin: 0 5px;
}

.star.filled {
    color: gold;
    text-shadow: 0 0 10px gold;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bounce {

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

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes float {

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

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

@keyframes moveLeftRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(20px);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}