:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    overflow-x: hidden;
    overflow-y: hidden; 
    touch-action: none;
}

.game-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 0.5rem;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.game-header { text-align: center; }
.game-header h1 { font-size: 2.2rem; margin: 0.5rem 0; line-height: 1; }

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.btn-group {
    display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem;
}

.score-board {
    display: flex; justify-content: space-around; background: rgba(0,0,0,0.3); border-radius: 12px; padding: 0.5rem; margin-bottom: 0.5rem; border: 1px solid var(--glass-border); align-items: stretch; max-width: 400px; margin-left: auto; margin-right: auto;
}
.score-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 1rem;
}
#enemy-hud {
    border-left: 1px solid var(--glass-border);
}
.score-label {
    font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px;
}
.score-value {
    font-size: 1.5rem; font-weight: 700;
}

main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }

.canvas-container {
    padding: 2px;
    background: #334155;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 2px solid #475569;
    flex: 1; min-height: 0; margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: center;
}

#game-canvas {
    background: #0f172a;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
}

.side-panel h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.side-panel canvas {
    background: #1e293b;
    border-radius: 4px;
}

.ctrl-btn {
    background: #334155;
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
}
.ctrl-btn:active { transform: scale(0.9); }

.hidden { display: none !important; }

@media (max-width: 600px) {
    #mobile-controls { display: flex !important; }
}
