/* Shared light and reading surfaces connect every presence to the same landscape. */
.refuge {
  --animal-light: .87; --animal-saturation: .73; --garden-light: 1;
  --reading-ink: #eee6d9; --reading-muted: #c4c6ba;
  --reading-surface: linear-gradient(145deg,#273f43f5,#172c36f5);
  --sky-sunset-top: #56668c; --sky-sunset-middle: #b18eaa;
  --sky-sunset-horizon: #e9b3a0; --sky-sunset-lower-horizon: #f2d1ae;
  --sky-night-top: #0c142d; --sky-night-middle: #263354;
  --sky-night-horizon: #576481; --sky-night-lower-horizon: #8a8095;
}
.refuge[data-sky-phase="dusk"] { --animal-light: .78; --garden-light: .9; }
.refuge[data-sky-phase="blue-hour"] { --animal-light: .67; --garden-light: .8; --garden-saturation: .9; }
.refuge[data-sky-phase="deep-blue"] { --animal-light: .58; --garden-light: .72; --garden-saturation: .82; }
.refuge[data-sky-phase="night"] { --animal-light: .52; --garden-light: .69; --animal-saturation: .55; --garden-saturation: .78; }
html,body,.refuge { width: 100%; height: 100svh; min-height: 0; }
.refuge { min-height: 280px; }
.sky-gradient { animation-duration: 40s; }
.sky-glow::after { content: ''; position: absolute; inset: 15% -5% 37%; opacity: .35; background: radial-gradient(ellipse at 20% 47%,#e6c5be55 0,transparent 35%),radial-gradient(ellipse at 72% 68%,#f2c7b34d 0,transparent 30%); filter: blur(22px); }
.sky-dust { position: absolute; inset: 0 0 37%; opacity: 0; transition: opacity 7s ease; }
.sky-dust i { position: absolute; width: var(--dust-size); height: var(--dust-size); background: #ece9ef; border-radius: 50%; opacity: var(--dust-opacity); }
.sky-nebula { position: absolute; inset: 0 0 29%; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 27% 25%,#a6a9d41c,transparent 33%),radial-gradient(ellipse at 52% 52%,#b7a8d118,transparent 30%),radial-gradient(ellipse at 72% 70%,#c4b4d212,transparent 23%); transition: opacity 8s ease; mix-blend-mode: screen; }
.refuge[data-sky-phase="blue-hour"] .sky-dust { opacity: .35; }
.refuge[data-sky-phase="deep-blue"] .sky-dust,.refuge[data-sky-phase="night"] .sky-dust { opacity: .85; }
.refuge[data-sky-phase="deep-blue"] .sky-nebula,.refuge[data-sky-phase="night"] .sky-nebula { opacity: 1; }
.moon { background: radial-gradient(circle at 32% 28%,#fff6da,#deddd3 70%); box-shadow: 0 0 35px #e3d9cc22,0 0 100px #e3d9cc0d; }
.presence img { filter: saturate(var(--animal-saturation)) brightness(var(--animal-light)) drop-shadow(0 3px 2px #142c354a); transition: filter 6s ease; }
.presences { z-index: 94; }
.presence--axolotl { opacity: .87; width: clamp(76px,8vw,112px); }
.presence--axolotl img { mask-image: linear-gradient(to bottom,#000 15%,#000e 65%,#0006 92%,transparent); }
.presence--axolotl::after { inset: 65% -3% 0; border-bottom-color: #bdcfd24d; border-top: 1px solid #bdcfd226; }
.panda-path { width: clamp(92px,10vw,136px); animation-duration: 95s; }
.presence--panda::before { content: ''; position: absolute; inset: 75% 15% 0 10%; border-radius: 50%; background: #122c3499; filter: blur(4px); }
.presence--panda img { transform-origin: 45% 88%; animation-name: quiet-breath; animation-duration: 5.8s; }
.presence--axolotl { animation-name: quiet-swim; animation-duration: 19s; }
.presence--axolotl.is-greeting img { animation-name: gentle-greeting; }
@keyframes quiet-breath { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.018) rotate(.35deg); } }
@keyframes quiet-swim { 0%,100% { transform: translate(0,0) rotate(-1deg); } 50% { transform: translate(9px,2px) rotate(1deg); } }
@keyframes gentle-greeting { 50% { transform: translateY(-3px) rotate(-2deg); } }
.builder-note__paper,.panda-note span { width: 16px; height: 10px; background: #c4bca5; border: 0; border-radius: 3px 1px; box-shadow: 0 2px 4px #172e3444; opacity: .75; animation: none; }
.builder-note__paper::after { display: none; }
.quiet-hotspot:not(.builder-note)::after { opacity: .25; width: 10px; height: 10px; }
.quiet-hotspot:not(.builder-note)::before { width: 3px; box-shadow: 0 0 8px #eddfb750; }
.narrative-voice { place-items: start center; padding: max(24px,8svh) 16px 0; z-index: 110; }
.narrative-voice__card,.narrative-voice[data-voice="constructor"] .narrative-voice__card {
  position: relative; width: min(440px,calc(100vw - 32px)); max-height: 54svh;
  overflow: auto; overscroll-behavior: contain; padding: 26px 30px;
  background: var(--reading-surface); border: 1px solid #b9c1bc1f; border-radius: 18px;
  color: var(--reading-ink); box-shadow: 0 16px 60px #091d2840; text-shadow: none;
  text-align: left; transform: translateY(8px); visibility: hidden;
  pointer-events: none; scrollbar-width: thin; scrollbar-color: #8e9c9166 transparent;
}
.narrative-voice.is-visible .narrative-voice__card,.narrative-voice.is-visible[data-voice="constructor"] .narrative-voice__card { transform: none; visibility: visible; pointer-events: auto; }
.narrative-voice[data-voice="constructor"] .narrative-voice__card { padding-top: 35px; }
.narrative-voice[data-voice="constructor"] .narrative-voice__card::after { display: none; }
.narrative-voice[data-voice="constructor"] .narrative-voice__text,.narrative-voice__text { font-family: Georgia,serif; font-size: clamp(15px,1.2vw,17px); line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.narrative-voice[data-voice="constructor"] .narrative-voice__speaker { color: var(--reading-muted); font-size: 10px; letter-spacing: .12em; margin-bottom: 14px; }
.narrative-close { position: absolute; top: 2px; right: 4px; border: 0; width: 44px; height: 44px; background: none; color: #d2d6cf; font-size: 21px; cursor: pointer; }
.narrative-close[hidden] { display: none; }
.narrative-close:focus-visible { outline: 1px solid #e6d9b9; outline-offset: -5px; border-radius: 50%; }
.song-control { left: 37%; bottom: 9%; }
.song-toggle { width: 52px; height: 52px; padding: 10px; color: #ddd1ae; border-radius: 50%; background: radial-gradient(circle,#d6d4b91a,transparent 65%); }
.song-toggle svg { filter: drop-shadow(0 0 6px #e5d5b33d); }
.song-panel { --reading-ink: #eee6d9; width: min(480px,calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 34px clamp(22px,5vw,42px) 25px; background: linear-gradient(145deg,#273f43f5,#172c36fa); border: 1px solid #b9c1bc26; border-radius: 20px; box-shadow: 0 28px 90px #091a2866; color: var(--reading-ink); scrollbar-width: thin; scrollbar-color: #8e9c9166 transparent; }
.song-panel::backdrop { background: #0e1d3266; backdrop-filter: blur(5px); }
.song-eyebrow { color: #b4beb8; font-size: 9px; letter-spacing: .18em; }
.song-title { font-size: clamp(27px,4vw,35px); margin: 12px 0 22px; font-style: italic; }
.song-note { font-size: clamp(14px,1.15vw,16px); line-height: 1.85; color: #e1dfd4; }
.song-close { color: #b4beb8 !important; font-size: 11px !important; }
.song-player { border-top-color: #b9c1bc26; gap: 16px; }
.song-play { border: 1px solid #bdc6b947; border-radius: 50px; background: #a8bba71a; font: 13px system-ui,sans-serif !important; padding: 12px 23px; }
.song-time { margin-left: auto; color: #aebcb7; }
.song-volume { accent-color: #adbda9; }
.song-volume-row { color: #b9c4bc; font-size: 11px; }
.song-mute { color: #b9c4bc !important; font: 11px system-ui,sans-serif !important; }
.song-close,.song-play,.song-mute,.narrative-close { touch-action: manipulation; }
@media (max-width:720px) and (orientation:portrait) {
  .presence--axolotl { left: 59%; bottom: 16%; width: 77px; }
  .panda-path { left: 17%; bottom: 24%; width: 93px; }
  .song-control { left: 27%; bottom: max(8%,env(safe-area-inset-bottom)); }
  .narrative-voice { padding-top: max(60px,9svh); }
  .narrative-voice__card,.narrative-voice[data-voice="constructor"] .narrative-voice__card { max-height: 43svh; padding: 28px 24px; }
  .moon { right: 12%; width: 42px; }
}
@media (max-width:360px) { .song-panel { padding: 30px 20px 18px; } .song-note { font-size: 14px; line-height: 1.7; } .song-volume-row { gap: 8px; } .panda-path { width: 82px; } .presence--axolotl { width: 70px; } }
@media (max-height:500px) and (orientation:landscape) {
  .song-panel { max-height: calc(100svh - 16px); padding: 24px 28px 18px; }
  .narrative-voice { padding-top: 16px; }
  .narrative-voice__card,.narrative-voice[data-voice="constructor"] .narrative-voice__card { max-height: 70svh; }
  .presence--axolotl { width: 78px; } .panda-path { width: 88px; }
  .song-control { bottom: 3%; }
}
@media (prefers-reduced-motion:reduce) {
  .sky-dust,.sky-nebula,.presence img { transition: none; }
  .presence--panda img,.presence--axolotl,.presence--axolotl.is-greeting img { animation: none; }
  .song-panel::backdrop { backdrop-filter: none; }
}
