:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --canvas-bg: #020617;
    --neon-blue: #22d3ee;
    --neon-pink: #f43f5e;
    --text-main: #f8fafc;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    /* Prevent scrolling on mobile */
    touch-action: none;
}

.game-container {
    width: 95%;
    max-width: 420px;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h1 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

h1 span {
    color: var(--neon-blue);
    font-weight: 200;
}

.score-board {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-blue);
}

#game-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

canvas {
    width: 100%;
    height: 100%;
    background: var(--canvas-bg);
    border-radius: 0.75rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    display: block;
}

/* Overlay for Start/Game Over */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0.75rem;
    z-index: 10;
}

button {
    background: var(--neon-blue);
    color: #000;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

button:active {
    transform: scale(0.95);
}

/* Mobile D-Pad */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 1.5rem;
}

.btn {
    background: #334155;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    background: var(--neon-blue);
    color: #000;
}

.up {
    grid-column: 2;
}

.left {
    grid-column: 1;
}

.down {
    grid-column: 2;
}

.right {
    grid-column: 3;
}

@media (min-width: 768px) {
    .controls-grid {
        display: none;
    }

    .desktop-hint {
        display: block;
        margin-top: 10px;
        opacity: 0.6;
        font-size: 0.8rem;
    }
}

.desktop-hint {
    display: none;
    text-align: center;
}