/* 기본 배경 설정 */
body {
    background-color: #000;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

#ui-container {
    position: relative;
    width: 1000px;
    height: 400px;
    max-width: 98vw;
    max-height: 98vh;
    aspect-ratio: 1000 / 400; /* 가로세로 비율 강제 유지 */
}

/* 캔버스 설정 */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    border: 2px solid #333;
    box-sizing: border-box;
}

/* 상단 점수 UI */
#game-ui {
    position: absolute;
    top: 5px;
    left: 10px;
    z-index: 10;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 2px #000;
    font-size: 14px;
}

/* 시작 화면 설정 */
#start-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('assets/images/start_bg.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding-top: 50px; /* 로고 아래 공간 확보 */
}

/* UI 묶음 레이아웃 */
#mobile-ui-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* 요소 간 간격 축소 */
}

/* 입력창 스타일 */
input[type="text"] {
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 180px;
    text-align: center;
    margin-bottom: 5px;
}

/* 버튼 스타일 */
button {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    color: white;
    width: 160px;
}

.btn-start { background-color: #e67e22; } /* 주황색 */
.btn-start:hover { background-color: #d35400; }

.btn-rank { background-color: #27ae60; } /* 녹색 */
.btn-rank:hover { background-color: #219150; }

/* 게임오버 화면 */
#gameover-screen {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    z-index: 110;
    min-width: 250px;
}

#gameover-screen button {
    background-color: white;
    color: #333;
    width: 120px;
    margin: 5px;
}

/* 모바일 대응 미디어 쿼리 (화면 높이가 낮을 때) */
@media (max-height: 450px) {
    #mobile-ui-wrapper {
        transform: scale(0.7); /* UI 덩어리 자체를 70%로 축소 */
        gap: 4px;
    }
    #game-ui { font-size: 12px; }
}

.hidden { display: none !important; }