* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #05060d;
  font-family: 'Inter', sans-serif;
  color: #e9e6f5;
}
#stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 600px at 50% -10%, rgba(70,90,180,0.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 90% 100%, rgba(90,60,160,0.25), transparent 60%),
    linear-gradient(180deg, #070912 0%, #05060d 100%);
}
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 140px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60px 140px, #cfd6ff, transparent),
    radial-gradient(1px 1px at 200px 200px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 260px 60px, #fff, transparent),
    radial-gradient(1px 1px at 320px 150px, #cfd6ff, transparent),
    radial-gradient(1px 1px at 40px 220px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 180px 260px, #fff, transparent);
  background-repeat: repeat;
  background-size: 340px 300px;
  opacity: 0.55;
  animation: twinkle 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.75; } }
.smoke { position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.5; pointer-events: none; }
.smoke.s1 { width: 340px; height: 340px; top: -80px; left: -60px; background: rgba(120,140,220,0.35); animation: drift1 18s ease-in-out infinite; }
.smoke.s2 { width: 300px; height: 300px; bottom: -60px; right: -40px; background: rgba(150,110,210,0.28); animation: drift2 22s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,20px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-25px,-15px); } }

#app { position: relative; max-width: 420px; margin: 0 auto; padding: 28px 20px 60px; }

.screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; gap: 14px; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(190,200,255,0.15); border-top-color: #b9a6ff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { text-align: center; margin-bottom: 18px; }
.brand .kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #8b91c9; }
.brand h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 26px; margin: 6px 0 0; color: #f3f0ff; }

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(190,200,255,0.14);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  padding: 20px;
  margin-bottom: 16px;
}

.card-art-wrap { position: relative; text-align: center; margin: 6px 0 22px; }
.card-art-glow {
  position: absolute; left: 50%; top: 50%;
  width: 230px; height: 230px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(160,150,255,0.35), transparent 65%);
  filter: blur(20px);
  z-index: 0;
}
.card-art { position: relative; z-index: 1; width: 168px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(210,200,255,0.35), 0 18px 40px rgba(0,0,0,0.55); }
.card-caption { font-family: 'Cormorant Garamond', serif; font-size: 20px; color: #f3f0ff; margin-top: 14px; }
.card-sub { font-size: 12px; color: #a6aad2; margin-top: 2px; letter-spacing: 0.05em; text-transform: uppercase; }

.section-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #b6b9ea; margin: 0 0 10px; }
.section-text { font-size: 14px; line-height: 1.7; color: #dcd9f0; margin: 0; white-space: pre-line; }

.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.task-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: #dcd9f0; cursor: pointer; }
.task-check {
  flex: none; width: 16px; height: 16px; margin-top: 2px;
  border-radius: 4px; border: 1px solid rgba(200,205,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
}
.task-check { transition: background .2s ease, border-color .2s ease; }
.task-item.done .task-check { background: rgba(190,175,255,0.3); color: #f3f0ff; border-color: rgba(210,200,255,0.6); animation: checkPop .3s ease; }
@keyframes checkPop { 0% { transform: scale(0.7); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.task-item.done span.label { color: #a6aad2; text-decoration: line-through; }
.task-note { font-size: 11.5px; color: #7c81b3; margin-top: 4px; }

.reflection-item { margin-bottom: 12px; }
.reflection-item textarea {
  width: 100%; min-height: 60px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(190,200,255,0.14);
  border-radius: 10px;
  color: #e9e6f5;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}
.reflection-item textarea::placeholder { color: #676c9e; }

.closing {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: #cfc9ff;
  line-height: 1.7;
  padding: 6px 6px 0;
}

.progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.progress-row .label { font-size: 11px; color: #a6aad2; letter-spacing: 0.05em; text-transform: uppercase; }
.progress-row .count { font-size: 12px; color: #cfc9ff; }
.progress-track { height: 3px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #7c7fe0, #b9a6ff); }

.placeholder-badge {
  display: inline-block; font-size: 10.5px; color: #b6b9ea;
  border: 1px solid rgba(190,200,255,0.3); border-radius: 6px;
  padding: 2px 8px; margin-bottom: 10px;
}

.stat-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 10px; }
.stat-row .stat-label { color: #a6aad2; white-space: nowrap; }
.stat-row .dots { flex: 1; border-bottom: 1px dotted rgba(190,200,255,0.3); transform: translateY(-3px); }
.stat-row .stat-value { color: #f3f0ff; font-weight: 500; white-space: nowrap; }

.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(190,200,255,0.12);
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
}
.menu-row.current { border-color: rgba(200,195,255,0.55); background: rgba(160,150,255,0.1); box-shadow: 0 0 16px rgba(150,140,255,0.25); }
.menu-row.locked { opacity: 0.55; }
.menu-thumb-wrap { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.05); }
.menu-thumb { width: 100%; height: 100%; object-fit: cover; }
.menu-row.locked .menu-thumb { filter: grayscale(1) brightness(0.35) blur(0.5px); }
.menu-lock-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #dcd9f0; }
.menu-info { flex: 1; min-width: 0; }
.menu-day { font-size: 10.5px; color: #a6aad2; text-transform: uppercase; letter-spacing: 0.05em; }
.menu-name { font-size: 13.5px; color: #f3f0ff; margin-top: 1px; }
.menu-row.locked .menu-name { color: #7c81b3; }
.menu-status { flex: none; font-size: 11px; }
.menu-status.done { color: #b9a6ff; }
.menu-status.today { color: #f3f0ff; background: rgba(160,150,255,0.3); padding: 3px 8px; border-radius: 8px; }
.menu-row.gift .menu-thumb-wrap { background: linear-gradient(160deg, rgba(190,175,255,0.25), rgba(120,110,220,0.15)); display: flex; align-items: center; justify-content: center; font-size: 20px; }

.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar-circle {
  flex: none; width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(160deg, #8d7fe8, #5b53b8);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 26px; color: #fff;
  border: 1px solid rgba(210,200,255,0.4);
  overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 19px; color: #f3f0ff; font-weight: 500; }
.profile-handle { font-size: 13.5px; color: #a6aad2; margin-top: 2px; }
.home-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; color: #f3f0ff; margin: 4px 0 2px; }
.home-subtitle { font-size: 12.5px; color: #b6b9ea; line-height: 1.5; margin: 0 0 18px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #b8bde6; cursor: pointer; margin-bottom: 14px; }

.insight-intro { font-size: 13px; color: #b6b9ea; line-height: 1.6; margin: 0 0 12px; }
.insight-send-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.insight-send {
  padding: 9px 16px; border-radius: 10px;
  background: rgba(160,150,255,0.22); border: 1px solid rgba(200,195,255,0.4);
  color: #f3f0ff; font-size: 13px; cursor: pointer;
}
.insight-send:disabled { opacity: 0.6; cursor: default; }
.ai-reply {
  margin-top: 12px;
  background: rgba(160,150,255,0.08);
  border: 1px solid rgba(190,200,255,0.18);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #e3e0f7;
  display: none;
}
.ai-reply .ai-tag { font-size: 10.5px; color: #b9a6ff; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: block; }

.day-complete-badge {
  text-align: center;
  font-size: 12.5px;
  color: #b9a6ff;
  background: rgba(160,150,255,0.12);
  border: 1px solid rgba(190,200,255,0.25);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 16px;
  display: none;
}

.gift-box { text-align: center; padding: 20px 10px; }
.gift-box .gift-emoji { font-size: 44px; }
.gift-locked-msg { text-align: center; padding: 40px 20px; color: #a6aad2; font-size: 13.5px; line-height: 1.6; }

/* --- день, який ще можна пройти (без осуду, лише запрошення) --- */
.menu-status.open { color: #9ea3d6; }
.menu-row.open .menu-name { color: #cbc8e0; }

/* --- підказка про «вогники» --- */
.info-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 4px;
  border-radius: 50%; border: 1px solid rgba(190,200,255,0.45);
  font-size: 10px; line-height: 1; color: #b6b9ea; cursor: pointer;
  vertical-align: middle;
}
.stat-hint {
  font-size: 12px; line-height: 1.55; color: #b4b7e4;
  background: rgba(160,150,255,0.09);
  border: 1px solid rgba(190,200,255,0.16);
  border-radius: 12px; padding: 11px 13px; margin: -8px 0 18px;
}

/* --- інтерактивні картки (Завдання, Інсайти) --- */
.glass.action { border-color: rgba(185,166,255,0.34); }

/* --- заголовок секції з лічильником --- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head .section-title { margin: 0; }
.task-counter { font-size: 11px; letter-spacing: 0.04em; color: #b6b9ea; white-space: nowrap; }
.task-counter.done { color: #b9a6ff; }

/* --- історія інсайтів --- */
.insight-history { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.insight-entry {
  font-size: 13px; line-height: 1.5; color: #d3d0ea;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid rgba(185,166,255,0.5);
  border-radius: 8px; padding: 8px 11px;
  white-space: pre-line;
}

/* --- екрани стану (не оплачено / помилка) --- */
.state-screen { text-align: center; padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.state-emoji { font-size: 42px; }
.state-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 23px; color: #f3f0ff; }
.state-text { font-size: 13.5px; line-height: 1.7; color: #b4b7e4; max-width: 300px; margin: 0; }
.btn {
  margin-top: 6px; padding: 11px 24px; border-radius: 12px;
  background: rgba(160,150,255,0.22); border: 1px solid rgba(200,195,255,0.4);
  color: #f3f0ff; font-size: 14px; font-family: inherit; cursor: pointer;
}
.btn:active { background: rgba(160,150,255,0.34); }

/* --- плавна поява екрана --- */
#app.fade-in { animation: fadeIn .32s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- конфеті --- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti-layer i { position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; opacity: 0.95; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(106vh) rotate(720deg); opacity: 0.15; } }

/* --- святкування вехи --- */
.celebrate { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(5,6,13,0.55); backdrop-filter: blur(3px); animation: fadeIn .3s ease; }
.celebrate.out { opacity: 0; transition: opacity .35s ease; }
.celebrate-box { text-align: center; padding: 28px 26px; border-radius: 20px; background: linear-gradient(180deg, rgba(40,36,90,0.96), rgba(20,18,45,0.96)); border: 1px solid rgba(200,190,255,0.35); box-shadow: 0 20px 60px rgba(0,0,0,0.5); max-width: 300px; }
.celebrate-emoji { font-size: 48px; }
.celebrate-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 24px; color: #f3f0ff; margin-top: 6px; }
.celebrate-text { font-size: 14px; color: #cfcbe8; line-height: 1.6; margin-top: 8px; }

/* --- онбординг --- */
.onb { min-height: 76vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 20px; }
.onb-emoji { font-size: 60px; }
.onb-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 28px; color: #f3f0ff; }
.onb-text { font-size: 14.5px; line-height: 1.7; color: #b4b7e4; max-width: 320px; margin: 0; }
.onb-dots { display: flex; gap: 8px; margin: 6px 0; }
.onb-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(190,200,255,0.25); }
.onb-dots span.on { background: #b9a6ff; }
.onb-skip { font-size: 12.5px; color: #a6aad2; cursor: pointer; }

/* --- шлях-подорож --- */
.journey { position: relative; padding: 4px 0; }
.journey::before { content: ''; position: absolute; left: 29px; top: 26px; bottom: 26px; width: 2px; background: linear-gradient(180deg, rgba(185,166,255,0.5), rgba(185,166,255,0.12)); }
.journey-item { display: flex; align-items: center; gap: 14px; padding: 7px 0; position: relative; }
.journey-dot { position: relative; z-index: 1; flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #0b0d18; border: 2px solid rgba(190,200,255,0.3); box-shadow: 0 0 0 4px #070912; }
.journey-dot img { width: 100%; height: 100%; object-fit: cover; }
.journey-item.done .journey-dot { border-color: #b9a6ff; }
.journey-item.done .journey-dot::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(120,110,220,0.5); color: #fff; font-size: 17px; font-weight: 600; }
.journey-item.today .journey-dot { border-color: #e6d8ff; animation: pulseDot 2.2s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { box-shadow: 0 0 0 4px #070912, 0 0 10px rgba(185,166,255,0.4); } 50% { box-shadow: 0 0 0 4px #070912, 0 0 20px rgba(185,166,255,0.75); } }
.journey-item.locked { opacity: 0.5; }
.journey-item.locked .journey-dot img { filter: grayscale(1) brightness(0.4); }
.journey-item.locked .journey-dot::after { content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.journey-card { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(190,200,255,0.1); }
.journey-item.today .journey-card { border-color: rgba(200,195,255,0.5); background: rgba(160,150,255,0.1); }
.journey-item.open .journey-card { border-color: rgba(190,200,255,0.22); }
.j-day { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #a6aad2; }
.j-name { font-size: 14px; color: #f3f0ff; margin-top: 1px; }
.journey-item.locked .j-name { color: #9296c1; }
.j-badge { display: inline-block; margin-top: 5px; font-size: 10.5px; }
.j-badge.done { color: #b9a6ff; }
.j-badge.today { color: #f3f0ff; background: rgba(160,150,255,0.3); padding: 2px 8px; border-radius: 8px; }
.j-badge.open { color: #9ea3d6; }
.journey-dot.gift-dot { display: flex; align-items: center; justify-content: center; font-size: 20px; background: linear-gradient(160deg, rgba(190,175,255,0.3), rgba(120,110,220,0.18)); }
.journey-item.gift.locked .gift-dot::after { content: '🔒'; }

/* --- дії на головній --- */
.home-actions { display: flex; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 11px; background: rgba(160,150,255,0.14); border: 1px solid rgba(190,200,255,0.2); color: #e9e6f5; font-size: 12.5px; font-family: inherit; cursor: pointer; }
.chip.reminder { padding: 6px 12px; }
.chip.reminder input[type="time"] { background: transparent; border: none; color: #e9e6f5; font-family: inherit; font-size: 12.5px; padding: 0; }

/* --- flip-картка --- */
.card-flip { position: relative; z-index: 1; width: 168px; height: 288px; margin: 0 auto; perspective: 1100px; }
.card-flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .75s cubic-bezier(.2,.75,.2,1); }
.card-flip-inner.revealed { transform: rotateY(0); }
.card-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 10px; overflow: hidden; }
.card-front { transform: rotateY(0); box-shadow: 0 0 0 1px rgba(210,200,255,0.35), 0 18px 40px rgba(0,0,0,0.55); }
.card-front .card-art { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; box-shadow: none; }
.card-front.noimg { background: linear-gradient(160deg,#2a2660,#151330); }
.card-back { transform: rotateY(180deg); background: radial-gradient(circle at 50% 40%, #3a3480, #17142f 70%); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(210,200,255,0.4); }
.card-back span { font-size: 44px; color: rgba(220,210,255,0.65); }

/* --- поділитися --- */
.share-link { display: inline-block; margin-top: 12px; font-size: 12.5px; color: #b8bde6; cursor: pointer; }

/* --- скелет завантаження --- */
.skel { background: linear-gradient(100deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 16px; }
.skel-card { margin-bottom: 16px; }
.skel-line { height: 14px; border-radius: 6px; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
