/* ===== Обсерватория — небо жизни ===== */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: #eef0ff;
  /* космическое небо: туманности на глубокой тёмной основе */
  background:
    radial-gradient(80% 50% at 50% -4%, rgba(96,88,182,.42) 0%, transparent 56%),    /* млечное свечение вверху */
    radial-gradient(70% 56% at 15% 26%, rgba(104,70,158,.40) 0%, transparent 60%),    /* фиолетовая туманность слева */
    radial-gradient(66% 60% at 87% 40%, rgba(54,100,162,.36) 0%, transparent 60%),    /* сине-бирюзовая справа */
    radial-gradient(72% 50% at 50% 104%, rgba(146,86,150,.28) 0%, transparent 58%),   /* розово-фиолетовый у горизонта */
    radial-gradient(120% 100% at 50% 0%, #1c1e4c 0%, #14163a 46%, #0a0c24 100%)       /* глубокая основа */
    fixed;
  min-height: 100vh;
}
.bgstars { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bgstars span { position: absolute; background: #fff; border-radius: 50%; box-shadow: 0 0 5px #fff; animation: tw 3.8s ease-in-out infinite; }
@keyframes tw { 0%,100% { opacity: .2; } 50% { opacity: .9; } }
a { color: inherit; text-decoration: none; }

.obs-nav { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; max-width: 960px; margin: 0 auto; padding: 20px 20px 0; }
.back-home { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: .92rem; color: #fff; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); transition: background .2s, transform .18s; }
.back-home:hover { background: rgba(255,255,255,.22); transform: translateX(-3px); }
.room-tag { font-family: 'Comfortaa', sans-serif; font-weight: 700; color: #c9ccf0; font-size: .98rem; }

.obs-wrap { position: relative; z-index: 2; max-width: 960px; margin: 0 auto; padding: 14px 16px 120px; }
.obs-head { text-align: center; margin: 14px 0 6px; }
.obs-head h1 { font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 8px; }
.obs-head p { color: #b9bdf0; margin: 0 auto; max-width: 540px; font-size: 1.0rem; }

/* ===== Карта неба ===== */
.sky-stage { margin: 6px 0 4px; }
#skyMap { width: 100%; height: auto; display: block; touch-action: manipulation; }
#skyMap .c-line { fill: none; stroke-width: 1.4; stroke-linejoin: round; transition: stroke .4s ease; }
#skyMap .c-star { fill: #fff7d8; animation: cTwinkle 3.6s ease-in-out infinite; }
#skyMap .goal-star { fill: #fff; animation: cTwinkle 2.4s ease-in-out infinite; }
@keyframes cTwinkle { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
#skyMap .c-sel { animation: selMarch 3.2s linear infinite; }
@keyframes selMarch { to { stroke-dashoffset: -40; } }
#skyMap .c-hit { fill: transparent; cursor: pointer; }
#skyMap .c-lbl { fill: #e8eaff; font-size: 15px; font-weight: 800; font-family: 'Nunito', sans-serif; cursor: pointer; transition: opacity .4s ease; }
#skyMap .c-score { fill: #aab0e8; font-size: 12px; font-weight: 700; font-family: 'Nunito', sans-serif; transition: opacity .4s ease; }
#skyMap .c-sel { stroke: #ffe9a8; stroke-width: 2; stroke-dasharray: 5 5; fill: rgba(255,233,168,.05); }
/* мобильный портретный режим: подписи крупнее (компенсация меньшего масштаба) */
@media (max-width: 700px) {
  #skyMap .c-lbl { font-size: 21px; }
  #skyMap .c-score { font-size: 16px; }
}

.sky-hint { text-align: center; color: #8e93cf; font-size: .85rem; margin: 2px 0 14px; }

/* «Сегодня твоё небо» */
.sky-summary { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 18px 20px; margin-bottom: 22px; }
.sky-summary h3 { font-family: 'Comfortaa', sans-serif; margin: 0 0 10px; font-size: 1.1rem; }
.sky-summary .line { font-size: 1rem; margin: 5px 0; color: #d6d9f4; }
.sky-summary .line b { color: #fff; }

/* секции */
.obs-wrap h2 { font-family: 'Comfortaa', sans-serif; font-size: 1.3rem; display: flex; align-items: center; gap: 9px; margin: 26px 0 6px; }
.obs-wrap h2 .cnt { font-size: .8rem; font-weight: 800; color: #c9ccf0; background: rgba(255,255,255,.12); padding: 3px 11px; border-radius: 999px; }
.section-note { color: #9499d6; font-size: .92rem; margin: 0 0 16px; }

/* выбор звезды */
.star-choose { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.sc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #e6e8ff; font-weight: 700; font-size: .92rem; transition: all .18s; }
.sc-chip:hover { background: rgba(255,255,255,.12); }
.sc-chip.sel { border-color: #ffe9a8; background: rgba(255,233,168,.16); color: #fff; box-shadow: 0 0 14px rgba(255,233,168,.3); }
.telescope-btn { display: block; margin: 4px auto 0; border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 1rem;
  padding: 13px 26px; border-radius: 999px; color: #2a2550; background: linear-gradient(135deg, #ffe9a8, #f5c98a);
  box-shadow: 0 8px 22px rgba(245,201,138,.32); transition: transform .15s, box-shadow .2s, opacity .2s; }
.telescope-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(245,201,138,.42); }
.telescope-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

/* созвездия целей */
.constels { display: grid; gap: 16px; }
.constel { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 16px 18px; }
.constel.born { animation: cBorn .9s ease; }
@keyframes cBorn { 0% { box-shadow: 0 0 0 transparent; } 45% { box-shadow: 0 0 30px rgba(255,235,150,.6); } 100% { box-shadow: none; } }
.constel-head { display: flex; align-items: center; gap: 9px; font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 1.08rem; margin-bottom: 12px; }
.gstar { position: relative; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.gstar:last-child { margin-bottom: 0; }
.gstar .g-spec { font-weight: 800; font-size: 1.02rem; margin-bottom: 6px; overflow-wrap: anywhere; word-break: break-word; }
.gstar .g-spec .ic { color: #ffe9a8; }
.gstar .g-row { font-size: .9rem; color: #c4c8f0; margin: 3px 0; overflow-wrap: anywhere; word-break: break-word; }
.gstar .g-date { display: inline-block; margin-top: 6px; font-size: .8rem; font-weight: 700; color: #2a2550; background: #ffe9a8; padding: 3px 11px; border-radius: 999px; }
.gstar .g-del { position: absolute; top: 10px; right: 10px; border: none; background: transparent; color: #b9bdf0; cursor: pointer; font-size: 1.05rem; opacity: .5; }
.gstar .g-del:hover { opacity: 1; }
.goals-empty { text-align: center; color: #9499d6; font-style: italic; padding: 22px; }

/* окно оценки сферы — по центру, с затемнением */
.rate-bar { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(8,8,24,.55); backdrop-filter: blur(3px); }
.rate-bar.open { display: flex; animation: rbFade .2s ease; }
@keyframes rbFade { from { opacity: 0; } to { opacity: 1; } }
.rb-panel { width: min(94vw, 460px); background: rgba(30,30,60,.96); border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px; padding: 24px; box-shadow: 0 28px 64px rgba(0,0,0,.55); animation: rbRise .25s ease; }
@keyframes rbRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.rate-bar .rb-title { text-align: center; font-weight: 700; margin-bottom: 8px; font-size: 1.05rem; }
.rate-bar .rb-title b { font-family: 'Comfortaa', sans-serif; }
.rate-bar .rb-desc { text-align: center; color: #b9bdf0; font-size: .9rem; line-height: 1.45; margin: 0 auto 16px; max-width: 420px; }
.rb-dots { display: flex; justify-content: space-between; gap: 4px; }
.rb-dots button { flex: 1; aspect-ratio: 1; border: none; cursor: pointer; border-radius: 50%; background: rgba(255,255,255,.1);
  color: #c9ccf0; font-weight: 800; font-size: .82rem; transition: all .15s; }
.rb-dots button:hover { background: rgba(255,255,255,.2); }
.rb-dots button.on { background: linear-gradient(135deg, #fff7d8, #ffd98a); color: #2a2550; box-shadow: 0 0 12px rgba(255,225,150,.6); }
.rb-close { display: block; margin: 12px auto 0; border: none; background: transparent; color: #9499d6; cursor: pointer; font-weight: 700; font-size: .88rem; }

/* модалка телескопа */
.modal-bg { position: fixed; inset: 0; background: rgba(8,8,24,.62); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-bg.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #15173a; border: 1px solid rgba(255,255,255,.12); color: #eef0ff; border-radius: 22px; width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; padding: 26px; box-shadow: 0 30px 70px rgba(0,0,0,.6); animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal h3 { font-family: 'Comfortaa', sans-serif; margin: 0 0 4px; font-size: 1.3rem; }
.modal .sub { color: #a8acdf; margin: 0 0 18px; font-size: .9rem; }
.modal .close-x { float: right; border: none; background: transparent; cursor: pointer; font-size: 1.4rem; color: #a8acdf; }
.modal label { display: block; margin-bottom: 15px; }
.modal label .ml { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 7px; }
.modal label .ml .ic { color: #ffe9a8; }
.modal input { width: 100%; padding: 12px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; font-family: inherit; font-size: 1rem; color: #fff; background: rgba(255,255,255,.06); }
.modal input::placeholder { color: #8186c0; }
.modal input:focus { outline: none; border-color: #ffe9a8; box-shadow: 0 0 0 4px rgba(255,233,168,.16); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn { border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 1rem; padding: 12px 22px; border-radius: 999px; color: #2a2550; background: linear-gradient(135deg, #ffe9a8, #f5c98a); }
.btn.ghost { background: rgba(255,255,255,.1); color: #eef0ff; }
.btn:hover { transform: translateY(-1px); }

/* фоновый метеор */
.shooting-star { position: fixed; z-index: 1; width: 5px; height: 5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 10px 3px rgba(255,245,210,.9); pointer-events: none; opacity: 0; }
.shooting-star::after { content: ''; position: absolute; right: 4px; top: 50%; width: 90px; height: 2px;
  transform: translateY(-50%); background: linear-gradient(90deg, transparent, rgba(255,245,210,.85)); border-radius: 2px; }

/* падающая/зажигающаяся звезда */
.falling-star { position: fixed; z-index: 80; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 16px 5px rgba(255,240,180,.95); pointer-events: none; }
.falling-star::after { content: ''; position: absolute; right: 6px; top: 50%; width: 130px; height: 2px; transform: translateY(-50%); background: linear-gradient(90deg, transparent, rgba(255,240,180,.9)); border-radius: 2px; }

.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(20px); background: #fff; color: #2a2550; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; transition: all .3s ease; z-index: 120; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
