/* =========================================================
   治愈花园 · 样式表
   ---------------------------------------------------------
   - 莫兰迪配色与玻璃态控制面板
   - 加载动画、故事开场与HUD排版
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Songti SC", "STKaiti", "Microsoft YaHei", serif;
  color: #efe7d8;
  background: #0d1018;
  -webkit-font-smoothing: antialiased;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#canvas-container canvas {
  display: block;
}

/* ================== 加载界面 ================== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, #2a2a48 0%, #0d1018 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  width: min(420px, 80vw);
}

.loading-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd9c2, #ff9ec7 40%, transparent 75%);
  box-shadow: 0 0 60px rgba(255, 180, 200, 0.6);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

#loading-screen h1 {
  font-weight: 300;
  font-size: 34px;
  letter-spacing: 12px;
  margin-bottom: 12px;
  color: #f5e9d8;
  text-shadow: 0 0 24px rgba(255, 200, 180, 0.4);
}

.loading-subtitle {
  font-size: 13px;
  letter-spacing: 4px;
  color: #a8a09a;
  margin-bottom: 36px;
  font-weight: 200;
}

.progress-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff9ec7, #ffd9c2, #ffe9a3);
  box-shadow: 0 0 12px rgba(255, 200, 180, 0.6);
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 11px;
  letter-spacing: 3px;
  color: #d4c8b8;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ================== 故事面板 ================== */
#story-panel {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: radial-gradient(ellipse at center, rgba(20, 22, 38, 0.6) 0%, rgba(13, 16, 24, 0.95) 80%);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#story-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.story-inner {
  text-align: center;
  width: min(560px, 86vw);
  padding: 44px 36px;
  background: rgba(28, 30, 44, 0.55);
  border: 1px solid rgba(255, 230, 200, 0.12);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.story-inner h2 {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 14px;
  margin-bottom: 24px;
  color: #f5e9d8;
  text-shadow: 0 0 20px rgba(255, 200, 180, 0.3);
}

.story-quote {
  font-size: 15px;
  line-height: 2;
  color: #d8cdb8;
  margin-bottom: 32px;
  font-weight: 300;
  font-style: italic;
}

.story-hints {
  text-align: left;
  margin: 0 auto 32px;
  width: max-content;
}

.hint-row {
  font-size: 13px;
  color: #b8ad9a;
  font-weight: 300;
  line-height: 2.4;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hint-row .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot.pink   { background: #ff9ec7; box-shadow: 0 0 8px #ff9ec7; }
.dot.blue   { background: #88d4ff; box-shadow: 0 0 8px #88d4ff; }
.dot.green  { background: #a8d8a8; box-shadow: 0 0 8px #a8d8a8; }
.dot.gold   { background: #ffd97a; box-shadow: 0 0 8px #ffd97a; }
.dot.purple { background: #c8a8e8; box-shadow: 0 0 8px #c8a8e8; }

#story-close {
  background: linear-gradient(135deg, #ff9ec7, #ffd9c2);
  color: #2a2030;
  border: none;
  padding: 12px 36px;
  font-size: 14px;
  letter-spacing: 6px;
  border-radius: 32px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(255, 180, 200, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#story-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 180, 200, 0.6);
}

/* ================== 顶部信息条 ================== */
#topbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 22px;
  background: rgba(28, 30, 44, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 230, 200, 0.1);
  border-radius: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#topbar h3 {
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 6px;
  color: #f5e9d8;
}

.vitality-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #c8bca8;
}

.vitality-bar {
  width: 110px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

#vitality-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #ff9ec7, #ffd9c2, #a8d4ff);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#vitality-percent {
  font-variant-numeric: tabular-nums;
  color: #f5e9d8;
  min-width: 32px;
  text-align: left;
}

#season-indicator {
  font-size: 12px;
  letter-spacing: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 230, 200, 0.1);
  color: #f5e9d8;
  transition: all 0.6s ease;
}

/* ================== 悬停提示 ================== */
#hint-text {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 8px 18px;
  background: rgba(28, 30, 44, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 230, 200, 0.1);
  border-radius: 16px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #f5e9d8;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#hint-text.visible {
  opacity: 1;
}

/* ================== lil-gui 自定义样式 ================== */
.lil-gui {
  --background-color: rgba(28, 30, 44, 0.72) !important;
  --text-color: #efe7d8 !important;
  --title-background-color: rgba(255, 200, 180, 0.12) !important;
  --title-text-color: #f5e9d8 !important;
  --widget-color: rgba(255, 255, 255, 0.08) !important;
  --hover-color: rgba(255, 200, 180, 0.2) !important;
  --focus-color: rgba(255, 200, 180, 0.3) !important;
  --number-color: #ffd97a !important;
  --string-color: #a8d4ff !important;
  --font-family: "PingFang SC", "Microsoft YaHei", sans-serif !important;
  --font-size: 12px !important;
  --input-font-size: 12px !important;
  -- folder-indent: 8px !important;
  --widget-padding: 4px !important;
  --widget-border-radius: 4px !important;
  --slider-knob-width: 3px !important;
  --font-family-mono: "SF Mono", monospace !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 230, 200, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.lil-gui.root {
  top: 90px !important;
  right: 20px !important;
  width: 240px !important;
}

/* ================== 响应式 ================== */
@media (max-width: 720px) {
  #topbar {
    gap: 12px;
    padding: 10px 14px;
    flex-wrap: wrap;
    max-width: 92vw;
  }
  .vitality-bar { width: 70px; }
  #season-indicator { font-size: 10px; padding: 3px 8px; }
  .story-inner { padding: 28px 20px; }
  .story-inner h2 { font-size: 22px; letter-spacing: 8px; }
}
