/* PottyQuest brand: lavender, violet and sunshine, with a sticker-chart motif.
   Mobile first. Tokens live here; screens only use these. */
:root {
  --bg: #F6F2FF;
  --surface: #FFFFFF;
  --ink: #24164A;
  --ink-2: #5E5480;
  --ink-3: #8B82A8;
  --violet: #6B4EE6;
  --violet-deep: #4B2FC2;
  --violet-soft: #ECE6FF;
  --sun: #FFC94D;
  --sun-deep: #E8A92A;
  --sun-soft: #FFF3D2;
  --mint: #22B98F;
  --mint-soft: #DCF6EC;
  --blush: #FF9EC4;
  --blush-soft: #FFE8F1;
  --sky-soft: #E3EDFF;
  --line: #E6DFF7;
  --danger: #C23B6E;

  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --gutter: 16px;

  --lift-1: 0 1px 2px rgba(36, 22, 74, .06), 0 6px 18px rgba(75, 47, 194, .07);
  --lift-2: 0 2px 4px rgba(36, 22, 74, .06), 0 14px 34px rgba(75, 47, 194, .14);
  --sticker: 0 0 0 4px #fff, 0 6px 14px rgba(36, 22, 74, .16);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; overflow-wrap: anywhere; }
p:last-child { margin-bottom: 0; }
a { color: var(--violet-deep); text-underline-offset: 3px; }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 10px; }
.ico { display: inline-block; vertical-align: -.2em; flex: none; }

.page {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 16px var(--gutter) 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.page > * { min-width: 0; }
.page.app { padding-bottom: 112px; }
.center { text-align: center; }
.fine { font-size: .86rem; color: var(--ink-3); }

/* ── wordmark ────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.wordmark-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--violet-soft); display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 2px #fff; }
.wordmark-mark .ellie { width: 34px; height: 34px; transform: translateY(3px) scale(1.15); }
.wordmark-text { font: 800 1.2rem/1 var(--display); letter-spacing: -.03em; }
.wordmark-text b { color: var(--violet); font-weight: 800; }

/* ── buttons ─────────────────────────────────── */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 22px;
  border-radius: 999px;
  background: var(--violet); color: #fff;
  font: 700 1.08rem/1.2 var(--body);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 20px rgba(107, 78, 230, .35);
  transition: transform .12s, box-shadow .12s, background .12s;
  text-align: center; white-space: normal; text-decoration: none;
}
.btn:hover { background: var(--violet-deep); }
.btn:active { transform: translateY(2px) scale(.99); box-shadow: 0 4px 10px rgba(107, 78, 230, .3); }
.btn-big { min-height: 62px; font-size: 1.15rem; }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 20px rgba(232, 169, 42, .4); }
.btn-sun:hover { background: #FFBE2E; }
.btn-quiet { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset; }
.btn-quiet:hover { background: var(--violet-soft); }
.link-btn {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--violet-deep); font: 600 .95rem var(--body); text-decoration: underline; text-underline-offset: 3px;
  padding: 10px; align-self: center;
}

/* ── surfaces & Ellie ────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--lift-1); min-width: 0;
}
.card h2 { font-size: 1.15rem; }
.says { display: flex; align-items: flex-end; gap: 8px; }
.says .ellie { flex: none; }
.bubble {
  position: relative; flex: 1; min-width: 0;
  background: var(--surface); border-radius: 22px 22px 22px 6px;
  padding: 14px 16px; margin: 0 0 16px;
  font-size: 1.04rem; box-shadow: var(--lift-1);
}
.ellie { display: block; }

/* sticker: the brand motif (sticker charts are what moms know) */
.sticker {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; background: var(--surface); box-shadow: var(--sticker);
}
.tilt-l { transform: rotate(-6deg); }
.tilt-r { transform: rotate(5deg); }

/* ── hero ────────────────────────────────────── */
.hero { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.hero-stage {
  position: relative; border-radius: var(--r-xl); background: var(--violet);
  padding: 28px 20px 0; overflow: hidden; display: flex; justify-content: center;
  min-height: 230px;
}
.hero-stage::before {
  content: ''; position: absolute; inset: auto -20% -55% -20%; height: 75%;
  background: var(--violet-deep); border-radius: 50%;
}
.hero-stage .ellie { position: relative; z-index: 1; filter: drop-shadow(0 10px 18px rgba(20, 8, 70, .35)); align-self: flex-end; }
.hero-stage .sticker { position: absolute; z-index: 2; font-size: 1.5rem; width: 54px; height: 54px; }
.hero-stage .s1 { left: 16px; top: 22px; }
.hero-stage .s2 { right: 18px; top: 40px; }
.hero-stage .s3 { left: 30px; bottom: 30px; width: 46px; height: 46px; font-size: 1.25rem; }
.hero-stage .s4 { right: 34px; bottom: 26px; width: 44px; height: 44px; }
.hero-title { font-size: clamp(2.5rem, 12vw, 3.4rem); margin: 0; line-height: 1; text-wrap: balance; letter-spacing: -.035em; }
.hero-sub { font-size: 1.1rem; color: var(--ink-2); margin: 0; }
.hero .btn { margin-top: 4px; }
.hero .fine { text-align: center; margin: -4px 0 0; }
.proof { display: flex; gap: 10px; flex-wrap: wrap; }
.proof span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--lift-1); }
.proof .ico { color: var(--mint); }

/* ── quiz ────────────────────────────────────── */
.quiz-progress { display: flex; align-items: center; gap: 12px; }
.qp-bar { flex: 1; height: 8px; background: var(--violet-soft); border-radius: 99px; overflow: hidden; }
.qp-bar span { display: block; height: 100%; background: var(--violet); border-radius: 99px; transition: width .35s ease; }
.qp-label { font-size: .88rem; font-weight: 600; color: var(--ink-3); flex: none; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  appearance: none; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 0; box-shadow: var(--lift-1);
  font: 600 1.04rem/1.3 var(--body); color: var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.choice:hover { box-shadow: var(--lift-2); }
.choice:active { transform: scale(.985); }
.choice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--violet-soft); display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.choice-dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--line) inset; flex: none; transition: .15s; }
.choice.is-on { box-shadow: 0 0 0 2px var(--violet), var(--lift-1); }
.choice.is-on .choice-dot { box-shadow: 0 0 0 7px var(--violet) inset; }
.choice-tall { padding: 18px; font-weight: 500; font-size: 1.06rem; }
.scene { background: var(--sun-soft); box-shadow: none; }
.scene-label { font: 700 .82rem var(--body); color: #8A6410; margin-bottom: 6px; }
.scene-text { font-size: 1.05rem; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-weight: 700; font-size: .95rem; }
.field input:not([type=radio]) {
  width: 100%; min-height: 54px; padding: 14px 16px; font: inherit; color: var(--ink);
  border: 0; border-radius: var(--r-sm); background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--line) inset;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: none; box-shadow: 0 0 0 2px var(--violet) inset, 0 0 0 5px rgba(107,78,230,.15); background: #fff; }
.field input[aria-invalid=true] { box-shadow: 0 0 0 2px var(--danger) inset; }
.field-error { color: var(--danger); font-size: .9rem; font-weight: 700; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--violet); }

/* ── first win ───────────────────────────────── */
.win-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.win-head h2 { font-size: 1.7rem; margin: 0; }
.win-plus {
  display: inline-flex; align-items: center; gap: 6px;
  font: 800 1.4rem var(--display); color: var(--ink);
  background: var(--sun); padding: 8px 18px; border-radius: 999px;
  box-shadow: var(--sticker); transform: rotate(-4deg);
  animation: pop .55s cubic-bezier(.3,1.6,.5,1);
}
@keyframes pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.tip { display: flex; flex-direction: column; gap: 14px; }
.swap { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-md); }
.swap p { margin: 0; font-weight: 700; font-size: 1.05rem; }
.swap-tag { font: 700 .8rem var(--body); }
.swap-no { background: var(--blush-soft); }
.swap-no .swap-tag { color: var(--danger); }
.swap-no p { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(194,59,110,.45); text-decoration-thickness: 2px; }
.swap-yes { background: var(--mint-soft); }
.swap-yes .swap-tag { color: #0E7A5C; }
.try-today { background: var(--violet-soft); border-radius: var(--r-md); padding: 16px; }
.try-today h3 { color: var(--violet-deep); margin-bottom: 4px; }

/* ── thank-you + offer ───────────────────────── */
.thanks-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.thanks-hero .sticker { width: 132px; height: 132px; background: var(--violet-soft); overflow: hidden; }
.thanks-hero .sticker .ellie { transform: translateY(10px); }
.thanks-hero h1 { text-wrap: balance; margin: 6px 0 0; }
.thanks-hero p { color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.star-pill {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: var(--surface); border-radius: 999px;
  padding: 5px 12px 5px 8px; font: 800 1rem var(--display); white-space: nowrap;
  box-shadow: var(--lift-1);
}
.preview-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.preview-head > div { min-width: 0; }
.preview-head p { margin: 0; color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.preview-head h2 { margin: 0; }
.sticker.mission-sticker { width: 58px; height: 58px; font-size: 1.8rem; background: var(--sun-soft); }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
  content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--violet-soft); color: var(--violet-deep); font: 800 .95rem/28px var(--display); text-align: center;
}
.say-line { font: 600 1.1rem/1.4 var(--display); letter-spacing: -.01em; color: var(--violet-deep); background: var(--violet-soft); border-radius: var(--r-md); padding: 14px 16px; margin: 0; }

.offer {
  background: var(--ink); color: #fff; border-radius: var(--r-xl);
  padding: 28px 20px 22px; display: flex; flex-direction: column; gap: 16px;
}
.offer a { color: #fff; }
.offer-title { font-size: clamp(2.1rem, 10vw, 2.7rem); font-weight: 800; color: var(--sun); margin: 0; letter-spacing: -.035em; line-height: 1; }
.offer-lede { font-size: 1.14rem; font-weight: 700; margin: 0; }
.offer > p { color: rgba(255,255,255,.82); margin: 0; }
.sticker-sheet {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
  background: rgba(255,255,255,.06); border-radius: var(--r-md); padding: 14px 12px;
}
.ss-dot {
  aspect-ratio: 1; border-radius: 50%; min-width: 0;
  display: grid; place-items: center; font: 700 .78rem var(--display);
  color: rgba(255,255,255,.55); box-shadow: 0 0 0 1.5px rgba(255,255,255,.22) inset;
}
.ss-dot.is-open { background: var(--sun); color: var(--ink); box-shadow: 0 0 0 3px #fff; font-size: 1.05rem; transform: rotate(-8deg); }
.sheet-caption { font-size: .85rem; color: rgba(255,255,255,.6); text-align: center; margin: -8px 0 0; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .tick { width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.price-box { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.price { font-family: var(--display); margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.price span { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.price small { font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.price-box .btn { margin-top: 12px; }
.price-box .fine { margin: 0; }
.faq { border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 600 1.3rem/1 var(--display); color: var(--sun); flex: none; }
.faq[open] summary::after { content: '–'; }
.faq p { margin-top: 8px; color: rgba(255,255,255,.78); }

/* ── demo bar & toast ────────────────────────── */
.demo-bar { font-size: .82rem; color: var(--ink-2); background: var(--surface); padding: 8px 14px; border-radius: 999px; text-align: center; box-shadow: 0 0 0 1.5px dashed var(--line) inset; border: 1.5px dashed #CFC3F2; }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; transition: .25s; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ── welcome: treasure chest ─────────────────── */
.chest-stage { min-height: 64vh; display: grid; place-items: center; align-content: center; gap: 20px; transition: min-height .5s; text-align: center; }
.chest-stage h1 { margin: 0 0 6px; }
.chest-copy { margin-bottom: 18px; }
.win-plus .ico path { fill: #fff; stroke: #fff; }
.chest-stage p { margin: 0; color: var(--ink-2); }
.chest-stage.is-done { min-height: 0; }
.chest-stage.is-done .chest { transform: scale(.5); margin: -36px 0; }
.chest-stage.is-done .chest-copy { display: none; }
.chest { position: relative; width: 176px; height: 146px; border: 0; background: none; cursor: pointer; transition: transform .5s; }
.chest-base { position: absolute; left: 0; right: 0; bottom: 0; height: 86px; background: var(--violet); border-radius: 12px 12px 22px 22px; box-shadow: 0 0 0 5px #fff, 0 14px 28px rgba(75,47,194,.3); }
.chest-base::before { content: ''; position: absolute; left: 0; right: 0; top: 20px; height: 12px; background: var(--sun); }
.chest-lock { position: absolute; left: 50%; top: 8px; width: 30px; height: 34px; margin-left: -15px; background: var(--sun); border-radius: 8px; box-shadow: 0 0 0 4px #fff; }
.chest-lid { position: absolute; left: 0; right: 0; top: 0; height: 66px; background: var(--violet-deep); box-shadow: 0 0 0 5px #fff; border-radius: 70px 70px 10px 10px; transform-origin: 12% 100%; transition: transform .6s cubic-bezier(.3,1.5,.5,1); z-index: 2; }
.chest-glow { position: absolute; left: 30px; right: 30px; top: 30px; height: 50px; background: radial-gradient(closest-side, #FFF1B8, transparent); opacity: 0; transition: opacity .4s, transform .5s; }
.chest:not(.is-open) { animation: shake 2.4s ease-in-out infinite; }
.chest.is-open .chest-lid { transform: translateY(-30px) rotate(-22deg); }
.chest.is-open .chest-glow { opacity: 1; transform: scale(2.6); }
.chest-hint { font: 700 1rem var(--body); color: var(--violet-deep); margin: 0; }
@keyframes shake { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-4deg); } 88% { transform: rotate(4deg); } 92% { transform: rotate(-3deg); } }
.welcome-body { display: flex; flex-direction: column; gap: 16px; }
.welcome-body h1 { text-align: center; text-wrap: balance; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; min-width: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 13px 6px; border-radius: var(--r-sm); background: var(--bg); box-shadow: 0 0 0 1.5px var(--line) inset; font: 700 1.1rem var(--display); cursor: pointer; transition: .12s; }
.seg input:checked + span { background: var(--violet); color: #fff; box-shadow: none; }
.seg input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }

/* ── app ─────────────────────────────────────── */
.app-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-head h1 { margin: 0; }
.app-head > div { min-width: 0; }
.app-hello { margin: 0; color: var(--ink-3); font-weight: 600; }
.today { display: flex; flex-direction: column; gap: 14px; box-shadow: var(--lift-2); }
.today-kicker { margin: 0; font: 700 .9rem var(--body); color: var(--violet); }
.today h2 { margin: 0; font-size: 1.35rem; }
.today-row { display: flex; gap: 16px; align-items: center; }
.today-row > div { min-width: 0; }
.today-row p { margin: 4px 0 0; color: var(--ink-2); font-size: .98rem; }
.today .sticker { width: 66px; height: 66px; font-size: 2.1rem; background: var(--sun-soft); }
.today.is-paused { background: var(--blush-soft); box-shadow: none; }
.today.is-done { background: var(--mint-soft); box-shadow: none; }
.today.is-done h2 { display: flex; align-items: center; gap: 8px; }
.today.is-done .ico { color: var(--mint); }

/* the island map: the one bold element */
.map-wrap { margin: 0; }
.map-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 4px 4px 10px; }
.map-title h2 { margin: 0; }
.map-title span { color: var(--ink-3); font-weight: 600; font-size: .9rem; flex: none; }
.map {
  position: relative; width: 100%; aspect-ratio: 3 / 4;
  background: var(--violet); border-radius: var(--r-xl); overflow: hidden;
}
.map::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.22) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
}
.map-art { position: absolute; inset: 6% 5% 3%; width: 90%; height: 91%; }
.sand { fill: #FFE3A3; }
.grass { fill: #BDEBD3; }
.trail { fill: none; stroke: #fff; stroke-width: 3.5; stroke-dasharray: 1 9; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.map-layer { position: absolute; inset: 6% 5% 3%; }
.region-label {
  position: absolute; transform: translate(-50%, -50%);
  font: 700 .74rem var(--body); color: var(--ink);
  background: rgba(255,255,255,.88); padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  pointer-events: none;
}
.map-layer .stone {
  position: absolute; width: 14.5%; aspect-ratio: 1; margin: 0; padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  font: 800 clamp(.85rem, 3.6vw, 1.05rem) var(--display);
  background: #fff; color: var(--ink-3);
  box-shadow: 0 4px 0 rgba(36,22,74,.18);
  transition: transform .15s;
}
.stone-face { font-size: 1.25em; line-height: 1; }
.stone.is-locked { background: rgba(255,255,255,.78); color: #4E7D69; cursor: default; box-shadow: none; }
.stone.is-locked .stone-face { font-size: 1em; }
.stone.is-today { background: var(--sun); color: var(--ink); box-shadow: 0 0 0 4px #fff, 0 8px 16px rgba(36,22,74,.3); animation: glow 2s ease-in-out infinite; }
.stone.is-done { background: #fff; box-shadow: 0 0 0 3px #fff, 0 6px 12px rgba(36,22,74,.22); transform: translate(-50%, -50%) rotate(-7deg); }
.stone.is-done:nth-child(even) { transform: translate(-50%, -50%) rotate(6deg); }
.stone-check { position: absolute; right: -5px; top: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px #fff, 0 0 0 12px rgba(255,201,77,.35), 0 8px 16px rgba(36,22,74,.3); } }
.wiggle { animation: wiggle .4s; }
@keyframes wiggle { 25% { margin-left: -4px; } 75% { margin-left: 4px; } }

/* floating tab bar */
.tabbar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; gap: 4px; padding: 6px;
  width: min(280px, calc(100% - 32px));
  background: rgba(36, 22, 74, .92); border-radius: 999px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(36,22,74,.28);
}
.tab { flex: 1; min-width: 0; text-decoration: none; color: rgba(255,255,255,.7); font: 700 .92rem var(--body); padding: 10px 12px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab.is-on { color: var(--ink); background: #fff; }

/* mission */
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 0; padding: 8px 14px 8px 10px; border-radius: 999px; font: 600 .92rem var(--body); color: var(--ink); cursor: pointer; text-decoration: none; box-shadow: var(--lift-1); }
.mission-head { position: relative; text-align: center; padding: 26px 18px 22px; border-radius: var(--r-xl); background: var(--sun-soft); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mission-head.region-bubble { background: var(--sky-soft); }
.mission-head.region-forest { background: var(--mint-soft); }
.mission-head.region-castle { background: var(--blush-soft); }
.mission-head .sticker { width: 84px; height: 84px; font-size: 2.6rem; margin-bottom: 10px; }
.mission-day { margin: 0; font: 700 .9rem var(--body); color: var(--ink-2); }
.mission-head h1 { margin: 2px 0 4px; }
.mission-goal { margin: 0; color: var(--ink-2); max-width: 32ch; }
.easier summary { cursor: pointer; font: 700 1.1rem var(--display); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.easier summary::-webkit-details-marker { display: none; }
.easier summary::after { content: '+'; width: 28px; height: 28px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-deep); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.easier[open] summary::after { content: '–'; }
.easier p { margin-top: 12px; }
.calm-rule { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--ink-2); margin: 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--blush-soft); }
.calm-rule .ico { color: var(--danger); margin-top: 2px; }
.done-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: #0E7A5C; background: var(--mint-soft); padding: 14px; border-radius: var(--r-md); margin: 0; }

/* check-in */
fieldset.card { margin: 0; border: 0; }
fieldset.card legend { font: 700 1.12rem var(--display); letter-spacing: -.01em; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
fieldset.card legend + * { clear: both; }
.ladder, .moods { display: flex; flex-direction: column; gap: 8px; }
.rung, .mood {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 10px 14px 10px 10px; border-radius: var(--r-md); background: var(--bg);
  transition: .12s;
}
.rung-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.rung input, .mood input { position: absolute; opacity: 0; pointer-events: none; }
.rung-icon { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.rung .choice-dot { background: #fff; }
.rung:has(input:checked), .mood:has(input:checked) { background: var(--violet-soft); box-shadow: 0 0 0 2px var(--violet) inset; }
.rung:has(input:checked) .choice-dot { box-shadow: 0 0 0 7px var(--violet) inset; }
.rung:has(input:focus-visible), .mood:has(input:focus-visible) { outline: 3px solid var(--violet); outline-offset: 2px; }
.ladder-steps { display: flex; gap: 4px; margin: 2px 0 0; }
.seg-wide span { padding: 14px; }

/* result */
.result { display: flex; flex-direction: column; gap: 16px; }
.result > .win-plus { align-self: center; font-size: 1.9rem; margin-top: 8px; }
.badge-new { background: var(--sun-soft); box-shadow: none; }
.badge-row { display: flex; gap: 14px; align-items: center; }
.badge-row + .badge-row { margin-top: 12px; }
.badge-row > div { min-width: 0; }
.badge-row p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.badge-medal { font-size: 1.6rem; width: 54px; height: 54px; }
.safety .card { background: var(--blush-soft); box-shadow: none; }

/* journey */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 14px 6px; text-align: center; min-width: 0; box-shadow: var(--lift-1); }
.stat-n { display: block; font: 800 1.9rem/1 var(--display); letter-spacing: -.03em; }
.stat-n small { font-size: .9rem; color: var(--ink-3); font-weight: 700; }
.stat-l { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.ladder-chart { display: flex; gap: 8px; height: 170px; margin-bottom: 4px; }
.lc-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .7rem; font-weight: 600; color: var(--ink-3); padding-bottom: 18px; flex: none; width: 54px; line-height: 1.1; }
.lc-bars { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; align-items: end; padding-left: 4px; background: repeating-linear-gradient(to bottom, transparent 0 calc(50% - 10px), var(--line) calc(50% - 10px) calc(50% - 9px)); }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 14px; border-radius: 99px; background: var(--violet); }
.bar.is-empty { background: var(--violet-soft); }
.bar.lvl-0 { background: var(--blush); }
.bar.lvl-1, .bar.lvl-2 { background: #A996F5; }
.bar.lvl-4 { background: var(--sun); }
.bar-x { font-size: .62rem; font-weight: 600; color: var(--ink-3); height: 18px; line-height: 18px; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 10px 14px; border-radius: var(--r-md); background: var(--bg); min-width: 0; }
.badge .sticker { width: 56px; height: 56px; font-size: 1.6rem; margin-bottom: 4px; }
.badge:not(.is-earned) .sticker { background: transparent; box-shadow: 0 0 0 2px dashed var(--line); border: 2px dashed #D5CBF0; color: var(--ink-3); }
.badge:not(.is-earned) strong { color: var(--ink-3); }
.badge.is-earned { background: var(--sun-soft); }
.badge.is-earned:nth-child(odd) .sticker { transform: rotate(-6deg); }
.badge.is-earned:nth-child(even) .sticker { transform: rotate(5deg); }
.badge strong { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; line-height: 1.15; }
.badge small { font-size: .78rem; color: var(--ink-2); line-height: 1.3; }

/* footer */
.site-foot { max-width: 480px; margin: 0 auto; padding: 8px var(--gutter) 24px; font-size: .8rem; color: var(--ink-3); text-align: center; }
.page .site-foot { padding: 12px 0 0; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 8px; }
.site-foot a { color: var(--ink-2); }

@media (hover: none) { .choice:hover { box-shadow: var(--lift-1); } .btn:hover { background: var(--violet); } .btn-sun:hover { background: var(--sun); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* login */
.sent { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 22px; }
.sent h1 { margin: 6px 0 0; }
.sent p { margin: 0; color: var(--ink-2); }
.sent .btn { margin-top: 6px; }
.sent-sticker { width: 76px; height: 76px; background: var(--sun-soft); color: var(--ink); }
.btn:disabled { opacity: .6; cursor: default; }
.btn[href] { text-decoration: none; }
