:root {
    --bg-color: #f0f4f8;
    --game-bg: #e2e8f0;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-color: #1e293b;
    --obstacle-color: #ef4444;
    --ground-color: #475569;
    --font-family: 'Segoe UI', system-ui, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    font-family: var(--font-family);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background-color: var(--game-bg);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

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

.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when playing */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

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

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    font-size: 2.5rem;
    color: var(--obstacle-color);
    margin-bottom: 1rem;
}

p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.primary-btn {
    padding: 12px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0);
}

.hud {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hud.hidden {
    display: none;
}