/*
 * Moonlit - Romance Interactive Novel
 * Deep plum-black theme with rose/fuchsia accents
 */

/* ============================================
   Typography - 소설 읽기 최적화
   ============================================ */
.story-text {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: #e8e0e4;
}

/* ============================================
   Scrollbar - 로맨스 테마
   ============================================ */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(244, 114, 182, 0.2);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 114, 182, 0.4);
}

/* ============================================
   Heart Gauge Animation
   ============================================ */
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes heartFill {
  from { width: 0%; }
  to { width: var(--fill-pct); }
}

.heart-gauge-fill {
  transition: width 0.7s ease-out;
  background: linear-gradient(90deg, #f472b6, #e879f9, #f472b6);
  background-size: 200% 100%;
  animation: heartShimmer 3s ease-in-out infinite;
}

@keyframes heartShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============================================
   Stat Change Popup
   ============================================ */
@keyframes statPopupBottom {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(-16px); }
  100% { opacity: 0; transform: translateY(-24px); }
}

/* ============================================
   Phase Transition Effect
   ============================================ */
@keyframes phaseGlow {
  0% { box-shadow: 0 0 5px rgba(244, 114, 182, 0.3); }
  50% { box-shadow: 0 0 20px rgba(244, 114, 182, 0.6), 0 0 40px rgba(232, 121, 249, 0.3); }
  100% { box-shadow: 0 0 5px rgba(244, 114, 182, 0.3); }
}

@keyframes phaseFlash {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes phaseBounce {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(0.95); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ============================================
   Story Card Animations
   ============================================ */
@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

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

/* ============================================
   Scene Info Card
   ============================================ */
@keyframes sceneInfoFadeIn {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Stat Bar Glow
   ============================================ */
@keyframes statGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

@keyframes achievementSlideIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes achievementSlideOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}
@keyframes criticalGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(251,191,36,0.2); }
  50% { box-shadow: 0 0 12px rgba(251,191,36,0.4); }
}

/* ============================================
   Loading Indicator
   ============================================ */
@keyframes gentlePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.loading-dots span {
  animation: gentlePulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   Genre Card Hover Effects
   ============================================ */
.genre-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.genre-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(244, 114, 182, 0.15);
}

/* ============================================
   Mood Gradient Overlays
   ============================================ */
.mood-romantic {
  background: linear-gradient(180deg, transparent 0%, rgba(244, 114, 182, 0.05) 100%);
}
.mood-tense {
  background: linear-gradient(180deg, transparent 0%, rgba(239, 68, 68, 0.05) 100%);
}
.mood-healing {
  background: linear-gradient(180deg, transparent 0%, rgba(251, 191, 36, 0.05) 100%);
}
.mood-mysterious {
  background: linear-gradient(180deg, transparent 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* ============================================
   Safe Area (Mobile Notch)
   ============================================ */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   Input Range - Rose Accent
   ============================================ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #27272a;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f472b6;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(244, 114, 182, 0.4);
}

/* ============================================
   Toggle Switch - Rose
   ============================================ */
.peer:checked ~ .peer-bg {
  background-color: #e11d48;
}

/* ============================================
   Scrollbar Hide (Filter Tabs)
   ============================================ */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
