body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #333;
    color: #eee;
    font-family: 'Arial', sans-serif;
    margin: 0;
    /* overflow: hidden; /* Prevent scrollbars */ */
}

h1 {
    color: #ffcc00;
    margin-bottom: 20px;
}

.game-container {
    position: relative;
    width: 100%; /* script.js에서 동적으로 크기 조절 */
    height: 100%; /* script.js에서 동적으로 크기 조절 */
    max-width: 800px; /* 최대 너비 제한 */
    max-height: 920px; /* 최대 높이 제한 */
    background-color: #000;
    border: 5px solid #ffcc00;
    overflow: auto; /* 스크롤바가 자동으로 나오도록 변경 */
    display: flex; /* 캔버스 중앙 정렬을 위해 추가 */
    justify-content: center; /* 캔버스 수평 중앙 정렬 */
    align-items: center; /* 캔버스 수직 중앙 정렬 */
}

canvas {
    display: block;
    background-color: #000;
    width: 100%; /* 부모 요소에 맞춰 크기 조절 */
    height: 100%; /* 부모 요소에 맞춰 크기 조절 */
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2em;
    text-align: center;
    z-index: 50;
}

.ui-overlay.hidden {
    display: none;
}

#ui-message {
    margin-bottom: 20px;
}

#ui-button {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #ffcc00;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 가상 패드 스타일 */
.virtual-pad {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* 기본적으로 flex로 설정하여 모바일에서 보이도록 함 */
    flex-direction: column;
    align-items: center;
    z-index: 100; /* UI 오버레이 위에 표시 */
    background-color: rgba(0, 0, 0, 0.5); /* 배경 추가 */
    padding: 10px;
    border-radius: 10px;
}

.virtual-pad div {
    display: flex;
}

.pad-btn {
    width: 60px;
    height: 60px;
    margin: 5px;
    font-size: 1.5em;
    background-color: #ffcc00;
    color: black;
    border: none;
    border-radius: 50%; /* 원형 버튼 */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none; /* 텍스트 선택 방지 */
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* 모바일 탭 시 하이라이트 제거 */
}

.pad-btn:active {
    background-color: #e6b800; /* 클릭 시 색상 변경 */
}

.pad-btn.up {
    margin-bottom: 10px;
}

.pad-btn.left {
    margin-right: 10px;
}

.pad-btn.right {
    margin-left: 10px;
}

/* 모바일 환경에서만 가상 패드 표시 (데스크톱에서는 숨김) */
/*
@media (min-width: 768px) {
    .virtual-pad {
        display: none;
    }
}
*/