:root {
    --bg-color: #0a0a12;
    --wall-color: #1a1a2e;
    --path-color: #0f3460;
    --player-color: #e94560;
    --goal-color: #00fff5;
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
    --text-primary: #ffffff;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent selection on mobile touch */
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    background-image: url('sci_fi_maze_bg.png');
    /* Added background image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    /* Prevent scrolling */
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    border-radius: 4px;
    /* Slight rounded corners for the game board */
    background-color: #050510;
}

/* UI Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through to canvas when playing */
}

/* Screens */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    /* Re-enable clicks for UI elements */
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 1.5rem;
    color: var(--neon-pink);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 5px var(--neon-pink);
}

.instructions {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Buttons */
.neon-btn {
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 1rem 3rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: all 0.3s ease;
}

.neon-btn:hover {
    background: var(--neon-blue);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--neon-blue), 0 0 40px var(--neon-blue);
}

/* HUD */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.hidden {
    display: none !important;
}

.stat-box {
    text-align: center;
}

.stat-box .label {
    display: block;
    font-size: 0.8rem;
    color: var(--neon-pink);
    font-family: var(--font-heading);
    margin-bottom: 2px;
}

.stat-box .value {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .game-title {
        font-size: 2.5rem;
    }

    .game-subtitle {
        font-size: 1rem;
    }

    .neon-btn {
        padding: 0.8rem 2rem;
        font-size: 1.2rem;
    }
}