:root {
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
    --dark-bg: #0f172a;
    --panel-bg: rgba(15, 23, 42, 0.9);
    --font-display: 'Orbitron', sans-serif;
    --font-pixel: 'Press Start 2P', cursive;
}

body {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: var(--font-display);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url('assets/track-pattern.svg');
    background-size: cover;
}

.game-shell {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--neon-blue);
}

h1 {
    font-family: var(--font-pixel);
    color: var(--neon-blue);
    margin: 0;
    font-size: 2rem;
}

.game-container {
    position: relative;
    border: 4px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
}

canvas {
    display: block;
    background: #222;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.hidden {
    display: none !important;
}

.btn {
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 15px 30px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

.char-grid {
    display: flex;
    gap: 20px;
}

.char-card {
    border: 2px solid #444;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.char-card:hover,
.char-card.selected {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 15px var(--neon-pink);
}

.char-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.game-footer {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.controls-info {
    display: flex;
    gap: 40px;
}

.controls-info h3 {
    color: var(--neon-pink);
    font-size: 0.8rem;
    margin: 0 0 5px 0;
}

.controls-info p {
    font-size: 0.8rem;
    margin: 0;
    color: #aaa;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
}

.back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
}

.d-pad {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(2, 50px);
    gap: 5px;
}

.d-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    touch-action: manipulation;
}

.d-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

.d-btn.up {
    grid-column: 2;
    grid-row: 1;
}

.d-btn.left {
    grid-column: 1;
    grid-row: 2;
}

.d-btn.down {
    grid-column: 2;
    grid-row: 2;
}

.d-btn.right {
    grid-column: 3;
    grid-row: 2;
}

@media (max-width: 768px) {
    .game-container {
        width: 100%;
        height: 60vh;
    }

    canvas {
        width: 100%;
        height: 100%;
    }

    .controls-info {
        display: none;
    }

    .mobile-controls {
        display: block;
    }
}