/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    font-family: 'Arial', sans-serif;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    touch-action: manipulation;
    user-select: none;
    position: fixed;
}

#wd{
    display: none;
}

/* Game Container */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-canvas {
    display: block;
    background-color: transparent;
    width: 100%;
    height: 100%;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Score and Level Displays */
#score-display, #level-display {
    position: absolute;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    pointer-events: none;
}

#score-display {
    top: 20px;
    left: 20px;
}

#level-display {
    top: 20px;
    right: 20px;
}

/* Health Bar */
#health-bar {
    position: absolute;
    top: 9%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 20px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

#health-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    transition: width 0.3s;
}

/* Text Elements */
#h2 {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    height: 20px;
    background: rgba(187, 101, 30, 0.3);
    border-radius: 10px;
    pointer-events: none;
    display: block;
    text-align: center;
}



/* Screens (Start/Game Over) */
#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(47, 196, 188, 0.9);
    z-index: 10;
    pointer-events: auto; /* Crucial for click detection */
}

#game-over-screen {
    display: none;
}

.screen-title {
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    color: #ffcc00;
    text-align: center;
    pointer-events: none;
}

.screen-button {
    padding: 15px 30px;
    font-size: 20px;
    background: linear-gradient(to right, #ff5f6d, #ffc371);
    border: none;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
    margin-top: 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.screen-button:hover, .screen-button:active {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.screen-text {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
    max-width: 80%;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Background Effects */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 20%);
    z-index: -1;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .screen-title {
        font-size: 36px;
    }
    
    .screen-button {
        padding: 12px 24px;
        font-size: 18px;
    }
    
    #health-bar {
        width: 250px;
        top: 10%;
    }
    
    #score-display, #level-display {
        font-size: 24px;
        padding: 8px 16px;
    }
}