:root {
  --night: #0b0a1a;
  --night-2: #14122b;
  --aurora: #8b5cf6;
  --aurora-deep: #6d28d9;
  --pink: #f472b6;
  --pink-deep: #db2777;
  --cyan: #67e8f9;
  --teal: #2dd4bf;
  --amber: #fbbf24;
  --cream: #fbf6ec;
  --ink: #1c1b2e;
  --muted: rgba(255,255,255,0.55);
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.12);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #050410;
  color: #f4f1ea;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- App canvas ---------- */
.app {
  width: 390px;
  height: 844px;
  max-width: 100vw;
  max-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--night);
}
@media (max-width: 520px) {
  .app { width: 100vw; height: 100vh; }
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 72px 28px 40px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.screen.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Shared elements ---------- */
.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 17px;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.3px;
  margin-bottom: 56px;
}
.brand .breath {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--aurora));
  box-shadow: 0 0 10px 1px rgba(139,92,246,0.9);
  animation: breathe 4.5s ease-in-out infinite;
}
.brand.light { color: #5a4a78; }
.brand.light .breath {
  background: radial-gradient(circle at 30% 30%, #fff, var(--aurora-deep));
  box-shadow: 0 0 10px 1px rgba(109,40,217,0.7);
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.4); opacity: 1; }
}

/* =========================================================
   STEP 1 — THE TRIGGER
   ========================================================= */
.s1 .ambient {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(139,92,246,0.45), transparent 55%),
    radial-gradient(120% 70% at 50% 110%, rgba(244,114,182,0.22), transparent 55%);
}
.s1 .stars {
  background-image:
    radial-gradient(1px 1px at 20% 18%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 78% 32%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 42% 68%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 88% 78%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 12% 88%, rgba(255,255,255,0.5), transparent);
}

.greeting {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-weight: 300;
}
.prompt {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.8px;
  margin-bottom: 6px;
}
.prompt em {
  font-style: italic;
  background: linear-gradient(120deg, var(--pink), var(--aurora));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 44px;
  font-weight: 300;
  letter-spacing: 0.2px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}
.state {
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 14px;
  text-align: center;
  position: relative;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.35) inset,
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 20px 40px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
}
.state:hover, .state:active {
  transform: translateY(-3px) scale(1.015);
}
.state .emoji { font-size: 50px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5)); }
.state .lbl { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: 0.2px; }
.state .sub-l { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 0.4px; font-weight: 300; }

.state.chaos {
  background: linear-gradient(160deg, rgba(244,114,182,0.22), rgba(244,114,182,0.05));
  border-color: rgba(244,114,182,0.35);
}
.state.mind {
  background: linear-gradient(160deg, rgba(139,92,246,0.22), rgba(139,92,246,0.05));
  border-color: rgba(139,92,246,0.35);
}
.state.battery {
  background: linear-gradient(160deg, rgba(251,191,36,0.18), rgba(251,191,36,0.04));
  border-color: rgba(251,191,36,0.3);
}
.state.auto {
  background: linear-gradient(160deg, rgba(103,232,249,0.18), rgba(103,232,249,0.04));
  border-color: rgba(103,232,249,0.3);
}

.foot {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.32);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-top: 32px;
  font-weight: 300;
}

/* =========================================================
   STEP 2 — THE OBSERVER
   ========================================================= */
.s2 { color: #3a2e52; }
.s2 .ambient {
  background: linear-gradient(180deg, #14122b 0%, #2a2350 28%, #6d5a8e 55%, #c9b8de 78%, #f3ead8 100%);
}
.s2 .stars { opacity: 0; }

.s2-instruct {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: rgba(255,255,255,0.92);
  text-align: center;
  line-height: 1.35;
  margin-bottom: 50px;
}

.bubble-wrap {
  position: relative;
  width: 150px; height: 150px;
  margin: 0 auto 40px;
  touch-action: none;
}
.bubble-glow {
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,114,182,0.5), rgba(139,92,246,0.25) 50%, transparent 70%);
  pointer-events: none;
}
.bubble {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.98), #f9c5dc 38%, #d98bba 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  cursor: grab;
  user-select: none;
  box-shadow:
    0 0 40px rgba(244,114,182,0.7),
    0 0 80px rgba(139,92,246,0.4),
    inset 0 -12px 24px rgba(0,0,0,0.18);
  transition: transform 0.1s ease;
}
.bubble.dragging { cursor: grabbing; }

.drag-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.65);
  margin-bottom: auto;
}
.drag-hint .arrow { font-size: 24px; }
.drag-hint .txt { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; }

.s2-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  color: #3a2e52;
  text-align: center;
  padding: 0 10px;
  transition: opacity 0.4s ease;
}
.s2-quote .light { color: rgba(58,46,82,0.55); }
.s2-quote .strong { color: #2a1f44; font-weight: 400; }
.s2-quote.hidden { opacity: 0; }

/* =========================================================
   STEP 3 — THE PAUSE
   ========================================================= */
.s3 { color: #5a4a78; }
.s3 .ambient {
  background:
    radial-gradient(75% 45% at 50% 48%, rgba(255,255,255,0.65), transparent 70%),
    linear-gradient(180deg, #f3ead8 0%, #fbf6ec 45%, #eef0f6 100%);
}

.s3-prompt {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 24px;
  color: #5a4a78;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 12px;
}
.s3-prompt em { font-style: italic; color: var(--aurora-deep); }
.s3-sub {
  font-size: 13px;
  color: rgba(90,74,120,0.6);
  text-align: center;
  margin-bottom: auto;
  font-weight: 300;
  letter-spacing: 0.3px;
}

.pause-wrap {
  position: relative;
  width: 220px; height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  align-self: center;
}
.pause-btn {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #e9def5 38%, #b9a3e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow:
    0 0 50px rgba(139,92,246,0.55),
    0 24px 50px rgba(109,40,217,0.35),
    inset 0 -8px 18px rgba(0,0,0,0.12);
  z-index: 2;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s ease;
}
.pause-btn:active { transform: scale(0.96); }
.pause-btn .bars { display: flex; gap: 8px; margin-bottom: 8px; }
.pause-btn .bars i {
  display: block; width: 8px; height: 30px; border-radius: 4px;
  background: linear-gradient(180deg, var(--aurora), var(--aurora-deep));
}
.pause-btn .word { font-family: 'Fraunces', serif; font-size: 14px; letter-spacing: 3px; color: var(--aurora-deep); text-transform: uppercase; font-weight: 500; }

.s3-count {
  text-align: center;
  margin-top: auto;
}
.s3-count .label {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  color: #5a4a78;
}
.s3-count .num {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 64px;
  font-style: italic;
  color: var(--aurora-deep);
  display: block;
  line-height: 1;
  margin-top: 6px;
  min-height: 64px;
}
.s3-heart {
  text-align: center;
  font-size: 11px;
  color: rgba(90,74,120,0.55);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* =========================================================
   STEP 4 — CONSCIOUS CHOICE
   ========================================================= */
.s4 .ambient {
  background:
    radial-gradient(100% 50% at 50% 0%, rgba(244,114,182,0.28), transparent 55%),
    radial-gradient(100% 50% at 50% 110%, rgba(45,212,191,0.22), transparent 55%),
    linear-gradient(180deg, #1a1736 0%, #221d44 50%, #1c1936 100%);
}

.s4-head {
  margin-bottom: 8px;
}
.s4-head .lead {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 300;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.s4-head .lead em {
  font-style: italic;
  background: linear-gradient(120deg, var(--teal), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.s4-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
  font-weight: 300;
  letter-spacing: 0.3px;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(45,212,191,0.14);
  border: 1px solid rgba(45,212,191,0.3);
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.5px;
  font-weight: 500;
  align-self: flex-start;
  margin-bottom: 24px;
}
.score-pill b { font-weight: 600; color: #fff; }

.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.card {
  border-radius: 26px;
  padding: 22px 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover, .card:active { transform: translateY(-2px); }
.card.c1:hover, .card.c1:active { border-color: rgba(244,114,182,0.45); }
.card.c2:hover, .card.c2:active { border-color: rgba(45,212,191,0.45); }
.card.c3:hover, .card.c3:active { border-color: rgba(139,92,246,0.45); }

.card .row { display: flex; align-items: flex-start; gap: 16px; }
.card .icon {
  width: 48px; height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.card .body { flex: 1; }
.card .title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card .ctitle {
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.2px;
}
.card .tag {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.card .cdesc {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  font-weight: 300;
  margin-bottom: 12px;
}
.card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.card .cta::after { content: ' →'; }

.card.c1 .icon { background: linear-gradient(140deg, rgba(244,114,182,0.32), rgba(244,114,182,0.1)); border: 1px solid rgba(244,114,182,0.35); }
.card.c1 .tag  { background: rgba(244,114,182,0.2); color: var(--pink); }
.card.c1 .cta  { color: var(--pink); }
.card.c2 .icon { background: linear-gradient(140deg, rgba(45,212,191,0.32), rgba(45,212,191,0.1)); border: 1px solid rgba(45,212,191,0.35); }
.card.c2 .tag  { background: rgba(45,212,191,0.2); color: var(--teal); }
.card.c2 .cta  { color: var(--teal); }
.card.c3 .icon { background: linear-gradient(140deg, rgba(139,92,246,0.32), rgba(139,92,246,0.1)); border: 1px solid rgba(139,92,246,0.35); }
.card.c3 .tag  { background: rgba(139,92,246,0.22); color: var(--aurora); }
.card.c3 .cta  { color: var(--aurora); }

.s4-foot {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-top: 24px;
}
.s4-foot em { font-style: normal; color: var(--teal); }

/* =========================================================
   STEP 5 — COMPLETION
   ========================================================= */
.s5 .ambient {
  background:
    radial-gradient(80% 50% at 50% 40%, rgba(45,212,191,0.3), transparent 60%),
    radial-gradient(80% 50% at 50% 80%, rgba(139,92,246,0.25), transparent 60%),
    linear-gradient(180deg, #0d1f1c 0%, #0a1419 100%);
}

.s5-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 28px 40px;
}
.s5-ring {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #5eead4 35%, #14b8a6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 80px rgba(45,212,191,0.6), 0 0 140px rgba(45,212,191,0.3);
  margin-bottom: 40px;
}
.s5-ring .check {
  font-size: 72px;
  color: #fff;
}
.s5-title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 32px;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.s5-title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--teal), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.s5-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 40px;
}
.s5-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(45,212,191,0.12);
  border: 1px solid rgba(45,212,191,0.3);
  margin-bottom: 50px;
}
.s5-score .lbl { font-size: 12px; color: rgba(255,255,255,0.6); letter-spacing: 0.5px; }
.s5-score .val { font-family: 'Fraunces', serif; font-size: 22px; color: var(--teal); font-weight: 500; }
.s5-score .plus { color: var(--teal); font-size: 24px; }
.s5-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 50px;
}
.s5-total .t-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 400;
}
.s5-total .t-val {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 400;
  color: #fff;
  line-height: 1;
}
.s5-done {
  padding: 16px 40px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}
.s5-done:hover, .s5-done:active { background: rgba(255,255,255,0.14); }

/* ---------- Confetti ---------- */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}
.confetti-piece {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
  animation: confetti-burst 1.8s cubic-bezier(0.12, 0.6, 0.35, 1) forwards;
}
@keyframes confetti-burst {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.2);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  45% {
    transform: translate(calc(-50% + var(--tx) * 0.7), calc(-50% + var(--ty) * 0.45))
      rotate(calc(var(--rot) * 0.5deg)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) + 220px))
      rotate(calc(var(--rot) * 1deg)) scale(0.9);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
