/* Rocket Launch in the browser. Tokens and components follow docs/design/DESIGN.md. */
:root {
  --cream: #fff9f0;
  --ink: #122640;
  --coral: #eb664f;
  --mint: #cfe8d9;
  --mint-line: #9fcdb3;
  --gold: #fad166;
  --teal: #2a8fa3;
  --teal-text: #1f7384; /* link text: 5.2 to 1 on cream (the lighter teal is 3.6 to 1, fine for outlines only) */
  --night: #14204a;
  --deep: #08112b;
  --pebble: #f5f0e5;
  --pebble-line: #ded9c9;
  --safety-stop: #d14a3b;
  --safety-done: #30826b;
  --safety-help: #267aa1;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--ink); }
body {
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
a { color: var(--teal-text); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Screen: header, play area, safety strip, footer. Never scrolls on phones or desktops. */
.launch-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  width: 100%;
  max-width: 1440px;
  height: 100vh;
  height: 100dvh;
  min-height: 460px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}

.launch-header { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.home-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 6px;
  color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 12px; white-space: nowrap;
}
.home-link svg { width: 22px; height: 22px; fill: var(--ink); flex: none; }
.launch-title {
  flex: 1; margin: 0; min-width: 0; text-align: center;
  font: 700 17px/1.2 var(--round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comfort { display: flex; gap: 6px; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 10px;
  border: 1px solid var(--pebble-line); border-radius: 999px; background: var(--pebble);
  font-weight: 600; font-size: 14px; cursor: pointer; touch-action: manipulation; white-space: nowrap;
}
.toggle svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toggle .knob { width: 26px; height: 16px; border-radius: 999px; background: var(--pebble-line); position: relative; flex: none; transition: background 0.2s ease; }
.toggle .knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease;
}
.toggle[aria-pressed="true"] { background: var(--mint); border-color: var(--mint-line); }
.toggle[aria-pressed="true"] .knob { background: var(--safety-done); }
.toggle[aria-pressed="true"] .knob::after { transform: translateX(10px); }

.launch-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

/* Scene board: the painted world fills it; it is the only place with motion. */
.board {
  position: relative; flex: 1 1 auto; min-height: 180px; overflow: hidden; isolation: isolate;
  border-radius: 24px; background: linear-gradient(180deg, var(--deep), #1a2b5c);
  --caption-size: 28px; --sticker: 36px;
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.board-target {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
}
.board-target:disabled { cursor: default; }
.hud {
  position: absolute; inset: 0; padding: 10px; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hud-row { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.status {
  margin: 0; max-width: 58%; padding: 5px 10px; border-radius: 999px; background: rgba(18, 38, 64, 0.45); color: rgba(255, 255, 255, 0.92);
  font: 600 12px/1.35 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelf { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(18, 38, 64, 0.45); flex: none; }
.sticker {
  width: var(--sticker); height: var(--sticker); opacity: 0.28; filter: saturate(0); transform: scale(0.86);
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.8, 0.5, 1);
}
.sticker.earned { opacity: 1; filter: none; transform: scale(1); }

.caption {
  margin: 0; max-width: min(92%, 22em); padding: 0.3em 0.6em; border-radius: 0.7em;
  background: var(--cream); color: var(--ink); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  font: 800 var(--caption-size)/1.1 var(--round); text-align: center; letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transform-origin: 50% 40%;
}
.caption .ending { color: var(--coral); }
.caption.pop { animation: caption-in 0.32s cubic-bezier(0.3, 1.45, 0.55, 1) both; }
.caption.is-out { opacity: 0; transition: opacity 0.06s ease-out; }
@keyframes caption-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

.help-text {
  margin: 0; max-width: min(92%, 28em); padding: 8px 14px; border-radius: 14px; background: rgba(255, 249, 240, 0.96); color: var(--ink);
  font: 600 14px/1.3 var(--body); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.noscript { position: absolute; inset: auto 16px 16px; margin: 0; padding: 12px; border-radius: 14px; background: var(--cream); font-weight: 600; text-align: center; }

/* Action area */
.controls { position: relative; flex: none; display: flex; flex-direction: column; gap: 8px; }
.dock { position: relative; min-height: 108px; display: flex; flex-direction: column; justify-content: center; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cards.is-waiting { opacity: 0.5; }
.card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 108px; padding: 6px 4px; border: 2px solid var(--mint); border-radius: 20px; background: #fff; color: var(--ink);
  font: 700 17px/1.15 var(--round); text-align: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:disabled { cursor: default; }
.card-icon { width: 56px; height: 56px; flex: none; }
.is-help .card { border-color: var(--coral); box-shadow: inset 0 0 0 2px var(--coral); }

.big {
  display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 84px; padding: 0 8px;
  border: 0; border-radius: 22px; font: 800 30px/1 var(--round); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform 0.12s ease-out, background-color 0.2s ease, opacity 0.2s ease;
}
.big:disabled { cursor: default; opacity: 0.45; }
.big .icon { width: 44px; height: 52px; flex: none; position: relative; display: block; }
.big .icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.big .icon.tilt img { transform: rotate(18deg); }
.big .icon .again-arrow { position: absolute; left: -10px; top: -2px; width: 20px; height: 20px; fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.big .icon svg.hare { width: 44px; height: 44px; margin-top: 4px; fill: var(--ink); }
.go, .resume { background: var(--coral); color: #fff; }
.go[data-ready="false"] { background: rgba(235, 102, 79, 0.35); }
.is-holding .go[data-ready="true"] { animation: go-pulse 0.9s ease-in-out infinite; }
@keyframes go-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.fast { background: var(--gold); color: var(--ink); }
.again, .replay { background: var(--mint); color: var(--ink); }
.big.is-pressed, .card.is-pressed:not(:disabled), .big:active:not(:disabled), .card:active:not(:disabled) { transform: scale(0.95); animation: none; }

.help-pointer svg { display: block; width: 100%; height: 100%; fill: var(--coral); }
.help-pointer {
  position: absolute; right: 10px; top: 50%; width: 46px; height: 38px; margin-top: -19px; pointer-events: none;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff);
  animation: pointer-nudge 1.2s ease-in-out infinite;
}
/* With the destination cards showing, the help pointer sits in the free top corner of a card. */
[data-mode="cards"] .help-pointer { top: 8px; margin-top: 0; right: 2px; width: 38px; height: 31px; }
@keyframes pointer-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-6px); } }

/* Safety strip: always at the bottom, four equal buttons, never moved or covered. */
.safety { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.safety-button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 4px 2px;
  border: 1px solid var(--pebble-line); border-radius: 14px; background: var(--pebble); color: var(--ink);
  font: 600 12px/1.2 var(--body); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease-out;
}
.safety-button:active { transform: scale(0.95); }
.disc { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.disc svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.disc.help, .disc.quiet { background: var(--safety-help); }
.disc.stop { background: var(--safety-stop); }
.disc.done { background: var(--safety-done); }
.disc .solid { fill: #fff; stroke: none; }

.launch-footer { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 14px; row-gap: 2px; font-size: 12px; line-height: 16px; }
.launch-footer a { color: var(--teal-text); text-decoration: none; padding: 4px 0; } /* 24 px tall: the smallest target WCAG 2.2 allows */
.launch-age { color: var(--ink); opacity: 0.75; padding: 4px 0; }
.launch-footer a:hover, .launch-footer a:focus-visible { text-decoration: underline; }
.launch-footer a.after-trip { flex-basis: 100%; text-align: center; font-weight: 700; font-size: 14px; line-height: 20px; padding: 8px 0; order: -1; } /* the grown-up's next step, once a trip is done */

/* Mouse and trackpad: a quiet hover so grown-ups can see what is clickable. */
@media (hover: hover) and (pointer: fine) {
  .card:hover:not(:disabled) { border-color: var(--mint-line); }
  .big:hover:not(:disabled) { filter: brightness(1.04); }
  .safety-button:hover, .toggle:hover { background: #efe9dc; }
  .toggle[aria-pressed="true"]:hover { background: #c3e0ce; }
  .home-link:hover { text-decoration: underline; }
}

/* Landscape: the board on the left, a controls column on the right (max 260 px), like the app. */
@media (orientation: landscape) and (min-width: 601px) {
  .launch-main { flex-direction: row; }
  .board { min-height: 0; }
  .controls { width: min(260px, 30vw); overflow-y: auto; overscroll-behavior: contain; justify-content: center; padding: 2px; }
  .dock { min-height: 0; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
/* Short landscape phones: smaller cards and buttons so the board keeps its room. */
@media (orientation: landscape) and (max-height: 500px) {
  .launch-app { gap: 6px; min-height: 300px; }
  .launch-header { min-height: 36px; }
  .home-link, .toggle { min-height: 36px; }
  .card { flex-direction: row; min-height: 0; padding: 4px 8px; gap: 8px; font-size: 15px; }
  .card-icon { width: 36px; height: 36px; }
  .big { min-height: 60px; font-size: 24px; }
  .safety-button { min-height: 44px; flex-direction: row; gap: 6px; }
  .disc { width: 24px; height: 24px; }
  [data-mode="cards"] .help-pointer { top: 0; right: 0; width: 28px; height: 23px; }
}
/* Narrow phones: icon-only home link so the title and comfort toggles fit. */
@media (max-width: 430px) {
  .home-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .home-link { min-width: 44px; justify-content: center; padding-right: 0; }
  .toggle { padding: 0 10px 0 8px; gap: 5px; font-size: 13px; }
  .toggle .knob { display: none; }
}
@media (max-width: 340px) { .launch-title { display: none; } .comfort { margin-left: auto; } }

/* Calm and Reduce Motion: still pictures, no pulses or pops. */
.is-reduced .caption.pop, .is-reduced .go, .is-reduced .help-pointer, .is-reduced .sticker { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* For grown-ups (2026-11-30): plain reading text below the game screen, outside .launch-app, so the screen above is
   unchanged. Quiet on purpose: body text, one hairline, no pictures or motion. */
.grownups {
  max-width: 680px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--pebble-line); font-size: 16px; line-height: 1.55;
}
.grownups h2 { margin: 28px 0 8px; font: 700 20px/1.25 var(--round); }
.grownups h2:first-child { margin-top: 0; }
.grownups h3 { margin: 18px 0 4px; font-size: 16px; line-height: 1.35; }
.grownups p, .grownups ol, .grownups ul { margin: 0 0 12px; }
.grownups ol, .grownups ul { padding-left: 22px; }
.grownups li { margin-bottom: 6px; }
.grownups-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.grownups-links a { padding: 6px 0; }
.grownups-cta { font-weight: 700; }
