:root {
  --bg-dark: #07120c;
  --bg-gradient: radial-gradient(circle at 50% 30%, #0e271a 0%, #06110a 70%, #020804 100%);
  --forest-green: #153e26;
  --bamboo-green: #2ecc71;
  --moon-light: rgba(167, 243, 208, 0.15);
  --text-gold: #fef08a;
  --text-white: #f8fafc;
  --text-muted: #86efac;
  --card-bg: rgba(15, 34, 23, 0.7);
  --card-border: rgba(74, 222, 128, 0.25);
  --font-global: 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --font-serif: var(--font-global);
  --font-sans: var(--font-global);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-global);
  background: var(--bg-dark);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==========================================
   대나무숲 배경 및 실루엣
   ========================================== */
.forest-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 달빛 아우라 */
.moon-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 243, 208, 0.12) 0%, rgba(52, 211, 153, 0.03) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: moonPulse 10s ease-in-out infinite alternate;
}

@keyframes moonPulse {
  0% { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* 대나무 실루엣 */
.bamboo-silhouettes {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0.25;
}

.bamboo {
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, rgba(20, 50, 32, 0.9), rgba(10, 30, 18, 0.4));
  border-radius: 3px;
}

/* 대나무 마디 디테일 */
.bamboo::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  right: -2px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to top,
    rgba(74, 222, 128, 0.3) 0px,
    rgba(74, 222, 128, 0.3) 3px,
    transparent 3px,
    transparent 120px
  );
}

.stalk-1 { left: 5%; width: 14px; height: 90%; }
.stalk-2 { left: 12%; width: 22px; height: 100%; }
.stalk-3 { left: 25%; width: 18px; height: 85%; }
.stalk-4 { right: 20%; width: 26px; height: 100%; }
.stalk-5 { right: 8%; width: 16px; height: 92%; }
.stalk-6 { right: 3%; width: 20px; height: 80%; }

/* ==========================================
   헤더 레이아웃
   ========================================== */
.header {
  flex: 0 0 auto;
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px 16px 8px 16px;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-logo-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.6));
  user-select: none;
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* ==========================================
   메시지 허공 캔버스 (Whisper Container - 로고 아래 ~ 입력창 위 범위)
   ========================================== */
.whisper-container {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  z-index: 5;
  pointer-events: none;
  overflow: hidden !important;
}

/* ==========================================
   대나무숲 허공 순수 글자 (Pure Text Floating Style)
   ========================================== */
.whisper-item {
  position: absolute;
  display: inline-block;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 380px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-white);
  font-family: var(--font-global);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 2px 10px rgba(0, 0, 0, 0.9);

  /* 순수 글자 샤우팅 모션 */
  animation: shoutEcho var(--duration, 4s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 다채로운 무작위 글자 네온 컬러 팔레트 8종 */
.whisper-item.color-gold {
  color: #fef08a;
  text-shadow: 0 0 16px rgba(254, 240, 138, 0.7), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-cyan {
  color: #7dd3fc;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.7), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-emerald {
  color: #6ee7b7;
  text-shadow: 0 0 16px rgba(52, 211, 153, 0.7), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-purple {
  color: #e9d5ff;
  text-shadow: 0 0 16px rgba(192, 132, 252, 0.75), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-pink {
  color: #fbcfe8;
  text-shadow: 0 0 16px rgba(244, 114, 182, 0.75), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-orange {
  color: #ffedd5;
  text-shadow: 0 0 16px rgba(251, 146, 60, 0.75), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-lime {
  color: #ecfccb;
  text-shadow: 0 0 16px rgba(163, 230, 53, 0.7), 0 2px 12px rgba(0, 0, 0, 0.9);
}

.whisper-item.color-white {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.8), 0 2px 12px rgba(0, 0, 0, 0.9);
}

/* 샤우팅 애니메이션: 부드럽게 나타나 이동하며 후반부에 서서히 페이드아웃 */
@keyframes shoutEcho {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.85) rotate(var(--rot-start, -4deg));
    filter: blur(4px);
  }
  15% {
    opacity: var(--max-op, 1);
    transform: translate(calc(var(--dx) * 0.15), calc(var(--dy) * 0.15)) scale(1.04) rotate(var(--rot-start, -4deg));
    filter: blur(0px);
  }
  60% {
    opacity: var(--max-op, 1);
    transform: translate(calc(var(--dx) * 0.6), calc(var(--dy) * 0.6)) scale(1.02) rotate(calc(var(--rot-start, -4deg) + 2deg));
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.08) rotate(var(--rot-end, 4deg));
    filter: blur(8px);
  }
}

/* 사운드 파동 링 퍼짐 애니메이션 */
@keyframes waveRing {
  0% {
    opacity: 0.9;
    transform: scale(0.9);
  }
  30% {
    opacity: 0;
    transform: scale(1.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* ==========================================
   하단 고정 입력창
   ========================================== */
.input-bar {
  flex: 0 0 auto;
  position: relative;
  width: 100%;
  z-index: 20;
  padding: 16px 20px 24px 20px;
  background: linear-gradient(to top, rgba(3, 10, 6, 0.95) 0%, rgba(3, 10, 6, 0.7) 70%, transparent 100%);
  display: flex;
  justify-content: center;
}

.input-form {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
}

.input-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  padding: 4px 18px;
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(74, 222, 128, 0.6);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7), 0 0 15px rgba(74, 222, 128, 0.2);
}

.whisper-input {
  width: 100%;
  height: 42px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 42px;
  padding-right: 0;
  overflow: hidden;
  white-space: nowrap;
  caret-color: #4ade80;
  caret-shape: block;
}

.send-btn {
  background: linear-gradient(135deg, #15803d, #047857);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.4);
}

.send-btn:hover {
  background: linear-gradient(135deg, #16a34a, #059669);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.5);
}

.send-btn:active {
  transform: translateY(1px);
}

.send-btn.disabled,
.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================
   반응형 모바일 스타일
   ========================================== */
@media (max-width: 600px) {
  .header {
    padding: 12px 12px 4px 12px;
  }
  .main-logo-img {
    max-width: 260px;
  }
  .whisper-item {
    max-width: 240px;
    padding: 8px 12px;
    font-size: 0.9rem !important;
  }
  .input-bar {
    padding: 10px 12px 16px 12px;
  }
  .input-form {
    padding: 6px 10px;
    border-radius: 24px;
  }
  .send-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}
