/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; /* Prevent text selection during gameplay */
    -webkit-user-select: none;
}

body {
    background: #0a0a0a;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    /* max-width: 600px; Removed max-width to use full screen canvas, renderer handles aspect ratio */
    margin: 0 auto;
    background: #111;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* Prevent default touch actions like scroll */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(45deg, #00f260, #0575e6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 242, 96, 0.3);
}

p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2rem;
}

h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ff4b1f;
    text-shadow: 0 0 10px rgba(255, 75, 31, 0.5);
}

button {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff00cc, #3333ff);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 204, 0.4);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 0, 204, 0.7);
}

button:active {
    transform: scale(0.95);
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.score-box, .high-score-box {
    font-family: 'Orbitron', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-box {
    flex-grow: 1;
    margin: 0 20px;
    display: flex;
    align-items: center;
}

#timer-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

#timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0055, #ffcc00);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    transition: width 0.1s linear;
}
