/* Little Paramedics — storybook calm: soft mint paper, rescue green, a red
   heart, sunny yellow, rounded everything, big friendly targets for small hands. */
:root {
  color-scheme: light;
  --bg: #eaf7f0;
  --paper: #f8fdfa;
  --surface: #ffffff;
  --text: #2d2433;
  --muted: #655a70;
  --line: rgba(45, 36, 51, 0.14);
  --brand: #17874a;
  --brand-hi: #3fcf80;
  --heart: #e8394a;
  --yellow: #ffd23f;
  --green: #22984f;
  --blue: #2f6fe0;
  --shadow: 0 10px 30px -12px rgba(20, 60, 40, 0.45);
  --ca-accent: #17874a; /* the accounts SDK's sheets and chip */
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12211b; --paper: #1b2e26; --surface: #233a30; --text: #f6effb; --muted: #c2b7d0;
    --line: rgba(255, 255, 255, 0.14); --shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12211b; --paper: #1b2e26; --surface: #233a30; --text: #f6effb; --muted: #c2b7d0;
  --line: rgba(255, 255, 255, 0.14); --shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.7);
}
* { box-sizing: border-box; }
/* no double-tap zoom on iOS: js/touch-guard.js adds the same rule plus a JS
   fallback; this copy covers Safari before 16.4 under the strict CSP */
:where(html, body, body *) { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: calc(100dvh / var(--ca-zoom, 1)); overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* a game page: no text selection or long-press callouts anywhere, HUD and
   menus included; form fields and long text (the Help sheet) opt back in */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable], .help p { -webkit-user-select: text; user-select: text; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }
i[data-icon] { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------ canvas */
.stage { position: fixed; inset: 0; width: calc(100vw / var(--ca-zoom, 1)); height: calc(100vh / var(--ca-zoom, 1)); height: calc(100dvh / var(--ca-zoom, 1)); display: block; z-index: 0; background: #bfe6ff; }
.field { position: fixed; inset: 0; z-index: 1; touch-action: none; }
body:not(.mode-mission) .field { pointer-events: none; }

/* ------------------------------------------------------------ top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  pointer-events: none;
  /* the SDK's tools in the round buttons' look */
  --ca-tool-bg: var(--surface); --ca-tool-ink: var(--text); --ca-tool-line: transparent; --ca-tool-hover: var(--paper);
}
.bar > * { pointer-events: auto; }
/* the two ends share the room; in a mission they are as wide as each other, so the dots stay in the middle */
.bar-start { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.bar-end { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.bar-mid { flex: none; }
body.mode-mission .bar-start, body.mode-mission .bar-end { flex-basis: 0; }
/* the brand's name on the start screen only: the other screens and a mission say where they are, and
   their Back or Pause sits right beside the game's icon */
body:not(.mode-home) .bar .ca-brand-name { display: none; }
/* the brand stands on the daylight sky in both themes: the star pill's dark ink */
.bar .ca-start { color: #2d2433; }
.round-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow), inset 0 -3px 0 rgba(0, 0, 0, 0.08);
  font-size: 22px; transition: transform 0.15s;
}
.round-btn:active { transform: scale(0.92); }
.dots { display: flex; gap: 8px; padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.82); box-shadow: var(--shadow); }
.dots:empty { display: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #d8cfdf; transition: transform 0.3s, background 0.3s; }
.dot.done { background: var(--green); }
.dot.now { background: var(--brand-hi); transform: scale(1.35); box-shadow: 0 0 0 3px rgba(63, 207, 128, 0.3); }
.star-pill {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 10px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.9); color: #2d2433; box-shadow: var(--shadow); font-size: 20px;
}
.star-pill i { font-size: 24px; }
.star-pill.bump { animation: bump 0.4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.22); } }
/* a phone: the mission's bar keeps the brand's mark and icon, Pause, the dots, the stars and the chip */
@media (max-width: 479.98px) {
  .bar, .bar-start, .bar-end { gap: 6px; }
  .bar .round-btn { width: 44px; height: 44px; font-size: 20px; }
  .dots { gap: 5px; padding: 8px 9px; }
  .dot { width: 9px; height: 9px; }
  .star-pill { height: 40px; gap: 5px; padding: 0 11px 0 8px; font-size: 18px; }
  .star-pill i { font-size: 20px; }
}
/* the smallest phones: no room for the dots beside them (the guide's words say what comes next) */
@media (max-width: 359.98px) {
  body.mode-mission .bar-mid { display: none; }
}

/* ------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; z-index: 10; }
.home { display: grid; align-items: start; justify-items: center; padding: calc(74px + var(--safe-t)) 16px calc(16px + var(--safe-b)); pointer-events: none; }
.home-card {
  pointer-events: auto; width: min(100%, 440px); text-align: center; padding: 18px 20px 16px;
  background: color-mix(in srgb, var(--paper) 90%, transparent); border-radius: 30px; box-shadow: var(--shadow);
}
.hello { margin: 0; color: var(--muted); font-weight: 650; }
.logo {
  margin: 2px 0 2px; font-size: clamp(32px, calc(9vw / var(--ca-zoom, 1)), 46px); line-height: 1.02; font-weight: 900; letter-spacing: -0.02em;
  color: var(--brand); text-shadow: 0 3px 0 rgba(255, 210, 63, 0.9);
}
:root[data-theme="dark"] .logo { color: #6fe0a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { color: #6fe0a0; } }
.tagline { margin: 6px 0 14px; color: var(--muted); font-size: 16px; }
.play-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 20px;
  border: 0; border-radius: 26px; color: #fff; text-align: left;
  background: linear-gradient(180deg, #3fcf80, #1e9a55 60%, #157a42); box-shadow: 0 8px 0 #0f5c31, 0 18px 30px -10px rgba(20, 120, 60, 0.6);
  transition: transform 0.12s, box-shadow 0.12s;
}
.play-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #0f5c31, 0 8px 18px -10px rgba(20, 120, 60, 0.6); }
.play-btn > i { font-size: 34px; }
.play-txt { display: grid; }
.play-txt b { font-size: 26px; line-height: 1.1; }
.play-txt small { font-size: 15px; opacity: 0.95; font-weight: 600; }
.home-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
  border: 0; border-radius: 25px; background: var(--surface); color: var(--text); font-weight: 750; font-size: 17px;
  box-shadow: 0 4px 0 rgba(45, 36, 51, 0.16), var(--shadow); transition: transform 0.12s;
}
.pill-btn:active { transform: translateY(3px); }
.pill-btn i { font-size: 22px; }
.pill-btn.wide { width: 100%; }
.credit { margin: 14px 0 0; font-size: 14px; color: var(--muted); font-weight: 650; }

/* ------------------------------------------------------------ map */
.map { background: #8fd06b; }
/* a chapter's sign on the map: the land's name and what happens there */
.chapter { position: relative; display: grid; justify-items: center; gap: 2px; margin: 18px auto 6px; width: fit-content; max-width: calc(100% - 32px); padding: 10px 22px 12px; border-radius: 22px; background: #fffef8; color: #2d2433; text-align: center; box-shadow: 0 5px 0 rgba(45, 36, 51, 0.18), var(--shadow); }
.chapter h3 { margin: 0; font-size: 21px; font-weight: 900; color: #17874a; }
.chapter span { font-size: 15px; font-weight: 650; color: #5a5466; }
.chapter.c2 h3 { color: #2a7fc0; }
.chapter.c3 h3 { color: #5a6fd8; }
.map-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.map-bg { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
.screen-title {
  position: relative; margin: calc(78px + var(--safe-t)) auto 6px; width: fit-content; padding: 8px 22px; border-radius: 99px;
  font-size: 26px; font-weight: 900; color: #2d2433; background: #f6fff9; box-shadow: var(--shadow);
}
.map-path { position: relative; list-style: none; margin: 0 auto; padding: 18px 0 calc(60px + var(--safe-b)); width: min(100%, 520px); }
.node { position: relative; height: 150px; }
.node-btn {
  position: absolute; top: 12px; left: var(--nx); transform: translateX(-50%);
  width: 112px; height: 112px; border-radius: 50%; border: 6px solid #fff; padding: 0; overflow: hidden;
  background: #fff; box-shadow: 0 7px 0 rgba(45, 36, 51, 0.25), var(--shadow);
  transition: transform 0.15s;
}
.node-btn:active { transform: translateX(-50%) scale(0.94); }
.node-btn canvas { width: 100%; height: 100%; display: block; }
.node-btn.locked canvas { filter: grayscale(1) brightness(1.1); opacity: 0.55; }
.node-btn .num {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); min-width: 34px; height: 28px; padding: 0 8px; border-radius: 14px;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 2px 0 #0f5c31;
}
.node-btn .lock { position: absolute; inset: 0; display: grid; place-items: center; color: #4b4658; font-size: 38px; }
.node-btn.next { border-color: var(--yellow); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 7px 0 rgba(45, 36, 51, 0.25), 0 0 0 10px rgba(255, 210, 63, 0.45); } }
.node-info { position: absolute; top: 130px; left: var(--nx); transform: translateX(-50%); width: 170px; text-align: center; }
.node-title { display: block; font-weight: 800; font-size: 15px; line-height: 1.15; color: #2d2433; text-shadow: 0 1px 0 #fff, 0 0 8px rgba(255, 255, 255, 0.9); }
.node-stars { display: flex; justify-content: center; gap: 2px; margin-top: 2px; font-size: 18px; }
.node-stars i.off { filter: grayscale(1); opacity: 0.4; }

/* ------------------------------------------------------------ stickers */
.stickers { background: var(--bg); }
.sheet-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 0 16px calc(30px + var(--safe-b)); }
.stickers .screen-title { background: var(--paper); color: var(--text); }
.sticker-grid { list-style: none; margin: 10px auto 0; padding: 0; width: min(100%, 640px); display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.sticker-grid li { text-align: center; padding: 12px 8px 10px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.sticker-grid canvas { width: 104px; height: 104px; display: block; margin: 0 auto 6px; }
.sticker-grid li.got canvas { animation: wiggle 5s ease-in-out infinite; }
.sticker-grid span { font-weight: 750; font-size: 15px; }
@keyframes wiggle { 0%, 90%, 100% { transform: rotate(0); } 94% { transform: rotate(-6deg); } 97% { transform: rotate(5deg); } }
/* my stars (Results): every mission's picture and its three stars, all the stars together, the friends' board */
.star-total { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 4px; font-size: 22px; color: var(--muted); font-weight: 750; }
.star-total i { font-size: 42px; }
.star-total b { font-size: 40px; font-weight: 900; color: var(--text); line-height: 1; }
.mission-stars { list-style: none; margin: 10px auto 0; padding: 0; width: min(100%, 640px); display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.mission-stars li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.ms-pic { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; overflow: hidden; background: #fff; box-shadow: 0 4px 0 rgba(45, 36, 51, 0.18); }
.ms-pic canvas { width: 100%; height: 100%; display: block; }
.ms-pic .num { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); min-width: 26px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 900; font-size: 14px; }
.ms-pic .lock { position: absolute; inset: 0; display: grid; place-items: center; color: #4b4658; font-size: 30px; }
.mission-stars li.locked .ms-pic canvas { filter: grayscale(1) brightness(1.1); opacity: 0.55; }
.mission-stars li.locked .ms-name { color: var(--muted); }
.ms-name { font-weight: 750; font-size: 15px; line-height: 1.2; }
.ms-stars { display: flex; gap: 3px; font-size: 28px; margin-top: auto; }
.ms-stars i.off { filter: grayscale(1); opacity: 0.35; }
/* on the dark card the stars still to win stay easy to see */
:root[data-theme="dark"] .ms-stars i.off { filter: grayscale(1) brightness(1.7); opacity: 0.5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ms-stars i.off { filter: grayscale(1) brightness(1.7); opacity: 0.5; } }
.friends { width: min(100%, 520px); margin: 26px auto 0; }
.friends-title { margin: 0 0 8px; text-align: center; font-size: 22px; font-weight: 900; }
.board { width: 100%; }

/* ------------------------------------------------------------ mission HUD */
.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
.say {
  position: absolute; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 24px), 560px); display: grid; grid-template-columns: 58px 1fr 44px; align-items: center; gap: 10px;
  padding: 8px 8px 8px 8px; border-radius: 24px; background: rgba(250, 255, 252, 0.95); color: #2d2433;
  box-shadow: 0 10px 24px -12px rgba(20, 40, 30, 0.5); border: 3px solid #fff;
}
.say.novoice { grid-template-columns: 58px 1fr; padding-right: 14px; }
.say.pop { animation: pop 0.35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pop { 0% { transform: translateX(-50%) scale(0.92); } 100% { transform: translateX(-50%) scale(1); } }
.say-face { width: 58px; height: 58px; border-radius: 50%; background: #e3f6ec; }
.say p { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.25; }
.say-again { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #e3f6ec; color: #17633a; display: grid; place-items: center; font-size: 22px; }
.trip {
  position: absolute; top: calc(150px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 40px), 420px); height: 34px;
  pointer-events: none;
}
.trip-line { position: absolute; left: 14px; right: 14px; top: 15px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.95) 0 12px, rgba(255,255,255,.35) 12px 20px); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.trip-truck { position: absolute; top: 0; left: calc(var(--p, 0) * (100% - 40px)); font-size: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.trip-goal { position: absolute; top: 0; right: -6px; font-size: 32px; animation: flick 0.6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scale(1.12) rotate(4deg); } }

.controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(14px + var(--safe-r)) calc(16px + var(--safe-b)) calc(14px + var(--safe-l)); display: flex; align-items: flex-end; gap: 12px; pointer-events: none; }
.ctl {
  pointer-events: auto; position: relative; display: grid; place-items: center; align-content: center; gap: 2px;
  width: 92px; height: 92px; border-radius: 28px; border: 0; color: #fff; font-weight: 850; font-size: 15px;
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.25), 0 14px 22px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.08s, box-shadow 0.08s; touch-action: none;
}
.ctl i { font-size: 40px; }
.ctl.down { transform: translateY(5px) scale(0.97); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 6px 12px -8px rgba(0, 0, 0, 0.5); }
.ctl.siren { background: linear-gradient(180deg, #4d8cff, #2f5fd0); }
.ctl.siren.on { background: linear-gradient(180deg, #ff5a4a, #c42a22); animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { background: linear-gradient(180deg, #4d8cff, #2f5fd0); } }
.ctl.horn { background: linear-gradient(180deg, #ffb340, #e0861a); color: #2d2433; }
.ctl.pedal { margin-left: auto; width: 112px; height: 132px; border-radius: 34px; background: linear-gradient(180deg, #4fd27f, #22984f 70%, #187a3d); }
.ctl.pedal i { font-size: 52px; }
.ctl.lift { margin-left: auto; width: 112px; height: 132px; border-radius: 34px; background: linear-gradient(180deg, #ff7a8a, #e8394a 70%, #b81c30); }
.ctl.lift i { font-size: 52px; }
.ctl.left, .ctl.right { width: 104px; height: 104px; border-radius: 34px; background: linear-gradient(180deg, #ffcf4a, #e0a800); color: #2d2433; }
.ctl.right { margin-left: auto; }
.ctl.left i, .ctl.right i { font-size: 52px; }
.ctl.nudge::after { content: ""; position: absolute; inset: -8px; border-radius: inherit; border: 4px solid #fff; animation: ring 1.1s ease-out infinite; }
@keyframes ring { from { opacity: 1; transform: scale(0.95); } to { opacity: 0; transform: scale(1.18); } }

/* the vehicle choice */
.choose {
  position: absolute; left: 50%; top: calc(164px + var(--safe-t)); transform: translateX(-50%);
  width: min(calc(100% - 24px), 640px); display: grid; gap: 12px;
}
.choose-scene { width: 100%; height: clamp(120px, calc(22vh / var(--ca-zoom, 1)), 210px); border-radius: 22px; border: 4px solid #fff; box-shadow: var(--shadow); display: block; background: #bfe6ff; }
.choose-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt {
  display: grid; justify-items: center; gap: 4px; padding: 6px 4px 10px; border: 4px solid #fff; border-radius: 22px;
  background: #fffaf2; color: #2d2433; box-shadow: 0 6px 0 rgba(45, 36, 51, 0.18), var(--shadow); transition: transform 0.15s, opacity 0.3s;
}
.opt:active { transform: scale(0.96); }
.opt-art { width: 100%; height: clamp(70px, calc(14vh / var(--ca-zoom, 1)), 120px); display: block; }
.opt-name { font-weight: 850; font-size: 15px; line-height: 1.1; text-align: center; }
.opt.ok { border-color: #4fd27f; background: #eafff0; transform: scale(1.06); }
.opt.no { animation: shake 0.45s; }
.opt.fade { opacity: 0.35; }
@media (max-width: 560px) and (orientation: portrait) {
  .choose-list { grid-template-columns: 1fr; gap: 8px; }
  .opt { grid-template-columns: 1.3fr 1fr; align-items: center; justify-items: start; padding: 4px 14px 4px 6px; }
  .opt-art { height: clamp(64px, calc(11vh / var(--ca-zoom, 1)), 96px); }
  .opt-name { font-size: 18px; text-align: left; }
  .choose-scene { height: clamp(110px, calc(18vh / var(--ca-zoom, 1)), 170px); }
}
@keyframes shake { 20%, 60% { transform: translateX(-8px) rotate(-2deg); } 40%, 80% { transform: translateX(8px) rotate(2deg); } }

/* the hint hand */
.hand { position: fixed; left: 0; top: 0; z-index: 8; width: 56px; height: 56px; font-size: 56px; pointer-events: none; transform: translate(var(--x), var(--y)); filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
.hand i { width: 1em; height: 1em; transform: translate(-30%, -8%); }
.hand.tap { animation: tap 1.1s ease-in-out infinite; }
.hand.drag, .hand.saw { animation: drag 2s ease-in-out infinite; }
.hand.circle { animation: circle 1.8s linear infinite; }
@keyframes circle { from { transform: translate(var(--x), var(--y)) rotate(0turn) translateX(var(--r)) rotate(0turn); } to { transform: translate(var(--x), var(--y)) rotate(1turn) translateX(var(--r)) rotate(-1turn); } }
.hand.saw { animation-duration: 0.9s; animation-direction: alternate; }
@keyframes tap { 0%, 100% { transform: translate(var(--x), var(--y)) scale(1); } 50% { transform: translate(var(--x), calc(var(--y) + 10px)) scale(0.88); } }
@keyframes drag { 0%, 12% { transform: translate(var(--x), var(--y)) scale(0.9); opacity: 0; } 20% { opacity: 1; } 75% { transform: translate(var(--x2), var(--y2)) scale(1); opacity: 1; } 100% { transform: translate(var(--x2), var(--y2)) scale(1); opacity: 0; } }

/* ------------------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(40, 20, 30, 0.42); }
.card {
  width: min(100%, 440px); max-height: calc(calc(100dvh / var(--ca-zoom, 1)) - 32px); overflow-y: auto; text-align: center; padding: 20px 20px 18px;
  border-radius: 32px; background: var(--paper); color: var(--text); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  animation: rise 0.4s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes rise { from { transform: translateY(30px) scale(0.96); opacity: 0; } }
.card h2 { margin: 2px 0 6px; font-size: 27px; line-height: 1.1; font-weight: 900; }
.intro-face { width: 120px; height: 120px; display: block; margin: -4px auto 4px; }
.kicker { margin: 0; font-weight: 800; color: var(--brand); letter-spacing: 0.02em; }
:root[data-theme="dark"] .kicker { color: #6fe0a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kicker { color: #6fe0a0; } }
.intro-text { margin: 0 0 16px; font-size: 19px; font-weight: 650; }
.play-btn.go { justify-content: center; }
.big-stars { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; font-size: 66px; }
.big-stars i { transform: scale(0); }
.big-stars i.on { animation: star-in 0.5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.big-stars i.off { filter: grayscale(1); opacity: 0.35; transform: scale(1); }
@keyframes star-in { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
.story { margin: 4px 0 8px; font-size: 18px; font-weight: 700; }
.tip { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 8px; padding: 10px 12px; border-radius: 18px; background: #fff7d6; color: #4a3a10; text-align: left; font-size: 16px; font-weight: 650; }
.tip i { font-size: 26px; }
:root[data-theme="dark"] .tip { background: #3a3218; color: #fff2c2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tip { background: #3a3218; color: #fff2c2; } }
.new-sticker { margin: 6px 0 4px; }
.new-sticker canvas { width: 140px; height: 140px; display: block; margin: 0 auto; animation: sticker 0.8s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sticker { from { transform: scale(0.2) rotate(-200deg); opacity: 0; } }
.new-sticker p { margin: 4px 0 0; }
.col { display: grid; gap: 10px; margin-top: 12px; }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ sheets */
.sheet {
  border: 0; border-radius: 28px; padding: 22px 20px 18px; width: min(calc(calc(100vw / var(--ca-zoom, 1)) - 24px), 440px); max-height: calc(calc(100dvh / var(--ca-zoom, 1)) - 40px);
  background: var(--paper); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.sheet::backdrop { background: rgba(30, 15, 25, 0.5); }
.sheet h2 { margin: 0 0 12px; font-size: 24px; font-weight: 900; }
.sheet h3 { margin: 18px 0 4px; font-size: 18px; }
.help p { margin: 6px 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); font-weight: 700; }
.set-row select { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); max-width: 55%; }
.switch { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 16px; background: #cfc7d8; position: relative; cursor: pointer; transition: background 0.2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform 0.2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(22px); }
.link-btn { margin: 14px 0 6px; padding: 10px 0; min-height: 44px; border: 0; background: none; color: var(--blue); font-weight: 750; text-decoration: underline; }
:root[data-theme="dark"] .link-btn { color: #8fb6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .link-btn { color: #8fb6ff; } }
.sheet form { margin-top: 12px; }

/* modes */
body.mode-mission .home, body.mode-mission .map, body.mode-mission .stickers { display: none; }
@media (max-height: 560px) and (orientation: landscape) {
  .home { padding-top: calc(10px + var(--safe-t)); }
  .home-card { padding: 12px 18px; width: min(46%, 420px); justify-self: start; margin-left: 4%; }
  .logo { font-size: 34px; }
  .tagline { display: none; }
  .play-btn { min-height: 62px; }
  .say { top: calc(60px + var(--safe-t)); width: min(calc(100% - 220px), 520px); grid-template-columns: 46px 1fr 40px; padding: 5px; }
  .say-face { width: 46px; height: 46px; }
  .say p { font-size: 16px; }
  .say-again { width: 40px; height: 40px; }
  .say.novoice { grid-template-columns: 46px 1fr; padding-right: 12px; }
  .trip { top: calc(124px + var(--safe-t)); }
  .choose { top: calc(124px + var(--safe-t)); }
  .choose-scene { display: none; }
  .ctl { width: 80px; height: 80px; }
  .ctl.pedal, .ctl.lift { width: 100px; height: 112px; }
  .ctl.left, .ctl.right { width: 84px; height: 84px; }
}
/* a phone on its side with little height: the card keeps its buttons in view */
@media (max-height: 420px) and (orientation: landscape) {
  .hello, .credit { display: none; }
  /* wide enough for the name on one line and Missions beside Stickers */
  .home-card { padding: 10px 16px 12px; width: min(60%, 420px); }
  .logo { font-size: 28px; }
  .play-btn { min-height: 58px; padding: 8px 16px; }
  .home-row { margin-top: 10px; flex-wrap: nowrap; }
  .pill-btn { min-height: 46px; padding: 0 14px; }
  .home-row .round-btn { width: 44px; height: 44px; }
}
@media (max-width: 360px) {
  .ctl { width: 80px; height: 80px; }
  .say p { font-size: 16px; }
  /* a 320 px phone: Missions and Stickers side by side inside the card (they pushed it past the edge) */
  .home-card { padding: 16px 12px 14px; }
  .home-row { gap: 8px; }
  .pill-btn { padding: 0 13px; font-size: 16px; }
}
html.reduce *, html.reduce *::before, html.reduce *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.full) *, html:not(.full) *::before, html:not(.full) *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
/* less motion: the hint hand still shows where to go, standing still at the goal */
html.reduce .hand { animation: none !important; opacity: 1; transform: translate(var(--x2), var(--y2)); }
html.reduce .hand.circle { transform: translate(var(--x), var(--y)) translateX(var(--r)); }
@media (prefers-reduced-motion: reduce) {
  html:not(.full) .hand { animation: none !important; opacity: 1; transform: translate(var(--x2), var(--y2)); }
  html:not(.full) .hand.circle { transform: translate(var(--x), var(--y)) translateX(var(--r)); }
}

/* cloud-apps bar 1.30.0 */
:root { --ca-brand-icon-w: 89px; } /* the brand's width with the icon alone (the mark, the divider, the app's icon) */
.ca-start { display: flex; align-items: center; flex: 0 100 auto; min-width: min(var(--ca-brand-icon-w), 100%); }
.ca-brand { display: flex; align-items: center; min-width: 0; height: 40px; color: inherit; font-family: inherit; }
.ca-brand a { display: flex !important; align-items: center !important; box-sizing: border-box !important; color: inherit !important; text-decoration: none !important; border-radius: 12px !important; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.ca-brand-home { flex: none !important; justify-content: center !important; width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 0 0 -5px !important; }
.ca-brand-home img { display: block !important; width: 30px !important; height: 30px !important; margin: 0 !important; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.ca-brand-sep { flex: none; display: block; width: 1.5px; height: 18px; margin: 0 4px; border-radius: 1px; background: currentColor; opacity: .22; transform: rotate(18deg); }
.ca-brand-app { flex: 0 1 auto !important; min-width: 44px !important; height: 40px !important; padding: 0 9px 0 5px !important; margin: 0 !important; }
.ca-brand-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 9px; min-width: 0; height: 40px; overflow: hidden; }
.ca-brand-in img { flex: none; display: block !important; width: 30px !important; height: 30px !important; margin: 5px 0 !important; border-radius: 8px; }
.ca-brand[data-ca-icon] .ca-brand-name { display: none !important; }
.ca-brand[data-ca-icon] .ca-brand-app { padding-right: 5px !important; }
.ca-brand-name { display: block; height: 40px; margin: 0 !important; padding: 0 !important; line-height: 40px !important; white-space: nowrap; font-family: var(--ca-brand-font, inherit); font-size: 17px !important; font-weight: 700; letter-spacing: -.015em; color: inherit; text-shadow: var(--ca-brand-shadow, none); }
@media (hover: hover) { .ca-brand a:hover { background-color: color-mix(in srgb, currentColor 7%, transparent); } .ca-brand-home:hover img { transform: rotate(-6deg) scale(1.06); } }
.ca-brand a:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: -3px; }
.ca-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-width: 0; }
.ca-tools { display: flex; align-items: center; gap: 6px; }
.ca-tools[hidden] { display: none !important; }
.ca-tool { position: relative; flex: none; display: inline-grid; place-items: center !important; box-sizing: border-box !important; width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; margin: 0; border-radius: 50% !important;
  border: 1px solid var(--ca-tool-line, color-mix(in srgb, currentColor 16%, transparent)) !important; background: var(--ca-tool-bg, color-mix(in srgb, currentColor 6%, transparent)) !important; color: var(--ca-tool-ink, inherit) !important;
  font: inherit; line-height: 0 !important; letter-spacing: 0; text-decoration: none !important; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .12s ease; }
.ca-tool[hidden] { display: none !important; }
.ca-tool::before { content: ""; position: absolute; inset: -4px; }
.ca-tool svg { display: block; width: 20px !important; height: 20px !important; margin: 0 !important; pointer-events: none; }
.ca-tool svg[hidden] { display: none !important; }
@media (hover: hover) { .ca-tool:hover { background: var(--ca-tool-hover, color-mix(in srgb, currentColor 13%, transparent)) !important; } }
.ca-tool:active { transform: scale(.94); }
.ca-tool:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: 2px; }
.ca-tool-talk { color: var(--ca-accent, #4f6bff) !important; border-color: color-mix(in srgb, var(--ca-accent, #4f6bff) 50%, transparent) !important; background: color-mix(in srgb, var(--ca-accent, #4f6bff) 13%, transparent) !important; }
.ca-tool .ca-tlive { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.ca-tool-talk.ca-new::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: ca-bar-ring 1.2s ease-out 2; }
@keyframes ca-bar-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ca-accent, #4f6bff) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
.ca-tool .ca-tcount, .ca-tool .ca-tunread { position: absolute; right: -5px; display: grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0; pointer-events: none; }
.ca-tool .ca-tcount { bottom: -5px; background: #1f9d55; }
.ca-tool .ca-tunread { top: -5px; background: #e5484d; }
@media (max-width: 599.98px), (max-height: 499.98px) { .ca-tools-app { display: none !important; } }
.ca-end[data-ca-cramped] .ca-tools-app { display: none !important; }
.ca-end[data-ca-tight] .ca-tool-friends { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ca-tool, .ca-brand a, .ca-brand-home img { transition: none; } .ca-tool-talk.ca-new::after { animation: none; } }
/* end of the cloud-apps bar */
/* ---- cloud-apps: big screens (App Standard §6.5) — written by `cloud-apps vendor-sdk`; do not edit ---- */
/* Past 1584 × 990 the page is laid out at about 1440 × 900 and zoomed to fill the screen; viewport
   units in this file are divided by --ca-zoom. cloud-kit.js turns it off where the engine has no
   standard zoom (html[data-ca-zoom="off"]). */
@media (min-width: 1585px) and (min-height: 991px) { :root { --ca-zoom: 1.1; } }
@media (min-width: 1656px) and (min-height: 1035px) { :root { --ca-zoom: 1.15; } }
@media (min-width: 1728px) and (min-height: 1080px) { :root { --ca-zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1125px) { :root { --ca-zoom: 1.25; } }
@media (min-width: 1872px) and (min-height: 1170px) { :root { --ca-zoom: 1.3; } }
@media (min-width: 1945px) and (min-height: 1215px) { :root { --ca-zoom: 1.35; } }
@media (min-width: 2016px) and (min-height: 1260px) { :root { --ca-zoom: 1.4; } }
@media (min-width: 2088px) and (min-height: 1305px) { :root { --ca-zoom: 1.45; } }
@media (min-width: 2160px) and (min-height: 1350px) { :root { --ca-zoom: 1.5; } }
@media (min-width: 2232px) and (min-height: 1395px) { :root { --ca-zoom: 1.55; } }
@media (min-width: 2304px) and (min-height: 1440px) { :root { --ca-zoom: 1.6; } }
@media (min-width: 2376px) and (min-height: 1485px) { :root { --ca-zoom: 1.65; } }
@media (min-width: 2448px) and (min-height: 1530px) { :root { --ca-zoom: 1.7; } }
@media (min-width: 2520px) and (min-height: 1575px) { :root { --ca-zoom: 1.75; } }
@media (min-width: 2592px) and (min-height: 1620px) { :root { --ca-zoom: 1.8; } }
@media (min-width: 2664px) and (min-height: 1665px) { :root { --ca-zoom: 1.85; } }
@media (min-width: 2736px) and (min-height: 1710px) { :root { --ca-zoom: 1.9; } }
@media (min-width: 2808px) and (min-height: 1755px) { :root { --ca-zoom: 1.95; } }
@media (min-width: 2880px) and (min-height: 1800px) { :root { --ca-zoom: 2; } }
@media (min-width: 2952px) and (min-height: 1845px) { :root { --ca-zoom: 2.05; } }
@media (min-width: 3024px) and (min-height: 1890px) { :root { --ca-zoom: 2.1; } }
@media (min-width: 3096px) and (min-height: 1935px) { :root { --ca-zoom: 2.15; } }
@media (min-width: 3169px) and (min-height: 1981px) { :root { --ca-zoom: 2.2; } }
@media (min-width: 3240px) and (min-height: 2025px) { :root { --ca-zoom: 2.25; } }
@media (min-width: 3312px) and (min-height: 2070px) { :root { --ca-zoom: 2.3; } }
@media (min-width: 3384px) and (min-height: 2115px) { :root { --ca-zoom: 2.35; } }
@media (min-width: 3456px) and (min-height: 2160px) { :root { --ca-zoom: 2.4; } }
@media (min-width: 3529px) and (min-height: 2205px) { :root { --ca-zoom: 2.45; } }
@media (min-width: 3600px) and (min-height: 2250px) { :root { --ca-zoom: 2.5; } }
@media (min-width: 3672px) and (min-height: 2295px) { :root { --ca-zoom: 2.55; } }
@media (min-width: 3744px) and (min-height: 2340px) { :root { --ca-zoom: 2.6; } }
@media (min-width: 3816px) and (min-height: 2385px) { :root { --ca-zoom: 2.65; } }
@media (min-width: 3889px) and (min-height: 2430px) { :root { --ca-zoom: 2.7; } }
@media (min-width: 3960px) and (min-height: 2475px) { :root { --ca-zoom: 2.75; } }
@media (min-width: 4032px) and (min-height: 2520px) { :root { --ca-zoom: 2.8; } }
@media (min-width: 4104px) and (min-height: 2565px) { :root { --ca-zoom: 2.85; } }
@media (min-width: 4176px) and (min-height: 2610px) { :root { --ca-zoom: 2.9; } }
@media (min-width: 4248px) and (min-height: 2655px) { :root { --ca-zoom: 2.95; } }
@media (min-width: 4320px) and (min-height: 2700px) { :root { --ca-zoom: 3; } }
@media (min-width: 4392px) and (min-height: 2745px) { :root { --ca-zoom: 3.05; } }
@media (min-width: 4464px) and (min-height: 2790px) { :root { --ca-zoom: 3.1; } }
@media (min-width: 4536px) and (min-height: 2835px) { :root { --ca-zoom: 3.15; } }
@media (min-width: 4608px) and (min-height: 2880px) { :root { --ca-zoom: 3.2; } }
@media (min-width: 4680px) and (min-height: 2925px) { :root { --ca-zoom: 3.25; } }
@media (min-width: 4752px) and (min-height: 2970px) { :root { --ca-zoom: 3.3; } }
@media (min-width: 4824px) and (min-height: 3015px) { :root { --ca-zoom: 3.35; } }
@media (min-width: 4896px) and (min-height: 3060px) { :root { --ca-zoom: 3.4; } }
@media (min-width: 4968px) and (min-height: 3105px) { :root { --ca-zoom: 3.45; } }
@media (min-width: 5040px) and (min-height: 3150px) { :root { --ca-zoom: 3.5; } }
@media (min-width: 5112px) and (min-height: 3195px) { :root { --ca-zoom: 3.55; } }
@media (min-width: 5184px) and (min-height: 3240px) { :root { --ca-zoom: 3.6; } }
@media (min-width: 5256px) and (min-height: 3285px) { :root { --ca-zoom: 3.65; } }
@media (min-width: 5328px) and (min-height: 3330px) { :root { --ca-zoom: 3.7; } }
@media (min-width: 5400px) and (min-height: 3375px) { :root { --ca-zoom: 3.75; } }
@media (min-width: 5472px) and (min-height: 3420px) { :root { --ca-zoom: 3.8; } }
@media (min-width: 5544px) and (min-height: 3465px) { :root { --ca-zoom: 3.85; } }
@media (min-width: 5616px) and (min-height: 3510px) { :root { --ca-zoom: 3.9; } }
@media (min-width: 5688px) and (min-height: 3555px) { :root { --ca-zoom: 3.95; } }
@media (min-width: 5760px) and (min-height: 3600px) { :root { --ca-zoom: 4; } }
@media (min-width: 5832px) and (min-height: 3645px) { :root { --ca-zoom: 4.05; } }
@media (min-width: 5904px) and (min-height: 3690px) { :root { --ca-zoom: 4.1; } }
@media (min-width: 5977px) and (min-height: 3736px) { :root { --ca-zoom: 4.15; } }
@media (min-width: 6048px) and (min-height: 3780px) { :root { --ca-zoom: 4.2; } }
@media (min-width: 6120px) and (min-height: 3825px) { :root { --ca-zoom: 4.25; } }
@media (min-width: 6192px) and (min-height: 3870px) { :root { --ca-zoom: 4.3; } }
@media (min-width: 6264px) and (min-height: 3915px) { :root { --ca-zoom: 4.35; } }
@media (min-width: 6337px) and (min-height: 3961px) { :root { --ca-zoom: 4.4; } }
@media (min-width: 6408px) and (min-height: 4005px) { :root { --ca-zoom: 4.45; } }
@media (min-width: 6480px) and (min-height: 4050px) { :root { --ca-zoom: 4.5; } }
@media (min-width: 6552px) and (min-height: 4095px) { :root { --ca-zoom: 4.55; } }
@media (min-width: 6624px) and (min-height: 4140px) { :root { --ca-zoom: 4.6; } }
@media (min-width: 6697px) and (min-height: 4185px) { :root { --ca-zoom: 4.65; } }
@media (min-width: 6768px) and (min-height: 4230px) { :root { --ca-zoom: 4.7; } }
@media (min-width: 6840px) and (min-height: 4275px) { :root { --ca-zoom: 4.75; } }
@media (min-width: 6912px) and (min-height: 4320px) { :root { --ca-zoom: 4.8; } }
@media (min-width: 6984px) and (min-height: 4365px) { :root { --ca-zoom: 4.85; } }
@media (min-width: 7057px) and (min-height: 4410px) { :root { --ca-zoom: 4.9; } }
@media (min-width: 7128px) and (min-height: 4455px) { :root { --ca-zoom: 4.95; } }
@media (min-width: 7200px) and (min-height: 4500px) { :root { --ca-zoom: 5; } }
@media (min-width: 1585px) and (min-height: 991px) {
  html { zoom: var(--ca-zoom, 1); }
  html[data-ca-zoom='off'] { --ca-zoom: 1 !important; }
}
/* ---- end of big screens ---- */
