/* ==============================================
   HIE GAMES - Top Page Styles
   Version: 1.3
   Last Updated: 2026-01-14
   変更点: 
   - スクロール完全禁止（固定レイアウト）
   - ウェルカムメッセージ色を確実に適用
   - 文字サイズを環境に最適化（clamp + vh/vw）
   ============================================== */

/* ==============================================
   Body - スクロール禁止
   ============================================== */
body.top-page {
  overflow: hidden;
  height: 100vh;
}

/* ==============================================
   Main Container (v1.3: 完全固定レイアウト)
   ============================================== */
#top-main {
  /* 完全固定：ヘッダー・フッター分を除いた高さ */
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  
  /* スクロール禁止 */
  overflow: hidden;
  
  /* コンテンツを中央配置 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-sm);
}

/* ==============================================
   Stars Container (時間変化ギミック用)
   ============================================== */
#stars-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* ==============================================
   星の演出
   ============================================== */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #FFF;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ==============================================
   流れ星の演出
   ============================================== */
.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, #FFF, transparent);
  transform: rotate(45deg);
  animation: shoot 1.5s ease-out forwards;
}

@keyframes shoot {
  0% {
    transform: rotate(45deg) translateX(0);
    opacity: 1;
  }
  100% {
    transform: rotate(45deg) translateX(300px);
    opacity: 0;
  }
}

/* ==============================================
   時間変化背景
   ============================================== */

/* 夜空モード（19:00〜7:00）：物語を作っている最中 */
.sky-night {
  background: linear-gradient(
    180deg,
    #0D1B2A 0%,
    #1A2F4A 50%,
    #0D1B2A 100%
  );
}

/* 朝焼けモード（7:00〜19:00）：物語が発表される間近 */
.sky-dawn {
  background: linear-gradient(
    180deg,
    #1A2F4A 0%,
    #4A148C 20%,
    #FF7043 60%,
    #FF8A80 80%,
    #FFD54F 100%
  );
}

/* ==============================================
   Message Container
   ============================================== */
.message {
  text-align: center;
  margin-bottom: clamp(0.5rem, 2vh, 1.5rem);
  position: relative;
  z-index: 1;
}

/* ==============================================
   Welcome Message (v1.3: ゴールデンイエロー確実適用)
   ============================================== */
.message .welcome {
  /* ゴールデンイエローを最優先で適用 */
  color: #FFD54F !important;
  
  /* 環境に最適化されたフォントサイズ */
  font-size: clamp(1.1rem, 3.5vw, 1.75rem);
  font-weight: 700;
  
  /* 光彩効果（About usポップアップと同等） */
  text-shadow: 
    0 0 10px rgba(255, 213, 79, 0.6),
    0 0 20px rgba(255, 213, 79, 0.4),
    0 0 30px rgba(255, 213, 79, 0.2);
  
  margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
  
  /* アニメーション */
  opacity: 0;
  animation: messageAppear 1s ease-out forwards;
  animation-delay: 0.2s;
}

/* ==============================================
   Message Lines (v1.3: 環境最適化)
   ============================================== */
.message p {
  /* 環境に最適化されたフォントサイズ */
  font-size: clamp(0.8rem, 2.2vw, 1.15rem);
  line-height: 1.8;
  color: var(--color-stardust-white);
  margin: clamp(0.15rem, 0.5vh, 0.35rem) 0;
  opacity: 0;
  animation: messageAppear 1s ease-out forwards;
}

.message .line1 { animation-delay: 0.5s; }
.message .line2 { animation-delay: 0.8s; }
.message .line3 { animation-delay: 1.1s; }
.message .line4 { animation-delay: 1.4s; }
.message .line5 { animation-delay: 1.7s; }
.message .line6 { animation-delay: 2.0s; }
.message .line7 { animation-delay: 2.3s; }

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================
   CTA Button (Top Page)
   ============================================== */
#top-main .cta-button {
  opacity: 0;
  animation: messageAppear 1s ease-out forwards;
  animation-delay: 2.6s;
  position: relative;
  z-index: 1;
  margin-top: clamp(0.5rem, 1.5vh, 1rem);
  
  /* 環境最適化 */
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  padding: clamp(0.6rem, 1.5vh, 1rem) clamp(1.5rem, 4vw, 2.5rem);
}

/* ==============================================
   Responsive - Mobile (〜767px)
   ============================================== */
@media (max-width: 767px) {
  #top-main {
    padding: var(--spacing-xs);
  }
  
  .message .welcome {
    font-size: clamp(1rem, 5vw, 1.4rem);
  }
  
  .message p {
    font-size: clamp(0.75rem, 3.8vw, 1rem);
    line-height: 1.7;
    margin: clamp(0.1rem, 0.4vh, 0.25rem) 0;
  }
  
  #top-main .cta-button {
    width: 80%;
    max-width: 280px;
    text-align: center;
  }
}

/* ==============================================
   Responsive - Small Mobile (〜480px)
   超小型画面対応
   ============================================== */
@media (max-width: 480px) {
  .message .welcome {
    font-size: clamp(0.95rem, 5.5vw, 1.2rem);
  }
  
  .message p {
    font-size: clamp(0.7rem, 4vw, 0.9rem);
    line-height: 1.6;
  }
}

/* ==============================================
   Responsive - Tablet (768px〜1023px)
   ============================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .message .welcome {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
  }
  
  .message p {
    font-size: clamp(0.85rem, 2vw, 1.05rem);
  }
}

/* ==============================================
   Responsive - Large Desktop (1400px〜)
   大画面対応
   ============================================== */
@media (min-width: 1400px) {
  .message .welcome {
    font-size: 1.85rem;
  }
  
  .message p {
    font-size: 1.2rem;
  }
}

/* ==============================================
   Landscape mode on mobile
   横向きモバイル対応
   ============================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .message .welcome {
    font-size: clamp(0.9rem, 3vh, 1.2rem);
    margin-bottom: 0.3rem;
  }
  
  .message p {
    font-size: clamp(0.65rem, 2.5vh, 0.85rem);
    line-height: 1.5;
    margin: 0.1rem 0;
  }
  
  #top-main .cta-button {
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
  }
}
