/* voidstyles.css */
@import url('https://fonts.googleapis.com/css2?family=Dongle:wght@300&family=Gamja+Flower&family=Gowun+Dodum&display=swap');
body, html {    
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;    
    font-family: "Gowun Dodum", sans-serif;
}

.hidden {
    display: none;
}

/* 기존 .modal 클래스 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right:0;
    bottom:0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 다른 요소보다 높게 설정 */
}

/* 추가: .modal.hidden 클래스의 우선순위 강화 */
.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    width: 80%;
    max-width: 400px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

#player-name {
    width: 80%;
    padding: 10px;
    margin: 20px 0;
    font-size: 16px;
}

#submit-name {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #00796b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#submit-name:hover {
    background-color: #004d40;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(160, 214, 197, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

#start-screen h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #004d40;
}

#start-game-button {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #00796b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-game-button:hover {
    background-color: #004d40;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: url('images/voidbgimg.jpg'); /* 원하는 배경 이미지 경로 */
    background-size: contain; /* 배경 이미지 크기를 전체 화면에 맞춤 */
    background-position: center; /* 배경 이미지의 중심을 맞춤 */
    background-repeat: no-repeat; /* 배경 이미지 반복 안 함 */
    z-index: 1; /* 기본 z-index */
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; /* 캔버스가 배경 이미지보다 위에 표시되도록 설정 */
    background-color: transparent;
}

#score-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 18px;
    color: #333;
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

#controls button {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background-color: #00796b;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#controls button:active {
    background-color: #004d40;
}

#view-record-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1003;
    padding: 8px 16px;
    background-color: #ff8a65;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#view-record-button:hover {
    background-color: #e65100;
}

#record-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border: 2px solid #ccc;
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#record-section.hidden {
    display: none;
}

#record-section h2 {
    margin-top: 0;
    color: #333;
}

#record-section #close-record {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    float: right;
}

#record-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    max-height: 300px;
    overflow-y: auto;
}

#record-list li {
    background-color: #f1f1f1;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

#restart-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    z-index: 1002;
}

#restart-button.hidden {
    display: none;
}
/* 예시: 모바일 기기에서 캔버스 크기 조정 */
@media (max-width: 768px) {
    #game-canvas {
        width: 100%;
        height: 100%;
    }
}
