/* ===== スプラッシュ / 起動ローディング画面 ===== */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070b18;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#splash.splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 背景: 同心ネオングロー */
.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 35% at 50% 38%, rgba(77, 163, 255, 0.22) 0%, transparent 65%),
    radial-gradient(40% 28% at 80% 15%, rgba(139, 92, 246, 0.16) 0%, transparent 60%),
    radial-gradient(40% 25% at 20% 75%, rgba(34, 211, 238, 0.10) 0%, transparent 60%),
    #070b18;
  animation: splash-bg-pulse 3s ease-in-out infinite alternate;
}

@keyframes splash-bg-pulse {
  from { opacity: 0.85; }
  to   { opacity: 1; }
}

/* スキャンライン (上から下に流れる細い光) */
.splash-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(34, 211, 238, 0.025) 3px,
    rgba(34, 211, 238, 0.025) 4px
  );
  pointer-events: none;
}

/* コンテンツ中央エリア */
.splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 340px;
  padding: 0 24px;
  text-align: center;
}

/* アイコン */
.splash-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin-bottom: 28px;
  box-shadow:
    0 0 0 1px rgba(77, 163, 255, 0.35),
    0 0 24px rgba(77, 163, 255, 0.45),
    0 0 60px rgba(77, 163, 255, 0.2);
  animation: splash-icon-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-icon-in {
  from { opacity: 0; transform: translateY(12px) scale(0.88); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ブランド名 */
.splash-brand {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  background: linear-gradient(95deg, #22d3ee 0%, #4da3ff 45%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(77, 163, 255, 0.7));
  animation: splash-text-in 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(148, 160, 196, 0.8);
  animation: splash-text-in 0.7s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-tagline {
  margin-top: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(148, 160, 196, 0.55);
  animation: splash-text-in 0.7s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* プログレスバー */
.splash-bar-wrap {
  margin-top: 40px;
  width: 180px;
  height: 2px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.15);
  overflow: hidden;
  animation: splash-text-in 0.5s 0.4s both;
}

.splash-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #4da3ff, #8b5cf6);
  box-shadow: 0 0 8px rgba(77, 163, 255, 0.8);
  width: 0%;
  transition: width 0.3s ease;
  animation: splash-bar-auto 3.5s 0.4s ease-out forwards;
}

/* ローディング中は自動で ~80% まで進む */
@keyframes splash-bar-auto {
  0%   { width: 0%; }
  30%  { width: 45%; }
  65%  { width: 70%; }
  100% { width: 82%; }
}

/* JS から .splash-bar-done を付けると即 100% に */
.splash-bar.splash-bar-done {
  animation: none;
  width: 100%;
  transition: width 0.2s ease;
}

/* ── 未ログイン時の選択ボタン ── */
.splash-choice {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  animation: splash-text-in 0.45s ease both;
}

.splash-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 14px;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.splash-choice-btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}

.sc-icon {
  font-size: 1.05rem;
}

/* ログイン: グラデCTA */
.splash-choice-login {
  background: linear-gradient(95deg, #22d3ee 0%, #4da3ff 45%, #8b5cf6 100%);
  color: #04101c;
  box-shadow: 0 0 18px rgba(77, 163, 255, 0.45);
}

/* はじめて: ゴーストボタン */
.splash-choice-guest {
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.32);
  color: #c8d6f8;
}
