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

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 400px;
}

.header h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.scores {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
}

.score {
    color: #4ecca3;
}

.high-score {
    color: #e94560;
}

#game-canvas {
    border: 2px solid #4ecca3;
    border-radius: 8px;
    background: #16213e;
    display: block;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#overlay {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 8px;
    background: rgba(22, 33, 62, 0.92);
    margin-top: 0;
    pointer-events: auto;
}

#overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: #4ecca3;
}

.overlay-content p {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #ccc;
}

kbd {
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.9rem;
}

.controls-hint {
    font-size: 0.8rem !important;
    color: #888 !important;
}

/* Mobile controls */
.controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.ctrl-row {
    display: flex;
    gap: 4px;
}

.ctrl-btn {
    width: 60px;
    height: 60px;
    border: 2px solid #4ecca3;
    background: rgba(78, 204, 163, 0.15);
    color: #4ecca3;
    font-size: 1.4rem;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ctrl-btn:active {
    background: rgba(78, 204, 163, 0.4);
}

@media (pointer: coarse) {
    .controls {
        display: flex;
    }
}

@media (max-width: 440px) {
    .header, #game-canvas, #overlay {
        width: 320px;
    }
    #game-canvas, #overlay {
        height: 320px;
    }
    .controls {
        display: flex;
    }
}
