body {
    margin: 0;
    padding: 20px;
    background-color: #000000;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

#gameContainer {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #000;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#controls {
    margin-top: 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #555;
}

#controls p {
    margin: 0;
    color: #fff;
    font-weight: bold;
}

/* 터치 컨트롤 스타일 */
#touchControls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

#leftControls, #rightControls {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

#leftControls {
    align-items: flex-end;
}

#rightControls {
    align-items: flex-end;
}

.control-btn, #leftBtn, #rightBtn, #downBtn, #jumpBtn {
    width: 60px;
    height: 60px;
    border: 3px solid #333;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#jumpBtn {
    width: 80px;
    height: 80px;
    font-size: 16px;
}

.control-btn:active, #leftBtn:active, #rightBtn:active, #downBtn:active, #jumpBtn:active {
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}


/* 모바일 최적화 */
@media (max-width: 768px) {
    #controls {
        display: none;
    }

    body {
        padding: 10px;
        justify-content: center;
    }

    #gameContainer {
        border-width: 2px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    #gameCanvas {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        width: auto;
        height: auto;
    }
}