* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; touch-action: manipulation; }
#game-container { position: relative; display: flex; justify-content: center; align-items: center; flex-direction: column; min-height: 100vh; }
canvas { border: 2px solid #333; background: #000; }
#ui-layer { position: absolute; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; }
#start-screen, #game-over-screen { background: rgba(0,0,0,0.85); padding: 40px; border-radius: 12px; text-align: center; color: #fff; }
h1 { margin-bottom: 20px; }
#start-btn, #restart-btn { background: #ff4444; color: #fff; border: none; padding: 12px 32px; font-size: 20px; border-radius: 8px; cursor: pointer; transition: transform 0.1s; }
#start-btn:hover, #restart-btn:hover { transform: scale(1.05); }
#sound-toggle { background: #555; color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 20px; cursor: pointer; margin-left: 10px; }
#sound-toggle:hover { background: #666; }
#mobile-controls { display: flex; justify-content: space-between; width: 100%; max-width: 800px; padding: 10px; margin-top: 10px; }
.d-pad { display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px); justify-items: center; align-items: center; }
.control-btn { width: 55px; height: 55px; background: rgba(255,255,255,0.2); color: #fff; border: 2px solid rgba(255,255,255,0.3); border-radius: 12px; font-size: 22px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.control-btn.active { background: rgba(255,255,255,0.5); transform: scale(0.95); }
.bomb-btn { width: 65px; height: 65px; font-size: 32px; background: rgba(255,100,100,0.3); }
#p1-up { grid-column: 2; grid-row: 1; }
#p1-left { grid-column: 1; grid-row: 2; }
#p1-down { grid-column: 2; grid-row: 3; }
#p1-right { grid-column: 3; grid-row: 2; }
#p2-up { grid-column: 2; grid-row: 1; }
#p2-left { grid-column: 1; grid-row: 2; }
#p2-down { grid-column: 2; grid-row: 3; }
#p2-right { grid-column: 3; grid-row: 2; }
@media (min-width: 768px) { #mobile-controls { display: none !important; } }
@media (max-width: 767px) { .d-pad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); } .control-btn { width: 45px; height: 45px; font-size: 18px; } .bomb-btn { width: 55px; height: 55px; font-size: 28px; } }
