/* Dont Panic on the web. Same paper, ink and amber as the iPad app (Look in Crew.swift).
   Sizes: body 19px, tap targets at least 48px, one 760px reading column (the quest board widens on laptops). */
@font-face { font-family: "Nunito"; src: url("fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
:root {
  --paper: #F6EFE3; --card: #FCF8F0; --ink: #2A1810; --soft: #604A3C; --line: #DCCDB9;
  --amber: #E58A2E; --button: #D4741A; --amber-deep: #A9570C; --night: #0E1B1F; --glow: #B8F28B; --letter: #FAEEDA; --mine: #F3DFC2;
  --round: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --shadow: 0 10px 26px rgba(42, 24, 16, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 500 19px/1.5 var(--round); min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
img { display: block; max-width: 100%; }
p { margin: 0 0 12px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 20px 140px; }

/* ---------- Top bar ---------- */
.bar { display: flex; align-items: center; gap: 12px; padding: 4px 0 18px; min-height: 68px; }
.brand { font-weight: 900; font-size: 22px; line-height: 1.1; letter-spacing: -.01em; }
.brand small { display: block; font-weight: 700; font-size: 13px; color: var(--amber-deep); letter-spacing: 0; }
.bar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px;
  border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 800; font-size: 16px; white-space: nowrap;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
@media (hover: hover) { .pill:hover { border-color: var(--amber); } }
.pill:active { transform: scale(.96); }
.pill[aria-pressed="false"] { color: var(--soft); }
.pill.sky { background: var(--night); color: #fff; border-color: var(--night); }
@media (hover: hover) { .pill.sky:hover { border-color: var(--glow); } }
.back { display: inline-grid; place-items: center; text-decoration: none; color: inherit; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--card); border: 2px solid var(--line); font-size: 26px; font-weight: 900; line-height: 1; padding-bottom: 3px; }
.back { font-size: 0; padding: 0; }
.back::before { content: ""; width: 11px; height: 11px; border-left: 3.5px solid var(--ink); border-bottom: 3.5px solid var(--ink); border-radius: 2px; transform: translateX(2px) rotate(45deg); }
@media (hover: hover) { .back:hover { border-color: var(--amber); } }

/* ---------- Type ---------- */
h1 { font-weight: 900; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -.02em; margin: 6px 0 14px; text-wrap: balance; }
h2 { font-weight: 900; font-size: 23px; line-height: 1.2; margin: 34px 0 14px; }
h2 small { font-weight: 700; font-size: 15px; color: var(--amber-deep); }
.sub { color: var(--soft); margin: 0 0 22px; }
.hint { color: var(--soft); font-size: 16px; margin-top: 16px; }
.foot { color: var(--soft); font-size: 15px; margin-top: 40px; line-height: 1.7; }
.link { color: var(--amber-deep); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.small { color: var(--soft); font-size: 15px; text-align: center; }

/* ---------- Big buttons ---------- */
.go {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; padding: 12px 32px;
  background: var(--button); color: #fff; font-weight: 900; font-size: 21px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 6px 0 var(--amber-deep); transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
@media (hover: hover) { .go:hover { filter: brightness(1.06); } }
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--amber-deep); }
.go.quiet { background: var(--card); color: var(--ink); box-shadow: 0 6px 0 var(--line); border: 2px solid var(--line); }
.go.quiet:active { box-shadow: 0 2px 0 var(--line); }

/* ---------- Home ---------- */
.hello { display: block; width: 100%; text-align: center; padding: 6px 0 2px; margin-bottom: 4px; }
.crewrow { display: flex; justify-content: center; gap: clamp(2px, 1.4vw, 12px); }
.crewrow img { width: clamp(30px, 9.4vw, 64px); height: clamp(30px, 9.4vw, 64px); object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
@media (hover: hover) { .hello:hover .crewrow img { animation-duration: 1.1s; } }
.hi { color: var(--soft); font-weight: 700; font-size: 17px; margin-top: 10px; text-wrap: balance; }
.hello + h1 { text-align: center; margin-top: 18px; }
.ask { display: flex; gap: 10px; align-items: center; }
.idea, .field {
  flex: 1; min-width: 0; background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 14px 20px; min-height: 58px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.idea::placeholder, .field::placeholder { color: #9A8778; }
.idea:focus, .field:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(229, 138, 46, .18); }
.ask.big .idea { min-height: 64px; font-size: 20px; box-shadow: var(--shadow); }
.send { width: 58px; height: 58px; flex: none; border-radius: 50%; background: var(--button); color: #fff; font-size: 26px; font-weight: 900; line-height: 1; box-shadow: 0 5px 0 var(--amber-deep); transition: transform .08s ease, box-shadow .08s ease; }
.send:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--amber-deep); }
.ask.big .send { width: 64px; height: 64px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; align-items: center; justify-content: center; }
.try { font-size: 15px; font-weight: 800; color: var(--soft); margin-right: 2px; }
.chip { min-height: 46px; padding: 8px 16px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 16px; transition: transform .08s ease, border-color .15s ease, background .15s ease; }
@media (hover: hover) { .chip:hover { border-color: var(--amber); background: #fff; } }
.chip:active { transform: scale(.96); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.how div { background: var(--card); border-radius: 22px; padding: 16px 14px; text-align: center; font-weight: 800; font-size: 16px; line-height: 1.3; }
.how b { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 8px; border-radius: 50%; background: var(--button); color: #fff; font-weight: 900; }
@media (max-width: 560px) { .how { grid-template-columns: 1fr; } .how div { display: flex; align-items: center; gap: 12px; text-align: left; } .how b { margin: 0; flex: none; } }
.qlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qcard { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 12px 16px 12px 12px; min-height: 84px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
@media (hover: hover) { .qcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--amber); } }
.qface, .qpic { width: 60px; height: 60px; flex: none; object-fit: contain; }
.qpic { object-fit: cover; border-radius: 14px; }
.qtext { min-width: 0; flex: 1; }
.qcard .for, .cover .for { font-size: 13px; font-weight: 800; color: var(--amber-deep); letter-spacing: .04em; text-transform: uppercase; }
.qcard .name { font-weight: 900; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pips { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.pips i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--amber); }
.pips .star { margin-left: 4px; font-size: 16px; line-height: 1; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.cover { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 10px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
@media (hover: hover) { .cover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--amber); } }
.cover img { border-radius: 16px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.cover .for { margin: 10px 4px 0; text-transform: none; letter-spacing: 0; }
.cover .name { font-weight: 900; font-size: 18px; line-height: 1.2; margin: 2px 4px 6px; }
.cover .done { float: right; font-size: 18px; }
.tile { aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; overflow: hidden; background: #EADFCB; }
.tile span { font-weight: 900; font-size: 64px; color: rgba(255, 255, 255, .92); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.k-make { background: #E4683A; } .k-art { background: #D8559B; } .k-invent { background: #2CA7B8; } .k-wonder { background: #C98A2E; }
.k-event { background: #8E5BD6; } .k-experiment { background: #4FA36B; } .k-game { background: #3E6FD8; } .k-homework { background: #D9473B; } .k-cheer { background: #8A7A62; }

/* ---------- Covers and the huddle ---------- */
.hero { border-radius: 28px; overflow: hidden; background: var(--night); margin: 4px 0 20px; box-shadow: var(--shadow); }
.hero img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.crewlist { display: grid; gap: 12px; }
.mate { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 18px; padding: 10px 14px; }
.mate b { font-weight: 900; }
.job { color: var(--soft); font-size: 16px; }
.plan { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; font-weight: 800; }
.plan li { counter-increment: step; display: flex; align-items: center; gap: 12px; }
.plan li::before { content: counter(step); width: 34px; height: 34px; flex: none; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; font-size: 16px; }

/* ---------- Chat ---------- */
.beat { display: flex; gap: 12px; margin: 14px 0; align-items: flex-start; animation: rise .32s cubic-bezier(.2, .8, .3, 1) both; }
.face { width: 54px; height: 54px; flex: none; object-fit: contain; }
.bubble { background: var(--card); border-radius: 8px 24px 24px 24px; padding: 12px 18px 14px; max-width: min(100%, 560px); border: 2px solid transparent; }
.bubble .who { font-size: 14px; font-weight: 900; margin-bottom: 2px; letter-spacing: .01em; }
.bubble.talking { border-color: var(--line); box-shadow: 0 6px 18px rgba(42, 24, 16, .08); background: #fff; }
.bubble.thinking { display: flex; gap: 6px; align-items: center; padding: 18px 20px; }
.bubble.thinking i { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); opacity: .35; animation: think 1s ease-in-out infinite; }
.bubble.thinking i:nth-child(2) { animation-delay: .15s; } .bubble.thinking i:nth-child(3) { animation-delay: .3s; }
.beat.me { justify-content: flex-end; }
.beat.me .bubble { background: var(--mine); border-radius: 24px 24px 8px 24px; font-weight: 800; }
.scene { border-radius: 24px; overflow: hidden; margin: 16px 0 6px; box-shadow: var(--shadow); animation: rise .5s ease both; }
.scene img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mine { border-radius: 14px; max-width: 240px; margin-bottom: 6px; }
.mine.big { max-width: min(100%, 420px); margin: 14px auto; }

.choices { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px 66px; }
.choice {
  text-align: left; min-height: 54px; padding: 12px 18px; background: #fff; border: 2px solid var(--amber); border-radius: 18px;
  font-weight: 800; font-size: 18px; line-height: 1.25; box-shadow: 0 3px 0 rgba(229, 138, 46, .35);
  transition: background .12s ease, transform .08s ease, box-shadow .08s ease; animation: rise .3s cubic-bezier(.2, .8, .3, 1) both;
}
@media (hover: hover) { .choice:hover { background: #FFF4E6; } }
.choice:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(229, 138, 46, .35); }
.choice.other { border-style: dashed; border-color: var(--line); color: var(--soft); font-weight: 700; box-shadow: none; background: transparent; }

/* Letters from a person */
.letter { background: var(--letter); border-radius: 20px; padding: 18px 22px 16px; margin: 18px 0 18px 8px; font: 400 20px/1.55 var(--serif); position: relative; transform: rotate(-.4deg); box-shadow: var(--shadow); animation: rise .5s ease both; }
.letter .from { font: 900 13px/1 var(--round); letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); margin-bottom: 8px; }
.letter.big { font-size: 22px; padding: 26px 26px 22px; transform: rotate(-.6deg); margin-left: 0; }
.letter .sign { margin-top: 12px; font-style: italic; color: var(--soft); }

.chapter { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 14px; }
.chapter .n, .stephead .n, .sheet .k, .chapterbox .n { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); white-space: nowrap; }
.chapter .t { font-weight: 900; font-size: 24px; line-height: 1.15; }
.dots { display: flex; gap: 6px; margin: 0 0 6px; }
.dots i { height: 6px; flex: 1; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--amber); }

/* ---------- Bottom bar ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 28px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 70%, rgba(246, 239, 227, 0)); display: flex; justify-content: center; pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock .go { min-width: min(100%, 320px); }
.dock.tall { flex-direction: column; gap: 10px; align-items: stretch; }
.dock.tall > * { width: 100%; max-width: 720px; margin: 0 auto; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.done-step { background: var(--button); color: #fff; border-color: var(--amber-deep); }
@media (hover: hover) { .done-step:hover { border-color: var(--amber-deep); filter: brightness(1.06); } }
.done-step.pulse { animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Quest board ---------- */
.qtitle { font-size: clamp(22px, 5vw, 30px); margin-bottom: 12px; }
.steps { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 8px; max-width: 250px; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 800; font-size: 15px; text-align: left; line-height: 1.2; }
.step:disabled { opacity: .55; cursor: default; }
.step.is-now { border-color: var(--amber); background: #fff; box-shadow: 0 0 0 4px rgba(229, 138, 46, .16); }
.step.is-done { color: var(--soft); }
.mini { width: 30px; height: 30px; object-fit: contain; flex: none; }
.stephead { display: flex; gap: 12px; align-items: center; margin: 8px 0 4px; }
.stephead .t { font-weight: 900; font-size: 23px; line-height: 1.15; }
.log { padding-bottom: 170px; }
.log > * { scroll-margin: 96px 0 200px; }

@media (min-width: 980px) {
  .wrap.board { max-width: 1080px; display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 36px; align-items: start; }
  .board > .bar, .board > .qtitle { grid-column: 1 / -1; }
  .board > .steps { grid-column: 1; grid-row: 3 / span 3; flex-direction: column; overflow: visible; position: sticky; top: 16px; padding: 0; margin: 0; }
  .board > .steps .step { max-width: none; width: 100%; border-radius: 20px; min-height: 60px; padding: 10px 14px; font-size: 16px; }
  .board > .stephead, .board > .log { grid-column: 2; }
  .board > .dock { grid-column: 2; position: sticky; bottom: 0; padding: 26px 0 16px; margin-top: -150px; }
  .board .choices.grid { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ---------- Finish ---------- */
.mission { background: var(--night); color: #fff; border-radius: 28px; padding: 28px 24px; margin: 26px 0; text-align: center; animation: rise .6s ease both; box-shadow: var(--shadow); }
.mission .k { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--glow); }
.mission .m { font-weight: 900; font-size: clamp(24px, 5.5vw, 32px); line-height: 1.2; margin: 10px 0 12px; text-wrap: balance; }
.mission p { color: #C9D6D2; margin: 0; }
.heart { font-size: 46px; text-align: center; margin: 22px 0 6px; animation: beat 1.6s ease-in-out infinite; }
.toast { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 10px 20px 10px 10px; box-shadow: 0 14px 34px rgba(42, 24, 16, .2); font-size: 15px; line-height: 1.3; width: max-content; max-width: calc(100vw - 32px); animation: drop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.toast b { font-size: 17px; font-weight: 900; }
.medal { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 21px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 3s ease-in forwards; }

/* ---------- My Sky ---------- */
.skycanvas { width: 100%; height: clamp(240px, 56vw, 420px); border-radius: 28px; display: block; cursor: pointer; box-shadow: var(--shadow); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.badge { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 6px; justify-items: start; }
.badge b { font-weight: 900; line-height: 1.2; }
.badge small { color: var(--soft); font-size: 14px; line-height: 1.35; }
.made { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px 18px; min-height: 56px; transition: border-color .15s ease; }
@media (hover: hover) { .row:hover { border-color: var(--amber); } }
.row b { font-weight: 900; }
.row small { color: var(--soft); margin-left: auto; font-size: 14px; white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.over { position: fixed; inset: 0; z-index: 40; background: rgba(14, 27, 31, .6); display: grid; place-items: center; padding: 16px; overflow: auto; animation: fade .2s ease both; }
.over.night { background: var(--night); color: #fff; }
.sheet { background: var(--paper); border-radius: 28px; padding: 24px; width: min(100%, 520px); max-height: calc(100dvh - 32px); overflow: auto; animation: rise .3s cubic-bezier(.2, .8, .3, 1) both; }
.sheet.wide { width: min(100%, 760px); }
.sheet h2 { margin: 6px 0 12px; }
.sheet .tools { margin-top: 16px; }
.gold { color: #9A6B00; font-weight: 900; }
.show { text-align: center; display: grid; gap: 16px; justify-items: center; }
.show h2 { margin: 0; }
.show .pill { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.hand { position: relative; width: 160px; height: 160px; border-radius: 50%; font-size: 80px; border: 3px dashed rgba(255, 255, 255, .5); touch-action: none; user-select: none; -webkit-user-select: none; animation: breathe 2.4s ease-in-out infinite; }
.hand.gold { border-color: #E5B13A; border-style: solid; background: rgba(229, 177, 58, .25); animation: none; }
.ring { position: absolute; inset: -3px; border-radius: 50%; background: rgba(229, 177, 58, .35); transform: scale(0); transition: transform .05s linear; pointer-events: none; }

/* ---------- Drawing pad ---------- */
.pad { width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; border: 2px solid var(--line); background: #FFFDF8; touch-action: none; margin: 8px 0 12px; cursor: crosshair; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); transition: transform .1s ease; }
.swatch.on { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--amber); transform: scale(1.05); }

/* ---------- Quest Maker ---------- */
.field { width: 100%; margin: 6px 0; font-size: 17px; min-height: 50px; padding: 10px 16px; border-radius: 16px; }
textarea.field { resize: vertical; line-height: 1.4; }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.chapterbox { background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 16px 18px; margin: 14px 0; }
.beatrow { display: grid; grid-template-columns: minmax(120px, 180px) 1fr 44px; gap: 8px; align-items: start; }
.qblock { border-left: 4px solid var(--amber); padding-left: 12px; margin: 10px 0; }
.choicerow { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; margin-left: 24px; }
.x { width: 44px; height: 50px; margin-top: 6px; border-radius: 14px; color: var(--soft); font-weight: 900; }
@media (hover: hover) { .x:hover { background: #fff; color: #B3261E; } }
.warn { color: #B3261E; font-weight: 800; min-height: 1.5em; margin-top: 10px; }

/* ---------- Joy: sparkles, banners, the party ---------- */
.toast.out { opacity: 0; transform: translate(-50%, -12px); transition: opacity .25s ease, transform .25s ease; }
.toast .medal { animation: medal .7s cubic-bezier(.2, 1.6, .4, 1) both .1s; }
.sparks { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.sparks i { position: absolute; width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%; animation: spark .7s cubic-bezier(.1, .7, .3, 1) forwards; }
.banner { position: fixed; left: 50%; top: 38%; z-index: 55; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--amber); border-radius: 999px; padding: 12px 28px 12px 14px; font-weight: 900; font-size: 26px; box-shadow: 0 18px 44px rgba(42, 24, 16, .25); pointer-events: none; animation: banner 1.5s cubic-bezier(.2, 1.4, .4, 1) both; white-space: nowrap; }
.banner img { width: 52px; height: 52px; object-fit: contain; animation: hop .5s ease-in-out 2; }
.over.party { background: rgba(14, 27, 31, .35); z-index: 45; }
.partycard { background: var(--card); border-radius: 32px; padding: 32px 30px 28px; width: min(100%, 460px); text-align: center; display: grid; gap: 14px; justify-items: center; box-shadow: 0 30px 70px rgba(14, 27, 31, .35); animation: pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.partycard .big { font-weight: 900; font-size: clamp(32px, 8vw, 42px); line-height: 1.05; letter-spacing: -.02em; }
.partycard p { margin: 0; }
.cheer { display: flex; gap: 8px; justify-content: center; }
.cheer img { width: clamp(38px, 11vw, 62px); height: clamp(38px, 11vw, 62px); object-fit: contain; animation: wiggle .35s ease-in-out 8 alternate; }
.bigstar { font-size: 84px; line-height: 1; animation: starpop .9s cubic-bezier(.2, 1.6, .4, 1) both .15s; filter: drop-shadow(0 8px 16px rgba(229, 177, 58, .5)); }
.nextcard { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin: 14px 0 6px; padding: 14px 16px; background: #EAF6E4; border: 2px solid #9FD08A; border-radius: 22px; animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; transition: transform .08s ease, background .15s ease; }
@media (hover: hover) { .nextcard:hover { background: #DFF2D6; } } .nextcard:active { transform: scale(.98); }
.nextcard img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.nextcard b { display: block; font-weight: 900; line-height: 1.2; } .nextcard small { color: var(--soft); font-size: 15px; }
.nextcard div { flex: 1; min-width: 0; }
.nextcard .arrow { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--button); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.chip.surprise { background: #FDEBD3; border-color: #F2C894; color: var(--amber-deep); font-weight: 800; }
.beat.speaking .face { animation: talk .45s ease-in-out infinite; }
.go, .send { position: relative; overflow: hidden; }
.go::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite; }
.go.quiet::after { display: none; }
.pips i.on, .dots i.on { animation: fill .5s ease both; transform-origin: left; }
.step.is-done .mini { animation: hop .5s ease 1; }
.badge .medal { transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); } @media (hover: hover) { .badge:hover .medal { transform: rotate(-10deg) scale(1.12); } }
.cover:active, .qcard:active { transform: scale(.98); }

/* The quest board's side list on a laptop: cards like the iPad app, with an arrow on the step she is on. */
@media (min-width: 980px) {
  .board > .steps .step { justify-content: flex-start; gap: 12px; }
  .board > .steps .step .mini { order: 3; margin-left: auto; }
  .board > .steps .step::before { content: ""; width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
  .board > .steps .step.is-done::before { content: "✓"; display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #fff; background: #5FAE4E; border-color: #5FAE4E; }
  .board > .steps .step.is-now::before { content: "→"; display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #fff; background: var(--button); border-color: var(--button); }
  .board > .steps .step.is-now { border-width: 2.5px; }
}
@keyframes spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 28%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(.96); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes wiggle { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes starpop { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes talk { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-3deg); } }
@keyframes medal { from { transform: scale(.3) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
@keyframes shine { 0%, 62% { left: -60%; } 86%, 100% { left: 130%; } }
@keyframes fill { from { transform: scaleX(.2); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -26px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes think { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 116, 26, .55); } 60% { box-shadow: 0 0 0 12px rgba(212, 116, 26, 0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Small screens ---------- */
@media (max-width: 430px) { .bar .lbl { display: none; } .bar .pill { min-width: 48px; padding: 8px 12px; font-size: 20px; } .brand { white-space: nowrap; } }
@media (max-width: 560px) {
  body { font-size: 18px; }
  .wrap { padding: 12px 16px 140px; }
  .face { width: 44px; height: 44px; }
  .choices { margin-left: 0; }
  .letter { font-size: 19px; margin-left: 0; }
  .chapter { flex-direction: column; gap: 2px; }
  .pill { padding: 8px 14px; font-size: 15px; }
  .beatrow { grid-template-columns: 1fr 44px; } .beatrow .who { grid-column: 1 / -1; }
  .choicerow { grid-template-columns: 1fr; margin-left: 0; }
  .row small { display: none; }
  .qlist { grid-template-columns: 1fr; }
}

/* ---------- The family ---------- */
.famrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fam { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 14px; background: var(--card); border: 2px solid var(--line); border-radius: 22px; text-align: center; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
@media (hover: hover) { .fam:hover { transform: translateY(-3px); border-color: var(--amber); box-shadow: var(--shadow); } }
.fam img { width: clamp(48px, 13vw, 84px); height: clamp(48px, 13vw, 84px); object-fit: contain; animation: bob 3s ease-in-out infinite; }
.fam:nth-child(2n) img { animation-delay: .4s; } .fam:nth-child(3n) img { animation-delay: .9s; }
.fam b { font-weight: 900; font-size: 16px; line-height: 1.15; }
.fam small { color: var(--soft); font-size: 12.5px; line-height: 1.2; }
.fam .flag { position: absolute; top: 6px; right: 8px; font-size: 20px; animation: hop 1.2s ease-in-out infinite; }
.famlist { display: grid; gap: 14px; }
.famcard { display: flex; gap: 18px; align-items: flex-start; background: var(--card); border: 2px solid var(--line); border-radius: 26px; padding: 18px; }
.famface { flex: none; width: 112px; height: 112px; border-radius: 26px; background: #fff; display: grid; place-items: center; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1); }
@media (hover: hover) { .famface:hover { transform: scale(1.06) rotate(-3deg); } }
.famface img { width: 96px; height: 96px; object-fit: contain; }
.famtext { flex: 1; min-width: 0; }
.famname { font-weight: 900; font-size: 26px; line-height: 1.1; }
.famfrom { font-size: 16px; margin-top: 2px; } .famfrom b { font-weight: 900; }
.famtag { color: var(--soft); font-size: 15px; line-height: 1.35; margin-top: 2px; }
.famloves { margin: 10px 0 12px; font-size: 17px; }
.pill.on { background: #EAF6E4; border-color: #9FD08A; }
.pill.mailbox.has { background: #FDEBD3; border-color: var(--amber); animation: pulse 1.8s ease-in-out infinite; }
.boxhead { display: flex; gap: 16px; align-items: center; margin: 4px 0 8px; }
.boxhead img { width: 92px; height: 92px; object-fit: contain; flex: none; }
.boxhead h1 { margin: 0 0 4px; } .boxhead .sub { margin: 0; }
.letterrow .env { font-size: 24px; } .letterrow.new { border-color: var(--amber); background: #fff; }
.mate.guest { background: #EAF6E4; }
.guestbeat .bubble { background: #F2F8EE; }
.giftcard { background: var(--card); border: 2px solid var(--line); border-radius: 28px; padding: 26px 22px; margin: 26px 0; text-align: center; display: grid; gap: 8px; justify-items: center; box-shadow: var(--shadow); animation: pop .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.giftcard img { width: 150px; height: 150px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.giftcard .k { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-deep); }
.giftcard .m { font-weight: 900; font-size: 34px; line-height: 1.1; }
.lab { display: block; font-size: 14px; font-weight: 800; color: var(--soft); margin-top: 10px; }
.warn.ok { color: #2E7D32; }
.promise { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
@media (max-width: 560px) {
  .famrow { grid-template-columns: repeat(3, 1fr); }
  .famcard { flex-direction: column; align-items: center; text-align: center; } .famcard .tools { justify-content: center; }
  .boxhead img { width: 64px; height: 64px; }
}

/* ============================================================================================================
   Motion, second pass: one calm rhythm for everything.
   Things arrive with a soft spring (--spring), leave quickly (--out), and never all at once.
   ============================================================================================================ */
:root { --spring: cubic-bezier(.22, 1.2, .36, 1); --ease: cubic-bezier(.22, 1, .36, 1); --out: cubic-bezier(.4, 0, 1, 1); }

/* A new screen settles in */
.wrap.enter > * { animation: settle .55s var(--ease) both; }
.wrap.enter > *:nth-child(2) { animation-delay: .05s; } .wrap.enter > *:nth-child(3) { animation-delay: .1s; } .wrap.enter > *:nth-child(4) { animation-delay: .15s; }
.wrap.enter > *:nth-child(5) { animation-delay: .2s; } .wrap.enter > *:nth-child(6) { animation-delay: .25s; } .wrap.enter > *:nth-child(n+7) { animation-delay: .3s; }
.wrap.enter.board > .dock, .wrap.enter > .dock, .wrap.enter > .log, .wrap.enter > .storylog { animation: fade .5s ease both .2s; }

/* Words arrive one by one, softly */
.w { opacity: 0; transition: opacity .28s ease; } .w.on { opacity: 1; }

/* A crew mate arrives: the face pops first, then the bubble opens from the face's side */
.beat { animation: none; }
.beat > .face { animation: facein .5s var(--spring) both; }
.beat > .bubble { animation: bubblein .5s var(--ease) both .08s; transform-origin: 0 18px; }
.beat.me > .bubble { animation: mine .45s var(--spring) both; transform-origin: 100% 100%; }
.beat.speaking > .face { animation: facein .5s var(--spring) both, talk .5s ease-in-out .5s infinite; }
.bubble { transition: background .35s ease, border-color .35s ease, box-shadow .35s ease; }
.bubble.thinking { animation: bubblein .35s var(--ease) both; }
.bubble.thinking i { width: 10px; height: 10px; animation: think 1.15s ease-in-out infinite; }
.bubble.thinking i:nth-child(2) { animation-delay: .18s; } .bubble.thinking i:nth-child(3) { animation-delay: .36s; }

/* Choices: they line up one after another; the one she picks answers, the others bow out */
.choice { animation: choicein .5s var(--spring) both; transition: background .2s ease, transform .2s var(--spring), box-shadow .2s ease, opacity .25s ease, border-color .2s ease; }
@media (hover: hover) { .choice:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(229, 138, 46, .28); } }
.choice:active { transform: translateY(2px) scale(.985); }
.choices.chosen .choice { opacity: 0; transform: scale(.96); pointer-events: none; }
.choices.chosen .choice.picked { opacity: 1; transform: scale(1.04); background: var(--button); border-color: var(--button); color: #fff; box-shadow: 0 10px 26px rgba(212, 116, 26, .4); }

/* Pictures, letters and chapter titles take their time */
.scene { animation: scene .9s var(--ease) both; }
.scene img { animation: kenburns 9s ease-out both; }
.letter { animation: letter .9s var(--ease) both; }
.letter.big { animation: letterbig .9s var(--ease) both; }
.chapterhead { animation: settle .7s var(--ease) both; margin-top: 30px; }
.chapterhead .dots i.on:last-of-type { animation: fill .8s var(--ease) both .2s; }
.storylog { padding-bottom: 150px; }
.mission, .giftcard { animation: pop .7s var(--spring) both; }
.heart { animation: starpop .8s var(--spring) both, beat 1.8s ease-in-out .8s infinite; }

/* Cards and buttons answer the finger */
.cover, .qcard, .famcard, .fam, .row, .chip, .pill, .step, .nextcard { transition: transform .22s var(--spring), box-shadow .22s ease, border-color .2s ease, background .2s ease; }
@media (hover: hover) { .cover:hover, .qcard:hover { transform: translateY(-4px); } }
.cover:active, .qcard:active, .fam:active, .row:active, .chip:active, .pill:active, .nextcard:active { transform: scale(.97); }
.go, .send { transition: transform .12s var(--spring), box-shadow .12s ease, filter .2s ease; }
@media (hover: hover) { .go:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--amber-deep); } }
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--amber-deep); }
.dock .go { animation: dockin .6s var(--spring) both; }
.nextcard { animation: dockin .6s var(--spring) both; }
.step.is-now { transition: box-shadow .4s ease, border-color .4s ease, background .4s ease; }
.toast { animation: drop .6s var(--spring) both; }
.sparks i { animation-duration: .85s; }
.sparks i:nth-child(3n) { width: 6px; height: 6px; } .sparks i:nth-child(4n) { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); }
.confetti i { animation-timing-function: cubic-bezier(.3, .2, .6, 1); }
.partycard { animation: pop .7s var(--spring) both; }
.partycard .big { animation: settle .6s var(--ease) both .25s; }
.partycard p, .partycard .go { animation: settle .6s var(--ease) both .45s; }
.badge { animation: settle .5s var(--ease) both; } .badge:nth-child(2) { animation-delay: .06s; } .badge:nth-child(3) { animation-delay: .12s; } .badge:nth-child(n+4) { animation-delay: .18s; }
.famcard { animation: settle .55s var(--ease) both; } .famcard:nth-child(2) { animation-delay: .07s; } .famcard:nth-child(3) { animation-delay: .14s; } .famcard:nth-child(4) { animation-delay: .21s; } .famcard:nth-child(5) { animation-delay: .28s; }
.fam { animation: choicein .5s var(--spring) both; } .fam:nth-child(2) { animation-delay: .06s; } .fam:nth-child(3) { animation-delay: .12s; } .fam:nth-child(4) { animation-delay: .18s; } .fam:nth-child(5) { animation-delay: .24s; }
.crewrow img { animation: facein .6s var(--spring) both, bob 2.8s ease-in-out .7s infinite; }
.chips .chip { animation: choicein .45s var(--spring) both; }
.chips .chip:nth-child(2) { animation-delay: .04s; } .chips .chip:nth-child(3) { animation-delay: .08s; } .chips .chip:nth-child(4) { animation-delay: .12s; } .chips .chip:nth-child(5) { animation-delay: .16s; } .chips .chip:nth-child(n+6) { animation-delay: .2s; }

@keyframes settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes facein { from { opacity: 0; transform: scale(.4) rotate(-14deg); } to { opacity: 1; transform: none; } }
@keyframes bubblein { from { opacity: 0; transform: scale(.9) translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes mine { from { opacity: 0; transform: scale(.85) translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes choicein { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes scene { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes letter { from { opacity: 0; transform: translateY(18px) rotate(1.5deg); } to { opacity: 1; transform: rotate(-.4deg); } }
@keyframes letterbig { from { opacity: 0; transform: translateY(22px) rotate(2deg); } to { opacity: 1; transform: rotate(-.6deg); } }
@keyframes dockin { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .w { opacity: 1 !important; } }

/* Phones: the bottom bar (and Safari's own toolbar) is tall, so the story keeps well clear of it. */
@media (max-width: 560px) {
  .log { padding-bottom: 250px; } .log > * { scroll-margin: 90px 0 250px; }
  .storylog { padding-bottom: 170px; }
  .choices { gap: 8px; } .choice { min-height: 50px; padding: 10px 16px; }
  .dock { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* Studio fields grow to show everything a founder wrote. */
textarea.field.grow { field-sizing: content; min-height: 0; resize: none; }

/* Buttons are for tapping: holding a finger on one must not select its words or open the Copy menu. */
button, .choice, .pill, .go, .card, summary { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
img { -webkit-touch-callout: none; -webkit-user-drag: none; }

/* ============================================================================================================
   Screen sizes, third pass. Phones first: every row lines up, every button is a full, easy target, and nothing
   depends on hover. Hover looks above are wrapped in (hover: hover) so they never stick after a tap.
   ============================================================================================================ */
/* No double-tap zoom anywhere: a quick second tap is just a tap. (The drawing pad and the high five set their own.) */
html, body, .wrap, .wrap *, .dock, .over, .over * { touch-action: manipulation; }
.pad, .hand { touch-action: none; }
.chips, .famrow, .steps { touch-action: pan-x pan-y; }
.wrap { padding-bottom: 56px; }
.wrap:has(> .dock) { padding-bottom: 140px; }
.foot p { margin: 0 0 2px; }
.footlinks { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot .link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
.swatch { width: 44px; height: 44px; flex: none; }
.banner { max-width: calc(100vw - 24px); font-size: clamp(18px, 5.6vw, 26px); }
.x { min-height: 44px; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  /* Suggestions and the family: one tidy row each, swiped sideways, running to the edge of the screen */
  .chips, .famrow, .steps { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .chips::-webkit-scrollbar, .famrow::-webkit-scrollbar { display: none; }
  .chips { margin-top: 16px; padding-top: 4px; padding-bottom: 10px; gap: 8px; }
  .chips .chip, .chips .try { flex: none; white-space: nowrap; scroll-snap-align: start; }
  .famrow { gap: 10px; padding-top: 4px; padding-bottom: 12px; }
  .fam { flex: none; width: 122px; scroll-snap-align: start; padding: 12px 8px 14px; }
  .fam img { width: 72px; height: 72px; }
  .shelf { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cover { border-radius: 20px; padding: 8px; } .cover .name { font-size: 16px; } .cover img, .tile { border-radius: 13px; }
  .badges { grid-template-columns: 1fr 1fr; gap: 10px; } .badge { padding: 14px 12px; }

  /* Main buttons fill the row, like the app */
  .wrap > .go, .tools > .go, .giftcard .go, .sheet .go, .partycard .go, .mission .go, .dock .go { width: 100%; min-width: 0; }
  .dock .go { max-width: 440px; }
  .tools { gap: 10px; }
  .go { min-height: 58px; padding: 12px 22px; font-size: 20px; }
  .beat { gap: 10px; margin: 12px 0; }
  .bubble { padding: 11px 16px 13px; }
  .stephead .t { font-size: 21px; }
  .mission { padding: 24px 18px; border-radius: 24px; } .giftcard { padding: 22px 16px; }
  .partycard { padding: 28px 20px 24px; border-radius: 28px; }

  /* Sheets rise from the bottom and stop under the thumb */
  .over:not(.party):not(.night) { place-items: end stretch; padding: 24px 0 0; }
  .over:not(.party):not(.night) > .sheet { width: 100%; border-radius: 28px 28px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px); animation: sheetup .35s var(--ease) both; }
  .sheet .tools:has(.swatch) { justify-content: space-between; }
  .sheet .tools:has(.swatch) .swatch { width: calc((100% - 40px) / 5); height: auto; aspect-ratio: 1; max-width: 56px; }
  .sheet .tools:has(.swatch) .pill { flex: 1; }
}
@media (max-width: 380px) {
  body { font-size: 17px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .chips, .famrow, .steps { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; scroll-padding-left: 14px; }
  .ask.big .idea { font-size: 18px; padding: 12px 16px; min-height: 60px; } .ask.big .send { width: 60px; height: 60px; }
  .go { font-size: 19px; }
  .choice { font-size: 17px; }
  .brand { font-size: 20px; }
  .face { width: 40px; height: 40px; }
  .famcard { padding: 16px 14px; }
  .letter.big { font-size: 20px; padding: 22px 18px 18px; }
}
.badge { align-content: start; }
.log:has(> .mission) { padding-bottom: 40px; }
@media (max-width: 560px) {
  /* Where a main button has a helper beside it, they stack: big one first, helper the same width below */
  .sheet .tools:not(:has(.swatch)), .wrap > .tools:has(> .go) { flex-direction: column; align-items: stretch; }
  .sheet .tools:not(:has(.swatch)) > .pill, .wrap > .tools:has(> .go) > .pill { min-height: 52px; font-size: 17px; }
}
.boxhead { margin-bottom: 20px; }
@media (max-width: 560px) {
  .famcard .tools { flex-direction: column; align-items: stretch; width: 100%; }
  .famcard .tools .pill { min-height: 52px; font-size: 16px; white-space: normal; }
}
@media (max-width: 560px) { h2 { margin-top: 30px; } h2 small { display: block; margin-top: 2px; } }
/* A phone on its side: little height, so the bottom bar and the sheets stay small */
@media (max-height: 480px) and (orientation: landscape) {
  .dock { padding-top: 14px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .log { padding-bottom: 150px; }
  .over { place-items: start center; }
}

/* ---------- Icons: drawn, not emoji, so they are the same crisp shape on every device ---------- */
.ico { display: inline-block; width: 1.2em; height: 1.2em; flex: none; background: currentColor; vertical-align: -.22em; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-moon { --i: url("icons/moon.svg"); }
.ico-sound { --i: url("icons/sound.svg"); }
.ico-mute { --i: url("icons/mute.svg"); }
.ico-arrow-right { --i: url("icons/arrow-right.svg"); }
.ico-arrow-up { --i: url("icons/arrow-up.svg"); }
.ico-pencil { --i: url("icons/pencil.svg"); }
.ico-mail { --i: url("icons/mail.svg"); }
.ico-mail-open { --i: url("icons/mail-open.svg"); }
.ico-check { --i: url("icons/check.svg"); }
.ico-mic { --i: url("icons/mic.svg"); }
.ico-mic-off { --i: url("icons/mic-off.svg"); }
.pill .ico { width: 24px; height: 24px; }
.pill.sky .ico { color: #F6D36B; }
.pill[aria-pressed="false"] .ico { opacity: .7; }
.send .ico { width: 26px; height: 26px; display: block; margin: auto; }
.ask.big .send .ico { width: 28px; height: 28px; }
.fam .flag { top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--button); color: #fff; display: grid; place-items: center; font-size: 13px; box-shadow: 0 0 0 3px var(--card); }
.fam .flag .ico { width: 15px; height: 15px; }
.letterrow .env { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); color: var(--soft); font-size: 20px; flex: none; }
.letterrow.new .env { background: var(--button); color: #fff; }
.step .ico { width: 16px; height: 16px; color: #4F9A3F; margin-right: 4px; }

/* ---------- Refinement pass: edges, rhythm and the phone's own furniture ---------- */
/* What scrolls under the clock and the camera island fades into the paper instead of colliding with them. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: calc(env(safe-area-inset-top) + 10px); z-index: 35; pointer-events: none; background: linear-gradient(to bottom, var(--paper) calc(100% - 10px), rgba(246, 239, 227, 0)); }
.fam b { display: flex; align-items: center; justify-content: center; min-height: 2.3em; }
.pill.on .ico { color: #4F9A3F; }
@media (max-width: 560px) { .dock { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 380px) { .dock { padding-left: 14px; padding-right: 14px; } }
.lab .field { font-weight: 500; color: var(--ink); margin-top: 6px; }

/* ---------- Pictures painted for a quest ---------- */
.art { display: block; position: relative; width: min(86%, 400px); aspect-ratio: 1; margin: 4px 0 16px auto; padding: 0; border-radius: 26px; overflow: hidden; background: var(--card); border: 4px solid #fff; box-shadow: 0 12px 30px rgba(42, 24, 16, .16); transform: rotate(.6deg); transition: transform .25s var(--spring); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.fresh { animation: artin .9s var(--spring) both; } .art.fresh img { animation: kenburns 6s ease-out both; }
@media (hover: hover) { .art:hover { transform: rotate(0) scale(1.02); } }
.art:active { transform: scale(.98); }
.art.painting { display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--soft); font-weight: 800; font-size: 16px; border-style: dashed; border-color: var(--line); border-width: 3px; box-shadow: none; background: linear-gradient(110deg, var(--card) 30%, #fff 50%, var(--card) 70%) 0 0 / 220% 100%; animation: shimmer 1.6s linear infinite; }
.art.painting .mini { width: 52px; height: 52px; animation: bob 1.2s ease-in-out infinite; }
.mission .art, .coverslot .art { margin: 16px auto 4px; width: min(100%, 420px); transform: rotate(-.8deg); }
.mission .art.painting { color: #C9D6D2; background: linear-gradient(110deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.14) 50%, rgba(255,255,255,.05) 70%) 0 0 / 220% 100%; border-color: rgba(255, 255, 255, .25); }
.lightbox { gap: 18px; align-content: center; justify-items: center; }
.lightbox img { width: min(100%, 720px, 80dvh); border-radius: 26px; border: 5px solid #fff; animation: pop .45s var(--spring) both; }
.lightbox .pill { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes artin { from { opacity: 0; transform: scale(.7) rotate(-6deg); } to { opacity: 1; transform: rotate(.6deg); } }
@media (max-width: 560px) { .art { width: min(88%, 340px); border-radius: 22px; } }
.artcard { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 26px; padding: 12px 16px 12px 12px; background: #fff; border: 2px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); transition: transform .22s var(--spring), border-color .2s ease; }
.artcard img { width: 72px; height: 72px; flex: none; border-radius: 16px; object-fit: cover; transform: rotate(-3deg); }
.artcard div { flex: 1; min-width: 0; } .artcard b { display: block; font-weight: 900; font-size: 18px; line-height: 1.2; } .artcard small { color: var(--soft); font-size: 15px; }
.artcard .arrow { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--button); color: #fff; display: grid; place-items: center; }
.artcard:active { transform: scale(.98); }
@media (hover: hover) { .artcard:hover { border-color: var(--amber); transform: translateY(-2px); } }
.sheet .promise { margin: 6px 0 14px; font-size: 16px; line-height: 1.45; }
.over { grid-template-columns: minmax(0, 1fr); }
.sheet { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Family cards: each mate in a scene from their own world ---------- */
.famcard { display: block; padding: 0; overflow: hidden; }
.famscene { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--line); }
.fambody { display: flex; gap: 18px; align-items: flex-start; padding: 0 18px 18px; }
.fambody .famface { margin-top: -44px; border: 4px solid var(--card); box-shadow: 0 8px 20px rgba(42, 24, 16, .14); position: relative; }
.fambody .famtext { padding-top: 14px; }
@media (max-width: 560px) { .fambody { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 16px 18px; } .fambody .famtext { padding-top: 0; width: 100%; } .fambody .tools { justify-content: center; } }
@media (min-width: 700px) { .famscene { aspect-ratio: 5 / 2; } }
.famscene { object-position: 50% 38%; }
@media (min-width: 700px) { .famscene { aspect-ratio: 2 / 1; } }

/* ---------- Talk to the crew ---------- */
.talkcard { margin-top: 14px; } .artcard + .artcard { margin-top: 12px; }
.micdot { width: 72px; height: 72px; flex: none; border-radius: 22px; background: var(--night); color: #F6D36B; display: grid; place-items: center; transform: rotate(-3deg); }
.micdot .ico { width: 34px; height: 34px; }
.talkgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.talkmate { display: grid; justify-items: center; gap: 2px; padding: 14px 8px 12px; background: var(--card); border: 2px solid var(--line); border-radius: 22px; text-align: center; animation: choicein .5s var(--spring) both; transition: transform .22s var(--spring), border-color .2s ease; }
.talkmate img { width: clamp(52px, 15vw, 84px); height: clamp(52px, 15vw, 84px); object-fit: contain; }
.talkmate b { font-weight: 900; font-size: 17px; } .talkmate small { color: var(--soft); font-size: 12.5px; line-height: 1.25; }
.talkmate:active { transform: scale(.96); }
@media (hover: hover) { .talkmate:hover { border-color: var(--amber); transform: translateY(-3px); } }
.talkstage { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 12px; }
.talkstage h1 { margin: 10px 0 0; }
.talkring { width: 220px; height: 220px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 4px solid var(--line); box-shadow: var(--shadow); transition: border-color .3s ease, box-shadow .3s ease; }
.talkring.hearing { border-color: #9FD08A; box-shadow: 0 0 0 10px rgba(159, 208, 138, .25); }
.talkring.speaking { border-color: var(--amber); box-shadow: 0 0 0 10px rgba(229, 138, 46, .2); }
.talkring.off { opacity: .55; }
.talkface { width: 150px; height: 150px; object-fit: contain; transition: transform .08s linear; }
.talkstatus { font-weight: 800; color: var(--soft); min-height: 1.6em; }
.talkwords { min-height: 4.6em; max-width: 34ch; margin: 4px auto 0; font-size: 20px; line-height: 1.4; text-wrap: balance; }
.talktimer { width: min(100%, 260px); height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.talktimer i { display: block; height: 100%; width: 100%; background: var(--amber); border-radius: 3px; transition: width .5s linear; }
.talktools { justify-content: center; }
@media (max-width: 560px) { .talkgrid { gap: 10px; } .talkring { width: 190px; height: 190px; } .talkface { width: 128px; height: 128px; } .talktools { flex-direction: column; align-items: stretch; } .talktools .go { width: 100%; } }

/* Story pictures are painted 3 wide by 2 tall: show the whole picture. */
.scene img, .hero img { aspect-ratio: 3 / 2; }
.lightbox .tools { justify-content: center; } .lightbox .small { color: #C9D6D2; min-height: 1.4em; }
@media (max-width: 560px) { .lightbox .tools { flex-direction: column; align-items: stretch; width: min(100%, 340px); } .lightbox .go { width: 100%; } }

/* ---------- Maths you can touch (boards.js) and the crew teach (lessons.js), 1.0.1 ---------- */
:root { --mb-amber: #E58A2E; --mb-teal: #2BA59A; --mb-done: #3BAA5C; --mb-empty: #E9DDCB; }
.mboard { margin: 10px 0 14px 66px; max-width: 560px; background: rgba(255, 255, 255, .8); border: 2px solid rgba(229, 138, 46, .45); border-radius: 22px; padding: 14px 16px; animation: rise .35s cubic-bezier(.2, 1.3, .4, 1) both; transition: border-color .25s ease; }
.mboard.is-done { border-color: rgba(59, 170, 92, .7); }
.mboard.tick { animation: mbtick .28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes mbtick { 50% { transform: scale(1.015); } }
.mb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mb-mark { font-style: normal; font-size: 20px; color: var(--mb-amber); }
.is-done .mb-mark { color: var(--mb-done); animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
.mb-hint { flex: 1; font-weight: 900; font-size: 16px; color: var(--soft); line-height: 1.3; }
.is-done .mb-hint { color: var(--mb-done); }
.mb-reset { width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--soft); font-weight: 900; font-size: 18px; flex: none; }
.mb-body { display: grid; gap: 12px; justify-items: start; }
.mb-tally { display: flex; align-items: baseline; gap: 10px; }
.mb-tally b { font-size: 36px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.mb-tally span { color: var(--soft); font-weight: 600; font-size: 17px; }
.mb-tally.ok b { color: var(--mb-done); }
.mb-go { color: #fff; background: var(--mb-amber); font-weight: 900; font-size: 18px; padding: 12px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--amber-deep); transition: transform .08s ease, box-shadow .08s ease; }
.mb-go:active { transform: translateY(3px) scale(.96); box-shadow: 0 1px 0 var(--amber-deep); }
.mb-go.green { background: var(--mb-done); box-shadow: 0 4px 0 #2a7d43; }
.mb-go.dark { background: var(--soft); box-shadow: 0 4px 0 var(--ink); font-size: 24px; padding: 8px 22px; }
.mb-go.tinted { background: var(--c, var(--mb-amber)); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.mb-cheer { color: #fff; background: var(--mb-done); font-weight: 900; padding: 10px 16px; border-radius: 999px; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--mb-empty); display: inline-block; transition: background .2s ease, transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.mb-dot.on { background: var(--mb-amber); transform: scale(1.08); }
.mb-dot.teal.on, .mb-dot.teal { background: var(--mb-teal); width: 14px; height: 14px; }
.mb-rows { display: grid; gap: 6px; }
.mb-row { display: flex; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 12px; }
.mb-row.pop { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.mb-run { color: var(--mb-amber); font-weight: 900; margin-left: 6px; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-pile { display: flex; flex-wrap: wrap; gap: 4px; min-height: 14px; }
.mb-bowls { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; width: 100%; }
.mb-bowl { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px; display: grid; gap: 6px; justify-items: center; min-height: 64px; transition: transform .1s ease; }
.mb-bowl:active { transform: scale(.94); }
.mb-bowl.ok { border-color: var(--mb-done); } .mb-bowl.pick { border-color: var(--mb-amber); background: #FCEBD6; }
.mb-bowl b { font-weight: 900; color: var(--soft); }
.mb-bowldots { display: grid; grid-template-columns: repeat(5, 12px); gap: 4px; min-height: 12px; }
.mb-bowldots .mb-dot { width: 12px; height: 12px; }
.mb-split { display: flex; align-items: flex-start; gap: 8px; }
.mb-by { font-size: 22px; font-weight: 900; color: var(--soft); padding-top: 34px; }
.mb-col { display: grid; gap: 6px; justify-items: center; }
.mb-col > b.amber, .mb-lbl.amber { color: var(--mb-amber); } .mb-col > b.teal, .mb-lbl.teal { color: var(--mb-teal); }
.mb-col small { font-weight: 800; color: var(--soft); font-size: 14px; }
.mb-box { width: 96px; height: 90px; border-radius: 14px; font-size: 30px; font-weight: 900; color: var(--mb-teal); background: rgba(43, 165, 154, .18); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1), background .2s ease; }
.mb-box.amber { color: var(--mb-amber); background: rgba(229, 138, 46, .18); } .mb-box.wide { width: 160px; }
.mb-box.open { color: #fff; background: var(--mb-teal); transform: rotateY(360deg); } .mb-box.amber.open { background: var(--mb-amber); }
.mb-place { display: flex; gap: 22px; align-items: flex-end; }
.mb-rods { display: flex; gap: 4px; align-items: flex-end; min-height: 74px; }
.mb-rod { display: block; width: 16px; height: 72px; border-radius: 4px; background: repeating-linear-gradient(var(--mb-amber) 0 6px, #f6c99a 6px 7px); padding: 0; }
.mb-rod.teal { background: repeating-linear-gradient(var(--mb-teal) 0 6px, #9fdcd5 6px 7px); }
.mb-rod.ok { background: repeating-linear-gradient(var(--mb-done) 0 6px, #a9ddb7 6px 7px); }
.mb-rod.new { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-rod.gone, .mb-cube.gone { opacity: .25; }
.mb-gap { width: 10px; }
.mb-cubes { display: grid; grid-template-columns: repeat(5, 16px); gap: 4px; transition: gap .3s ease; }
.mb-cubes.together { gap: 2px; } .mb-cubes.big { grid-template-columns: repeat(5, 22px); }
.mb-cube { display: block; width: 16px; height: 16px; border-radius: 4px; background: var(--mb-amber); padding: 0; font-size: 12px; font-weight: 900; color: var(--soft); }
.mb-cubes.big .mb-cube { width: 22px; height: 22px; }
.mb-cube.teal { background: var(--mb-teal); } .mb-cube.ring { box-shadow: 0 0 0 3px var(--mb-done); }
.mb-cube.gone { background: var(--mb-empty); }
.mb-barbtn { width: 100%; padding: 0; }
.mb-bar { display: flex; width: 100%; height: 46px; border-radius: 10px; overflow: hidden; border: 1.5px solid rgba(96, 74, 60, .4); gap: 3px; background: #fff; }
.mb-bar i { flex: 1; background: var(--mb-empty); transition: background .2s ease; }
.mb-bar i.amber { background: var(--mb-amber); } .mb-bar i.teal { background: var(--mb-teal); } .mb-bar i.cut { margin-left: 5px; }
.mb-lbl { font-weight: 900; font-size: 17px; }
.mb-line { position: relative; width: 100%; height: 92px; }
.mb-track { position: absolute; left: 0; right: 0; top: 46px; height: 6px; border-radius: 3px; background: var(--line); }
.mb-tick { position: absolute; top: 42px; width: 2px; height: 14px; margin-left: -1px; background: rgba(96, 74, 60, .5); }
.mb-tick.half { top: 34px; height: 28px; background: var(--mb-teal); } .mb-tick.zero { top: 36px; height: 26px; width: 3px; background: var(--ink); }
.mb-halflbl { position: absolute; top: 66px; transform: translateX(-50%); font-size: 13px; font-weight: 800; color: var(--mb-teal); white-space: nowrap; }
.mb-pin { position: absolute; top: 0; transform: translateX(-50%); background: var(--mb-amber); color: #fff; font-weight: 900; font-size: 16px; padding: 2px 9px; border-radius: 999px; transition: left .45s cubic-bezier(.2, 1.3, .4, 1); }
.mb-pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border: 6px solid transparent; border-top-color: inherit; border-top-color: var(--mb-amber); }
.mb-pin.ok { background: var(--mb-done); } .mb-pin.ok::after { border-top-color: var(--mb-done); }
.mb-line .mb-pin { max-width: none; }
.mb-ends { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 12px; }
.mb-num { position: absolute; top: 64px; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--soft); }
.mb-num.neg { color: var(--mb-teal); } .mb-num.at { color: var(--mb-amber); font-weight: 900; }
.mb-frog { position: absolute; top: 6px; transform: translateX(-50%); font-size: 28px; transition: left .35s cubic-bezier(.2, 1.3, .4, 1); }
.mboard.tick .mb-frog { animation: hop .35s ease; }
.mb-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.mb-cards small { font-size: 11px; }
.mb-card { width: 100%; min-height: 58px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-size: 32px; font-weight: 900; transition: transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.mb-card.target { border: 3px solid var(--mb-amber); }
.mb-card.teal { background: var(--mb-teal); color: #fff; font-size: 20px; } .mb-card.ok { background: var(--mb-done); color: #fff; font-size: 20px; transform: scale(1.06); }
.mb-grid { display: grid; gap: 2px; }
.mb-gridrow { display: flex; gap: 2px; align-items: center; padding: 0; }
.mb-gridrow i { width: 24px; height: 24px; border-radius: 3px; background: var(--mb-empty); transition: background .2s ease; }
.mb-gridrow i.on { background: var(--mb-amber); }
.mb-gridrow b { color: var(--mb-amber); font-weight: 900; font-size: 15px; margin-left: 8px; min-width: 24px; }
.mb-perim { position: relative; padding: 22px; }
.mb-grid.flat { grid-template-columns: repeat(var(--w), 22px); }
.mb-grid.flat i { width: 22px; height: 22px; border: 1px solid var(--mb-empty); }
.mb-side { position: absolute; background: rgba(96, 74, 60, .3); border-radius: 6px; transition: background .2s ease; }
.mb-side.on { background: var(--mb-amber); }
.mb-side b { position: absolute; color: var(--mb-amber); font-weight: 900; font-size: 16px; }
.mb-side.top, .mb-side.bottom { left: 22px; width: calc(var(--w) * 24px - 2px); height: 10px; } .mb-side.top { top: 10px; } .mb-side.bottom { top: calc(22px + var(--h) * 24px); }
.mb-side.left, .mb-side.right { top: 22px; height: calc(var(--h) * 24px - 2px); width: 10px; } .mb-side.left { left: 10px; } .mb-side.right { left: calc(22px + var(--w) * 24px); }
.mb-side.top b { top: -22px; left: 50%; } .mb-side.bottom b { top: 12px; left: 50%; } .mb-side.left b { left: -22px; top: 40%; } .mb-side.right b { left: 16px; top: 40%; }
.mb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-chip { min-width: 46px; min-height: 52px; padding: 0 8px; display: grid; place-items: center; font-size: 26px; font-weight: 900; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-chip.sign { font-size: 30px; border: 2.5px solid rgba(229, 138, 46, .6); }
.mb-chip.amber { background: var(--mb-amber); color: #fff; } .mb-chip.teal { background: var(--mb-teal); color: #fff; } .mb-chip.ok { background: var(--mb-done); color: #fff; }
.mb-note { color: var(--soft); font-weight: 800; margin: 0; }
.mb-clockrow { display: flex; align-items: center; gap: 18px; }
.mb-clockbtn { padding: 0; } .mb-clock { width: 132px; height: 132px; }
.mb-clock .face { fill: var(--card); stroke: rgba(96, 74, 60, .6); stroke-width: 3; }
.mb-clock text { font: 800 11px var(--round); fill: var(--soft); }
.mb-clock line { stroke-linecap: round; transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); }
.mb-clock .min { stroke: var(--mb-amber); stroke-width: 4; } .mb-clock .hr { stroke: var(--ink); stroke-width: 6; } .mb-clock .pin { fill: var(--ink); }
.mb-time { display: block; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.mb-parts { display: flex; gap: 3px; width: 100%; }
.mb-part { flex: 1; min-height: 50px; border-radius: 6px; background: var(--mb-empty); font-weight: 900; color: var(--soft); font-size: 16px; transition: background .2s ease, transform .1s ease; padding: 0; }
.mb-part:active { transform: scale(.92); } .mb-part.on { background: var(--mb-amber); color: #fff; }
.mb-win { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px 66px; max-width: 440px; padding: 14px 18px; background: #FFF6D8; border: 2px solid #F5C542; border-radius: 20px; }
.mb-win.fresh { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-bigstar { font-size: 48px; line-height: 1; color: #F5C542; text-shadow: 0 0 14px rgba(245, 197, 66, .6); }
.mb-win.fresh .mb-bigstar { animation: starpop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.mb-win b { display: block; font-size: 22px; font-weight: 900; color: var(--mb-done); }
.mb-stars { color: #F5C542; font-size: 16px; letter-spacing: 2px; } .mb-stars i { font-style: normal; }
.mb-win small { color: var(--soft); font-weight: 700; font-size: 14px; }
.shake { animation: wobble .4s linear; }
@keyframes wobble { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.subject { display: inline-block; font-size: 13px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); padding: 2px 9px; border-radius: 999px; white-space: nowrap; vertical-align: 2px; }
.lshelf { margin: 16px 0 8px 66px; max-width: 560px; display: grid; gap: 8px; animation: rise .4s ease both .2s; }
.lshelf-h { font-weight: 900; font-size: 15px; color: var(--soft); }
.loffer { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; background: var(--card); border: 2px solid color-mix(in srgb, var(--c) 50%, transparent); border-radius: 18px; transition: transform .1s ease; }
.loffer:active { transform: scale(.97); }
.loffer .face { width: 40px; height: 40px; object-fit: contain; flex: none; } .loffer div { flex: 1; } .loffer b { display: block; font-weight: 900; font-size: 17px; line-height: 1.25; margin-top: 3px; }
.loffer .arrow { width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.lcard { margin: 10px 0 14px 66px; max-width: 560px; padding: 16px; background: rgba(255, 255, 255, .85); border: 2px solid color-mix(in srgb, var(--c, #E58A2E) 55%, transparent); border-radius: 22px; display: grid; gap: 12px; }
.lcard.fresh { animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.lcard.is-done { border-color: rgba(59, 170, 92, .7); }
.lcard.maths { padding: 0; background: none; border: 0; } .lcard.maths .mboard, .lcard.maths .mb-win { margin-left: 0; }
.lhead { display: flex; justify-content: space-between; align-items: center; } .lcount { color: var(--soft); font-weight: 800; font-size: 13px; }
.lcard h3 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.2; }
.lbites { display: grid; gap: 10px; }
.lbite { display: flex; gap: 10px; align-items: flex-start; } .lbite.fresh { animation: rise .35s ease both; }
.lbite i { font-style: normal; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--c, #E58A2E); color: #fff; font-weight: 900; font-size: 14px; display: grid; place-items: center; margin-top: 1px; }
.lq > b { display: block; font-weight: 900; font-size: 18px; margin-bottom: 8px; }
.lchoices { display: flex; flex-wrap: wrap; gap: 10px; }
.lchoices .choice { animation: none; }
.choice.right { background: var(--mb-done); border-color: var(--mb-done); color: #fff; box-shadow: none; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.choice.wrong { opacity: .55; border-color: var(--line); box-shadow: none; }
.lnope { margin: 8px 0 0; font-weight: 800; color: var(--soft); font-size: 16px; min-height: 0; } .lnope:empty { display: none; }
.lwhy { margin: 0; color: var(--mb-done); font-weight: 800; }
.lcard .mb-win { margin: 4px 0 0; }
@media (max-width: 560px) { .mboard, .mb-win, .lshelf, .lcard { margin-left: 0; } }

/* ---------- The founder's studio ---------- */
.hidden { display: none; }
.toolbox { display: grid; gap: 10px; margin: 18px 0 6px; }
.tool { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 14px 18px; min-height: 76px; box-shadow: var(--shadow); transition: transform .2s var(--spring), border-color .15s ease; }
.tool:active { transform: scale(.98); }
@media (hover: hover) { .tool:hover { border-color: var(--amber); } }
.temoji { font-size: 32px; line-height: 1; flex: none; width: 44px; text-align: center; }
.ttext { display: grid; gap: 2px; flex: 1; } .ttext b { font-weight: 900; font-size: 19px; } .ttext small { color: var(--soft); font-size: 15px; }
.tgo { font-size: 30px; color: var(--amber-deep); font-weight: 900; }
.link.tune { display: inline-block; margin-top: 18px; background: none; border: 0; font-size: 17px; }
.pill.big { min-height: 60px; font-size: 18px; padding: 10px 22px; }
.sendrow { margin-top: 18px; gap: 12px; }
.chips.topics { flex-wrap: wrap; justify-content: flex-start; overflow: visible; margin: 8px 0 4px; padding: 0; }
.chip.on { background: var(--amber); border-color: var(--amber-deep); color: #fff; }
.shot { margin: 16px 0 8px; }
.shotadd { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 34px 18px; border: 3px dashed var(--line); border-radius: 26px; background: var(--card); }
.shotadd span { font-size: 44px; } .shotadd b { font-size: 21px; font-weight: 900; } .shotadd small { color: var(--soft); font-size: 15px; }
.shotpic { display: grid; gap: 10px; justify-items: start; } .shotpic img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }
.tick { display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 17px; margin: 10px 0 4px; padding: 12px 16px; background: var(--letter); border-radius: 16px; cursor: pointer; }
.tick input { width: 26px; height: 26px; accent-color: var(--button); flex: none; }
.mic { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 6px; }
.mic .micgo { min-height: 60px; font-size: 18px; padding: 10px 24px; border-color: var(--amber); }
.mictip { color: var(--soft); font-size: 14px; }
.micrec, .micdone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.micrec small { flex-basis: 100%; color: var(--soft); }
.pill.recording { background: #C62828; border-color: #8E1B1B; color: #fff; min-height: 60px; font-size: 18px; padding: 10px 26px; }
.pill.recording .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: blink 1s ease-in-out infinite; }
.clock { font-variant-numeric: tabular-nums; font-size: 18px; }
.micdone .ok { color: #2E7D32; font-weight: 900; display: inline-flex; align-items: center; gap: 4px; }
@keyframes blink { 50% { opacity: .25; } }
.ideas { background: var(--letter); border-radius: 18px; padding: 12px 18px; margin: 8px 0 14px; } .ideas ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.answer { display: grid; gap: 0; margin-bottom: 10px; } .arow { display: flex; gap: 8px; align-items: center; } .arow .field { flex: 1; }
.field.small { font-size: 15px; min-height: 42px; margin-top: 0; }
.pill.star { flex: none; } .pill.star.on { background: #FFF3C4; border-color: #E0B100; }
.matepreview { margin-top: 20px; }
.blankface { width: 120px; height: 120px; flex: none; border: 3px dashed var(--line); border-radius: 50%; display: grid; place-content: center; text-align: center; font-size: 40px; font-weight: 900; color: var(--soft); }
.blankface small { font-size: 11px; font-weight: 700; padding: 0 12px; line-height: 1.2; }
.matepreview .letter { margin: 10px 0 0; font-size: 18px; }

/* What a child sees: a founder's photo and voice */
.snap { margin: 18px 6px 10px; background: #fff; padding: 12px 12px 14px; border-radius: 10px; box-shadow: var(--shadow); transform: rotate(.8deg); animation: letter .9s var(--ease) both; }
.snap img { width: 100%; border-radius: 4px; max-height: 70vh; object-fit: cover; }
.snap figcaption { display: grid; gap: 4px; padding: 10px 4px 0; font: 400 19px/1.45 var(--serif); }
.snap figcaption small { font: 900 12px/1 var(--round); letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); }
.voicenote .vrow { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.vplay { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--button); box-shadow: 0 4px 0 var(--amber-deep); display: grid; place-content: center; flex: none; }
.vplay .tri { width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.voicenote.playing .vplay .tri { width: 16px; height: 18px; border: 0; margin: 0; background: linear-gradient(90deg, #fff 35%, transparent 35% 65%, #fff 65%); }
.vbar { flex: 1; height: 10px; border-radius: 99px; background: rgba(169, 87, 12, .15); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: var(--amber); border-radius: 99px; transition: width .15s linear; }
.voicenote small { color: var(--soft); font: 800 14px/1 var(--round); }
.vwords { margin: 10px 0 0; }
.liverow { justify-content: space-between; } .liverow b { flex: 1; } .pill.share { border-color: var(--amber); color: var(--amber-deep); flex: none; }
.hint.tight { margin-top: 0; }
.heldcard { background: var(--card); border: 2px solid var(--amber); border-radius: 20px; padding: 14px 18px; margin: 8px 0; display: grid; gap: 4px; }
.heldcard small { color: var(--soft); } .pill.okbtn { background: #3BAA5C; border-color: #2E8A49; color: #fff; }
.bigface { width: 220px; height: 220px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.link.report { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--soft); font-size: 14px; }
.emailcard { background: var(--letter); border-radius: 20px; padding: 14px 18px; margin: 12px 0; display: grid; gap: 4px; }
.emailcard .lab { margin-top: 4px; } .signedin { font-size: 14px; } .signedin .link { font-size: 14px; padding: 0; background: none; border: 0; }
.emailcard.claim { border: 2px solid var(--amber); background: var(--card); margin: 18px 0; }

/* Learning, woven in */
.figured { text-align: left; background: rgba(255,255,255,.08); border-radius: 18px; padding: 12px 16px; margin: 14px 0 4px; }
.figured ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.lq.soft { margin: 6px 0 14px; } .lq.soft .choice.dim { opacity: .45; }
.pill.moreless { margin: 2px 0 12px 58px; border-color: var(--line); font-size: 15px; min-height: 40px; }
.beat.small .bubble { font-size: 17px; }
.twistbox .choice { border-style: dashed; }
.talknote { display: flex; gap: 12px; align-items: flex-start; background: var(--letter); border-radius: 20px; padding: 12px 16px; margin: 10px 0; }
.talknote .face { width: 52px; height: 52px; flex: none; } .talknote ul { margin: 4px 0 0; padding-left: 18px; }
.talktools + .talktools { margin-top: 8px; }
.figured.light { background: var(--letter); color: var(--ink, #2A1810); } .figured .k { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); } .mission .figured .k { color: var(--glow); }

/* Free helplines, shown under the words Data says when a child may be being hurt (helpCard in js/ui.js). */
.helpcard { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 2px solid var(--line); font-size: 0.95em; }
.helpcard b { display: block; margin-bottom: 6px; }
.helpcard ul { margin: 0 0 6px; padding-left: 18px; }
.helpcard li { margin: 2px 0; }
.helpcard p { margin: 6px 0 0; }
.helpcard a { color: inherit; font-weight: 700; }

/* Choices as picture cards ("Show me pictures", as in the iPhone app). */
.showpics { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
.piccards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.piccard { display: grid; gap: 8px; padding: 8px; border-radius: 22px; background: #F6DFC0; border: 2px solid #E58A2E; font: inherit; color: inherit; text-align: center; cursor: pointer;
  animation: choicein .5s var(--spring) both; transition: transform .2s var(--spring), box-shadow .2s ease; box-shadow: 0 4px 0 rgba(229, 138, 46, .35); }
.piccard b { font-size: 16px; line-height: 1.25; min-height: 2.5em; }
.picface { aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--card); display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--soft); font-weight: 800; }
.picface img { width: 100%; height: 100%; object-fit: cover; display: block; animation: artin .6s var(--spring) both; }
.picface .brush { font-size: 30px; animation: bob 1.2s ease-in-out infinite; }
.picface .nopic { font-size: 30px; opacity: .35; }
@media (hover: hover) { .piccard:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(229, 138, 46, .28); } }
.piccard:active { transform: translateY(2px) scale(.985); }
.piccard.picked { outline: 4px solid #E58A2E; }
.choices.chosen .piccard:not(.picked) { opacity: .45; }
@media (max-width: 560px) { .piccards { grid-template-columns: 1fr 1fr; } }
