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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #87CEEB; /* fallback */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none; /* Prevent browser handling of gestures */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none; /* Let clicks pass through */
    z-index: 10;
}

.score-display, .high-score-display {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1c5285;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 20, 40, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 20;
    transition: opacity 0.3s ease;
}

#game-over-screen.hidden {
    display: none;
    opacity: 0;
}

#game-over-screen h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.8), 0 0 40px rgba(255, 255, 255, 0.5);
    color: #f0f8ff;
    letter-spacing: 2px;
}

#game-over-screen p {
    font-size: 2rem;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.blink {
    font-size: 1.2rem !important;
    color: #a0d8ef;
    animation: blinker 1.5s ease-in-out infinite;
}

@keyframes blinker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@media (max-width: 600px) {
    #ui-container {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    .score-display, .high-score-display {
        font-size: 1rem;
        padding: 8px 12px;
    }
    #game-over-screen h1 {
        font-size: 3rem;
    }
    #game-over-screen p {
        font-size: 1.5rem;
    }
}
