/* ===== Дом спокойствия — главный экран (2.5D) ===== */
:root {
  --house-w: min(96vw, 800px);   /* ширина дома-картинки (главная ручка размера) */
  --house-scale: 1;   /* картинка детальная — без увеличения */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: #4a4458;
}

.scene {
  position: fixed; inset: 0;
  overflow: hidden;
  --px: 0; --py: 0;
  perspective: 1200px;
}

/* ---- Небо: фазы дня ---- */
.sky { position: absolute; inset: -6% -6% -6% -6%; transition: background 3s ease, opacity 1.2s ease; z-index: 0;
  transform: translate(calc(var(--px) * -8px), calc(var(--py) * -6px)); }

/* ===== Фото-фон окружения (картинка по центру + её размытая копия по краям) ===== */
.envbg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  transform: translate(calc(var(--px) * -6px), calc(var(--py) * -5px)); }
.env-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; will-change: opacity; }
.env-layer.show { opacity: 1; }
/* размытая увеличенная копия — мягкий фон по краям, без резких полей */
.env-blur { position: absolute; inset: -10%; background-size: cover; background-position: center;
  filter: blur(38px) saturate(1.12) brightness(.9); transform: scale(1.18); }
/* сама картинка целиком, по центру, ничего не обрезается */
.env-main { position: absolute; inset: 0; background-size: contain; background-position: center;
  background-repeat: no-repeat; }

/* когда есть фото-фон окружения — прячем нарисованные небо-слои (солнце/холмы/дымку/звёзды) */
.scene.photobg .celestial,
.scene.photobg .hills,
.scene.photobg .haze,
.scene.photobg .stars,
.scene.photobg .constellations { display: none; }
/* 🌅 рассвет — персиковое тёплое небо */
.scene[data-phase="dawn"]  .sky { background: linear-gradient(180deg, #ffc4a4 0%, #ffd6bd 36%, #ffe6d4 68%, #fff1e2 100%); }
/* 🌸 день — голубое небо с лёгкой дымкой у горизонта */
.scene[data-phase="day"]   .sky { background: linear-gradient(180deg, #6fb6ec 0%, #a6daf4 42%, #d6effb 72%, #eaf7ec 100%); }
/* 🌇 закат — розово-лавандовое */
.scene[data-phase="dusk"]  .sky { background: linear-gradient(180deg, #f6a6b6 0%, #e6a6c4 40%, #c7a4dd 72%, #b6a4dd 100%); }
/* 🌙 ночь — глубокое синее небо */
.scene[data-phase="night"] .sky { background: linear-gradient(180deg, #1e2350 0%, #2d3468 42%, #48487a 76%, #6a6a92 100%); }

/* палитра рисованной сцены по фазам (переменные для SVG) */
.scene-svg { position: absolute; inset: -4%; z-index: 0; overflow: hidden;
  transform: translate(calc(var(--px) * -8px), calc(var(--py) * -6px)); }
.scene-svg svg { width: 100%; height: 100%; display: block; }
.celestial { display: none !important; }

/* плавный переход между фазами (~2.6с перетекание всех цветов) */
.scene-svg rect, .scene-svg path, .scene-svg circle, .scene-svg ellipse, .scene-svg stop {
  transition: fill 2.6s ease, stop-color 2.6s ease; }
.scene-svg .dim, .scene-svg .stars-g { transition: opacity 2.6s ease; }

/* живые движения сцены */
.scene-svg .svg-sunglow { transform-box: fill-box; transform-origin: center; animation: sunBreath 8s ease-in-out infinite; }
@keyframes sunBreath { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
.scene-svg .svg-shine ellipse { animation: shineFade 5s ease-in-out infinite; }
.scene-svg .svg-shine ellipse:nth-child(2) { animation-delay: 1.4s; }
.scene-svg .svg-shine ellipse:nth-child(3) { animation-delay: 2.6s; }
@keyframes shineFade { 0%,100% { opacity: .1; } 50% { opacity: .4; } }
.scene-svg .stars-g circle { animation: svgTw 3.6s ease-in-out infinite; }
.scene-svg .stars-g circle:nth-child(odd) { animation-delay: 1.2s; }
.scene-svg .stars-g circle:nth-child(3n) { animation-delay: 2.3s; }
@keyframes svgTw { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.scene-svg .svg-sakura { transform-box: fill-box; transform-origin: left top; animation: sakuraSway 9s ease-in-out infinite; }
@keyframes sakuraSway { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(1.4deg); } }
@media (prefers-reduced-motion: reduce) { .scene-svg * { animation: none !important; } }
.scene[data-phase="day"]   { --sky-1:#5db0ec;--sky-2:#9fd6f3;--sky-3:#e6f6ef;--sun:#fff7d6;--mtn1:#bcd6d2;--mtn2:#8fc29a;--mtn3:#5fa873;--water1:#bfeef2;--water2:#5cc0d6;--grass1:#9fcf8f;--grass2:#79b672;--star-op:0;--scene-dim:0; }
.scene[data-phase="dawn"]  { --sky-1:#ffb89a;--sky-2:#ffd3bd;--sky-3:#fff0e2;--sun:#fff0d0;--mtn1:#d7c2cb;--mtn2:#b9c8a2;--mtn3:#9cba88;--water1:#ffe6d6;--water2:#f0c4bc;--grass1:#c2d6a0;--grass2:#a8c890;--star-op:.25;--scene-dim:.05; }
.scene[data-phase="dusk"]  { --sky-1:#f2909f;--sky-2:#e0a0c2;--sky-3:#cdaad8;--sun:#ffd9b0;--mtn1:#a892b8;--mtn2:#8f7ca6;--mtn3:#6e5f8e;--water1:#e8c2d6;--water2:#bf96bd;--grass1:#9f8db8;--grass2:#85729c;--star-op:.5;--scene-dim:.18; }
.scene[data-phase="night"] { --sky-1:#171a44;--sky-2:#262c5c;--sky-3:#3e3f6e;--sun:#eef0ff;--mtn1:#2e335a;--mtn2:#262a4c;--mtn3:#1e2240;--water1:#33406e;--water2:#1f2750;--grass1:#37406a;--grass2:#2a3054;--star-op:1;--scene-dim:.42; }

/* ---- Звёзды (видны ночью/в сумерках) ---- */
.stars { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 3s ease;
  transform: translate(calc(var(--px) * -4px), calc(var(--py) * -3px)); pointer-events: none; }
.scene[data-phase="night"] .stars { opacity: 1; }
.scene[data-phase="dusk"]  .stars { opacity: .5; }
.scene[data-phase="dawn"]  .stars { opacity: .2; }
.stars span { position: absolute; background: #fff; border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,255,255,.8); animation: twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---- Солнце / Луна ---- */
.celestial { position: absolute; z-index: 1; width: 90px; height: 90px; border-radius: 50%;
  top: 11%; right: 16%; transition: all 3s ease;
  transform: translate(calc(var(--px) * -14px), calc(var(--py) * -10px)); }
.scene[data-phase="dawn"]  .celestial { background: radial-gradient(circle at 40% 40%, #fff4da, #ffcaa0); box-shadow: 0 0 60px 16px rgba(255,200,150,.5); top: 30%; }
.scene[data-phase="day"]   .celestial { background: radial-gradient(circle at 40% 40%, #fff8da, #ffe08a); box-shadow: 0 0 74px 20px rgba(255,222,120,.55); top: 11%; }
.scene[data-phase="dusk"]  .celestial { background: radial-gradient(circle at 42% 42%, #ffe6bf, #ff9466); box-shadow: 0 0 64px 18px rgba(255,140,90,.5); top: 35%; }
.scene[data-phase="night"] .celestial { background: radial-gradient(circle at 38% 38%, #fffdff, #ddd2ec); box-shadow: 0 0 48px 10px rgba(232,222,255,.5); top: 13%; }

/* ---- Пейзаж: горы, вода, луг (параллакс) ---- */
.mountains { position: absolute; left: -6%; right: -6%; z-index: 2; transition: background 2s ease;
  transform: translate(calc(var(--px) * -16px), calc(var(--py) * 2px)); }
.mountains.far  { top: 47%; height: 17%; opacity: .85; background: var(--mtn-far, #a6cdb6);
  clip-path: polygon(0 100%,0 60%,9% 34%,17% 54%,27% 24%,37% 50%,49% 18%,61% 50%,71% 28%,83% 52%,93% 32%,100% 58%,100% 100%); }
.mountains.near { top: 53%; height: 17%; background: var(--mtn-near, #74b482);
  clip-path: polygon(0 100%,0 64%,12% 40%,22% 60%,33% 34%,45% 56%,57% 30%,68% 58%,79% 36%,90% 60%,100% 44%,100% 100%);
  transform: translate(calc(var(--px) * -24px), calc(var(--py) * 3px)); }

.water { position: absolute; left: 0; right: 0; top: 62%; height: 16%; z-index: 2; overflow: hidden;
  background: linear-gradient(180deg, var(--water-top, #c4eef2), var(--water-bot, #67c6da)); transition: background 2s ease;
  transform: translate(0, calc(var(--py) * 2px)); }
.water::after { content: ''; position: absolute; left: 42%; top: 0; width: 16%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0)); filter: blur(4px);
  animation: shimmer 5s ease-in-out infinite; }
@keyframes shimmer { 0%,100% { opacity: .5; transform: scaleX(.8); } 50% { opacity: .85; transform: scaleX(1.15); } }

.meadow { position: absolute; left: -6%; right: -6%; bottom: -2%; height: 36%; z-index: 3;
  border-radius: 50% 50% 0 0 / 16% 16% 0 0; transition: background 2s ease;
  background: linear-gradient(180deg, var(--meadow-top, #bfe3b6), var(--meadow-bot, #92cc90));
  transform: translate(calc(var(--px) * -8px), calc(var(--py) * 4px)); }
.meadow::before { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: .7;
  background:
    radial-gradient(circle, #f4a8c4 0 2px, transparent 3px) 0 0/64px 64px,
    radial-gradient(circle, #c9a8e0 0 1.6px, transparent 3px) 24px 30px/72px 72px,
    radial-gradient(circle, #f7d97a 0 1.6px, transparent 3px) 40px 14px/58px 58px; }
.scene[data-phase="night"] .meadow::before { opacity: .25; }

/* ---- Обёртка дома (зум/интро) ---- */
.house-wrap { position: absolute; z-index: 5; left: 50%; bottom: 9%; transform: translateX(-50%);
  width: var(--house-w); transition: transform 1.1s cubic-bezier(.6,0,.32,1), opacity .8s ease;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 26px 40px rgba(60,40,80,.28)); }
.house-inner { transform: translate(calc(var(--px) * 6px), calc(var(--py) * 4px)); }

/* ---- Дом ---- */
.house { position: relative; transform: scale(var(--house-scale)); transform-origin: bottom center; }

/* ===== Дом-картинка с кликабельными дверями ===== */
.house-pic { position: relative; width: 100%; }
.house-pic .house-img { width: 100%; height: auto; display: block; pointer-events: none;
  user-select: none; -webkit-user-drag: none; transition: filter 2.6s ease; }
/* освещение дома под время суток — чтобы вписывался в сцену */
.scene[data-phase="day"]   .house-pic .house-img { filter: saturate(1.03); }
.scene[data-phase="dawn"]  .house-pic .house-img { filter: brightness(.82) saturate(1.04) hue-rotate(-4deg); }
.scene[data-phase="dusk"]  .house-pic .house-img { filter: brightness(.95) saturate(1.12) sepia(.12) hue-rotate(-10deg); }
.scene[data-phase="night"] .house-pic .house-img { filter: brightness(.6) saturate(.82) contrast(1.05) hue-rotate(14deg); }
/* контактная тень под домом — «приземляет» его */
.house-pic::after { content: ''; position: absolute; left: 16%; right: 16%; bottom: 3%; height: 4%;
  background: radial-gradient(ellipse at center, rgba(25,15,35,.45), transparent 72%); filter: blur(7px); z-index: -1; }

/* трава с цветами на переднем плане — дом утопает в саду */
.meadow-front { position: absolute; left: -4%; right: -4%; bottom: -2%; height: 16%; z-index: 6; pointer-events: none;
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * 5px)); transition: filter 2.6s ease; }
.meadow-front svg { width: 100%; height: 100%; display: block; }
/* плавный морфинг зелени переднего плана и земли — в такт с небом */
.ground svg path, .meadow-front svg path { transition: fill 2.6s ease; }
.scene[data-phase="dusk"]  .meadow-front { filter: brightness(.88) saturate(1.05); }
.scene[data-phase="night"] .meadow-front { filter: brightness(.5) saturate(.7); }

/* цветы — отдельный слой, каждый мини-SVG держит пропорции (не растягивается) */
.meadow-flowers { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; z-index: 7; pointer-events: none;
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * 5px)); transition: filter 2.6s ease; }
.meadow-flowers .mf { position: absolute; bottom: 7%; height: auto; transform: translateX(-50%); transform-origin: bottom center; }
.scene[data-phase="dusk"]  .meadow-flowers { filter: brightness(.88) saturate(1.05); }
.scene[data-phase="night"] .meadow-flowers { filter: brightness(.5) saturate(.7); }

/* земля-лужайка под домом — он стоит на ней, а не парит */
.ground { position: absolute; left: -2%; right: -2%; bottom: -2%; height: 34%; z-index: 3; pointer-events: none;
  transform: translate(calc(var(--px) * -6px), calc(var(--py) * 3px)); transition: filter 2.6s ease; }
.ground svg { width: 100%; height: 100%; display: block; }
.scene[data-phase="dusk"]  .ground { filter: brightness(.9) saturate(1.04); }
.scene[data-phase="night"] .ground { filter: brightness(.55) saturate(.72); }

/* ===== Дневное сияние вокруг дома — солнечный «карман» в любое время суток ===== */
.day-bloom { --bloom: .55; position: absolute; left: 50%; bottom: 5%; width: 128%; height: 74%; transform: translateX(-50%);
  z-index: 4; pointer-events: none; mix-blend-mode: screen; filter: blur(6px);
  background:
    radial-gradient(ellipse 42% 44% at 50% 58%, rgba(255,252,232,.6), rgba(255,246,214,.26) 42%, transparent 72%),
    radial-gradient(ellipse 60% 56% at 50% 66%, rgba(190,225,255,.28), transparent 70%);
  animation: dayBloom 9s ease-in-out infinite; }
@keyframes dayBloom { 0%,100% { opacity: calc(.85 * var(--bloom, .55)); } 50% { opacity: var(--bloom, .55); } }
/* утром и днём почти не светим внутри дома; вечером — тёплый кокон */
.scene[data-phase="dawn"] .day-bloom { --bloom: .14; }
.scene[data-phase="day"]  .day-bloom { --bloom: .12; }
.scene[data-phase="dusk"] .day-bloom { --bloom: .6; }
.scene[data-phase="night"] .day-bloom { --bloom: .42; filter: blur(7px) saturate(1.05); }
.house-pic .door { position: absolute; cursor: pointer; border-radius: 16px; background: transparent;
  box-shadow: none; border: none; padding: 0; min-height: 0; overflow: visible;
  display: flex; align-items: flex-end; justify-content: center;
  transition: background .2s ease, box-shadow .2s ease; }
.house-pic .door:hover { background: transparent; box-shadow: none; }
.house-pic .door .rname { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.88); color: #5a5570; font-weight: 800; font-size: .72rem; white-space: nowrap;
  padding: 3px 11px; border-radius: 999px; opacity: 0; transition: opacity .2s ease; pointer-events: none;
  box-shadow: 0 4px 12px rgba(60,40,80,.22); z-index: 8; }
.house-pic .door:hover .rname { opacity: 1; }
.roof { position: relative; height: 92px; margin: 0 -10px;
  background: linear-gradient(160deg, #d98c6a, #c2705a);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 8px; }
.roof .chimney { position: absolute; top: -6px; right: 24%; width: 26px; height: 44px;
  background: #b5634f; border-radius: 5px 5px 0 0; }
.smoke { position: absolute; left: 50%; top: -6px; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.0); }
.smoke span { position: absolute; left: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(245,245,250,.66); animation: smoke 5s linear infinite; opacity: 0; }
.smoke span:nth-child(2) { animation-delay: 1.6s; }
.smoke span:nth-child(3) { animation-delay: 3.2s; }
@keyframes smoke { 0% { transform: translate(0,0) scale(.5); opacity: 0; }
  20% { opacity: .6; } 100% { transform: translate(-12px,-70px) scale(2.2); opacity: 0; } }

/* Обсерватория — купол на крыше */
.dome { position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 56px; border-radius: 60px 60px 0 0;
  background: linear-gradient(160deg, #8ea2d8, #6f86c4);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(60,50,110,.3); transition: transform .25s, filter .25s, opacity 1s ease; z-index: 6; }
.dome:hover { transform: translateX(-50%) translateY(-4px); filter: brightness(1.08); }
.dome .ricon { font-size: 1.5rem; color: #eaf0ff; }
.dome .rname { position: absolute; bottom: -20px; font-size: .72rem; font-weight: 800; color: #5a5570; white-space: nowrap; }

/* ---- Стены / комнаты ---- */
.walls { background: linear-gradient(180deg, #f3e6d6, #ecdcc8);
  border-radius: 4px 4px 16px 16px; padding: 8px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.4); }
.floor { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.room { position: relative; overflow: hidden; cursor: pointer;
  border-radius: 12px; min-height: 96px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease, opacity 1s ease;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.room:hover { transform: translateY(-3px) scale(1.015); box-shadow: 0 10px 22px rgba(80,60,110,.18), inset 0 0 0 2px rgba(255,255,255,.6); z-index: 7; }
.room .ricon { font-size: 2rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,.12)); color: #cf7a96; }
.room .ricon .rico { display: block; }
.room.gratitude .ricon { color: #d98a4a; }
.room.garden .ricon { color: #5fa86a; }
.room.feelings .ricon { color: #7f9fd8; }
.room.silence .ricon { color: #4f9aa0; }
.room.resources .ricon { color: #b07fd0; }
.room .rname { font-weight: 800; font-size: .9rem; color: #5a5570; }
.room .glow { position: absolute; inset: 0; opacity: 0; transition: opacity 2.5s ease;
  background: radial-gradient(circle at 50% 38%, rgba(255,240,200,.85), transparent 65%); pointer-events: none; }
/* ночью окна светятся */
.scene[data-phase="night"] .room .glow,
.scene[data-phase="dusk"] .room .glow { opacity: .85; }

.room.mail      { background: #f3dcef url('../assets/mail-room.png') 50% 40% / cover no-repeat; }
.room.mail .ricon { display: none; }
.room.mail .rname {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  max-width: 48%; text-align: center; line-height: 1.2; font-size: .84rem;
  background: rgba(255,255,255,.85); color: #7a5570; padding: 5px 12px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(120,80,110,.2);
}
.room.feelings  { background: linear-gradient(160deg, #e3edfa, #d3e2f4); }
.room.gratitude { background: linear-gradient(160deg, #fdeccb, #f8dca6); }
.room.silence   { background: linear-gradient(160deg, #d9f0ef, #c2e6e4); }
.room.resources { background: linear-gradient(160deg, #efe0fb, #e1d0f3); }
.garden { background: linear-gradient(180deg, #d8f0d2 0%, #bfe6b6 100%); padding-bottom: 24px; }
.garden .plants { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: space-around; font-size: 1.1rem; }
.garden .plants span { animation: sway 4s ease-in-out infinite; transform-origin: bottom center; }
.garden .plants span:nth-child(even) { animation-delay: 1.2s; }
@keyframes sway { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

/* ---- Экстерьер (закрытый фасад для интро) ---- */
.exterior { position: absolute; inset: 0; z-index: 9; opacity: 0; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; }
.exterior .facade { width: 100%; }
.exterior .e-roof { height: 92px; margin: 0 -10px; background: linear-gradient(160deg, #d98c6a, #c2705a); clip-path: polygon(50% 0,100% 100%,0 100%); }
.exterior .e-wall { background: linear-gradient(180deg, #f3e6d6, #e6d4bf); border-radius: 4px 4px 16px 16px; height: 360px; position: relative; }
.exterior .e-door { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 64px; height: 110px; background: #b5775a; border-radius: 30px 30px 0 0; }
.exterior .e-win { position: absolute; width: 56px; height: 56px; border-radius: 10px; background: #ffe6a8; box-shadow: 0 0 18px rgba(255,220,140,.6); top: 60px; }
.exterior .e-win.l { left: 16%; } .exterior .e-win.r { right: 16%; }

/* ---- Интро: пролёт сквозь стену ---- */
.intro .house-wrap { animation: flyIn 2.4s cubic-bezier(.4,0,.2,1) both; }
.intro .exterior { animation: wallThrough 2.4s ease both; }
@keyframes flyIn { 0% { transform: translateX(-50%) scale(.66) translateY(14px); }
  55% { transform: translateX(-50%) scale(1.05) translateY(0); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes wallThrough { 0% { opacity: 1; transform: scale(1); } 48% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.6); } }

/* ---- Зум в комнату ---- */
.zooming .house-wrap { transform: translateX(-50%) scale(2.7); }
.zooming .room:not(.target), .zooming .dome:not(.target) { opacity: 0; transition: opacity .4s ease; }
.zooming .sky, .zooming .stars, .zooming .celestial, .zooming .hills, .zooming .title { opacity: 0; transition: opacity .7s ease; }
.veil { position: fixed; inset: 0; background: #fff; opacity: 0; z-index: 40; pointer-events: none; transition: opacity .8s ease; }
.zooming .veil { opacity: 1; }

/* ---- Обратный зум: выход из комнаты в дом ---- */
.returning .house-wrap { transform: translateX(-50%) scale(2.25); }
.returning .room:not(.target), .returning .dome:not(.target) { opacity: 0; }
.returning .sky, .returning .stars, .returning .celestial, .returning .hills, .returning .title { opacity: 0; }

/* ---- Заголовок ---- */
.title { position: absolute; z-index: 8; top: 5%; left: 0; right: 0; text-align: center;
  font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: clamp(1.4rem, 4vw, 2.1rem);
  color: #5a5570; text-shadow: 0 2px 10px rgba(255,255,255,.5); transition: color 3s, opacity .6s; pointer-events: none; }
.scene[data-phase="night"] .title { color: #f3eefb; text-shadow: 0 2px 14px rgba(40,30,70,.45); }
.title .sub { display: block; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: .82rem; opacity: .8; margin-top: 4px; }

/* приветствие по фазе */
.greeting { position: absolute; z-index: 8; top: 12.5%; left: 0; right: 0; text-align: center; padding: 0 24px;
  font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: clamp(1rem, 2.6vw, 1.32rem);
  color: #5d5380; line-height: 1.45; transition: color 3s ease, opacity 1s ease; pointer-events: none; }
.greeting .g2 { display: block; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: .9rem; opacity: .85; margin-top: 6px; }
.scene[data-phase="night"] .greeting { color: #f3eefb; text-shadow: 0 2px 12px rgba(40,30,70,.4); }

/* 🌅 дымка на рассвете */
.haze { position: absolute; left: -6%; right: -6%; bottom: 16%; height: 24%; z-index: 3; opacity: 0; pointer-events: none;
  transition: opacity 2.5s ease; filter: blur(9px);
  background: linear-gradient(180deg, transparent, rgba(255,250,245,.6) 55%, rgba(255,245,240,.3)); }
.scene[data-phase="dawn"] .haze { opacity: 1; }

/* 🌙 созвездия ночью */
.constellations { position: absolute; inset: 0 0 auto 0; height: 56%; z-index: 1; opacity: 0; pointer-events: none; transition: opacity 3s ease; }
.scene[data-phase="night"] .constellations { opacity: .65; }

/* 🌇🌙 большая звезда в Обсерватории */
.big-star { position: absolute; top: -38px; left: 50%; width: 30px; height: 30px; z-index: 7; pointer-events: none;
  transform: translateX(-50%) scale(0); opacity: 0; transition: opacity 2s ease, transform 2s cubic-bezier(.3,1.4,.5,1);
  background: radial-gradient(circle at 50% 50%, #fffdf2, #ffe9a8 55%, transparent 72%);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 10px rgba(255,235,150,.9)); }
.scene[data-phase="dusk"] .big-star, .scene[data-phase="night"] .big-star { opacity: 1; transform: translateX(-50%) scale(1); animation: bigStar 3.4s ease-in-out infinite; }
@keyframes bigStar { 0%,100% { filter: drop-shadow(0 0 8px rgba(255,235,150,.7)); } 50% { filter: drop-shadow(0 0 20px rgba(255,242,185,1)); } }

/* 🌸 солнечный блик в комнате благодарности (днём) */
.glint { position: absolute; top: 0; left: -45%; width: 45%; height: 100%; opacity: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); }
.scene[data-phase="day"] .gratitude .glint { opacity: 1; animation: glint 6s ease-in-out infinite; }
@keyframes glint { 0% { transform: translateX(0); } 55%, 100% { transform: translateX(360%); } }

/* переключатель фаз (превью режимов) */
.phase-switch { position: absolute; z-index: 9; left: 14px; bottom: 14px; display: flex; gap: 3px;
  background: rgba(255,255,255,.5); backdrop-filter: blur(8px); padding: 5px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(80,60,110,.2); opacity: .55; transition: opacity .25s ease; }
.phase-switch:hover { opacity: 1; }
.phase-switch button { border: none; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1;
  width: 30px; height: 30px; border-radius: 50%; transition: background .15s, transform .15s; }
.phase-switch button:hover { transform: scale(1.18); }
.phase-switch button.active { background: #fff; box-shadow: 0 2px 8px rgba(80,60,110,.28); }

.hint { position: absolute; z-index: 8; bottom: 3.5%; left: 0; right: 0; text-align: center;
  font-size: .82rem; font-weight: 600; color: #6a6580; opacity: .7; pointer-events: none; transition: color 3s; }
.scene[data-phase="night"] .hint { color: #e6e1f3; }
