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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background-color: #000;
}

#game-canvas {
    display: block;
    background-color: #6b88fe;
    width: 100%;
    height: 100%;
    image-rendering: pixelated; /* For crisp rendering of scaled pixels */
}

.font-geist-mono {
    font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
    letter-spacing: -0.5px;
}

#start-screen, #game-over, #win-screen, #pause-menu {
    display: flex;
}

/* Responsive layout */
@media (max-width: 640px) {
    #game-ui {
        padding: 8px;
    }
    
    #game-ui .font-geist-mono {
        font-size: 14px;
    }
    
    #start-screen h1 {
        font-size: 2rem;
    }
    
    #start-screen .text-lg, #game-over .text-2xl, #win-screen .text-2xl {
        font-size: 1rem;
    }
    
    #start-screen .max-w-md {
        max-width: 90%;
    }
}

/* For touch controls on mobile devices */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dpad-row {
    display: flex;
}

.dpad-button, .action-button {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    font-size: 24px;
    color: white;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dpad-button:active, .action-button:active {
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.action-buttons {
    display: flex;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#start-button, #restart-button, #next-level-button, #resume-button, #quit-button {
    animation: bounce 2s infinite;
}

#start-screen, #game-over, #win-screen, #pause-menu {
    animation: fadeIn 0.5s;
}
