:root {
    --bg-color: #050505;
    --neon-orange: #FF4500;
    --neon-yellow: #FFD700;
    --text-color: #fff;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Press Start 2P', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    /* Prevent scroll on mobile */
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    max-height: 800px;
    border: 2px solid var(--neon-orange);
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.3);
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through to canvas */
}

.header>* {
    pointer-events: auto;
}

.score-board {
    color: var(--neon-yellow);
    text-shadow: 2px 2px 0 #000;
    margin-right: 20px;
}

.health-board {
    display: flex;
    align-items: center;
    text-shadow: 2px 2px 0 #000;
}

#health-bar {
    width: 100px;
    height: 10px;
    background: #333;
    border: 1px solid #fff;
    margin-left: 10px;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: #00ff00;
    transition: width 0.2s, background 0.2s;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at bottom, #1a0500 0%, #000000 70%);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 2.5rem;
    color: var(--neon-orange);
    text-shadow: 0 0 10px var(--neon-orange);
    margin-bottom: 20px;
    line-height: 1.5;
}

p {
    margin-bottom: 30px;
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
}

button {
    background: transparent;
    color: var(--neon-orange);
    font-family: inherit;
    font-size: 1.2rem;
    padding: 15px 40px;
    border: 2px solid var(--neon-orange);
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 10px var(--neon-orange);
    transition: all 0.2s;
}

button:hover {
    background: var(--neon-orange);
    color: #000;
}

.home-btn {
    text-decoration: none;
    color: #fff;
    font-size: 0.8rem;
    border: 1px solid #fff;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }

    .game-container {
        height: 70vh;
        /* Make room for controls */
    }
}

/* Mobile Controls */
.d-pad {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    justify-content: space-between;
    z-index: 100;
}

.d-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 69, 0, 0.3);
    border: 2px solid var(--neon-orange);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--neon-orange);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-orange);
}

.d-btn:active {
    background: var(--neon-orange);
    color: #000;
}

/* Show on tablet/mobile or coarse pointer */
@media (max-width: 1024px),
(pointer: coarse) {
    .d-pad {
        display: flex;
        /* grid or flex */
    }
}