@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --primary-color: #ff8f56; /* 진한 오렌지 (오픈 전 배경) */
  --card-bg: #ffece1; /* 연한 살구색 (오픈 후 배경) */
  --text-color: #ff763b; /* 텍스트컬러 */
}

body {
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  background-image: url("https://res.cloudinary.com/dkqqxjsek/image/upload/v1767002360/Frame_84_bh88ll.png");
  background-size: auto;
  background-position: center top;
  background-repeat: repeat;
  background-attachment: fixed;
  background-color: #fcfcfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: #333;
  overflow-x: hidden;
}

/* --- 헤더 --- */
header {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.top-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  margin-bottom: 40px;
}

.event-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 8px 6px;
  gap: 2px;
  border-radius: 27px;
  background: #fff;
  box-shadow: 0 2px 8px 0 rgba(163, 73, 27, 0.15);
  border: none;
  color: var(--Primary-Text, #ff763b);
  text-align: center;
  font-family: Pretendard;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.28px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.nav-icons {
  display: flex;
  gap: 15px;
  align-items: center;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  cursor: pointer;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* --- 타이틀 --- */
.logo-area {
  text-align: center;
  margin-bottom: 5px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-image {
  width: 145px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
  max-width: 100%;
}

.sub-title {
  color: var(--BrownBlack, #564343);
  text-align: center;
  font-family: Pretendard;
  font-size: 15px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.3px;
}

/* --- 캘린더 그리드 --- */
.calendar-container {
  display: grid;
  grid-template-columns: repeat(2, 130px);
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 380px;
  margin-bottom: 40px;
  z-index: 1;
}

.door {
  width: 100%;
  height: 150px;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
}

/* --- 애니메이션 정의 --- */
@keyframes hoverBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes todayBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

.door:hover {
  animation: hoverBob 1s ease-in-out !important;
  z-index: 20;
}

.door.is-today:not(.open) {
  animation: todayBob 2s ease-in-out infinite;
  z-index: 5;
}

.door-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.door.open .door-inner {
  transform: rotateY(180deg);
}

/* --- 카드 앞/뒤 공통 --- */
.door-front,
.door-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 15px;
}

.door-front {
  background-color: var(--primary-color);
  color: white;
}

.door-front .door-num {
  font-family: Pretendard;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  letter-spacing: -0.32px;
  color: white;
  margin-bottom: 5px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding-top: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.cover-image {
  width: 100%;
  height: auto;
  max-height: calc(100% - 35px);
  object-fit: contain;
  align-self: center;
  margin-top: auto;
  margin-bottom: auto;
  /*filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));*/
}

.door-back {
  background-color: var(--card-bg);
  transform: rotateY(180deg);
  border: none;
}

.door-back .door-num {
  font-family: Pretendard;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  letter-spacing: -0.32px;
  color: var(--primary-color);
  margin-bottom: 5px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding-top: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.puzzle-image {
  width: 80%;
  height: auto;
  max-height: calc(100% - 35px);
  object-fit: contain;
  align-self: center;
  margin-top: auto;
  margin-bottom: auto;
}

.door.missed .door-front {
  background-color: var(--primary-color);
}

.lock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 28px;
  z-index: 10;
  opacity: 0.9;
  object-fit: contain;
}

.door.missed .cover-image {
  opacity: 0.3;
}

.door-num-10-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30px;
  margin-bottom: 5px;
  flex-shrink: 0;
}
.star-icon {
  width: 30px;
  height: 30px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);


}
.door-num-10-wrapper span {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  padding-top: 1px;
}
.door-front .door-num-10-wrapper span {
  color: var(--primary-color);
}
.door-back .door-num-10-wrapper span {
  color: white;
}

/* --- 푸터 & 모달 CSS --- */
footer {
  margin-bottom: 40px;
  z-index: 10;
}
.footer-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-size: 0.9rem;
  font-weight: 500;
  text-underline-offset: 4px;
  cursor: pointer;
}
.footer-wrapper {
  margin-top: 80px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}
.modal.active {
  opacity: 1;
  visibility: visible;
}

/* 모달 애니메이션 */
@keyframes bounceIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes bounceOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0;
  }
}
@keyframes bounceClick {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.animate-bounce {
  animation: bounceClick 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.daily-modal {
  background: var(--primary-color);
  padding: 20px;
  border-radius: 12px;
  text-align: left;
  width: 295px;
  height: 422px;
  position: relative;
  transform: scale(0.9);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  color: white;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: visible;
  margin-top: 60px;
}

.modal-top-deco {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: auto;
  object-fit: contain;
  display: block;
  z-index: 25;
  pointer-events: none;
  margin-bottom: -10px;
}

.deco-day-1 {
  width: 94px;
  margin-bottom: 0px;
}

.deco-day-2 {
  width: 94px;
  margin-bottom: -1px;
}

.deco-day-3 {
  width: 127px;
  margin-bottom: -2px;
}

.deco-day-4 {
  width: 94px;
  margin-bottom: -1px;
}

.deco-day-5 {
  width: 150px;
  margin-bottom: 0px;
}

.deco-day-6 {
  width: 119px;
  margin-bottom: 0px;
}

.deco-day-7 {
  width: 115px;
  margin-bottom: -1px;
}

.deco-day-8 {
  width: 120px;
  margin-bottom: 0px;
}

.deco-day-9 {
  width: 117px;
  margin-bottom: 0px;
}

.deco-day-10 {
  width: 126px;
  margin-bottom: 0px;
}
.modal.active .modal-content {
  animation: bounceIn 0.4s ease-out forwards;
}
.modal.closing .modal-content {
  animation: bounceOut 0.3s ease-in forwards;
}
.modal.closing {
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0;
  gap: 5px;
}
.modal-profile-icon {
  width: 50px;
  height: 50px;
  backface-visibility: hidden;
  transform: translateZ(0);

  box-sizing: border-box;
  object-fit: contain;
}
.modal-text-group {
  display: flex;
  flex-direction: column;
}

.modal-day-title {
  font-family: Pretendard;
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.36px;
  margin: 0;
  line-height: 1.2;
}
.modal-subtext {
  font-family: Pretendard;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.28px;
  opacity: 0.9;
  margin: 5px 0 0 0;
  word-break: keep-all;
}

#modal-image {
  width: 247px;
  height: 247px;
  object-fit: cover;
  border-radius: 8px;
  margin: 12px auto;
  background-color: white;
  display: block;
}
#modal-image.vertical {
  width: 175px;
  height: 247px;
}

.modal-btn-group {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
  font-family: "Pretendard", sans-serif;
}
.modal-btn:active {
  transform: scale(0.96);
}

.btn-save {
  width: 133px;
  height: 47px;
  background-color: white;
  color: var(--primary-color);
}
.btn-close {
  width: 106px;
  height: 47px;
  background-color: white;
  color: #333;
}

/* 도움말 모달 */
.modal-content.help-modal {
  background-color: white;
  color: #333;
  padding: 30px 25px;
  text-align: center;
  width: 85%;
  max-width: 320px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s;
  box-sizing: border-box;
}
.help-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 5px 0;
  color: #333;
}
.help-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
  margin-bottom: 25px;
  text-decoration: none;
}
.help-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  text-align: left;
}
.help-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  line-height: 1.5;
  color: #555;
  word-break: keep-all;
}
.help-bullet-icon {
  width: 13px;
  height: 13px;
  margin-top: 4px;
  flex-shrink: 0;
  object-fit: contain;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.small-text {
  font-size: 0.75rem;
  color: #777;
}
.help-close-btn {
  background-color: #ffece5;
  color: var(--primary-color);
  border: none;
  padding: 14px 0;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  font-family: "Pretendard", sans-serif;
}

/* --- 커스텀 순수 알럿 디자인 (아이콘 영역 포함) --- */
.custom-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  backdrop-filter: blur(2px);
}
.custom-alert-box {
  background: white;
  padding: 30px 25px;
  border-radius: 20px;
  width: 280px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: bounceIn 0.4s ease-out forwards;
}
.alert-icon-area {
  width: 50px;
  height: 50px;
  margin: 0 auto 15px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.alert-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.alert-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #333;
}
.alert-text {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 15px;
  word-break: keep-all;
  line-height: 1.4;
}
.alert-input {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #eee;
  border-radius: 10px;
  margin-bottom: 20px;
  box-sizing: border-box;
  outline: none;
  font-size: 1rem;
  text-align: center;
}
.alert-input:focus {
  border-color: var(--primary-color);
}
.alert-btn-group {
  display: flex;
  gap: 10px;
}
.alert-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 25px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
}
.alert-btn-confirm {
  background: var(--primary-color);
  color: white;
}
.alert-btn-cancel {
  background: #f5f5f5;
  color: #888;
}

dotlottie-player {
  position: fixed;
  width: 1000px;
  height: 1000px;
  z-index: 2001;
  transform: translate(-50%, -70%);
  pointer-events: none;
}
