@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Sigmar&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #ffe5b4, #ffd700);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4a4a4a;
  text-align: center;
  overflow: hidden;
  position: relative;
  padding: 20px;
  height: 100%;
  width: 100%;
  overflow: auto;
}

.background-coins {
  position: fixed; /* fixed로 변경하여 모바일에서도 안정적으로 표시 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.coin {
  position: absolute;
  opacity: 0.15;
  animation: float 15s linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
  }
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  gap: clamp(10px, 2vw, 200px);
}


.content-container {
  position: relative;
  z-index: 1;
  padding: clamp(15px, 5vw, 30px); /* 반응형 패딩 */
  width: clamp(300px, 80vw, 1200px); /* 컨테이너 최대 너비 제한 */
  height: clamp(200px, 80vh, 100px);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari 지원 */
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.main-logo {
  width: 350px; /* 반응형 로고 크기 */
  height: min(200px, 50vw);
  top: 0px;
}

.logo-container {
  z-index: 1;
  position: absolute; 
}

.logo {
  z-index: 1;
  width: min(200px, 50vw); /* 반응형 로고 크기 */
  height: min(200px, 50vw);
  border-radius: 50%;
  margin-bottom: clamp(180px, 5vw, 35px);
  animation: bounce 2s infinite;
  object-fit: cover; /* 이미지 비율 유지 */
}

.title {
  z-index: 1;
  font-family: "Sigmar", serif;
  font-weight: 300;
  font-style: normal;
  font-size: clamp(2rem, 8vw, 3.5rem); /* 반응형 폰트 크기 */
  color: #ff6b6b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  word-break: break-word; /* 긴 제목 처리 */
  line-height: 1.2;
}

.rainbow-gallery-container {
  display: flex;
  flex-direction: column; /* 세로 방향으로 정렬 */
  justify-content: center;
  align-items: center; /* 중앙 정렬 */
  width: 100%;
  height: 100%;
  gap: clamp(10px, 5vw, 100px);
}

.rainbow-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%; /* 부모 요소에 따라 높이 설정 */
  min-height: 300px; /* 최소 높이 */
  max-height: 600px; /* 최대 높이 */
  position: relative;
}

.rainbow-gallery img { 
  width: 200px;
  height: 200px;
  object-fit: cover;
  position: absolute;
  transition: transform 0.3s ease;
}

.rainbow-gallery img:nth-child(1) { top: 40%; left: 15%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(2) { top: 30%; left: 25%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(3) { top: 20%; left: 35%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(4) { top: 15%; left: 45%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(5) { top: 15%; left: 55%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(6) { top: 20%; left: 65%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(7) { top: 30%; left: 75%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(8) { top: 40%; left: 85%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(9) { top: 60%; left: 85%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(10) { top: 70%; left: 75%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(11) { top: 80%; left: 65%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(12) { top: 85%; left: 55%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(13) { top: 85%; left: 45%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(14) { top: 80%; left: 35%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(15) { top: 70%; left: 25%; transform: translate(-50%, -50%); }
.rainbow-gallery img:nth-child(16) { top: 60%; left: 15%; transform: translate(-50%, -50%); }

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.fancy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #000;
  background: linear-gradient(145deg, #f0a500, #ffcc00);
  border: none;
  border-radius: 20px;
  padding: 15px 30px;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3), inset 2px 2px 5px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
}

.fancy-button:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.fancy-button:active {
  transform: translateY(2px);
  text-decoration: none;
}


.coming-soon {
  font-size: clamp(1.2rem, 5vw, 2rem);
  margin-bottom: clamp(10px, 3vw, 20px);
  color: #4a4a4a;
}

.date {
  font-size: clamp(1rem, 4vw, 1.5rem);
  margin-bottom: clamp(20px, 5vw, 40px);
  color: #666;
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 20px;
  border-radius: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: clamp(10px, 2vw, 20px);
  margin-bottom: clamp(20px, 5vw, 40px);
  padding: 0 clamp(10px, 3vw, 20px);
}

.countdown-item {
  background: rgba(255, 255, 255, 0.7);
  padding: clamp(10px, 2vw, 15px);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.countdown-item:hover {
  transform: translateY(-5px);
}

.countdown-number {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 600;
  color: #ff6b6b;
}

.countdown-label {
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  color: #666;
}

.mbti-links {
  text-transform: uppercase;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* 모바일 최적화 미디어 쿼리 */
@media (max-width: 480px) {
  .container {
    padding: 15px;
    width: 95%;
  }

  .coin {
    font-size: clamp(
      15px,
      4vw,
      30px
    ) !important; /* 모바일에서 코인 크기 제한 */
  }

  .background-coins {
    opacity: 1;
  }

  .countdown {
    grid-template-columns: repeat(2, 1fr); /* 모바일에서 2열로 변경 */
  }
}

@media (max-width: 480px) {
  .rainbow-gallery {
    margin-top: 20px;
  }

  .fancy-button {
    font-size: 1rem;
    padding: 8px 16px;
  }
}

/* 가로 모드 대응 */
@media (max-height: 600px) and (orientation: landscape) {
  .container {
    padding: 10px;
  }

  .logo {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
  }

  .countdown {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
  }

  .title {
    font-size: clamp(1.5rem, 6vh, 2.5rem);
    margin-bottom: 5px;
  }

  .coming-soon {
    font-size: clamp(1rem, 4vh, 1.5rem);
    margin-bottom: 5px;
  }

  .date {
    font-size: clamp(0.8rem, 3vh, 1.2rem);
    margin-bottom: 15px;
  }
}
