/* 기본 스타일 */
body {
    background-color: #222;
    color: #eee;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    margin: 0;
}
/* 오버레이가 활성화될 때만 스크롤을 막는 클래스 */
body.overlay-active {
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    max-width: 600px;
    margin: auto;
}

h1 { font-size: 2.5em; color: #00aaff; margin: 15px 0; }
#life-area { margin: 15px 0; display: flex; justify-content: center; gap: 5px; }
.life-heart { width: 30px; height: 30px; }
#timer-area { font-size: 1.2em; color: #a0a0a0; margin-bottom: 20px; }
#puzzle-content { margin: 20px 0; }
#puzzle-image { max-width: 100%; height: auto; border: 1px solid #777; background-color: #444; }
.input-area { width: 100%; }
#password-input { padding: 10px; border: 1px solid #777; background-color: #444; color: #eee; margin-right: 10px; border-radius: 5px; }
#submit-btn { padding: 10px 20px; background-color: #007BFF; color: white; border: none; cursor: pointer; border-radius: 5px; transition: background-color 0.3s; }
#submit-btn:hover { background-color: #0056b3; }

/* 피드백 오버레이 스타일 */
#feedback-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex; justify-content: center; align-items: center;
    visibility: hidden; opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    z-index: 1000;
}
#feedback-overlay.show { visibility: visible; opacity: 1; }
#feedback-text {
    font-size: 15vw; font-weight: bold;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
#feedback-overlay.show #feedback-text { transform: scale(1); }
#feedback-text.correct { color: #28a745; }
#feedback-text.incorrect { color: #dc3545; }

/* 게임 종료 화면 스타일 */
.game-end-screen { width: 100%; }
.game-end-screen h1 { color: #00aaff; }
.game-end-screen.game-over h1 { color: salmon; }
.game-end-screen p { font-size: 1.2em; line-height: 1.6; }
.retry-btn { margin-top: 20px; padding: 10px 20px; font-size: 16px; background-color: #007BFF; color: white; border: none; cursor: pointer; border-radius: 5px; }

/* 반응형 스타일 (세로 모바일) */
@media (max-width: 480px) {
    .input-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }
    #password-input { width: 100%; margin-right: 0; box-sizing: border-box; }
    #submit-btn { width: 100%; }
}

/* 
  ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
    태블릿 가로 모드를 위한 미디어 쿼리 (이 부분이 수정되었습니다!)
  ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
*/
@media (orientation: landscape) and (max-height: 700px) {
    .container {
        padding: 5px 20px; /* 상하 패딩 최소화 */
    }
    h1 {
        font-size: 1.8em; /* 제목 크기 조금 줄이기 */
        margin: 5px 0; /* 제목 위아래 여백 최소화 */
    }
    #life-area {
        margin: 5px 0; /* 하트 위아래 여백 최소화 */
    }
    .life-heart {
        width: 22px; /* 하트 크기 조금 줄이기 */
        height: 22px;
    }
    #timer-area {
        margin-bottom: 5px; /* 타이머 아래 여백 최소화 */
    }
    #puzzle-content {
        margin: 5px 0; /* 이미지 위아래 여백 최소화 */
    }
    #puzzle-image {
        /* 이미지 최대 높이를 화면 높이의 60%까지 사용하도록 대폭 상향! */
        max-height: 60vh; 
    }
    .input-area {
        margin-top: 5px; /* 입력창 위 여백 추가 */
    }
}