.inner {
  position: relative;
}
/* 배경 퍼즐 조각 */
.background-piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* height: 100%; */
  z-index: 999;
}
.background-piece img:nth-child(1) {
  position: absolute;
  top: 300px;
  left: 200px;
  width: 200px;
}
.background-piece img:nth-child(2) {
  position: absolute;
  top: 600px;
  left: 200px;
  width: 200px;
}
.background-piece img:nth-child(3) {
  position: absolute;
  top: 900px;
  left: 200px;
  width: 200px;
}
.background-piece img:nth-child(4) {
  position: absolute;
  top: 300px;
  right: 200px;
  width: 200px;
}
.background-piece img:nth-child(5) {
  position: absolute;
  top: 600px;
  right: 200px;
  width: 200px;
}
.background-piece img:nth-child(6) {
  position: absolute;
  top: 900px;
  right: 200px;
  width: 200px;
}
/* 퍼즐 게임 섹션 */
.puzzle-section {
  background-color: #000;
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden; /* 배경 조각이 화면 밖으로 나가는 것 방지 */
}
/* 상단 카피 */
.hero {
  margin: 120px 0 150px 0;
  color: #fff;
}
.hero > h1 {
  font-size: 3rem;
}
.hero > h3 {
  font-weight: 400;
  font-size: 1.2rem;
  margin: 50px;
}
/* 퍼즐 보드 */
.puzzle-board {
  position: relative;
  margin: 0 auto;
  width: 800px;
  height: 800px;
  background-color: var(--sub-1);
  border-radius: 50px;
}
.puzzle-board h1 {
  position: absolute;
  top: -12%;
  left: 21%;
  font-size: 5rem;
  font-weight: 400;
  font-family: "Black Han Sans", sans-serif;
  color: var(--sub-1-1);
  margin: 40px 0;
  -webkit-text-stroke: 19px #fff;
  paint-order: stroke fill;
  z-index: 999;
}
/* 프레임 */
.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
}
.frame-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
/* 보드 카테고리 */
.board-category {
  position: absolute;
  color: #666;
  line-height: 0.6;
  font-size: 2.5rem;
  font-weight: lighter;
  font-family: "Black Han Sans", sans-serif;
  z-index: 9999;
}
.board-category p {
  cursor: pointer;
  position: absolute;
  z-index: 9999;
}
.board-category p:nth-child(1) {
  position: absolute;
  top: 190px;
  left: 120px;
  width: 160px;
}
.board-category p:nth-child(2) {
  position: absolute;
  top: 190px;
  left: 320px;
  width: 160px;
}
.board-category p:nth-child(3) {
  position: absolute;
  top: 190px;
  left: 519px;
  width: 160px;
}
.board-category p:nth-child(4) {
  position: absolute;
  top: 390px;
  left: 120px;
  width: 160px;
}
.board-category p:nth-child(5) {
  position: absolute;
  top: 390px;
  left: 320px;
  width: 160px;
}
.board-category p:nth-child(6) {
  position: absolute;
  top: 390px;
  left: 519px;
  width: 160px;
}
.board-category p:nth-child(7) {
  position: absolute;
  top: 590px;
  left: 120px;
  width: 160px;
}
.board-category p:nth-child(8) {
  position: absolute;
  top: 590px;
  left: 320px;
  width: 160px;
}
.board-category p:nth-child(9) {
  position: absolute;
  top: 590px;
  left: 519px;
  width: 160px;
}
/* 퍼즐 조각 */
.piece {
  position: absolute;
  z-index: 99;
  /* pointer-events:none; */
  /* display: none;  */
}
.piece img {
  opacity: 0;
  /* display: none; */
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.piece img.active {
  opacity: 1;
}
.piece img:nth-child(1) {
  position: absolute;
  top: 98px;
  left: 52px;
  width: 296px;
}
.piece img:nth-child(2) {
  position: absolute;
  top: 51px;
  left: 301px;
  width: 201px;
}
.piece img:nth-child(3) {
  position: absolute;
  top: 99px;
  left: 453px;
  width: 296px;
}
.piece img:nth-child(4) {
  position: absolute;
  top: 252px;
  left: 99px;
  width: 201px;
}
.piece img:nth-child(5) {
  position: absolute;
  top: 300px;
  left: 252px;
  width: 296px;
}
.piece img:nth-child(6) {
  position: absolute;
  top: 253px;
  left: 501px;
  width: 201px;
}
.piece img:nth-child(7) {
  position: absolute;
  top: 500px;
  left: 51px;
  width: 296px;
}
.piece img:nth-child(8) {
  position: absolute;
  top: 453px;
  left: 299px;
  width: 201px;
}
.piece img:nth-child(9) {
  position: absolute;
  top: 501px;
  left: 452px;
  width: 296px;
  /* display: none; */
}
/* 퍼즐 조각 카테고리 */
.piece-category {
  position: absolute;
  color: #000;
  line-height: 0.6;
  font-size: 2.5rem;
  font-weight: lighter;
  font-family: "Black Han Sans", sans-serif;
  pointer-events: none;
  z-index: 999;
}
.piece-category p {
  opacity: 0;
  transition: 0.4s;
}
.piece-category p:nth-child(1) {
  position: absolute;
  top: 190px;
  left: 120px;
  width: 160px;
}
.piece-category p:nth-child(2) {
  position: absolute;
  top: 190px;
  left: 320px;
  width: 160px;
}
.piece-category p:nth-child(3) {
  position: absolute;
  top: 190px;
  left: 519px;
  width: 160px;
}
.piece-category p:nth-child(4) {
  position: absolute;
  top: 390px;
  left: 120px;
  width: 160px;
}
.piece-category p:nth-child(5) {
  position: absolute;
  top: 390px;
  left: 320px;
  width: 160px;
}
.piece-category p:nth-child(6) {
  position: absolute;
  top: 390px;
  left: 519px;
  width: 160px;
}
.piece-category p:nth-child(7) {
  position: absolute;
  top: 590px;
  left: 120px;
  width: 160px;
}
.piece-category p:nth-child(8) {
  position: absolute;
  top: 590px;
  left: 320px;
  width: 160px;
}
.piece-category p:nth-child(9) {
  position: absolute;
  top: 590px;
  left: 519px;
  width: 160px;
}
/* 외곽선 */
.stroke-img {
  /* display: none; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  pointer-events: none;
  z-index: 999;
}
/* 퍼즐 모달창 */
.modal-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999999;
}
#modal-box {
  position: relative;
  width: 800px;
  height: 800px;
  padding: 30px;
}
.modal-puzzle-shape {
  position: absolute;
  inset: 0;
  /* top: 20%; */
  /* left: 0; */
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}
#modal-category {
  position: absolute;
  top: 50px;
  left: 40px;
  right: 40px;
  background-color: var(--sub-1-1);
  border-radius: 50px;
  padding: 10px;
  margin: auto;
  width: 300px;
  color: #fff;
  font-size: 2rem;
  line-height: 3rem;
  z-index: 3;
}
.close-btn {
  position: absolute;
  top: 140px;
  right: 155px;
  font-size: 2rem;
  cursor: pointer;
  z-index: 9;
}
.modal-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 120px 80px;
  text-align: center;
}
/* 퍼즐 타입별 모달 레이아웃  */

/* 가로 퍼즐 (purple) */
#modal-box.horizontal .modal-content {
  justify-content: center;
  padding-top: 80px;
}

#modal-box.horizontal #modal-question {
  margin-top: 30px;
  font-size: 1.4rem;
}

#modal-box.horizontal .option-buttons {
  width: 360px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

#modal-box.horizontal .option-btn {
  width: calc((100% - 24px) / 3);
}

/* 세로 퍼즐 (pink, blue) */
#modal-box.vertical .modal-content {
  justify-content: center;
  /* padding-top: 40px; */
}

#modal-box.vertical #modal-question {
  margin-bottom: 20px;
  font-size: 1.4rem;
}

#modal-box.vertical .option-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 180px;
}

#modal-box.vertical .option-btn {
  width: 100%;
}
#modal-box.vertical #modal-category {
  position: absolute;
  top: -55px;
}
#modal-box.vertical .close-btn {
  position: absolute;
  top: 150px;
  right: 160px;
  cursor: pointer;
}
#modal-question {
  margin: 20px auto;
}
/* 모달창 옵션 버튼 */
.option-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.option-btn {
  width: calc((100% - 24px) / 3);
  min-height: 56px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

.option-btn.active {
  background: #9b89f7;
  color: white;
  border-color: #9b89f7;
}
/* 모달창 완료 버튼 */
#complete-btn {
  margin-top: 28px;
  padding: 8px 30px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s;
}
#complete-btn:hover {
  transform: translateY(-2px);
}
#modal-box.horizontal #complete-btn {
  background: var(--sub-1-1);
}

#complete-btn:hover {
  transform: translateY(-2px);
}
/* 퍼즐 완성도 */
.completion {
  margin: 100px auto;
  width: 800px;
  text-align: center;
}
.completion p {
  color: #fff;
  margin-bottom: 20px;
  font-size: 2rem;
}
/* 퍼즐 완성도 그래프 */
.completion-box {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden; /* 밖으로 넘치는 부분 숨김 */
  background: rgba(255,255,255,1);
}
/* 실제 차오르는 영역 */
.completion-fill {
  /* 처음엔 안 보이게 */
  width: 0%; 
  height: 100%;
  overflow: hidden;
  transition: width 0.6s ease;
}

/* 그래프 이미지는 항상 원본 크기 유지 */
.completion-fill img {
  width: 800px;
  height: 90%;
  padding: 5px;
  display: block;
  object-fit: cover;
}
/* .completion-box img {
  width: 100%;
  display: block;
} */
/* 결과 보기 버튼 */
.result-btn {
  display: inline-block;
  padding: 20px 70px;
  margin-top: 50px;
  cursor: pointer;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.3rem;
  color: #fff;
  background-color: var(--main);
}
.result-btn h2 {
  font-weight: 500;
}
