/* Light, airy and quietly futuristic: soft glass over drifting colour,
   one quiet control to talk to, and nothing you have to figure out. */
:root {
  color-scheme: light;
  --bg: #f4f2ee;
  --ink: #36333d; /* soft charcoal, never pure black */
  --muted: #84808c;
  --accent: #5d566b; /* muted plum-grey for buttons and selections: present, not heavy */
  --line: rgba(28, 27, 33, 0.08);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --peach: #ffd6c2;
  --lilac: #e4daff;
  --mint: #cdeee8;
  --butter: #fff0c4;
  --good: #2f8f7f;
  /* Zen Maru Gothic: a Japanese rounded typeface. Thin, airy strokes that end in
     soft curves, so nothing on the screen feels sharp. Used everywhere, for calm. */
  --display: "Zen Maru Gothic", system-ui, sans-serif;
  --reading: "Zen Maru Gothic", system-ui, sans-serif;
  --sans: "Zen Maru Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(28, 27, 33, 0.03), 0 10px 28px rgba(28, 27, 33, 0.05); /* light, so nothing feels heavy */
  --nav-space: calc(96px + env(safe-area-inset-bottom));
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Drifting colour behind every screen */
.aura {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aura span {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: drift 28s ease-in-out infinite alternate;
  transition: background 6s ease;
}

/* The three glows take their colours from the sky right now (see sky.js). */
.aura span:nth-child(1) { background: var(--sky-1, var(--peach)); top: -30vmax; left: -20vmax; }
.aura span:nth-child(2) { background: var(--sky-2, var(--lilac)); top: 10vmax; right: -35vmax; animation-delay: -9s; }
.aura span:nth-child(3) { background: var(--sky-3, var(--mint)); bottom: -40vmax; left: -10vmax; animation-delay: -18s; }

@keyframes drift {
  to { transform: translate(8vmax, 6vmax) scale(1.1); }
}

#scenery {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
}

body.scenic #scenery { display: block; }
body.scenic .aura { display: none; }

.view {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 20px var(--nav-space);
  animation: rise 0.45s ease both;
}

body.immersive .view { padding-bottom: 24px; min-height: 100dvh; display: flex; flex-direction: column; }
body.scenic .view { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------- Type ---------- */

h1, h2 { margin: 0; font-weight: 400; }
p { margin: 0 0 10px; }

.page-title, .greeting, .question, .entry-title, .panel-title {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.page-title { font-size: 2.1rem; margin: 5vh 0 6px; }
.greeting { font-size: 2.5rem; margin: 6px 0 8px; }
.question { font-size: 1.6rem; margin: 8px 0 12px; }
.entry-title { font-size: 1.8rem; margin: 2px 0 10px; }
.panel-title { font-size: 1.45rem; margin: 0 0 6px; }
.section-title { font-size: 0.85rem; font-weight: 500; letter-spacing: 0.03em;  color: var(--muted); margin: 26px 0 10px; }
h2 { font-size: 1.15rem; font-weight: 500; margin-bottom: 10px; }

.eyebrow {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  
  color: var(--muted);
  margin-bottom: 6px;
}

.sub { font-size: 1.1rem; color: var(--muted); max-width: 30ch; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.metaphor {
  font-family: var(--reading);
  font-size: 1.18rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.75;
  white-space: pre-wrap;
  margin: 10px 0 18px;
}

.small-metaphor { font-size: 1rem; color: var(--muted); animation: none; }

@keyframes reveal {
  from { opacity: 0; filter: blur(4px); transform: translateY(6px); }
}

/* Go deeper: the metaphor carrying on, beneath the original */
.deeper { margin: 6px 0 18px; }
.deeper-part { border-left: 2px solid rgba(93, 86, 107, 0.18); padding-left: 16px; margin: 18px 0; }
.deeper-btn { margin-top: 4px; }
.deeper-ask { padding: 18px 20px; margin-top: 8px; }
.deeper-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; }
.deeper-loading .presence { width: 72px; height: 72px; }
.reply { font-family: var(--reading); font-size: 1.05rem; line-height: 1.7; }

/* ---------- Surfaces ---------- */

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.note, .empty, .attempt, .up-next, .fold { padding: 18px 20px; margin: 14px 0; }
.empty .btn { margin-top: 8px; }

.notice {
  background: #fdecea;
  border: 1px solid #f4cdc7;
  border-radius: 16px;
  padding: 12px 16px;
  margin-top: 14px;
}

.support { padding: 18px 20px; margin-bottom: 18px; background: rgba(255, 236, 228, 0.85); }
.support a { color: inherit; font-weight: 500; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s;
}

.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn .icon { width: 18px; height: 18px; }

.link {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 8px;
}

.icon { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon svg { width: 100%; height: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn.labelled { width: auto; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 0.85rem; font-weight: 500; }
.icon-btn-spacer { width: 46px; }

button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid rgba(93, 86, 107, 0.3);
  outline-offset: 3px;
}

textarea:focus, input:focus { outline: none; box-shadow: 0 0 0 3px rgba(93, 86, 107, 0.14), var(--shadow); }

.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 10px; }

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

/* Stays at the bottom of the screen; frosted so text scrolling underneath doesn't clash. */
.bottom-action {
  position: sticky;
  z-index: 2;
  bottom: 0;
  margin: auto -20px 0;
  padding: 22px 20px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  background: rgba(244, 242, 238, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px);
  mask-image: linear-gradient(to bottom, transparent, #000 18px);
}

.bottom-action.stack { flex-direction: column; }

/* Progress: dots for the questions, segments for the drill */
.dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(28, 27, 33, 0.15); transition: background 0.3s, width 0.3s; }
.dot.on { background: var(--accent); width: 22px; border-radius: 999px; }

.progress { flex: 1; display: flex; gap: 6px; max-width: 260px; }
.seg { flex: 1; height: 6px; border-radius: 999px; background: rgba(28, 27, 33, 0.1); overflow: hidden; position: relative; }
.seg.on::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #8fd8c9, #b9a6ff); animation: fill 0.5s ease both; }

@keyframes fill { from { transform: translateX(-100%); } }

/* ---------- Home ---------- */

/* Everything has a place: the greeting sits high and left like a page heading,
   the one control to talk rests low in the centre, within easy reach of a thumb. */
.home {
  min-height: calc(100dvh - var(--nav-space) - 40px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
}

.home-head { margin-top: 10vh; }
.home .greeting { cursor: pointer; }
.name-ask { margin-top: 18px; max-width: 320px; }
.name-row { display: flex; gap: 8px; margin-top: 6px; }
.name-input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass-strong); font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.becoming-line { margin-top: 26px; }
.home .greeting { font-size: 2.2rem; line-height: 1.22; margin-bottom: 14px; max-width: 15ch; }
.home .sub { max-width: 28ch; font-size: 1.02rem; line-height: 1.6; }

.voice-area { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: auto; padding-bottom: 4vh; }

.voice {
  position: relative;
  isolation: isolate;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 2px rgba(28, 27, 33, 0.05), 0 22px 60px rgba(28, 27, 33, 0.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.voice:active { transform: scale(0.95); }

/* A soft glow of colour that slowly turns and breathes behind the glass */
.voice-halo {
  position: absolute;
  inset: -14px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--peach), var(--lilac), var(--mint), var(--butter), var(--peach));
  filter: blur(20px);
  opacity: 0.7;
  animation: spin 14s linear infinite, breathe 6s ease-in-out infinite;
}

.wave { display: flex; align-items: center; gap: 4px; height: 30px; }
.wave i { display: block; width: 3px; border-radius: 3px; background: var(--accent); animation: wave 1.8s ease-in-out infinite; }
.wave i:nth-child(1), .wave i:nth-child(5) { height: 10px; }
.wave i:nth-child(2), .wave i:nth-child(4) { height: 19px; animation-delay: -0.35s; }
.wave i:nth-child(3) { height: 28px; animation-delay: -0.7s; }
.wave i:nth-child(4) { animation-delay: -1.05s; }
.wave i:nth-child(5) { animation-delay: -1.4s; }

@keyframes wave { 50% { transform: scaleY(0.4); } }

.voice-label { margin: 0; font-size: 0.74rem; font-weight: 500; letter-spacing: 0.03em;  }

.type-instead { background: none; border: none; color: var(--muted); font: inherit; font-size: 0.9rem; padding: 6px 12px; cursor: pointer; }

@keyframes spin { to { rotate: 360deg; } }
@keyframes breathe { 50% { scale: 1.05; } }

.thinking { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; min-height: 60vh; }
.presence { cursor: default; width: 108px; height: 108px; }
.presence.thinking .wave i { animation-duration: 0.9s; }
.presence.thinking .voice-halo { animation: spin 5s linear infinite, breathe 2.4s ease-in-out infinite; }
.presence.done .wave i { animation-duration: 3.2s; }


.title { font-family: var(--display); font-size: 1.15rem; font-weight: 400; letter-spacing: 0.01em; line-height: 1.3; }

/* ---------- Questions and answers ---------- */

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

.field { position: relative; margin-top: 10px; }

textarea, input[type="search"], .title-input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
  resize: vertical;
  -webkit-appearance: none;
}

.field textarea { padding-right: 62px; }
textarea::placeholder, input::placeholder { color: var(--muted); opacity: 0.75; }

.mic {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  background: rgba(28, 27, 33, 0.06);
  color: var(--ink);
  cursor: pointer;
}

.mic.listening { background: var(--accent); color: #fff; animation: pulse 1.6s ease-out infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(28, 27, 33, 0.35); }
  100% { box-shadow: 0 0 0 16px rgba(28, 27, 33, 0); }
}

/* The one talk control under the text box: its wave moves with your words */
.talk-circle { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 22px auto 0; border: none; background: none; font: inherit; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.talk-circle .presence { width: 84px; height: 84px; cursor: pointer; }
.talk-circle .wave i { animation: none; transform: scaleY(0.3); transition: transform 0.08s linear; }
.talk-circle .when-listening, .field.listening + .talk-circle .when-idle { display: none; }
.field.listening + .talk-circle .when-listening { display: inline; }
.field:not(.listening) + .talk-circle .presence { opacity: 0.7; }
.field.listening textarea { box-shadow: 0 0 0 3px rgba(93, 86, 107, 0.14), var(--shadow); }

.result { margin-bottom: 8px; }

.listen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 18px 9px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.listen .icon { width: 18px; height: 18px; }
.listen.playing { background: var(--accent); color: #fff; }
.listen.breathing { animation: breathe-button 5.2s ease-in-out infinite; }

@keyframes breathe-button { 50% { transform: scale(1.07); } }

/* ---------- Library ---------- */

.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; margin: 16px 0 12px; border-radius: 999px; }
.search input { border: none; background: transparent; box-shadow: none; padding: 14px 0; outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -4px; padding: 2px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sub-chips { margin-top: -2px; }
.sub-chips .chip { padding: 6px 12px; font-size: 0.8rem; }
.sub-chips .chip.on { background: rgba(93, 86, 107, 0.8); }
.chip:disabled { opacity: 0.5; }

.cards { display: grid; gap: 12px; margin-top: 6px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  animation: rise 0.4s ease both;
}

.card { flex-direction: row; align-items: center; gap: 16px; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Each metaphor's own artwork */
.art { display: block; }
.art.thumb { width: 72px; height: 72px; flex: none; border-radius: 20px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8); }
.art.banner { width: 100%; height: auto; border-radius: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }

/* Only a newly made metaphor fades in; redrawing the screen doesn't replay it. */
.fresh .metaphor, .fresh .art.banner { animation: reveal 1.6s ease both; }

.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mint);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tag.alt { background: var(--lilac); }

.fold summary { cursor: pointer; font-weight: 500; list-style: none; }
.fold summary::after { content: " +"; color: var(--muted); }
.fold[open] summary::after { content: " –"; }
.fold[open] summary { margin-bottom: 10px; }

.history h2 { margin-top: 26px; }
.attempt summary { cursor: pointer; font-weight: 500; }
.round-review { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

/* ---------- Practice ---------- */

.up-next .title { display: block; margin: 4px 0 8px; }
.up-next .btn { margin-top: 12px; }

.moment-list { display: grid; gap: 10px; }

.moment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.moment > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.moment .icon { width: 18px; height: 18px; color: var(--muted); }

.games { display: grid; gap: 10px; }

.game {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.game.featured { background: var(--accent); color: #fff; border-color: var(--accent); }
.game.featured .muted { color: rgba(255, 255, 255, 0.7); }
.game-mark { font-family: var(--display); font-size: 1.1rem; font-weight: 300; line-height: 1; opacity: 0.5; width: 26px; }
.game-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.game .icon { width: 18px; height: 18px; opacity: 0.6; }

/* A question: the prompt, then big answers that are easy to tap */
.question-card { flex: 1; }
.ask { margin: 14px 0 4px; }
.prompt { font-family: var(--reading); font-size: 1.2rem; line-height: 1.55; margin: 0 0 22px; }
.blank { display: inline-block; width: 4.5em; border-bottom: 2px solid var(--muted); margin: 0 4px; transform: translateY(-4px); }

.answers { display: grid; gap: 10px; }
.answers.split { grid-template-columns: 1fr 1fr; }

.answer-btn {
  padding: 16px 18px;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s, background 0.25s, border-color 0.25s;
}

.answer-btn.half { text-align: center; font-weight: 500; min-height: 76px; }
.answer-btn:active:not(:disabled) { transform: scale(0.98); }
.answer-btn:disabled { cursor: default; }
.answer-btn:disabled:not(.right):not(.wrong) { opacity: 0.45; }
.answer-btn.right { background: #e3f5ef; border-color: #8fd8c9; }
.answer-btn.wrong { background: #fde9e2; border-color: #f2b7a6; animation: shake 0.35s; }

@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.seg.miss::after { content: ""; position: absolute; inset: 0; background: #f2b7a6; animation: fill 0.5s ease both; }
.tag.warm { background: var(--butter); }
.done-screen { min-height: 40vh; }
.review { margin-top: 8px; }
.sheet {
  position: sticky;
  bottom: 0;
  margin: auto -20px 0;
  padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #fff4ec;
  box-shadow: 0 -12px 40px rgba(28, 27, 33, 0.1);
  animation: slide-up 0.35s ease both;
}

.sheet.landed { background: #e7f6f1; }
.sheet-title { font-weight: 500; font-size: 1.1rem; }
.sheet .btn { margin-top: 10px; }

@keyframes slide-up { from { transform: translateY(100%); } }

/* ---------- Calm ---------- */

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  align-self: center;
}

.segmented button {
  border: none;
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.on { background: var(--accent); color: #fff; }

.panel { padding: 18px 18px 12px; background: rgba(255, 255, 255, 0.72); }
.hint { margin: 4px 0 0; font-size: 0.78rem; }

/* Tap the landscape: everything else fades away until you tap again */
body.unveiled .view > *, body.unveiled .nav { opacity: 0; pointer-events: none; }
.view > *, .nav { transition: opacity 0.6s ease; }
.panel.tall { max-height: 70dvh; overflow-y: auto; }
.panel .btn.primary { margin: 10px 0 4px; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 8px; }

.play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(28, 27, 33, 0.25);
  margin: 0 auto;
}

.play-btn .icon { width: 30px; height: 30px; }
.controls.centered { justify-content: center; gap: 28px; }


/* What's playing, tucked into the top corner on other screens */
.now-playing {
  position: fixed;
  z-index: 5;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  max-width: calc(100% - 28px);
  animation: rise 0.35s ease both;
}

.now-playing[hidden] { display: none; }
.now-playing.open { padding-left: 6px; }

.np-dot, .np-label, .np-btn { border: none; background: none; font: inherit; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.np-dot { width: 40px; height: 40px; border-radius: 50%; }
.np-label { gap: 8px; padding: 0 8px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-btn { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--accent); color: #fff; }
.np-btn.quiet { background: transparent; color: var(--muted); }
.np-btn .icon { width: 16px; height: 16px; }

/* A tiny moving wave: still when paused */
.np-wave { display: flex; align-items: center; gap: 2.5px; height: 16px; flex: none; }
.np-wave i { display: block; width: 2.5px; border-radius: 2px; background: var(--accent); animation: wave 1.4s ease-in-out infinite; }
.np-wave i:nth-child(1) { height: 8px; }
.np-wave i:nth-child(2) { height: 15px; animation-delay: -0.45s; }
.np-wave i:nth-child(3) { height: 10px; animation-delay: -0.9s; }
.now-playing.paused .np-wave i { animation-play-state: paused; opacity: 0.45; }

/* ---------- Self-hypnosis ---------- */

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  margin: 6px 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.option > span { display: flex; flex-direction: column; gap: 4px; }
.title-input { font-family: var(--display); font-size: 1.3rem; font-weight: 300; letter-spacing: 0.01em; padding: 12px 18px; }
audio { width: 100%; margin-top: 12px; }

.statements { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; font-family: var(--reading); font-size: 1.05rem; }
.statements.big { gap: 18px; margin-top: 18px; font-family: var(--display); font-weight: 300; letter-spacing: 0.01em; font-size: 1.6rem; line-height: 1.3; }

.statement-list { display: grid; gap: 8px; margin: 8px 0; }
.statement-row { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 16px; border-radius: 18px; }
.statement-row input { flex: 1; min-width: 0; border: none; background: transparent; font-family: var(--reading); font-size: 1.08rem; padding: 12px 0; color: var(--ink); outline: none; }
.statement-row textarea { flex: 1; min-width: 0; border: none; background: transparent; box-shadow: none; resize: none; font-size: 1rem; line-height: 1.45; padding: 10px 0; color: var(--ink); }
.statement-row textarea:focus { box-shadow: none; }
.remove { width: 40px; height: 40px; border: none; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.remove .icon { width: 16px; height: 16px; }

.recording-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e5484d;
  vertical-align: 1px;
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- Sensory games ---------- */

.game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; touch-action: none; }
.game-canvas[hidden] { display: none; }

/* While playing, touches go through to the canvas, except on buttons. */
body[data-view="play"] .view { pointer-events: none; }
body[data-view="play"] .view button { pointer-events: auto; }

.reveal-layer {
  position: fixed;
  left: 24px;
  right: 24px;
  top: 16vh;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.reveal-context { font-size: 0.74rem; font-weight: 500; letter-spacing: 0.03em;  opacity: 0.6; margin-bottom: 12px; }
.reveal-text { font-family: var(--display); font-weight: 300; letter-spacing: 0.01em; font-size: 1.55rem; line-height: 1.35; transition: filter 0.2s; }
.reveal-hint { margin-top: 40vh; font-size: 0.85rem; opacity: 0.6; transition: opacity 1s; }
.reveal-hint.faded { opacity: 0; }
.reveal-layer.show .reveal-context, .reveal-layer.show .reveal-text { animation: rise-in 1.2s ease both; }
.reveal-layer.light { color: #fff; }
.game-bar.light .seg { background: rgba(255, 255, 255, 0.18); }
.reveal-layer.steady { color: var(--ink); top: 12vh; }
.reveal-layer.garden { color: var(--ink); top: 12vh; }
.reveal-layer.rub { color: var(--ink); top: 18vh; }
.reveal-layer.rub .reveal-text { display: none; } /* the words are painted on the canvas */

@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Becoming ---------- */

.identity { padding: 18px 20px; margin: 6px 0 14px; }
.identity-line { font-family: var(--display); font-weight: 300; font-size: 1.7rem; line-height: 1.3; margin: 0; }
.identity .plant { flex: none; }
.level { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.meter { flex: 1; height: 6px; border-radius: 6px; background: rgba(93, 86, 107, 0.12); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #8fd8c9, #b9a6ff); transition: width 0.6s ease; }
.focus { padding: 18px 20px; margin: 12px 0; }
.focus-text { font-size: 1.08rem; line-height: 1.5; margin: 0; }

/* Log a moment, any time of day */
.log-btn { margin: 4px 0 12px; }
.log-card { padding: 18px 20px; margin: 4px 0 12px; }
.chips.wrap .chip { white-space: normal; text-align: left; }

/* This week's sticker book */
.sticker-book { padding: 18px 20px; margin: 12px 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 6px 0 12px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot { width: 100%; aspect-ratio: 1; max-width: 44px; display: grid; place-items: center; font-size: 1.35rem; border-radius: 12px; border: 1.5px dashed rgba(93, 86, 107, 0.25); }
.slot.got { border: 1.5px solid var(--glass-edge); background: rgba(255, 255, 255, 0.85); transform: rotate(-5deg); }
.week-day:nth-child(2n) .slot.got { transform: rotate(4deg); }
.slot.today:not(.got) { border-color: rgba(93, 86, 107, 0.5); }
.slot.pop { animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.day-label { font-size: 0.7rem; color: var(--muted); }
.moment-note { margin: 0; font-size: 0.95rem; line-height: 1.5; }

@keyframes pop { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } }

/* Your ways, with how many times you've shown up each way */
.ways { padding: 18px 20px; margin: 12px 0; }
.way-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.way { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.7); font-size: 0.9rem; line-height: 1.4; }
.way .count { align-self: flex-end; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.becoming-you { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--good); }
.becoming-you .icon { width: 14px; height: 14px; }

/* The constellation (Layout A): a small night sky of the days you showed up */
.sky-card { margin: 18px 0; padding: 18px 18px 14px; border-radius: 24px; background: linear-gradient(160deg, #2c2842, #3f3760 70%, #4b4270); box-shadow: var(--shadow); }
.constellation { display: block; width: 100%; height: auto; margin: 6px 0 8px; }
.light { color: rgba(255, 255, 255, 0.72); }
.eyebrow.light { color: rgba(255, 255, 255, 0.6); }

.practice-line { margin: 18px 0 6px; }
.becoming-actions { margin: 14px 0 6px; }

.reminder-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; margin: 18px 0 6px; }
.reminder-row > span { display: flex; flex-direction: column; gap: 2px; }
.reminder-row input { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--glass-strong); }

/* ---------- Settings and the avatar maker ---------- */

.bar-title { flex: 1; text-align: center; }
.settings-btn { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; }
.home { position: relative; }
.settings-block { padding: 18px 20px; margin: 12px 0; }
section.settings-block:not(.glass) { padding: 0; }
.layout-choice { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px; margin: 8px 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.layout-choice > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.layout-choice.on { outline: 2px solid var(--accent); }
.layout-swatch { flex: none; width: 54px; height: 54px; border-radius: 14px; }
.swatch-a { background: radial-gradient(circle at 30% 30%, #ffd6c2, transparent 60%), radial-gradient(circle at 70% 70%, #cdeee8, transparent 60%), #e4daff; }
.swatch-b { background: radial-gradient(circle at 25% 25%, #fff 1.5px, transparent 2px) 0 0 / 10px 10px, linear-gradient(#bfe3ff, #ffd9ec); border: 2.5px solid #2b2a55; box-shadow: 3px 3px 0 #2b2a55; border-radius: 8px; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-stage { display: grid; place-items: center; padding: 18px 0; }
.avatar-maker { padding: 16px 18px; display: grid; gap: 14px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong); font-size: 1rem; color: var(--ink); cursor: pointer; }
.step-label { display: flex; flex-direction: column; align-items: center; }
.swatch-row { display: flex; flex-direction: column; gap: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid rgba(0, 0, 0, 0.1); cursor: pointer; }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.sprite { display: block; image-rendering: pixelated; }

/* Only Layout B uses these */
.pixel-icon, .a-key, .voice-words { display: none; }

/* On Home: who you're becoming, and today's focus, under the greeting */
.becoming-line { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border: none; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.becoming-line .sub { margin: 0; }
.today-focus { font-size: 0.9rem; color: var(--ink); padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.55); border: 1px solid var(--glass-edge); max-width: 30ch; line-height: 1.4; }

/* ---------- Bottom bar ---------- */

.nav {
  position: fixed;
  z-index: 4;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 24px));
  display: flex;
  padding: 6px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 16px 40px rgba(28, 27, 33, 0.12);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

body.immersive .nav { display: none; }

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-btn .icon { width: 22px; height: 22px; }
.nav-btn.active { color: var(--ink); background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(28, 27, 33, 0.08); }

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