/* =========================================================
   Face Yoga — design system
   Dark aurora-glass aesthetic, mobile-first portrait.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg:            #07080c;
  --bg-elev:       #0d0f16;
  --ink:           #f3eee6;
  --ink-dim:       rgba(243,238,230,.72);
  --ink-mute:      rgba(243,238,230,.46);
  --ink-faint:     rgba(243,238,230,.22);
  --accent:        #ead1b5;
  --glass:         rgba(255,255,255,.055);
  --glass-strong:  rgba(255,255,255,.09);
  --glass-border:  rgba(255,255,255,.09);
  --glass-border-strong: rgba(255,255,255,.16);
  --radius-xl:     28px;
  --radius-lg:     22px;
  --radius-md:     16px;
  --radius-pill:   999px;
  --shadow-soft:   0 20px 60px -30px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.03) inset;
  --pad-page:      22px;
  --font: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
  letter-spacing: -0.01em;
}

[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

/* ---------- Aurora background ---------- */
#aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  animation: drift 22s ease-in-out infinite;
  transition: opacity .6s ease, filter .6s ease, transform .6s ease;
}
.b1 {
  background: radial-gradient(circle at 30% 30%, #ff8da1 0%, #ff5a3c 40%, transparent 70%);
  top: -20vw;
  left: -15vw;
  animation-delay: -3s;
  /* Smile warms + intensifies the pink blob */
  filter: blur(calc(80px - var(--sm-smile, 0) * 22px)) saturate(calc(1.3 + var(--sm-smile, 0) * 0.8));
  opacity: calc(.55 + var(--sm-smile, 0) * .35);
}
.b2 {
  background: radial-gradient(circle at 60% 40%, #7a8bff 0%, #c05aff 50%, transparent 72%);
  top: 25vh;
  right: -25vw;
  animation-delay: -11s;
  /* Brow raise lifts the violet blob */
  filter: blur(80px) saturate(calc(1.3 + var(--sm-brow, 0) * 0.5));
  opacity: calc(.55 + var(--sm-brow, 0) * .3);
  transform: translateY(calc(var(--sm-brow, 0) * -3vh));
}
.b3 {
  background: radial-gradient(circle at 50% 60%, #ffb98b 0%, #ff6f6a 45%, transparent 72%);
  bottom: -25vw;
  left: 10vw;
  width: 90vw;
  height: 90vw;
  animation-delay: -17s;
  /* Jaw-open expands the warm blob below */
  filter: blur(calc(80px - var(--sm-open, 0) * 18px)) saturate(calc(1.3 + var(--sm-open, 0) * 0.6));
  opacity: calc(.4 + var(--sm-open, 0) * .35);
  transform: scale(calc(1 + var(--sm-open, 0) * .12));
}
.grain {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,.3), transparent 30%, transparent 70%, rgba(0,0,0,.5));
  mix-blend-mode: multiply;
}
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(5vw,-3vh) scale(1.1); }
  66%      { transform: translate(-4vw,4vh) scale(.95); }
}

/* ---------- App shell ---------- */
#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    calc(env(safe-area-inset-top,0) + 16px)
    var(--pad-page)
    calc(env(safe-area-inset-bottom,0) + 20px);
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.screen { display: flex; flex-direction: column; gap: 16px; animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Topbar ---------- */
.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 4px 0 10px;
}
.brand {
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: center;
}
.date { font-size: 12px; color: var(--ink-mute); text-align: right; letter-spacing: .04em; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink);
  font-size: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.glass-chip { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.icon-btn:active { transform: scale(.94); }

/* ---------- Glass surfaces ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* ---------- Hero (home) ---------- */
.hero {
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 320px;
}
.hero-aurora {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,120,170,.55) 0%, transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(120,170,255,.45) 0%, transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(255,160,110,.5) 0%, transparent 55%);
  filter: blur(42px);
  opacity: .9;
  animation: drift 28s ease-in-out infinite;
  z-index: 0;
}
.hero-aurora.bloom {
  animation: bloom 2.6s ease-out both, drift 28s ease-in-out infinite 2.6s;
}
@keyframes bloom {
  from { opacity: 0; transform: scale(.6); filter: blur(80px); }
  to   { opacity: .9; transform: scale(1); filter: blur(42px); }
}
.hero-top, .hero-body, .hero > .btn, .report-stats { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-title {
  font-size: 40px;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
}
.hero-title.big { font-size: 44px; }
.hero-sub {
  color: var(--ink-dim);
  font-size: 15px;
  margin-top: 10px;
  max-width: 20em;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  letter-spacing: .02em;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  color: var(--ink);
}
.pill-ghost {
  background: rgba(255,255,255,.06);
  color: var(--ink-dim);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  width: 100%;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(180deg, #fff 0%, #efe6d7 100%);
  color: #1a1a1a;
}
.btn-ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--glass-border);
}
.btn.small { padding: 11px 16px; font-size: 13px; width: auto; }
.arrow { font-size: 18px; line-height: 1; }

/* ---------- Tile grid (home) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  padding: 18px 18px 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}
.tile-label {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.tile-sub { font-size: 12px; color: var(--ink-mute); }
.tile-num { font-size: 44px; font-weight: 300; line-height: 1; color: #fff; }
.tile-num em { font-size: 14px; font-style: normal; color: var(--ink-dim); margin-left: 4px; }

.tile-wide { padding: 20px 20px 18px; }
.tile-wide-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}

/* ---------- Week dots ---------- */
.weekdots { display: flex; gap: 7px; }
.weekdots .d {
  flex: 1;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
}
.weekdots .d.on {
  background: linear-gradient(135deg,#ffb48c,#ff6a7d);
  border-color: transparent;
}
.weekdots .d.today { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* ---------- Moves mini (home) ---------- */
.moves-mini {
  display: flex; flex-direction: column; gap: 10px;
}
.moves-mini li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-dim);
}
.moves-mini .idx {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--glass);
  display: grid; place-items: center;
  font-size: 11px;
  color: var(--ink);
  border: 1px solid var(--glass-border);
}
.moves-mini .dur { font-size: 11px; color: var(--ink-mute); }

/* ---------- Footnote ---------- */
.footnote {
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 8px;
  padding: 0 12px;
}

/* ---------- Screen title ---------- */
.screen-title {
  font-size: 36px;
  font-weight: 300;
  line-height: 1.1;
  color: #fff;
  margin: 8px 2px 10px;
  letter-spacing: -0.02em;
}
.screen-title em { font-style: normal; color: var(--ink-dim); }
.screen-sub {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 2px 16px;
  max-width: 24em;
}
.screen-cta { margin-top: auto; padding-top: 20px; }

/* ---------- Moves full list ---------- */
.moves-full {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0;
}
.moves-full li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}
.moves-full .idx {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#fff2e3,#ffcbaf);
  color: #2a1a0e;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 500;
}
.moves-full .meta { display: flex; flex-direction: column; gap: 2px; }
.moves-full .ttl { font-size: 15px; color: var(--ink); }
.moves-full .mode { font-size: 11px; color: var(--ink-mute); letter-spacing: .04em; }
.moves-full .time { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ---------- Mode cards ---------- */
.mode-cards {
  display: flex; flex-direction: column; gap: 12px; margin-top: 8px;
}
.mode-card {
  text-align: left;
  padding: 20px 20px 18px;
  position: relative;
  border-radius: var(--radius-xl);
}
.mode-card h3 {
  font-size: 20px;
  font-weight: 400;
  margin: 10px 0 6px;
  color: #fff;
}
.mode-card p {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.5;
}
.mode-cta {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
}
.mode-badge {
  position: absolute;
  top: 16px; right: 16px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.08);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.mode-badge.experimental { background: rgba(255,180,60,.14); color: #ffcf8a; }

/* ---------- Camera stage ---------- */
.camera-stage {
  position: relative;
  flex: 1;
  min-height: 60vh;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
}
.camera-stage video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
  opacity: 0;
  transition: opacity .5s ease;
}
.mesh-canvas.on { opacity: 1; }
.mesh-canvas-soft.on { opacity: .55; }
#exerciseMesh { z-index: 2; }
.exercise-body { z-index: 4 !important; }
.topbar-exercise { z-index: 5 !important; }

/* Camera-mode layout: face is the UI. Everything else gets out of the way. */
.screen-exercise.in-camera-mode .exercise-body {
  justify-content: flex-end;
  padding-bottom: 10px;
  gap: 10px;
}
/* No central glow — the face mesh + target overlay IS the visual. */
.screen-exercise.in-camera-mode .phase-stage,
.screen-exercise.in-camera-mode .phase-track {
  display: none;
}
/* Minimal cue card at the bottom only */
.screen-exercise.in-camera-mode .phase-copy {
  background: rgba(10,12,18,.6);
  padding: 12px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  max-width: 320px;
  margin: 0 auto;
  gap: 6px;
}
.screen-exercise.in-camera-mode .phase-copy .pill { background: rgba(255,255,255,.1); }
.screen-exercise.in-camera-mode .phase-cue {
  font-size: 20px;
  letter-spacing: .005em;
}
.screen-exercise.in-camera-mode .phase-sub { font-size: 12px; }
/* Only a very subtle darken at the very bottom for the controls */
.screen-exercise.in-camera-mode .exercise-dim {
  background: linear-gradient(180deg, transparent 0%, transparent 75%, rgba(0,0,0,.55) 98%);
}
.screen-exercise.in-camera-mode #exerciseVideo {
  filter: brightness(1.08) contrast(1.03) saturate(1.08);
}

/* Completion flash — brief glow around the whole screen when a move completes */
.completion-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  background: radial-gradient(circle at 50% 50%,
    rgba(255,210,170,.25) 0%,
    rgba(255,150,130,.15) 40%,
    transparent 70%);
  opacity: 0;
  animation: completionFlash 1.4s ease-out both;
}
.completion-flash .mark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  color: rgba(255,235,210,.95);
  text-shadow: 0 0 40px rgba(255,180,140,.9);
  animation: markPop .9s cubic-bezier(.3,0,.2,1) both;
}
@keyframes completionFlash {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes markPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  40%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.sticker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s ease;
  z-index: 3;
}
.sticker-layer.on { opacity: 1; }
.sticker-layer img {
  position: absolute;
  top: 0; left: 0;
  display: block;
  will-change: transform;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
#exerciseStickers.on { opacity: .9; }
.face-oval {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,.3);
  pointer-events: none;
  transition: border-color .4s ease;
}
.face-oval.ok {
  border-color: rgba(130,255,180,.75);
  border-style: solid;
  animation: steady 1.6s ease-in-out infinite;
}
@keyframes steady {
  0%,100% { opacity: .7; }
  50%     { opacity: 1; }
}
.setup-status {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Calibration ---------- */
.calib-stage {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px 0;
}
.breath-ring {
  width: 220px; height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,180,170,.6) 0%, transparent 70%);
  position: relative;
  animation: breath 4.5s ease-in-out infinite;
  filter: blur(2px);
}
.breath-ring::after {
  content: "";
  position: absolute; inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
}
@keyframes breath {
  0%,100% { transform: scale(.9); opacity: .7; }
  50%     { transform: scale(1.08); opacity: 1; }
}
.calib-copy { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.calib-copy h2 { font-size: 24px; font-weight: 300; color: #fff; }
.calib-copy p { font-size: 13px; color: var(--ink-dim); }

/* ---------- Exercise screen ---------- */
.screen-exercise {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: calc(env(safe-area-inset-top,0) + 10px) var(--pad-page) calc(env(safe-area-inset-bottom,0) + 14px);
  max-width: none;
  gap: 0;
  justify-content: space-between;
  background: #06080c;
  z-index: 10;
}
#exerciseVideo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  filter: brightness(1.18) contrast(1.05) saturate(1.1);
  z-index: 0;
  opacity: 0;
  transition: opacity .5s ease;
}
#exerciseVideo.show { opacity: 1; }
#setupVideo { filter: brightness(1.12) contrast(1.03) saturate(1.08); }
.exercise-dim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 20%, rgba(0,0,0,.55) 65%),
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 25%, transparent 70%, rgba(0,0,0,.75));
  z-index: 1;
  pointer-events: none;
}
.topbar-exercise {
  position: relative; z-index: 3;
  grid-template-columns: 44px 1fr 44px;
  gap: 14px;
}
.session-progress { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.progress-track {
  width: 100%; height: 3px;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb48c, #ff6a7d);
  width: 0%;
  transition: width .4s ease;
}
.exercise-body {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 20px 0;
  pointer-events: none;
}
.exercise-body > * { pointer-events: auto; }

/* phase visual */
.phase-stage {
  position: relative;
  width: 260px; height: 260px;
  display: grid; place-items: center;
  transition: width .4s ease, height .4s ease, transform .4s ease;
}

/* Visible motion tracks — give the dot/glow a spatial reference */
.phase-track {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.phase-track.on { opacity: 1; }

/* Horizontal track for left/right moves */
.phase-track.lateral::before {
  content: "";
  width: 70%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.35) 15%,
    rgba(255,255,255,.5) 50%,
    rgba(255,255,255,.35) 85%,
    rgba(255,255,255,0) 100%);
}
.phase-track.lateral::after {
  content: "";
  position: absolute;
  width: 70%;
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  letter-spacing: 2px;
  pointer-events: none;
}

/* Circular dashed track for circle moves */
.phase-track.circular::before {
  content: "";
  width: 72%; height: 72%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,.3);
}

/* Breath track (concentric rings for hold) */
.phase-track.hold-track::before {
  content: "";
  width: 60%; height: 60%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  animation: holdTrack 3.5s ease-in-out infinite;
}
@keyframes holdTrack {
  0%,100% { transform: scale(.9); opacity: .4; }
  50%     { transform: scale(1.15); opacity: .9; }
}

/* Direction arrows for lateral moves */
.phase-arrow {
  position: absolute;
  font-size: 32px;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,.6);
  opacity: 0;
  transition: opacity .3s ease, transform .5s cubic-bezier(.5,0,.2,1);
  pointer-events: none;
}
.phase-arrow.show { opacity: 1; }
.phase-arrow.left  { left: 8%;  }
.phase-arrow.right { right: 8%; }
.phase-visual {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
}
.phase-glow {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,170,160,.9) 0%, rgba(255,100,120,.6) 45%, transparent 75%);
  filter: blur(6px);
  transition: transform .9s cubic-bezier(.5,0,.2,1), background .5s ease, filter .5s ease;
}
.phase-letter {
  position: absolute;
  font-size: 72px;
  font-weight: 200;
  color: #fff;
  letter-spacing: -0.04em;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .4s ease, transform .5s ease;
}
.phase-letter.show { opacity: 1; }
.phase-dot {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(255,255,255,.25),
    0 0 32px rgba(255,210,180,1);
  opacity: 0;
  z-index: 2;
  transition: transform .9s cubic-bezier(.6,0,.3,1), opacity .3s ease;
}
.phase-dot.show { opacity: 1; animation: dotPulse 1.8s ease-in-out infinite; }
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(255,255,255,.25), 0 0 24px rgba(255,210,180,.9); }
  50%     { box-shadow: 0 0 0 6px rgba(255,255,255,.35), 0 0 40px rgba(255,210,180,1); }
}
.phase-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
}
.phase-ring::before, .phase-ring::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--accent);
  animation: ringSpin 11s linear infinite;
  opacity: .5;
}
.phase-ring::after { animation-direction: reverse; animation-duration: 17s; border-top-color: rgba(255,170,160,.6); }
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* phase side-to-side shifts */
.phase-visual.shift-left  .phase-glow { transform: translateX(-70px); background: radial-gradient(circle at 50% 50%, rgba(130,180,255,.9) 0%, rgba(90,110,255,.5) 40%, transparent 75%); }
.phase-visual.shift-right .phase-glow { transform: translateX( 70px); background: radial-gradient(circle at 50% 50%, rgba(255,180,110,.9) 0%, rgba(255,100,90,.55) 40%, transparent 75%); }
.phase-visual.shift-up    .phase-glow { transform: translateY(-70px); }
.phase-visual.shift-down  .phase-glow { transform: translateY( 70px); }

.phase-visual.vowel-a .phase-glow { transform: scale(1.15); background: radial-gradient(circle, rgba(255,180,160,.95) 0%, rgba(255,100,80,.5) 50%, transparent 80%); }
.phase-visual.vowel-u .phase-glow { transform: scale(.68);  background: radial-gradient(circle, rgba(255,170,220,.95) 0%, rgba(220,100,200,.55) 50%, transparent 80%); }
.phase-visual.vowel-e .phase-glow { transform: scaleX(1.35) scaleY(.75); background: radial-gradient(ellipse, rgba(255,220,160,.95) 0%, rgba(255,160,100,.5) 55%, transparent 80%); }

.phase-visual.hold .phase-glow { transform: scale(.75); background: radial-gradient(circle, rgba(255,130,170,.95) 0%, rgba(220,80,110,.6) 50%, transparent 78%); animation: holdPulse 3.5s ease-in-out infinite; }
@keyframes holdPulse {
  0%,100% { transform: scale(.72); filter: blur(6px); }
  50%     { transform: scale(.80); filter: blur(10px); }
}

.phase-visual.draw-in .phase-glow { transform: scale(.6); }
.phase-visual.release .phase-glow { transform: scale(1.1); opacity: .8; }

/* phase copy */
.phase-copy {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 0 20px;
}
.phase-copy .pill { background: rgba(255,255,255,.08); }
.phase-cue {
  font-size: 28px;
  font-weight: 300;
  color: #fff;
  letter-spacing: -0.01em;
  min-height: 1.1em;
}
.phase-sub {
  font-size: 13px;
  color: var(--ink-dim);
  max-width: 20em;
}

/* rhythm / rep dots — quality-tiered */
.rhythm-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.rhythm-dots .r {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  transition: background .3s ease, transform .35s cubic-bezier(.3,0,.2,1), box-shadow .3s ease;
}
.rhythm-dots .r.on {
  background: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(234,209,181,.8);
}
.rhythm-dots .r.done.p0 {
  background: rgba(255,255,255,.3);
  transform: scale(1.05);
}
.rhythm-dots .r.done.p1 {
  background: linear-gradient(135deg,#ffdfae,#ffb27a);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255,180,140,.5);
}
.rhythm-dots .r.done.p2 {
  background: linear-gradient(135deg,#ffcf8a,#ff8a9a);
  transform: scale(1.3);
  box-shadow: 0 0 14px rgba(255,140,160,.65);
}
.rhythm-dots .r.done.p3 {
  background: linear-gradient(135deg,#fff2d3,#ff7cb9 60%,#9668ff);
  transform: scale(1.4);
  box-shadow: 0 0 18px rgba(255,180,220,.85), 0 0 36px rgba(150,100,255,.4);
}

/* Snap feedback — scaled by petal quality */
.phase-stage.snap {
  animation: snapPulse .65s cubic-bezier(.3,0,.2,1) both;
}
.phase-stage.snap-2 { animation: snapPulse2 .75s cubic-bezier(.3,0,.2,1) both; }
.phase-stage.snap-3 { animation: snapPulse3 .85s cubic-bezier(.3,0,.2,1) both; }
@keyframes snapPulse {
  0%   { transform: scale(1);    filter: brightness(1); }
  25%  { transform: scale(1.08); filter: brightness(1.3) saturate(1.2); }
  100% { transform: scale(1);    filter: brightness(1); }
}
@keyframes snapPulse2 {
  0%   { transform: scale(1);    filter: brightness(1); }
  25%  { transform: scale(1.15); filter: brightness(1.45) saturate(1.4); }
  60%  { transform: scale(1.03); filter: brightness(1.2) saturate(1.2); }
  100% { transform: scale(1);    filter: brightness(1); }
}
@keyframes snapPulse3 {
  0%   { transform: scale(1);    filter: brightness(1) hue-rotate(0deg); }
  20%  { transform: scale(1.22); filter: brightness(1.6) saturate(1.5) hue-rotate(10deg); }
  55%  { transform: scale(1.05); filter: brightness(1.3) saturate(1.3); }
  100% { transform: scale(1);    filter: brightness(1); }
}

/* Cue-card pulse so the user feels the hit even when phase-stage is hidden */
.phase-copy.snap-pulse, .cue-card.snap-pulse {
  animation: cueSnap .55s cubic-bezier(.3,0,.2,1) both;
}
.phase-copy.pq-2, .cue-card.pq-2 { box-shadow: 0 0 24px rgba(255,160,180,.45); }
.phase-copy.pq-3, .cue-card.pq-3 { box-shadow: 0 0 32px rgba(255,160,220,.65), 0 0 72px rgba(150,100,255,.35); }
@keyframes cueSnap {
  0%   { transform: translateX(-50%) scale(1); }
  40%  { transform: translateX(-50%) scale(1.06); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Mandala petal richness by session quality */
.mandala .petal.q0 { filter: blur(10px) saturate(.8); opacity: .35; }
.mandala .petal.q1 { filter: blur(6px)  saturate(1.2); }
.mandala .petal.q2 { filter: blur(4px)  saturate(1.5); }
.mandala .petal.q3 {
  filter: blur(3px) saturate(1.8) drop-shadow(0 0 10px rgba(255,180,220,.6));
}

/* Sound toggle button in the exercise topbar */
.audio-toggle {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(243,238,230,.8);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
  cursor: pointer;
}
.audio-toggle.on { background: var(--accent); color: #1a1a1a; }

.exercise-footer {
  position: relative; z-index: 2;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 8px;
}

/* overlays — centered in the viewport, no transform-based animation */
.selfcheck, .pause-overlay, .demo-overlay {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 28px 24px 24px;
  text-align: center;
  width: min(360px, calc(100% - 32px));
  animation: overlayFade .3s ease both;
}
@keyframes overlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.selfcheck, .pause-overlay, .demo-overlay {
  background: rgba(10,10,15,.82);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
}
.selfcheck h3, .pause-overlay h3, .demo-overlay h3 {
  font-size: 22px; font-weight: 300; color: #fff; margin-bottom: 8px;
}
.pause-overlay p, .demo-overlay p {
  font-size: 13px; color: var(--ink-dim); margin-bottom: 16px;
}
.selfcheck-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pause-overlay > .btn { margin-top: 10px; }

.demo-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: radial-gradient(circle, rgba(255,180,160,.9) 0%, transparent 70%);
  animation: breath 3.5s ease-in-out infinite;
}

/* ---------- Mandala (session bloom) ---------- */
.mandala-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 4px 0 6px;
  z-index: 1;
}
.mandala {
  position: relative;
  width: 240px;
  height: 240px;
  pointer-events: none;
}
.mandala .petal {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 76px;
  height: 118px;
  margin-left: -38px;
  transform: translateX(-50%) rotateZ(var(--rot, 0deg)) scale(0);
  transform-origin: 50% 115px;
  border-radius: 50% 50% 40% 40% / 55% 55% 35% 35%;
  filter: blur(4px) saturate(1.5);
  opacity: 0;
  mix-blend-mode: screen;
}
.mandala .petal.show {
  animation: petalBloom 1s cubic-bezier(.3,0,.2,1) both;
}
.mandala .petal.partial {
  animation-duration: 1.2s;
  filter: blur(8px) saturate(1.1);
  opacity: .5;
}
@keyframes petalBloom {
  0%   { opacity: 0; transform: translateX(-50%) rotateZ(var(--rot, 0deg)) scale(.25); }
  70%  { opacity: 1; transform: translateX(-50%) rotateZ(var(--rot, 0deg)) scale(1.08); }
  100% { opacity: 1; transform: translateX(-50%) rotateZ(var(--rot, 0deg)) scale(1); }
}
.mandala .core {
  position: absolute;
  top: 50%; left: 50%;
  width: 92px; height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,235,200,.95) 0%, rgba(255,180,140,.6) 40%, transparent 72%);
  filter: blur(3px);
  opacity: 0;
  animation: coreBloom 1.4s .5s cubic-bezier(.3,0,.2,1) both;
}
@keyframes coreBloom {
  0%   { opacity: 0; transform: scale(.3); }
  100% { opacity: 1; transform: scale(1); }
}
.mandala .sparkle {
  position: absolute;
  width: 14px; height: 14px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,230,180,.6) 40%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sparkle {
  0%,100% { opacity: 0; transform: scale(0); }
  50%     { opacity: 1; transform: scale(1); }
}

.hero-reflect {
  position: relative; z-index: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-dim);
  font-style: italic;
  padding: 6px 4px 0;
  max-width: 24em;
}

/* ---------- Report ---------- */
.report-hero { gap: 18px; padding-bottom: 28px; }
.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.report-stats > div {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}
.report-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 300;
  color: #fff;
}
.report-stats em {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-style: normal;
}

.moves-report li { grid-template-columns: 36px 1fr auto; }
.status-chip {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  letter-spacing: .06em;
}
.status-chip.completed { background: rgba(130,220,160,.14); color: #a9ecb8; }
.status-chip.partial   { background: rgba(255,195,120,.14); color: #ffd49a; }
.status-chip.skipped   { background: rgba(255,255,255,.06); color: var(--ink-mute); }

.streak-card { text-align: center; align-items: center; }

/* ---------- Diag strip ---------- */
.diag-strip {
  position: fixed;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-mute);
  background: rgba(0,0,0,.4);
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 999;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

/* ---------- Small-screen tweaks ---------- */
@media (max-width: 360px) {
  .hero-title { font-size: 34px; }
  .hero-title.big { font-size: 38px; }
  .screen-title { font-size: 30px; }
  .phase-stage { width: 220px; height: 220px; }
  .phase-glow { width: 150px; height: 150px; }
  .phase-letter { font-size: 60px; }
}
