:root {
    --bg: #0b0e14;
    --panel: #161b22;
    --neon-blue: #2563eb;
    --accent: #fbbf24;
    --danger: #ef4444;
    --text: #e6edf3;
}

body {
    background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif;
    margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    overflow: hidden; touch-action: none;
}

.arcade-container { display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; max-width: 480px; padding: 10px; }
.header { display: flex; justify-content: space-between; width: 100%; align-items: center; }
h1 { font-size: 1.2rem; color: var(--accent); text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }

.score-board { background: var(--panel); padding: 8px; border-radius: 8px; border: 1px solid #30363d; font-size: 0.8rem; color: var(--accent); min-width: 100px; text-align: center; }

.game-area { position: relative; border: 3px solid var(--neon-blue); border-radius: 12px; box-shadow: 0 0 20px rgba(37, 99, 235, 0.3); background: #000; }
#gameCanvas { display: block; max-width: 100%; border-radius: 8px; }

.overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: 8px; }
.overlay.hidden { display: none; }

.speed-control { margin-bottom: 20px; }
.speed-control label { display: block; margin-bottom: 10px; color: var(--accent); font-size: 0.8rem; }

.action-buttons { display: flex; gap: 10px; width: 100%; }
.action-btn { flex: 1; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; }
.action-btn.pause { background: var(--accent); }
.action-btn.stop { background: var(--danger); color: white; }

.controls-mobile { display: none; gap: 20px; width: 100%; margin-top: 10px; }
.ctrl-btn { flex: 1; height: 70px; background: var(--panel); border: 1px solid #30363d; border-radius: 12px; color: white; font-size: 2rem; }

.btn { background: var(--accent); border: none; padding: 15px 40px; font-weight: bold; border-radius: 30px; cursor: pointer; }

@media (max-width: 768px), (pointer: coarse) {
    .controls-mobile { display: flex; }
    footer { display: none; } /* Slėpiame, kad neatimtų vietos iš mygtukų */
    
    body {
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding-top: 5px; 
    }
    
    .arcade-container {
        transform: scale(0.95); /* Maksimaliai išplečiame į kraštus */
        transform-origin: top center; 
        margin-top: -1px;           
        margin-bottom: -60px; /* Kompensacija sumažinta, nes mastelis didesnis */
        width: 100% !important;
        padding: 5px !important;
        height: auto !important;
    }

    #gameCanvas {
        max-height: 62dvh !important; /* Leidžiame žaidimui augti iki 62% ekrano aukščio */
        width: 100% !important;
        object-fit: contain; /* Apsaugo kamuoliuko ir blokelių proporcijas nuo iškraipymo */
        margin: 0 auto;
    }
    
    .ctrl-btn {
        min-height: 60px !important;
        flex: 1 1 auto;
    }
}