:root {
  --bg-top: #1e1c26;
  --bg-mid: #282532;
  --bg-bot: #332e3f;
  --card-bg: rgba(255, 246, 238, 0.06);
  --card-border: rgba(244, 185, 150, 0.14);
  --card-active: rgba(244, 185, 150, 0.16);
  --text-main: #f5efe8;
  --text-muted: #bfb6c9;
  --accent: #c4bce0;
  --peach: #f4b996;
  --star-gold: #f5d38e;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bot) 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
  overflow: hidden;
  user-select: none;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.ambient-nebula {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 42% at 24% 18%, rgba(156, 151, 184, 0.16), transparent 70%),
    radial-gradient(ellipse 72% 36% at 80% 28%, rgba(244, 185, 150, 0.12), transparent 70%),
    radial-gradient(ellipse 90% 45% at 50% 62%, rgba(232, 182, 107, 0.07), transparent 72%);
}

.hidden {
  display: none !important;
}

/* --- Верх: ночное небо со звёздами и созвездиями --- */
.sky-section {
  position: relative;
  flex: 0 0 32%;
  min-height: 165px;
  overflow: hidden;
}

#skyCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.top-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.sky-badge,
.haptic-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(34, 31, 44, 0.74);
  border: 1px solid rgba(244, 185, 150, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 246, 238, 0.07);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  transition: box-shadow 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.sky-badge.is-celebrating {
  border-color: rgba(245, 211, 142, 0.68);
  box-shadow: 0 0 18px rgba(245, 211, 142, 0.38), inset 0 1px 0 rgba(255, 246, 238, 0.2);
  transform: scale(1.04);
}

.star-icon {
  color: var(--star-gold);
  font-size: 14px;
}

.constellation-pill {
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--accent);
  font-size: 12px;
}

.haptic-btn {
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.haptic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  transition: background 0.2s, box-shadow 0.2s;
}

.haptic-btn.is-on {
  color: var(--text-main);
  border-color: rgba(244, 185, 150, 0.28);
}

.haptic-btn.is-on .haptic-dot {
  background: #a7d7b8;
  box-shadow: 0 0 8px rgba(167, 215, 184, 0.7);
}

/* --- Центр: облачко Нимби смотрит на небо --- */
.cloud-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px 6px;
  position: relative;
}

.cloud-stage {
  position: relative;
  width: 210px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cloud-ring {
  position: absolute;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 185, 150, 0.22);
  transform: scale(0.75);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.cloud-aura {
  position: absolute;
  width: 190px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 185, 150, 0.28) 0%, rgba(156, 151, 184, 0.14) 45%, rgba(244, 185, 150, 0) 74%);
  transform: scale(1);
  pointer-events: none;
  will-change: transform, opacity;
}

.nimbi-cloud {
  position: relative;
  z-index: 1;
  width: 162px;
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(244, 185, 150, 0.22));
  transform: scale(1);
  will-change: transform;
  animation: gentleFloat 5.2s ease-in-out infinite;
}

.nimbi-cloud.is-practicing {
  animation: none;
}

.cloud-ring.is-release {
  border-color: rgba(251, 146, 60, 0.34);
}

.cloud-aura.is-release {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.38) 0%, rgba(249, 115, 22, 0.14) 46%, rgba(251, 146, 60, 0) 74%);
}

.nimbi-cloud.is-release {
  filter: drop-shadow(0 12px 28px rgba(251, 146, 60, 0.34));
}

.timer-pill.is-release {
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.32);
  color: #fed7aa;
}

/* --- Объятие бабочки --- */
.butterfly-wings {
  position: absolute;
  width: 248px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.wing {
  width: 104px;
  height: 124px;
  opacity: 0.26;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, filter 0.26s ease;
  will-change: transform, opacity;
}

.wing-left {
  transform-origin: 94% 55%;
}

.wing-right {
  transform-origin: 6% 55%;
}

.wing-left.is-lit {
  opacity: 1;
  transform: scale(1.14) rotate(-11deg);
  filter: drop-shadow(0 0 18px rgba(244, 114, 182, 0.65));
}

.wing-right.is-lit {
  opacity: 1;
  transform: scale(1.14) rotate(11deg);
  filter: drop-shadow(0 0 18px rgba(244, 114, 182, 0.65));
}

.wing.is-both {
  opacity: 0.85;
  transform: scale(1.04);
  filter: drop-shadow(0 0 14px rgba(192, 132, 252, 0.48));
}

.cloud-ring.is-butterfly {
  border-color: rgba(244, 114, 182, 0.3);
}

.cloud-aura.is-butterfly {
  background: radial-gradient(circle, rgba(244, 114, 182, 0.34) 0%, rgba(192, 132, 252, 0.14) 48%, rgba(244, 114, 182, 0) 74%);
}

.nimbi-cloud.is-butterfly {
  filter: drop-shadow(0 12px 28px rgba(244, 114, 182, 0.3));
}

.timer-pill.is-butterfly {
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.3);
  color: #fbcfe8;
}

.bilateral-cue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(244, 114, 182, 0.22);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.cue-side {
  padding: 2px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.cue-side.is-active {
  background: rgba(244, 114, 182, 0.24);
  color: #fdf2f8;
}

.cue-dot {
  opacity: 0.45;
}

/* --- Сжать и отпустить (Микро-PMR) --- */
.cloud-ring.is-pmr-tense {
  border-color: rgba(244, 63, 94, 0.42);
}

.cloud-aura.is-pmr-tense {
  background: radial-gradient(circle, rgba(232, 121, 249, 0.36) 0%, rgba(244, 63, 94, 0.16) 46%, rgba(244, 63, 94, 0) 74%);
}

.nimbi-cloud.is-pmr-tense {
  filter: drop-shadow(0 10px 26px rgba(244, 63, 94, 0.38));
}

.timer-pill.is-pmr-tense {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.34);
  color: #fecdd3;
}

.cloud-ring.is-pmr-relax {
  border-color: rgba(45, 212, 191, 0.32);
}

.cloud-aura.is-pmr-relax {
  background: radial-gradient(circle, rgba(45, 212, 191, 0.34) 0%, rgba(56, 189, 248, 0.12) 48%, rgba(45, 212, 191, 0) 74%);
}

.nimbi-cloud.is-pmr-relax {
  filter: drop-shadow(0 12px 30px rgba(45, 212, 191, 0.3));
}

.timer-pill.is-pmr-relax {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.3);
  color: #99f6e4;
}

/* --- Звёздная рябь (интерактивное заземление) --- */
.ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  touch-action: none;
  cursor: pointer;
}

.cloud-ring.is-ripple {
  border-color: rgba(45, 212, 191, 0.32);
}

.cloud-aura.is-ripple {
  background: radial-gradient(circle, rgba(45, 212, 191, 0.3) 0%, rgba(251, 191, 36, 0.12) 48%, rgba(45, 212, 191, 0) 74%);
}

.nimbi-cloud.is-ripple {
  filter: drop-shadow(0 12px 28px rgba(45, 212, 191, 0.28));
}

.timer-pill.is-ripple {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.3);
  color: #99f6e4;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-6px) scale(1.03); }
}

.guide-text {
  margin-top: 8px;
  text-align: center;
  max-width: 310px;
}

.together-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.14);
  border: 1px solid rgba(244, 114, 182, 0.28);
  color: #fbcfe8;
  font-size: 12.5px;
  font-weight: 500;
}

.phase-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
  min-height: 26px;
}

.phase-sub {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.42;
  color: var(--text-muted);
  min-height: 36px;
}

.timer-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(244, 185, 150, 0.12);
  border: 1px solid rgba(244, 185, 150, 0.24);
  color: #f6dcc9;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* --- Низ: список практик и управление --- */
.bottom-section {
  flex: 0 0 auto;
  padding: 6px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 5;
}

.practice-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.practice-list.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.practice-grid .practice-card {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 16px;
}

.practice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.practice-grid .practice-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.practice-grid .practice-badge svg {
  width: 18px;
  height: 18px;
}

.practice-grid .practice-name {
  font-size: 13.5px;
  line-height: 1.22;
}

.practice-grid .practice-desc {
  font-size: 11.5px;
  line-height: 1.3;
  white-space: normal;
}

.practice-grid .practice-time {
  font-size: 11px;
  padding: 3px 8px;
}

.practice-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 246, 238, 0.075) 0%, rgba(255, 246, 238, 0.04) 100%);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgba(255, 246, 238, 0.08), 0 6px 18px rgba(18, 14, 26, 0.34);
  color: var(--text-main);
  text-align: left;
  transition: transform 0.14s ease, background 0.2s ease, border-color 0.2s ease;
}

.practice-btn {
  cursor: pointer;
  font: inherit;
}

.practice-btn:active {
  transform: scale(0.982);
  background: var(--card-active);
  border-color: rgba(244, 185, 150, 0.34);
}

.practice-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.practice-badge svg {
  width: 20px;
  height: 20px;
}

.badge-indigo {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

.badge-sky {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.badge-amber {
  background: rgba(251, 146, 60, 0.15);
  color: #fdba74;
}

.badge-violet {
  background: rgba(192, 132, 252, 0.15);
  color: #d8b4fe;
}

.badge-rose {
  background: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
}

.badge-teal {
  background: rgba(45, 212, 191, 0.15);
  color: #5eead4;
}

.practice-info {
  flex: 1 1 auto;
  min-width: 0;
}

.practice-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.practice-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice-time {
  font-size: 12px;
  color: #f6dcc9;
  font-weight: 500;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(244, 185, 150, 0.12);
  border: 1px solid rgba(244, 185, 150, 0.2);
}

/* Активная практика */
.active-controls {
  display: flex;
  justify-content: center;
  padding: 12px 0 18px;
}

.stop-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* Экран после практики */
.complete-card {
  background: linear-gradient(180deg, rgba(255, 246, 238, 0.09) 0%, rgba(255, 246, 238, 0.045) 100%);
  border: 1px solid rgba(244, 185, 150, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 246, 238, 0.1), 0 12px 32px rgba(18, 14, 26, 0.45);
  border-radius: 22px;
  padding: 20px 16px 16px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.complete-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--star-gold);
}

.complete-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-main);
}

.rating-row {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.rate-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.rate-btn:active {
  transform: scale(0.92);
  background: var(--card-active);
}

.skip-btn {
  margin-top: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
}

/* --- Переключатель вкладок (Дыхание / Общие цели) --- */
.mode-tabs {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 3;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(34, 31, 44, 0.74);
  border: 1px solid rgba(244, 185, 150, 0.14);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(156, 151, 184, 0.28), rgba(244, 185, 150, 0.22));
  border-color: rgba(244, 185, 150, 0.44);
  color: var(--text-main);
  box-shadow: 0 4px 16px rgba(244, 185, 150, 0.18);
}

.mode-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--peach);
  color: #2b2633;
  font-size: 11px;
  font-weight: 700;
}

.breath-view {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* --- Вкладка 2: Общие цели («Созвездие Дружбы») --- */
.goals-view {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.goals-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 14px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.goals-header-card {
  padding: 13px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(156, 151, 184, 0.17) 0%, rgba(244, 185, 150, 0.13) 100%);
  border: 1px solid rgba(244, 185, 150, 0.24);
}

.goals-header-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--star-gold);
}

.goals-header-sub {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.42;
  color: #dfd6e5;
}

.goals-toast {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(197, 216, 198, 0.16);
  border: 1px solid rgba(197, 216, 198, 0.36);
  color: #e4f2e5;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.goals-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.goals-block-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #dfd6e5;
  padding: 0 2px;
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.goals-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

/* --- Выбор конкретной подруги из близкого круга (1..5 подруг) --- */
.friend-picker-wrap {
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--card-border);
}

.friend-picker-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.friend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.friend-chip.is-selected {
  background: linear-gradient(135deg, rgba(165, 180, 252, 0.25), rgba(244, 114, 182, 0.22));
  border-color: #f472b6;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(244, 114, 182, 0.28);
}

.friend-chip-cloud {
  font-size: 14px;
}

/* --- Карточка цели «Созвездие Дружбы» --- */
.goal-card {
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 246, 238, 0.08) 0%, rgba(255, 246, 238, 0.04) 100%);
  border: 1px solid rgba(244, 185, 150, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 246, 238, 0.08), 0 8px 22px rgba(18, 14, 26, 0.36);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.goal-card.is-completed {
  border-color: rgba(245, 211, 142, 0.44);
  background: linear-gradient(180deg, rgba(245, 211, 142, 0.13) 0%, rgba(244, 185, 150, 0.07) 100%);
}

.goal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goal-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.goal-emoji-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(165, 180, 252, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.goal-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.goal-card-pair {
  margin-top: 2px;
  font-size: 12px;
  color: #fbcfe8;
}

.goal-status-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(165, 180, 252, 0.14);
  color: #c7d2fe;
}

.goal-status-pill.is-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
}

.goal-status-pill.is-done {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

/* --- Визуальная дорожка двух облачков и звёздной шкалы --- */
.constellation-track {
  position: relative;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(24, 21, 32, 0.62);
  border: 1px solid rgba(244, 185, 150, 0.11);
}

.clouds-bridge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.mini-cloud-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.mini-cloud-tag.is-me {
  color: var(--star-gold);
  border: 1px solid rgba(253, 230, 138, 0.28);
}

.mini-cloud-tag.is-friend {
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.28);
}

.goal-progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.goal-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f5d38e 0%, #f4b996 52%, #e2a8c9 100%);
  transition: width 0.35s ease;
}

.goal-stars-row {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.goal-step-star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.goal-step-star.is-half-mine {
  background: linear-gradient(90deg, rgba(253, 230, 138, 0.52) 50%, rgba(255, 255, 255, 0.06) 50%);
  border-color: rgba(253, 230, 138, 0.55);
  color: #fef3c7;
  box-shadow: -3px 0 10px rgba(253, 230, 138, 0.32);
}

.goal-step-star.is-half-friend {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 50%, rgba(244, 114, 182, 0.52) 50%);
  border-color: rgba(244, 114, 182, 0.55);
  color: #fce7f3;
  box-shadow: 3px 0 10px rgba(244, 114, 182, 0.32);
}

.goal-step-star.is-both-done {
  background: linear-gradient(90deg, rgba(253, 230, 138, 0.62) 0%, rgba(244, 114, 182, 0.62) 100%);
  border-color: rgba(253, 230, 138, 0.85);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.42), 0 0 8px rgba(253, 230, 138, 0.35);
}

.goal-action-btn.is-waiting {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  box-shadow: none;
  cursor: default;
  opacity: 0.85;
}

.goal-last-note {
  font-size: 12px;
  color: #fde68a;
  background: rgba(253, 230, 138, 0.08);
  border: 1px solid rgba(253, 230, 138, 0.18);
  padding: 7px 10px;
  border-radius: 12px;
}

.goal-reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.warm-reaction-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11.5px;
  cursor: pointer;
}

.warm-reaction-chip.is-selected {
  background: rgba(244, 114, 182, 0.2);
  border-color: rgba(244, 114, 182, 0.45);
  color: #fbcfe8;
}

.goal-actions-row {
  display: flex;
  gap: 8px;
}

.goal-action-btn {
  flex: 1 1 auto;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(244, 185, 150, 0.42);
  background: linear-gradient(135deg, rgba(244, 185, 150, 0.3), rgba(156, 151, 184, 0.3));
  color: #fffaf5;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s;
}

.goal-action-btn:active {
  transform: scale(0.98);
}

.goal-action-btn.is-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

/* --- Пресеты и форма своей цели --- */
.presets-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s;
}

.preset-card:active {
  transform: scale(0.985);
  border-color: rgba(165, 180, 252, 0.38);
}

.preset-card-emoji {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(165, 180, 252, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.preset-card-info {
  flex: 1 1 auto;
  min-width: 0;
}

.preset-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.preset-card-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.preset-card-steps {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.14);
  color: #fbcfe8;
  font-size: 11.5px;
  font-weight: 600;
}

.custom-goal-toggle {
  width: 100%;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(244, 185, 150, 0.08);
  border: 1px dashed rgba(244, 185, 150, 0.34);
  color: #f6dcc9;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.custom-goal-form {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-field label {
  font-size: 12px;
  color: var(--text-muted);
}

.custom-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(244, 185, 150, 0.2);
  background: rgba(24, 21, 32, 0.68);
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
}

.custom-field input:focus {
  border-color: var(--accent);
}

.emoji-Chips,
.steps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.emoji-chip,
.step-chip {
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
}

.emoji-chip.is-selected,
.step-chip.is-selected {
  background: rgba(165, 180, 252, 0.24);
  border-color: var(--accent);
  color: #ffffff;
}

.custom-goal-submit {
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(244, 185, 150, 0.45);
  background: linear-gradient(135deg, rgba(244, 185, 150, 0.34), rgba(156, 151, 184, 0.32));
  color: #fffaf5;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* --- Кнопка баланса звёздочек 🌟 в углу и модальное окно скидок --- */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.bonus-stars-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.22), rgba(245, 158, 11, 0.16));
  border: 1px solid rgba(253, 230, 138, 0.42);
  box-shadow: 0 0 14px rgba(253, 230, 138, 0.18);
  color: #fef3c7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.bonus-stars-btn:active {
  transform: scale(0.94);
}

.bonus-star-emoji {
  font-size: 14px;
}

.stars-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 17, 27, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.stars-modal-card {
  width: 100%;
  max-width: 380px;
  border-radius: 24px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, #353142 0%, #25222f 100%);
  border: 1px solid rgba(245, 211, 142, 0.34);
  box-shadow: 0 20px 50px rgba(10, 8, 16, 0.65);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stars-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stars-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(253, 230, 138, 0.16);
  border: 1px solid rgba(253, 230, 138, 0.38);
  color: var(--star-gold);
  font-size: 16px;
  font-weight: 700;
}

.stars-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.stars-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.stars-modal-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}

.stars-plan-box {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(253, 230, 138, 0.3);
  min-height: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stars-plan-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--star-gold);
}

.stars-plan-placeholder {
  min-height: 28px;
}

.stars-plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.star-tier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.star-tier-item.is-available {
  border-color: rgba(253, 230, 138, 0.42);
  background: rgba(253, 230, 138, 0.08);
}

.star-tier-item.is-locked {
  opacity: 0.52;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.star-tier-item.is-used {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.star-tier-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.star-tier-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.star-tier-cost {
  font-size: 12px;
  font-weight: 700;
  color: var(--star-gold);
  background: rgba(253, 230, 138, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.star-tier-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.star-tier-sub {
  font-size: 11.5px;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
}

.star-old-price {
  text-decoration: line-through;
  color: rgba(226, 232, 240, 0.45);
}

.star-new-price {
  font-weight: 700;
  color: var(--star-gold);
}

.star-extra {
  color: rgba(226, 232, 240, 0.68);
}

.star-tier-btn {
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(253, 230, 138, 0.48);
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.28), rgba(165, 180, 252, 0.26));
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.star-tier-btn:disabled {
  opacity: 0.48;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.75);
  cursor: default;
}

.stars-redeem-status {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.35;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.stars-redeem-status.is-error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.stars-plan-note {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.6);
}

.stars-modal-ok-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(253, 230, 138, 0.38);
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.24), rgba(165, 180, 252, 0.22));
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
