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

body {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

#gameCanvas {
    border: 2px solid #333;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
    max-width: none;
    max-height: none;
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 100;
    pointer-events: none;
}

.dpad, .action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: all;
}

.dpad {
    position: relative;
    width: 120px;
    height: 120px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #333;
    border-radius: 8px;
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.1s ease;
}

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

.dpad-left, .dpad-right {
    position: absolute;
    top: 40px;
    width: 40px;
    height: 40px;
}

.dpad-left {
    left: 0;
}

.dpad-right {
    right: 0;
}

.dpad-down {
    position: absolute;
    bottom: 0;
    left: 40px;
    width: 40px;
    height: 40px;
}

.action-buttons {
    flex-direction: row;
    gap: 15px;
}

.jump-btn, .run-btn, .throw-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.throw-btn {
    opacity: 0.5;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: #fff;
    max-width: 400px;
    padding: 20px;
}

.loading-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.loading-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #ecf0f1;
}

.loading-bar {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e74c3c);
    width: 0%;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    #gameCanvas {
        border: none;
    }
}

@media (max-height: 600px) {
    .loading-content h1 {
        font-size: 2em;
    }
    
    .loading-content p {
        font-size: 1em;
    }
}

/* Desktop specific */
@media (min-width: 769px) {
    #gameCanvas {
        width: 1024px;
        height: 576px;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #gameCanvas {
        image-rendering: pixelated;
    }
}