/* ============================================
   Starry Sky Experience - Main Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sky-dark: #0a0e27;
  --sky-purple: #1a0a2e;
  --star-warm: #fff8e7;
  --star-cool: #a8c8ff;
  --star-gold: #ffd700;
  --ground-near: #0d0d1a;
  --ground-mid: #111122;
  --aurora-green: #4ade80;
  --aurora-purple: #a78bfa;
  --transition-scene: 0.8s ease-in-out;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sky-dark);
  font-family: 'Noto Sans SC', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* --- Canvas --- */
#skyCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- Aurora Layer --- */
.aurora-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-scene);
}

.aurora-layer.visible {
  opacity: 1;
}

.aurora-layer.hidden {
  opacity: 0;
}

.aurora-band {
  position: absolute;
  width: 200%;
  height: 120px;
  left: -50%;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
  animation: auroraFlow 12s ease-in-out infinite alternate;
}

.aurora-band:nth-child(1) {
  top: 10%;
  background: linear-gradient(90deg, transparent, var(--aurora-green), var(--aurora-purple), transparent);
  animation-duration: 10s;
}

.aurora-band:nth-child(2) {
  top: 18%;
  background: linear-gradient(90deg, transparent, var(--aurora-purple), #22d3ee, transparent);
  animation-duration: 14s;
  animation-delay: -3s;
  opacity: 0.3;
}

.aurora-band:nth-child(3) {
  top: 8%;
  background: linear-gradient(90deg, transparent, #22d3ee, var(--aurora-green), transparent);
  animation-duration: 18s;
  animation-delay: -7s;
  opacity: 0.25;
  height: 80px;
}

@keyframes auroraFlow {
  0% { transform: translateX(-10%) scaleY(1); }
  50% { transform: translateX(10%) scaleY(1.3); }
  100% { transform: translateX(-5%) scaleY(0.8); }
}

/* --- Firefly Layer --- */
.firefly-layer {
  position: fixed;
  bottom: 15%;
  left: 0;
  width: 100%;
  height: 30%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-scene);
}

.firefly-layer.visible {
  opacity: 1;
}

.firefly-layer.hidden {
  opacity: 0;
}

.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fef08a;
  box-shadow: 0 0 6px 2px rgba(254, 240, 138, 0.6), 0 0 12px 4px rgba(254, 240, 138, 0.3);
  animation: fireflyFloat 8s ease-in-out infinite;
}

@keyframes fireflyFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(30px, -40px); opacity: 0.6; }
  90% { opacity: 1; }
}

/* --- Moon Glow --- */
.moon-glow {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-scene);
}

.moon-glow.visible {
  opacity: 1;
}

.moon-glow.hidden {
  opacity: 0;
}

.moon-circle {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef9ef 0%, #e8dcc8 60%, transparent 100%);
  box-shadow: 0 0 40px 20px rgba(254, 249, 239, 0.15), 0 0 80px 40px rgba(254, 249, 239, 0.08);
}

/* --- Milky Way --- */
.milky-way {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-scene);
}

.milky-way.visible {
  opacity: 1;
}

.milky-way.hidden {
  opacity: 0;
}

.milky-way-band {
  position: absolute;
  width: 160%;
  height: 100px;
  left: -30%;
  top: 15%;
  transform: rotate(-30deg);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(168, 200, 255, 0.03) 20%,
    rgba(168, 200, 255, 0.08) 40%,
    rgba(255, 248, 231, 0.06) 50%,
    rgba(168, 200, 255, 0.08) 60%,
    rgba(168, 200, 255, 0.03) 80%,
    transparent 100%
  );
  filter: blur(20px);
}

/* --- Ground Layer --- */
.ground-layer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  z-index: 10;
  pointer-events: none;
  transition: opacity var(--transition-scene);
}

.ground-layer svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* 地面顶部边缘环境光 */
.ground-layer::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to bottom, transparent, rgba(30, 40, 80, 0.15));
  z-index: -1;
  pointer-events: none;
}

/* --- Scene Name --- */
.scene-name {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scene-name.visible {
  opacity: 1;
}

.scene-name-zh {
  display: block;
  font-size: 1.5rem;
  font-weight: 300;
  color: rgba(255, 248, 231, 0.85);
  letter-spacing: 0.3em;
  text-shadow: 0 0 20px rgba(255, 248, 231, 0.3);
  margin-bottom: 6px;
}

.scene-name-en {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  color: rgba(168, 200, 255, 0.5);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* --- Scene Navigation --- */
.scene-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  background: linear-gradient(to top, rgba(10, 14, 39, 0.95) 0%, rgba(10, 14, 39, 0.6) 70%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scene-nav-inner {
  display: flex;
  gap: 4px;
  padding: 10px 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.scene-nav-inner::-webkit-scrollbar {
  display: none;
}

.scene-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(168, 200, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 248, 231, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  min-width: 60px;
}

.scene-btn:active {
  transform: scale(0.95);
}

.scene-btn.active {
  background: rgba(168, 200, 255, 0.1);
  border-color: rgba(168, 200, 255, 0.3);
  color: rgba(255, 248, 231, 0.9);
  box-shadow: 0 0 12px rgba(168, 200, 255, 0.1);
}

.scene-btn-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.scene-btn-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
