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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #000;
}

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

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#score-container,
#timer-container,
#level-indicator {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    backdrop-filter: blur(5px);
}

#timer-container {
    font-size: 28px;
    color: #4CAF50;
}

#timer-container.warning {
    color: #ff9800;
    animation: pulse 1s infinite;
}

#timer-container.danger {
    color: #f44336;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.label {
    opacity: 0.8;
    margin-right: 10px;
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #fff;
    text-align: center;
}

.overlay-screen h1 {
    font-size: 64px;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.overlay-screen h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #4CAF50;
}

.overlay-screen p {
    font-size: 20px;
    margin: 10px 0;
    line-height: 1.6;
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    max-width: 500px;
}

.instructions p {
    margin: 15px 0;
}

.instructions strong {
    color: #4CAF50;
    font-size: 22px;
}

/* Buttons */
button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Loading indicator */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    z-index: 50;
}

/* Loading spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 30px;
}

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

#loading-message {
    color: #ccc;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #hud {
        padding: 10px;
    }

    #score-container,
    #timer-container,
    #level-indicator {
        font-size: 18px;
        padding: 8px 15px;
    }

    .overlay-screen h1 {
        font-size: 48px;
    }

    button {
        font-size: 20px;
        padding: 12px 30px;
    }
}
