/**
 * DONT DIE - CORE STYLESHEET
 * --------------------------
 * Manages the visual presentation, CRT retro emulation filters, 
 * and responsive scaling for the 800x600 game engine.
 * 
 * Design Tokens:
 * - Font: 'Press Start 2P' (Retro Pixel Font)
 * - Background: #111 (Deep Charcoal)
 * - Highlights: #3498db (Soft Blue)
 */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', cursive;
    color: white;
}

#app-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-container {
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 1);
    border: 4px solid #333;
    background-color: #000;
    
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    aspect-ratio: 4 / 3;
    
    flex-shrink: 1; /* Allow it to intelligently yield space gracefully! */
    min-height: 0; 
    overflow: hidden;
}

canvas {
    display: block;
    /* Ensures scaled up pixels stay crisp and blocky */
    image-rendering: pixelated; 
    image-rendering: crisp-edges;
    width: 100%;
    height: 100%;
}

#touch-controls {
    display: none; /* Managed seamlessly by engine dynamically */
    width: 100%;
    max-width: 800px;
    height: 155px; /* Safely accommodates stacked directional pads elegantly */
    flex-shrink: 0; /* Strictly preserve button legibility */
    justify-content: space-between; 
    align-items: center;
    padding: 10px 30px;
    box-sizing: border-box;
    margin-top: 10px;
}

/* Beautiful structural overlay natively mapped exclusively onto the empty black bars dynamically explicitly safely during Landscape orientations precisely! */
@media (orientation: landscape) and (max-height: 600px) {
    #touch-controls {
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100vw; /* Stretch fully across screen */
        height: 100px;
        margin-top: 0;
        z-index: 100;
        pointer-events: none; /* Let empty space clicks organically fall explicitly through natively! */
    }
}


.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Classic tight dpad spacing natively */
}

.dpad-row {
    display: flex;
    flex-direction: row;
    gap: 8px; /* Internal tight alignment horizontally */
}

.touch-btn {
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    user-select: none;
    touch-action: manipulation;
    pointer-events: auto; 
    margin: 0;
    transition: background 0.1s ease;
}

.touch-btn.active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.space-btn {
    width: 140px; /* Wide pill specifically for Space functionality */
    border-radius: 20px;
    font-size: 14px;
    letter-spacing: 2px;
}
