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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f3460, #1a1a2e);
    overflow: hidden;
    color: white;
}

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

.loading-text {
    font-size: 2rem;
    margin-bottom: 2rem;
    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, #e94560, #ffc93c);
    width: 0;
    animation: loadingProgress 2s ease-in-out forwards;
}

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

#game-container {
    display: none;
    position: relative;
    width: 100vw;
    height: 100vh;
}

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

.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, #e94560, #ff6b6b);
    transition: width 0.3s ease;
}

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

.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: 2rem;
    margin-bottom: 2rem;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.screen button {
    padding: 15px 30px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #e94560, #ff6b6b);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.screen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 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;
}
