/* スプラッシュスクリーン */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--kaku-bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--z-index-splash);
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-screen.hidden {
  display: none;
}

/* ロゴコンテナ */
.splash-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: splash-float 2s ease-in-out infinite;
}

/* ネイティブ環境（シームレス遷移）では浮遊アニメーションを停止 */
.splash-screen.is-native .splash-logo-container {
  animation: none;
}

/* メインロゴ（SVG） */
.splash-logo-svg {
  width: 40vw; /* アセットのスケール 0.4 に合わせる */
  height: 40vw;
  max-width: 200px;
  max-height: 200px;
  color: var(--kaku-accent-primary);
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.1));
  animation: splash-fade-in 0.4s ease-out forwards;
  opacity: 0;
}

/* アニメーション無効化（シームレス遷移用） */
.splash-screen.no-animation .splash-logo-svg,
.splash-screen.no-animation .splash-subtitle,
.splash-screen.no-animation .splash-loading {
  animation: none !important;
  opacity: 1 !important;
}

/* サブタイトル */
.splash-subtitle {
  font-size: 18px;
  color: var(--kaku-text-secondary);
  margin-top: 12px;
  letter-spacing: 8px;
  animation: splash-fade-in 0.4s ease-out 0.1s forwards;
  opacity: 0;
}

/* ローディングドット */
.splash-loading {
  display: flex;
  gap: 8px;
  margin-top: 40px;
  animation: splash-fade-in 0.4s ease-out 0.2s forwards;
  opacity: 0;
}

/* ネイティブ環境ではローディングを表示しない */
.splash-screen.is-native .splash-loading {
  display: none;
}

.splash-dot {
  width: 10px;
  height: 10px;
  background: var(--kaku-accent-primary);
  border-radius: 50%;
  animation: splash-bounce 1.4s ease-in-out infinite;
}

.splash-dot:nth-child(1) {
  animation-delay: 0s;
}

.splash-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.splash-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* アニメーション定義 */
@keyframes splash-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes splash-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .splash-screen {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  }

  .splash-logo {
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
  }

  .splash-subtitle {
    color: #aaaaaa;
  }
}
