:root {
    --bg-color: #f7f7f7;
    --text-color: #333;
    --primary-color: #8bc34a;
    --accent-color: #ff5722;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[data-theme="dark"] {
    --bg-color: #222;
    --text-color: #eee;
    --primary-color: #689f38;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    pointer-events: auto;
    max-width: 80%;
    transition: opacity 0.3s;
}

[data-theme="dark"] .screen {
    background: rgba(40, 40, 40, 0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    color: #eee;
}

.hidden {
    display: none !important;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.1s, background-color 0.2s;
    font-weight: bold;
}

button:hover {
    filter: brightness(1.1);
}

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

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    height: auto;
}

#score-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}

[data-theme="dark"] #score-display {
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

#theme-toggle {
    pointer-events: auto;
    background: rgba(0,0,0,0.1);
    font-size: 1.5rem;
    padding: 8px;
    margin: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] #theme-toggle {
    background: rgba(255,255,255,0.1);
}
