// style.css
/* Reset and basic styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling */
    background-color: #000; /* Black background for 3D */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none; /* Disable double tap to zoom, pinch to zoom, etc. */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Container to center the game on larger screens, but fill mobile screens */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background-color: #000;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* UI Layer covering the canvas */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when needed, or manage via JS */
}

/* Screens */
.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(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    pointer-events: auto; /* Catch clicks for screens */
    z-index: 10;
}

.screen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #f1c40f;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.screen p {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Animations for text */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#start-screen p, #game-over-screen p:last-child {
    animation: pulse 1.5s infinite;
    cursor: pointer;
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

#score-display {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Near miss text overlay */
#near-miss-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
}

.near-miss-text {
    position: absolute;
    color: #f1c40f;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-50px); opacity: 0; }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .screen h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .screen p {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    #score-display {
        font-size: 1.2rem;
    }

    .near-miss-text {
        font-size: 1.2rem;
    }
}
