/* Yoga Guru – kid-friendly, calm and bright. */
:root {
  --ink: #1f2a44;
  --ink-soft: #55607a;
  --paper: #ffffff;
  --sky: #e8f4ff;
  --sand: #fff6e6;
  --primary: #2a9d8f;
  --primary-dark: #1f7a70;
  --accent: #ff9f1c;
  --pink: #ff6b9d;
  --good: #2fbf71;
  --warn: #ffb020;
  --bad: #ff5d5d;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(31, 42, 68, 0.12);
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Avenir Next', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* Phones: follow the REAL visible height as browser toolbars slide in and out (100vh would hide the bottom). */
@supports (height: 100dvh) { html, body { height: 100dvh; } }
/* The app scrolls inside its screens, never as a page: no pull-to-refresh / bounce in the middle of a pose. */
html, body { overscroll-behavior-y: none; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--sky) 0%, #f3ecff 50%, var(--sand) 100%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; /* iOS must not inflate text when the phone is turned sideways */
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, [tabindex]:focus-visible { outline: 4px solid rgba(42, 157, 143, 0.5); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

#app { height: 100%; }
.screen {
  height: 100%; display: none; flex-direction: column; overflow: auto; overscroll-behavior: contain;
  /* viewport-fit=cover: keep everything clear of notches, rounded corners and the home indicator (0 on laptops). */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.screen.active { display: flex; animation: screen-in 0.35s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-size: 1.15rem; font-weight: 800;
  background: var(--primary); color: #fff; box-shadow: 0 6px 0 var(--primary-dark), var(--shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-dark); }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #d6dcea, var(--shadow); }
.btn--ghost:active { box-shadow: 0 1px 0 #d6dcea; }
.btn--accent { background: var(--accent); box-shadow: 0 6px 0 #d97f00, var(--shadow); }
.btn--small { padding: 9px 16px; font-size: 0.95rem; box-shadow: 0 3px 0 #d6dcea; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; background: #fff; font-size: 1.3rem;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #d6dcea, 0 6px 16px rgba(31,42,68,.1);
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d6dcea; }

/* ---------------------------------------------------------------- HOME */
.home { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 28px 40px; }
.home-hero { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; }
.guru-avatar { width: 108px; height: 108px; flex: none; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; }
.guru-avatar svg { width: 100px; height: 100px; }
.home-hero h1 { font-size: 2.6rem; letter-spacing: -0.5px; }
.home-hero .tagline { font-size: 1.2rem; color: var(--ink-soft); margin-top: 4px; }
.home-stats { margin-left: auto; display: flex; gap: 12px; }
.stat-pill { background: #fff; border-radius: 18px; padding: 10px 16px; box-shadow: var(--shadow); text-align: center; min-width: 92px; }
.stat-pill b { display: block; font-size: 1.5rem; }
.stat-pill span { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }

.section-title { font-size: 1.35rem; margin: 6px 0 14px; }
.session-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.session-card {
  position: relative; text-align: left; background: #fff; border-radius: 28px; padding: 22px; box-shadow: var(--shadow);
  border: 4px solid transparent; display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s ease, border-color 0.15s;
}
.session-card:hover { transform: translateY(-4px); border-color: var(--card-color); }
.session-card__top { display: flex; align-items: center; gap: 14px; }
.session-card__emoji { font-size: 2.6rem; width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: color-mix(in srgb, var(--card-color) 18%, #fff); }
.session-card h3 { font-size: 1.55rem; }
.session-card .level { font-weight: 800; color: var(--card-color); text-transform: uppercase; letter-spacing: 1px; font-size: 0.85rem; }
.session-card p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.35; }
.session-card__meta { display: flex; gap: 10px; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.session-card__strip { display: flex; gap: 2px; margin: 2px -6px 0; overflow: hidden; }
.session-card__strip > div { flex: 1 1 0; min-width: 0; }
.session-card__strip svg { width: 100%; height: auto; display: block; }
.session-card__go { margin-top: auto; align-self: stretch; background: var(--card-color); color: #fff; font-weight: 800; font-size: 1.15rem; text-align: center; padding: 12px; border-radius: 16px; }
.badge-reco { position: absolute; top: -12px; right: 18px; background: var(--accent); color: #fff; font-weight: 800; font-size: 0.85rem; padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.session-card__stars { font-size: 0.95rem; font-weight: 700; color: var(--ink-soft); }

.home-nav { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.focus-tip { margin-top: 22px; background: #fff; border-radius: 22px; padding: 16px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.focus-tip .fig { width: 84px; flex: none; }
.focus-tip .fig svg { width: 84px; height: 84px; }
.focus-tip p { color: var(--ink-soft); }
.focus-tip b { color: var(--ink); }

/* ---------------------------------------------------------------- POSTERS */
.poster { background: #fff; border-radius: 26px; padding: 16px 16px 14px; box-shadow: var(--shadow); border-top: 10px solid var(--pose-color); display: flex; flex-direction: column; gap: 8px; }
.poster__head { display: flex; align-items: center; gap: 12px; }
.poster__emoji { font-size: 2rem; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--pose-color) 20%, #fff); flex: none; }
.poster__name { font-size: 1.3rem; line-height: 1.1; }
.poster__sub { font-size: 0.82rem; color: var(--ink-soft); }
.poster__figure { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--pose-color) 14%, #fff), #fff 70%); border-radius: 18px; }
.poster__figure svg { max-width: 100%; height: auto; }
.poster__view { font-size: 0.85rem; font-weight: 800; color: var(--pose-color); filter: brightness(0.8); text-align: center; }
.poster__steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.poster__steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 1rem; font-weight: 600; line-height: 1.25; }
.step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pose-color); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 0.9rem; }
.poster__benefit { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
.poster--compact .poster__steps li { font-size: 0.9rem; }
.poster--compact .poster__name { font-size: 1.1rem; }

/* ---------------------------------------------------------------- PAGE SHELL (library / progress) */
.page { max-width: 1240px; width: 100%; margin: 0 auto; padding: 22px 28px 40px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.page-head h2 { font-size: 2rem; }
.page-head .spacer { flex: 1; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; background: #fff; font-weight: 800; box-shadow: 0 2px 0 #d6dcea; }
.chip.active { background: var(--ink); color: #fff; box-shadow: none; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.poster-grid .poster { cursor: pointer; transition: transform 0.15s; position: relative; }
.poster-grid .poster:hover { transform: translateY(-4px) rotate(-0.5deg); }
.mastery-tag { position: absolute; top: 10px; right: 12px; font-size: 0.8rem; font-weight: 800; background: #fff; border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(20, 28, 50, 0.55); display: grid; place-items: center; z-index: 50; animation: fade 0.2s;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  overscroll-behavior: contain;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal__card { background: var(--sand); border-radius: 30px; padding: 22px; max-width: 980px; width: 100%; max-height: 94vh; max-height: min(94dvh, calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.pose-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pose-detail__3d { background: #fff; border-radius: 24px; min-height: 420px; position: relative; overflow: hidden; }
.pose-detail__3d .hint3d { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; pointer-events: none; }
.pose-detail__actions { display: flex; gap: 12px; margin-top: 16px; justify-content: flex-end; }
.pose-stats { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.pose-stats .stat-pill { box-shadow: none; border: 2px solid #eee4d0; min-width: 0; padding: 6px 12px; }
.pose-stats .stat-pill b { font-size: 1.1rem; }

/* ---------------------------------------------------------------- SETUP */
.topbar--setup { padding: 14px 28px 0; }
.setup { flex: 1; display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; padding: 22px 28px 28px; min-height: 0; }
.setup__cam { position: relative; border-radius: 30px; overflow: hidden; background: #101827; box-shadow: var(--shadow); min-height: 0; }
.setup__side { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; }
.setup-card { background: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.setup-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
.setup-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 12px; }
.setup-list li { display: flex; gap: 12px; align-items: center; font-size: 1.08rem; font-weight: 600; }
.setup-list .tick { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #eef1f7; font-size: 1.1rem; transition: background 0.3s; }
.setup-list li.ok .tick { background: var(--good); color: #fff; }
.setup-status { font-size: 1.25rem; font-weight: 800; text-align: center; padding: 14px; border-radius: 18px; background: #fff4dc; }
.setup-status.ok { background: #dcf7e8; color: #167a45; }
.setup-status.err { background: #ffe3e3; color: #b42323; }
.load-bar { height: 10px; border-radius: 99px; background: #e8ecf5; overflow: hidden; margin-top: 10px; }
.load-bar > i { display: block; height: 100%; width: 30%; border-radius: 99px; background: var(--primary); animation: load 1.2s infinite ease-in-out; }
@keyframes load { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
/* Once the download size is known the bar shows real progress instead of the back-and-forth shimmer. */
.load-bar.determinate > i { animation: none; margin-left: 0; width: 0%; transition: width .25s ease-out; }
.setup-tips > summary { list-style: none; cursor: default; }
.setup-tips > summary::-webkit-details-marker { display: none; }
.setup-tips__list { margin: 8px 0 0; padding-left: 20px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.setup-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: auto; }

/* ---------------------------------------------------------------- CAMERA STAGE (shared by setup + session) */
.stage { position: absolute; inset: 0; }
.stage video, .stage canvas { position: absolute; transform: scaleX(-1); /* mirror, like a real mirror */ }
.stage video { object-fit: fill; background: #101827; }
.body-guide { position: absolute; inset: 6% 22%; border: 5px dashed rgba(255,255,255,.55); border-radius: 40% 40% 12% 12% / 20% 20% 8% 8%; pointer-events: none; transition: border-color .3s, opacity .3s; }
.body-guide.ok { border-color: var(--good); border-style: solid; }

/* ---------------------------------------------------------------- SESSION */
/* She practises in front of a touch screen: a stray finger, a double tap or a long press must never
   scroll, zoom, select text or pop up a menu. Buttons still click; the 3D figure handles its own drags;
   the few scrollable sheets opt back in to panning. */
#screen-session { overflow: hidden; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#screen-session .steps-card, #screen-session .intro-dock, #screen-session .check-chips, #screen-session .card-pop, #screen-session .dots { touch-action: pan-x pan-y; }
#screen-setup { overscroll-behavior: none; }
.topbar__info, .steps-card__close { display: none; } /* small-screen controls (see responsive.css) */
.session { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 18px 18px; gap: 12px; }
.topbar { display: flex; align-items: center; gap: 14px; }
.topbar__title { font-weight: 800; font-size: 1.15rem; }
.dots { display: flex; gap: 7px; align-items: center; flex: 1; justify-content: center; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #d6dcea; transition: all .3s; display: grid; place-items: center; font-size: 0.6rem; }
.dot.done { background: var(--good); }
.dot.skipped { background: #b9c0d0; }
.dot.now { width: 38px; border-radius: 10px; background: var(--accent); }
.topbar__actions { display: flex; gap: 10px; }

.session__main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 16px; min-height: 0; }
.cam-panel { position: relative; border-radius: 30px; overflow: hidden; background: #101827; box-shadow: var(--shadow); min-height: 0; border: 6px solid #fff; transition: border-color .4s, box-shadow .4s; }
.cam-panel.good { border-color: var(--good); box-shadow: 0 0 0 6px rgba(47,191,113,.25), var(--shadow); }
.cam-panel.holding { border-color: var(--good); }
.cam-label { position: absolute; top: 14px; left: 14px; background: rgba(16,24,39,.6); color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: 0.9rem; backdrop-filter: blur(6px); display: flex; gap: 8px; align-items: center; }
.cam-label i { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.fps { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: .75rem; font-weight: 700; background: rgba(16,24,39,.45); padding: 4px 9px; border-radius: 99px; }

.hold-ring { position: absolute; right: 18px; bottom: 18px; width: clamp(150px, 24vh, 250px); height: clamp(150px, 24vh, 250px); display: grid; place-items: center; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
.hold-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke-width: 12; }
.hold-ring .track { stroke: rgba(255,255,255,.28); fill: rgba(16,24,39,.55); }
.hold-ring .bar { stroke: var(--good); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.hold-ring__text { position: relative; text-align: center; color: #fff; line-height: 1; }
.hold-ring__text b { font-size: clamp(3rem, 9vh, 5.6rem); display: block; }
.hold-ring__text span { font-size: clamp(.9rem, 2.2vh, 1.5rem); font-weight: 800; opacity: .95; }

.match { position: absolute; left: 18px; bottom: 18px; width: min(50%, 520px); background: rgba(16,24,39,.6); backdrop-filter: blur(6px); color: #fff; border-radius: 22px; padding: 12px 16px; }
.match__row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: clamp(1.15rem, 1.6vw, 1.8rem); }
.match__row b { font-size: clamp(1.7rem, 2.4vw, 2.8rem); }
.match__bar { height: clamp(16px, 2.4vh, 26px); background: rgba(255,255,255,.22); border-radius: 99px; margin-top: 8px; position: relative; overflow: visible; }
.match__bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--warn), var(--good)); width: 0%; transition: width .2s ease-out; }
.match__bar .goal { position: absolute; top: -9px; font-size: 1.3rem; transform: translateX(-50%); }

.cam-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.cam-col .cam-panel { flex: 1; }
/* The Guru's words: a caption strip under the mirror, sized to be read from the mat (2–3 m away). */
.coach-bubble { display: flex; align-items: center; gap: 14px; min-height: clamp(72px, 10vh, 110px); background: #fff; border-radius: 26px; padding: 10px 22px 10px 12px; box-shadow: var(--shadow); font-size: clamp(1.5rem, 2.2vw, 2.4rem); line-height: 1.15; font-weight: 800; visibility: hidden; }
.coach-bubble.show { visibility: visible; animation: fade .25s; }
.coach-bubble.fix { background: #fff4dc; }
.coach-bubble.praise { background: #dcf7e8; }
.coach-bubble .ava { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--sky); display: grid; place-items: center; overflow: hidden; }
.coach-bubble .ava svg { width: 52px; height: 52px; }

.joint-tag { position: absolute; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 5px solid var(--accent); box-shadow: 0 0 0 6px rgba(255,159,28,.3); pointer-events: none; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.18); opacity: .7; } }

.side-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ref-card { flex: 1.5; min-height: 0; background: #fff; border-radius: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; border-top: 10px solid var(--pose-color, var(--primary)); display: flex; flex-direction: column; }
.ref-card__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 0; }
.ref-card__head .poster__emoji { --pose-color: inherit; }
.ref-card__head h2 { font-size: 1.5rem; line-height: 1.1; }
.ref-card__head p { font-size: .85rem; color: var(--ink-soft); }
.ref-card__side { margin-left: auto; font-weight: 800; font-size: .85rem; background: var(--sand); padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
.ref-card__3d { flex: 1; min-height: 0; position: relative; cursor: grab; }
.ref-card__3d:active { cursor: grabbing; }
.ref-card__hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink-soft); pointer-events: none; }
.steps-card { flex: 1; min-height: 0; overflow: auto; background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.steps-card .poster__steps { gap: 10px; }
.steps-card .poster__steps li { font-size: 1.3rem; }
.steps-card .step-num { width: 32px; height: 32px; font-size: 1.05rem; }
.check-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.check-chip { font-size: clamp(.9rem, 1.15vw, 1.25rem); font-weight: 800; padding: 5px 11px; border-radius: 99px; background: #eef1f7; color: var(--ink-soft); transition: background .3s, color .3s; }
.check-chip.ok { background: #dcf7e8; color: #167a45; }
.check-chip.warn { background: #fff0cf; color: #946200; }
.check-chip.bad { background: #ffe1d6; color: #b3401a; }
.check-chip.active { outline: 3px solid var(--accent); }

/* overlays inside the session */
/* Overlays never hide the mirror completely: she can always see herself. */
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; padding: 18px; animation: fade .25s; }
.overlay--dock { background: linear-gradient(90deg, rgba(16,24,39,.62) 0%, rgba(16,24,39,.25) 48%, rgba(16,24,39,0) 70%); align-items: center; justify-content: flex-start; }
.overlay--center { background: rgba(16,24,39,.42); align-items: center; justify-content: center; }
.intro-dock { width: min(46%, 410px); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; animation: dock-in .45s cubic-bezier(.2,1.2,.4,1); }
@keyframes dock-in { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.intro-dock .poster { padding: 14px 16px; }
.intro-dock .poster__steps li { font-size: 1.12rem; }
.intro-dock__foot { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.95); border-radius: 16px; padding: 8px 14px; }
.intro-dock .intro__tip { max-width: none; font-size: 1rem; }
.card-pop { background: rgba(255,255,255,.97); border-radius: 32px; padding: 26px 40px; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.intro__count { font-size: 1.2rem; font-weight: 800; color: var(--ink-soft); }
.intro__kicker { font-size: 1.1rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; }
.intro__tip { background: #fff; border-radius: 20px; padding: 14px 18px; font-size: 1.1rem; font-weight: 700; box-shadow: var(--shadow); max-width: 420px; }

.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.result__stars { font-size: 5rem; letter-spacing: 8px; line-height: 1; }
.result__stars span { display: inline-block; opacity: .18; filter: grayscale(1); transform: scale(.6); }
.result__stars span.on { opacity: 1; filter: none; animation: star-pop .5s cubic-bezier(.2,1.6,.4,1) forwards; }
.result__stars span.on:nth-child(2) { animation-delay: .25s; }
.result__stars span.on:nth-child(3) { animation-delay: .5s; }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
.result h2 { font-size: 2.4rem; }
.result p { font-size: 1.25rem; color: var(--ink-soft); font-weight: 700; max-width: 520px; }

.breath { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.breath__circle { width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, #b8e8dc, #7fd1c1); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #0f5e54; box-shadow: 0 0 0 18px rgba(127,209,193,.25); transform: scale(.62); transition: transform 4s ease-in-out; }
.breath__circle.in { transform: scale(1); }
.breath h2 { font-size: 2.2rem; }
.breath p { font-size: 1.2rem; color: var(--ink-soft); font-weight: 700; }

/* ---- the relaxation moment: dim the room, keep the mirror visible, nothing bright or bouncy */
.overlay--relax { background: radial-gradient(ellipse at 50% 40%, rgba(24, 28, 62, .38), rgba(12, 14, 34, .66)); }
.breath--relax { gap: 16px; background: linear-gradient(180deg, #1d2447, #141a36); color: #eef1ff; box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08); animation: relax-in 1.2s ease-out; }
@keyframes relax-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.breath--relax h2 { color: #f4e9c7; font-weight: 800; }
.breath--relax p { color: #b9c1e6; }
.breath--relax .breath__circle { background: radial-gradient(circle at 45% 40%, #d2f2ea, #7fd1c1 70%, #5fb8a8); color: #0f4a43; box-shadow: 0 0 0 18px rgba(127, 209, 193, .18), 0 0 60px rgba(127, 209, 193, .35); }
/* a soft pulse, only while the camera really sees her breathing – it is her reflection, not a game */
.breath__circle.seen { box-shadow: 0 0 0 18px rgba(127, 209, 193, .28), 0 0 80px rgba(127, 209, 193, .55); }
.breath__live { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 3.2em; /* room for the two-line cue, so a longer line never moves the circle */ padding: 6px 16px; border-radius: 99px; background: rgba(255, 255, 255, .07); font-weight: 700; font-size: 1.05rem; color: #c9d1f2; max-width: 520px; transition: background .6s, color .6s; }
.breath__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #8a93bd; transition: background .6s; }
.breath__live[data-state="seen"] { background: rgba(127, 209, 193, .16); color: #d8f7ef; }
.breath__live[data-state="seen"] .breath__dot { background: #7fd1c1; animation: breath-pulse 4s ease-in-out infinite; }
.breath__live[data-state="still"] { background: rgba(244, 233, 199, .14); color: #f4e9c7; }
.breath__live[data-state="still"] .breath__dot { background: #f4e9c7; }
.breath__live[data-state="away"] { background: rgba(255, 255, 255, .12); color: #fff; }
.breath__live[data-state="away"] .breath__dot { background: #ff9f7f; }
@keyframes breath-pulse { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(1.35); opacity: 1; } }

/* the relaxation line on the summary */
.relax-note { color: var(--ink-soft); }
.relax-note--ok { color: #0f5e54; font-weight: 800; }

.paused { text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.paused h2 { font-size: 2.6rem; }
.paused__text { font-size: 1.3rem; font-weight: 700; color: var(--ink-soft); }
.paused__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.breath__say { max-width: 520px; }

/* ---------------------------------------------------------------- SUMMARY */
.summary { max-width: 1080px; width: 100%; margin: 0 auto; padding: 26px 28px 40px; text-align: center; }
.summary h1 { font-size: 2.8rem; }
.summary .big-stars { font-size: 3.2rem; margin: 8px 0; }
.summary__sub { font-size: 1.25rem; color: var(--ink-soft); font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 22px 0; text-align: left; }
.sum-card { background: #fff; border-radius: 22px; padding: 12px; box-shadow: var(--shadow); border-top: 8px solid var(--pose-color); display: flex; gap: 10px; align-items: center; }
.sum-card .fig { width: 72px; flex: none; }
.sum-card .fig svg { width: 72px; height: 72px; }
.sum-card h4 { margin: 0; font-size: 1.05rem; }
.sum-card .stars { font-size: 1.15rem; letter-spacing: 2px; }
.sum-card .note { font-size: .82rem; color: var(--ink-soft); font-weight: 700; }
.summary-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
.tip-card { background: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: var(--shadow); }
.tip-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.tip-card ul { margin: 0; padding-left: 20px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 8px; background: var(--sand); border-radius: 16px; padding: 8px 12px; font-weight: 800; }
.badge span { font-size: 1.6rem; }
.badge.locked { opacity: .4; filter: grayscale(1); }
.summary__actions { display: flex; gap: 14px; justify-content: center; margin-top: 24px; }

/* ---------------------------------------------------------------- PROGRESS */
.progress-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.progress-top .stat-pill b { font-size: 2rem; }
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mastery { background: #fff; border-radius: 20px; padding: 12px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; cursor: pointer; }
.mastery .fig svg { width: 64px; height: 64px; }
.mastery h4 { margin: 0 0 2px; font-size: 1rem; }
.mastery .lvl { font-size: .85rem; font-weight: 800; color: var(--ink-soft); }
.mastery .bar { height: 8px; border-radius: 99px; background: #eef1f7; margin-top: 6px; overflow: hidden; }
.mastery .bar i { display: block; height: 100%; background: var(--pose-color); border-radius: 99px; }
.week { display: flex; gap: 8px; }
.week .day { flex: 1; text-align: center; background: #fff; border-radius: 14px; padding: 8px 0; font-weight: 800; font-size: .85rem; color: var(--ink-soft); }
.week .day.on { background: var(--good); color: #fff; }

/* settings */
.settings-list { display: flex; flex-direction: column; gap: 16px; min-width: 420px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-weight: 700; }
.setting select, .setting input[type=range] { font: inherit; padding: 8px 10px; border-radius: 12px; border: 2px solid #d6dcea; background: #fff; max-width: 240px; }
.seg { display: inline-flex; background: #e8ecf5; border-radius: 99px; padding: 4px; }
.seg button { padding: 7px 14px; border-radius: 99px; font-weight: 800; font-size: .95rem; }
.seg button.active { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 700; padding: 12px 20px; border-radius: 99px; z-index: 120; box-shadow: var(--shadow); animation: fade .25s; }

/* Breakpoints (phones, tablets, rotated screens, narrow windows) live in responsive.css, loaded last. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .cam-label i, .joint-tag, .load-bar > i { animation: none !important; }
  .breath__circle { transition-duration: 4s !important; } /* the slow breathing circle IS the content */
}
