/* ============================================
   splash.css — 스플래시 스크린 + 나무 + 파티클
   ============================================ */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-splash-from), var(--color-splash-to));
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}

.splash--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash__content {
  text-align: center;
  z-index: 3;
}

.splash__logo {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.splash__title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.5px;
}

.splash__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: var(--spacing-xl);
}

.splash__loader {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-primary-light);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.splash__loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40px;
  width: 40px;
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  0% { left: -40px; }
  100% { left: 40px; }
}

/* ── 나무 (양쪽) ── */
.splash__tree {
  position: absolute;
  bottom: 0;
  z-index: 2;
  width: 120px;
}

.splash__tree--left { left: -10px; }
.splash__tree--right { right: -10px; }

/* 나무 줄기 */
.splash__tree::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 45vh;
  border-radius: 6px;
}

/* 나무 수관 (잎 덩어리) */
.splash__tree::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  animation: treeSway 4s ease-in-out infinite;
}

.splash__tree--right::after {
  animation-delay: -1.5s;
}

@keyframes treeSway {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(1.5deg); }
  75% { transform: translateX(-50%) rotate(-1.5deg); }
}

/* ── 봄 나무 — 벚꽃나무 ── */
[data-season="spring"] .splash__tree::before {
  background: linear-gradient(to top, #5d4037, #795548);
}

[data-season="spring"] .splash__tree::after {
  width: 140px;
  height: 140px;
  bottom: 38vh;
  background: radial-gradient(ellipse, #f8bbd0 0%, #f48fb1 40%, #ec407a 80%, transparent 100%);
  box-shadow:
    -30px 25px 0 -10px rgba(248,187,208,0.7),
    30px 30px 0 -5px rgba(244,143,177,0.6),
    0px -20px 0 -5px rgba(248,187,208,0.5);
}

/* ── 여름 나무 — 녹음 ── */
[data-season="summer"] .splash__tree::before {
  background: linear-gradient(to top, #4e342e, #6d4c41);
}

[data-season="summer"] .splash__tree::after {
  width: 150px;
  height: 160px;
  bottom: 36vh;
  background: radial-gradient(ellipse, #81c784 0%, #43a047 40%, #2e7d32 80%, transparent 100%);
  box-shadow:
    -25px 30px 0 -8px rgba(129,199,132,0.7),
    32px 25px 0 -5px rgba(67,160,71,0.6),
    0px -25px 0 -5px rgba(129,199,132,0.5);
}

/* ── 가을 나무 — 단풍 ── */
[data-season="autumn"] .splash__tree::before {
  background: linear-gradient(to top, #3e2723, #5d4037);
}

[data-season="autumn"] .splash__tree::after {
  width: 130px;
  height: 130px;
  bottom: 38vh;
  background: radial-gradient(ellipse, #ffcc80 0%, #ff8a65 40%, #e65100 80%, transparent 100%);
  box-shadow:
    -28px 28px 0 -10px rgba(255,204,128,0.7),
    30px 22px 0 -5px rgba(255,138,101,0.6),
    0px -18px 0 -5px rgba(255,204,128,0.5);
}

/* ── 겨울 나무 — 앙상한 가지 + 눈 ── */
[data-season="winter"] .splash__tree::before {
  background: linear-gradient(to top, #455a64, #607d8b);
}

[data-season="winter"] .splash__tree::after {
  width: 100px;
  height: 100px;
  bottom: 40vh;
  background: radial-gradient(ellipse, rgba(255,255,255,0.8) 0%, rgba(206,147,216,0.3) 60%, transparent 100%);
  box-shadow:
    -20px 20px 0 -10px rgba(255,255,255,0.4),
    22px 18px 0 -8px rgba(206,147,216,0.3);
}

/* 파티클 컨테이너 */
.splash__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 2;
}

.particle {
  position: absolute;
  opacity: 0.7;
  pointer-events: none;
}

/* 봄 — 벚꽃잎 흩날림 */
[data-season="spring"] .particle {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #f8bbd0 30%, #f48fb1 100%);
  border-radius: 50% 0 50% 50%;
  animation: petalScatter linear infinite;
}

/* 여름 — 나뭇잎 떨어지며 흔들림 */
[data-season="summer"] .particle {
  width: 14px;
  height: 10px;
  background: radial-gradient(ellipse, #a5d6a7, #388e3c);
  border-radius: 40% 60% 50% 50%;
  box-shadow: 0 0 6px rgba(255,235,59,0.2);
  animation: leafFall linear infinite;
}

/* 가을 — 낙엽 */
[data-season="autumn"] .particle {
  width: 14px;
  height: 10px;
  background: var(--color-particle);
  border-radius: 50% 0;
  animation: leafFall linear infinite;
}

/* 겨울 — 눈 */
[data-season="winter"] .particle {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(179,157,219,0.4);
  animation: snowFall linear infinite;
}

/* 벚꽃잎 — 나무에서 옆으로 흩날림 */
@keyframes petalScatter {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0;
  }
  5% { opacity: 0.8; }
  50% {
    transform: translate(var(--drift-x, 60px), 40vh) rotate(180deg) scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: translate(var(--drift-x, 80px), 90vh) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

/* 나뭇잎 — 나무에서 흔들리며 떨어짐 */
@keyframes leafFall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  5% { opacity: 0.7; }
  25% {
    transform: translate(calc(var(--drift-x, 30px) * 0.4), 22vh) rotate(90deg);
  }
  50% {
    transform: translate(var(--drift-x, 30px), 45vh) rotate(200deg);
    opacity: 0.5;
  }
  75% {
    transform: translate(calc(var(--drift-x, 30px) * 0.7), 68vh) rotate(290deg);
  }
  100% {
    transform: translate(var(--drift-x, 40px), 95vh) rotate(380deg);
    opacity: 0;
  }
}

/* 눈 — 천천히 흔들리며 떨어짐 */
@keyframes snowFall {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  5% { opacity: 0.9; }
  50% {
    transform: translate(var(--drift-x, 20px), 50vh);
    opacity: 0.7;
  }
  100% {
    transform: translate(calc(var(--drift-x, 20px) * -0.5), 100vh);
    opacity: 0;
  }
}
