#game {
    width: 400px;
    height: 300px;
    background: #dff4ff;
    border: 3px solid #333;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    display: none;
}

.obstacle {
    position: absolute;
    font-size: 30px;
    top: -40px;
}

#player {
    position: absolute;
    font-size: 40px;
    left: 180px;
    bottom: 10px;
}

#score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    font-weight: bold;
}

#gameOverText {
    display: none;
    position: absolute;
    top: 100px;
    left: 80px;
    font-size: 32px;
    font-weight: bold;
}

#restartButton {
    display: none;
    position: absolute;
    top: 165px;
    left: 145px;
    font-size: 18px;
    padding: 8px 14px;
    cursor: pointer;
}

#settingsBox {
    display: none;
    margin-top: 15px;
    padding: 10px;
    width: 380px;
    background: #f4f4f4;
    border: 1px solid #aaa;
}


/* ========================================
   모바일 조작 버튼
======================================== */

#mobileControls {
    display: none;
    width: 406px;
    margin-top: 12px;
    gap: 12px;
}

#mobileControls button {
    flex: 1;
    height: 55px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
}


/* ========================================
   휴대폰 화면
======================================== */

@media (max-width: 500px) {

    body {
        margin: 12px;
    }

    #game {
        width: calc(100vw - 30px);
        max-width: 400px;
    }

    #settingsBox {
        width: calc(100vw - 50px);
        max-width: 380px;
    }

    #mobileControls {
        width: calc(100vw - 24px);
        max-width: 406px;
    }
}