* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Jua', sans-serif; overflow: hidden; }

.main-map {
    width: 100vw; height: 100vh;
    background-image: url('../images/main/bg.webp'); /* 확장자 꼭 확인하세요! */
    background-size: cover; background-position: center;
    position: relative; /* 자식 요소들의 절대 위치 기준점이 됩니다 */
}

.top-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mini-login-btn {
    display: flex; align-items: center; padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9); border: 2px solid #ddd;
    border-radius: 30px; cursor: pointer; font-family: 'Jua', sans-serif; font-size: 1rem;
}
.mini-icon { width: 20px; margin-right: 10px; }
#user-info { background: rgba(255, 255, 255, 0.9); padding: 10px 20px; border-radius: 30px; font-weight: bold; }

/* =========================================
   공통 디자인 (표지판과 집)
========================================= */
.signpost {
    position: absolute; 
    cursor: pointer;
    transition: all 0.1s ease-out; transform 0.2s;
}

.signpost:hover {
    transform: scale(1.1); 
}

/* 표지판 이미지 크기를 부모 크기에 맞춤 */
.sign-img {
    width: 100%; 
    filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.2)); 
}

.house {
    position: absolute; 
    text-align: center; 
    cursor: pointer; 
    touch-action: manipulation;
    transition: all 0.1s ease-out; transform 0.2s; 
    /* width: 120px; <-- 절대 넣지 마세요! */
}

.house:hover { 
    transform: scale(1.1); 
}

/* 🌟 여기가 핵심입니다! 집 이미지들이 부모 크기에 딱 맞게 찌그러지지 않고 변함 */
.roof-img {
    width: 100%;
    filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.2)); /* 집에도 살짝 그림자 추가 */
}

/* =========================================
   각 요소의 위치와 크기 지정 (완벽한 원근감)
========================================= */

/* 표지판 — 국어마을 / 수학마을 안내 */
#sign-kor { bottom: 0%;
    left: 78%;
    width: 11vw; }
#sign-math { bottom: 1%;
    right: 60%;
    width: 11vw; }

.learning-menu-btn {
    border-color: #ff80ab;
    color: #ad1457;
}

/* 🏠 국어마을 (다시 width vw 수치로 변경!) */
#kor-1 { top: 52%;
    left: 62%;
    width: 15vw; } /* 맨 앞 */
#kor-2 { top: 40%;
    left: 88%;
    width: 12vw;}
#kor-3 { top: 33%;
    left: 58%;
    width: 11vw; }
#kor-4 { top: 27%;
    left: 80%;
    width: 7vw; }


/* 🏠 수학마을 */
#math-1 { top: 47%;
    left: 23%;
    width: 14vw; }
#math-2 {top: 32%;
    left: 11%;
    width: 11vw; }
#math-3 {top: 28%;
    left: 37%;
    width: 9vw; }
#math-4 { top: 26%;
    left: 23%;
    width: 8vw; }

    /* 모달 배경 (어두운 반투명) */
.modal-overlay {
  display: none; /* 처음에는 숨김 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

/* 모달 창 안의 게임 컨테이너 */
.modal-content {
 position: relative;
  width: 100%;       /* 가로를 화면 끝까지 */
  height: 100vh;     /* 세로를 화면 높이 100%로 */
  max-width: none;   /* 최대 너비 제한 해제 */
  background-color: #ffffff; /* 배경색을 흰색으로 고정 */
  overflow: hidden;  /* 내부 스크롤 방지 */
}

/* iframe (게임 화면이 들어갈 액자) */
#gameFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 20px;
  background-color: transparent;
}

/* 닫기 버튼 */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1001;     /* 게임 화면보다 위에 보이게 */
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;       /* 누르기 편하게 조금 더 크게 */
  height: 50px;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* 눈에 잘 띄게 그림자 추가 */
}