:root {
    --primary-color: #ff9a9e;
    --secondary-color: #fad0c4;
    --text-color: #333;
    --bg-color: #fdfbf7;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.game-container {
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 15px;
    overflow: hidden;
    background-color: var(--bg-color);
}

canvas {
    display: block;
    background-color: #fff; /* Fallback */
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
}

.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas if needed, but we have buttons */
}

.score-board {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    pointer-events: none;
}

#start-screen, #game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto; /* Enable clicks */
    transition: opacity 0.3s;
}

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

h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ff6b6b;
}

p {
    font-size: 18px;
    margin-bottom: 10px;
    color: #555;
}

button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 20px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    background-color: #ff5252;
    transform: scale(1.05);
}

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