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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1f013d, #080012);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    color: white;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1f013d, #080012);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
}

.loading-text {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #FFD700;
    animation: pulse 2s infinite;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0;
    animation: loadingProgress 2s ease-in-out forwards;
}

@keyframes loadingProgress {
    to {
        width: 100%;
    }
}

#game-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    background: transparent;
    touch-action: none;
}

.ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.health-bar {
    width: 200px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #ff5722);
    transition: width 0.3s ease;
}

#score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFD700;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
}

.screen h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.screen button {
    padding: 15px 30px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #1a0033;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.screen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes shake {

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

    10% {
        transform: translate(-2px, -1px);
    }

    20% {
        transform: translate(2px, 1px);
    }

    30% {
        transform: translate(-1px, 2px);
    }

    40% {
        transform: translate(1px, -2px);
    }

    50% {
        transform: translate(-2px, 1px);
    }

    60% {
        transform: translate(2px, -1px);
    }

    70% {
        transform: translate(-1px, -2px);
    }

    80% {
        transform: translate(1px, 2px);
    }

    90% {
        transform: translate(-2px, -1px);
    }
}

.screen-shake {
    animation: shake 0.3s ease-in-out;
}

.controls-ui {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #FFD700;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
    border-color: #FFD700;
}
