@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', monospace;
    background: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* CRT scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
}

#game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 3px solid #2222ff;
    border-radius: 4px;
    background: #000;
}

/* Gesture zone overlay */
#gesture-zone {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    touch-action: none;
    display: none;
}

/* Mobile controls */
#mobile-controls {
    display: none;
    width: 100%;
    max-width: 400px;
    margin-top: 10px;
    padding: 0 10px;
}

.mobile-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.mobile-btn {
    width: 70px;
    height: 70px;
    font-family: 'Press Start 2P', monospace;
    font-size: 20px;
    background: rgba(255, 255, 0, 0.08);
    border: 2px solid rgba(255, 255, 0, 0.3);
    border-radius: 12px;
    color: #ffdd00;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.05s;
}

.mobile-btn:active, .mobile-btn.pressed {
    background: rgba(255, 255, 0, 0.25);
    border-color: rgba(255, 255, 0, 0.6);
    transform: scale(0.92);
}

#instructions {
    margin-top: 10px;
    font-size: 8px;
    color: #666;
    text-align: center;
    line-height: 1.8;
}

#gesture-hint {
    display: none;
    margin-top: 6px;
    font-size: 7px;
    color: #444;
    text-align: center;
}

/* Responsive */
@media (max-width: 560px) {
    body { justify-content: flex-start; padding-top: 6px; }
    #game-container { width: 100%; }
    #game-canvas { width: 98vw; max-width: 504px; height: auto; }
    #gesture-zone { display: block; }
    #mobile-controls { display: block; }
    #instructions { display: none; }
    #gesture-hint { display: block; }
}

@media (max-height: 850px) and (max-width: 560px) {
    .mobile-btn { width: 60px; height: 60px; font-size: 16px; }
}
