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

body {
    background: #0a0a0a;
    color: #0ff;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    overflow: hidden;
}

.game-container {
    background: #111;
    padding: 25px 30px;
    border: 8px solid #0ff;
    border-radius: 20px;
    box-shadow: 0 0 50px #0ff, inset 0 0 30px rgba(0,255,255,0.3);
    max-width: 100%;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    text-shadow: 0 0 25px #0ff;
    letter-spacing: 6px;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

#gameCanvas {
    border: 7px solid #0ff;
    background: #000;
    box-shadow: 0 0 40px #0ff;
    touch-action: none;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.info {
    display: flex;
    justify-content: space-between;
    font-size: 1.6rem;
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 0 0 12px #0ff;
}

#startButton {
    padding: 14px 50px;
    font-size: 1.4rem;
    background: #0ff;
    color: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px auto 20px;
    display: block;
    box-shadow: 0 0 25px #0ff;
    transition: 0.2s;
}

#startButton:hover { transform: scale(1.05); }

.touch-controls {
    margin: 15px auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    max-width: 280px;
}

.dir-btn {
    background: rgba(0,255,255,0.12);
    color: #0ff;
    border: 5px solid #0ff;
    font-size: 2.8rem;
    width: 78px;
    height: 78px;
    border-radius: 18px;
    box-shadow: 0 0 20px rgba(0,255,255,0.5);
    touch-action: manipulation;
}

.dir-btn:active {
    background: #0ff;
    color: #000;
    transform: scale(0.92);
}

.up, .down { grid-column: 2; }
.middle-row { grid-column: 1/4; display:flex; gap:12px; justify-content:center; }

.controls { font-size:1.05rem; opacity:0.85; margin-top:8px; }

.overlay {
    position:absolute; top:0; left:0; width:100%; height:100%;
    background:rgba(0,0,0,0.88); display:none; align-items:center; justify-content:center;
    border-radius:8px;
}

.overlay-content {
    background:#111; padding:45px 65px; border:6px solid #f33;
    border-radius:15px; text-align:center;
}

.overlay-content h2 { color:#f33; font-size:3rem; margin-bottom:10px; }

/* iPad / Large Tablet Boost */
@media (min-width: 768px) {
    .game-container { padding: 35px 45px; }
    h1 { font-size: 3.4rem; }
    .dir-btn { width:88px; height:88px; font-size:3.2rem; }
    .info { font-size:1.8rem; }
}