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

body {
    background: #0a0a0f;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

/* Menu */
.menu-container {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.game-title {
    font-size: 3rem;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff8855, 0 0 40px #00ff8833;
    letter-spacing: 0.3em;
    margin-bottom: 0.2em;
}

.game-subtitle {
    font-size: 1.5rem;
    color: #ff4444;
    text-shadow: 0 0 10px #ff444455;
    letter-spacing: 0.5em;
    margin-bottom: 2em;
    font-weight: normal;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    color: #00ff88;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #1a1a2e;
    border: 1px solid #00ff8844;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 10px #00ff8833;
}

.btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin: 0.8rem 0;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.15em;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #00ff88;
    color: #0a0a0f;
    font-weight: bold;
}

.btn-primary:hover {
    background: #33ffaa;
    box-shadow: 0 0 20px #00ff8855;
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: #00ff88;
    border: 1px solid #00ff8844;
}

.btn-secondary:hover {
    background: #00ff8811;
    border-color: #00ff88;
}

.controls-info {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid #ffffff11;
    text-align: left;
}

.controls-info h3 {
    color: #00ff88;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.controls-info p {
    font-size: 0.75rem;
    color: #888;
    margin: 0.3rem 0;
}

/* Game Canvas */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none;
}

/* Result Screens */
.result-container, .leaderboard-container {
    text-align: center;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    background: #0d0d1a;
    border: 1px solid #00ff8833;
    box-shadow: 0 0 30px #00000088;
}

.result-title {
    font-size: 1.8rem;
    color: #00ff88;
    text-shadow: 0 0 15px #00ff8844;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.gameover-title {
    color: #ff4444;
    text-shadow: 0 0 15px #ff444444;
}

.gameover-reason {
    color: #ff8888;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.result-stats {
    margin-bottom: 2rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ffffff0a;
    font-size: 0.9rem;
}

.stat-row span:last-child {
    color: #00ff88;
    font-weight: bold;
}

/* Leaderboard */
.leaderboard-list {
    margin: 1rem 0 2rem;
    max-height: 300px;
    overflow-y: auto;
}

.lb-entry {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #ffffff08;
    font-size: 0.85rem;
}

.lb-entry:nth-child(1) .lb-rank { color: #ffd700; }
.lb-entry:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-entry:nth-child(3) .lb-rank { color: #cd7f32; }

.lb-rank {
    color: #00ff88;
    width: 2rem;
}

.lb-name {
    flex: 1;
    text-align: left;
    padding-left: 0.5rem;
}

.lb-score {
    color: #00ff88;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #00ff8844; }

/* Mobile Controls */
#mobile-controls {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    pointer-events: none;
    z-index: 100;
}

.mobile-btn {
    pointer-events: auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 136, 0.6);
    background: rgba(0, 0, 0, 0.5);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.1s, background 0.1s;
}

.mobile-btn:active {
    transform: scale(0.9);
    background: rgba(0, 255, 136, 0.3);
}

.fire-btn {
    border-color: rgba(255, 50, 50, 0.8);
    background: rgba(255, 0, 0, 0.2);
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.fire-btn:active {
    background: rgba(255, 50, 50, 0.5);
    transform: scale(0.9);
}

.breath-btn.active {
    background: rgba(0, 255, 136, 0.4);
    border-color: rgba(0, 255, 136, 1);
}

/* Hide mobile controls on desktop */
@media (hover: hover) and (pointer: fine) {
    #mobile-controls { display: none; }
}
