
/* ---- styles/00-tokens.css ---- */
/*
 * Design tokens: the only place raw colours, radii, shadows, spacing and timings are defined.
 * Every other stylesheet uses var(--token), so the whole look can be changed from here.
 * (The page is a deliberately light, pink design; there is no dark variant.)
 */
:root {
  /* colour */
  --color-bg: #fff3f6;
  --color-surface: #ffffff;
  --color-ink: #5b2a3f;
  --color-ink-muted: #8d566c;
  --color-ink-verse: #6d3a52;
  --color-on-ink: #ffffff;
  --color-line: #f6cddb;
  --color-blush: #ffe4ec;
  --color-blush-soft: #fff0f4;
  --color-pink: #ff8fb3;
  --color-pink-bright: #ff5c93;
  --color-pink-deep: #e5487b;
  --color-peach: #ffc3a0;
  --color-lilac: #cdb8ff;
  --color-plum: #6a3350;
  --color-plum-deep: #5b2a3f;
  --color-plum-light: #7a3a5a;

  /* per-component accent; JS overrides it with each planet's colour */
  --accent: var(--color-pink);

  /* type */
  --font-ui: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-fa: "Vazirmatn", "Noto Naskh Arabic", Tahoma, "Segoe UI", sans-serif;

  /* shape */
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-pill: 999px;

  /* depth */
  --shadow-soft: 0 4px 12px rgba(229, 72, 123, 0.1);
  --shadow-lift: 0 6px 14px rgba(229, 72, 123, 0.12);
  --shadow-card: 0 10px 28px rgba(229, 72, 123, 0.13), 0 0 0 1.5px rgba(246, 205, 219, 0.7);
  --shadow-sprite: drop-shadow(0 3px 3px rgba(120, 50, 80, 0.22));

  /* spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;

  /* motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-pop: cubic-bezier(0.3, 1.5, 0.5, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.3s;
  --dur-slow: 0.6s;
  --word-step: 55ms; /* set from Config.timing.wordStepMs at start-up */

  /* layers */
  --z-content: 1;
  --z-dock: 20;
  --z-toast: 30;
  --z-overlay: 50;
  --z-bloom: 60;

  --content-width: 460px;

  /* keep content clear of notches and home bars */
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- styles/10-base.css ---- */
/* Base: reset, page layout, and the small utilities everything shares. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* one focus style for everything interactive */
:focus-visible { outline: 3px solid var(--color-pink-deep); outline-offset: 3px; }

/* soft blush background with a faint dot pattern */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 12% 0%, #ffd6e3, transparent 70%),
    radial-gradient(50% 40% at 100% 100%, #ffe2d4, transparent 70%),
    radial-gradient(rgba(255, 92, 147, 0.09) 1.5px, transparent 1.9px) 0 0 / 28px 28px,
    linear-gradient(#fff7f9, #ffeef3);
}

.app {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 14px 3rem;
}

.screen {
  width: min(100%, var(--content-width));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: screen-in var(--dur-slow) var(--ease-out) both;
}
.screen:focus { outline: none; }

/* utilities */
.text-muted { color: var(--color-ink-muted); }
.sprite { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

.fine-print {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-ink-muted);
}
.fine-print--end { margin: 0.4rem 0 6rem; }

/* ---- styles/20-components.css ---- */
/* Components: building blocks shared by every screen. */

/* ---------- card ---------- */
.card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- chip (pill button) ---------- */
.chip {
  position: relative;
  min-height: 46px;
  min-width: 46px;
  padding: 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  box-shadow: var(--shadow-soft);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--dur-fast) ease, border-color 0.2s ease;
}
.chip:hover { border-color: var(--color-pink); }
.chip:active { transform: scale(0.96); }
.chip svg { width: 20px; height: 20px; }
.chip__icon svg { shape-rendering: crispEdges; }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--color-blush);
  color: var(--color-ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- badge ---------- */
.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--color-ink);
  color: var(--color-on-ink);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
}

/* ---------- segmented control (language) ---------- */
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  box-shadow: var(--shadow-soft);
}
.segmented button {
  min-width: 56px;
  min-height: 40px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.segmented button[lang="fa"] { font-family: var(--font-fa); font-weight: 700; font-size: 0.95rem; }
.segmented button[aria-pressed="true"] { background: var(--color-pink); color: var(--color-ink); font-weight: 600; }

/* ---------- today's poem card ---------- */
.today-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: inset 6px 0 0 var(--color-pink), var(--shadow-card);
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) ease;
}
.today-card:active { transform: scale(0.98); }
.today-card__dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-pink-bright);
  animation: pulse 2.4s ease-out infinite;
}
.today-card__text { flex: 1; min-width: 0; }
.today-card__text > * { display: block; }
.today-card__text > .text-muted { font-size: 0.88rem; font-weight: 500; }
.today-card__title { font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.today-card__meta { font-size: 0.92rem; color: var(--color-ink-muted); }
.today-card__go {
  flex: none;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--color-pink);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- dock (poem controls) ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-dock);
  display: flex;
  justify-content: center;
  padding: 26px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(rgba(255, 243, 246, 0), rgba(255, 243, 246, 0.96) 60%);
  pointer-events: none;
}
.dock__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, var(--content-width));
  pointer-events: auto;
}
.dock__btn {
  position: relative;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px solid var(--color-line);
  border-radius: 22px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lift);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--dur-fast) ease, border-color 0.2s ease;
}
.dock__btn:hover { border-color: var(--color-pink); }
.dock__btn:active { transform: scale(0.94); }
.dock__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.dock__btn--primary { background: var(--color-pink); border-color: var(--color-pink); font-weight: 600; }
.dock__btn--heart[aria-pressed="true"] { border-color: var(--color-pink-bright); color: var(--color-pink-deep); }
.dock__btn--heart[aria-pressed="true"] svg { fill: var(--color-pink-bright); stroke: var(--color-pink-bright); }
.dock__star svg { width: 24px; height: 24px; stroke: none; shape-rendering: crispEdges; }
.dock__btn.is-pinging .dock__star svg { animation: ping 0.6s var(--ease-pop); }
.dock .badge { position: absolute; top: -9px; right: -6px; }

/* tiny confetti dots that burst from the Keep button */
.confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: confetti 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-toast);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-on-ink);
  box-shadow: 0 8px 20px rgba(91, 42, 63, 0.3);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- launch bloom (the soft pink flash between screens) ---------- */
.bloom {
  position: fixed;
  inset: 0;
  z-index: var(--z-bloom);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, #ffc2d6 0, rgba(255, 214, 228, 0.92) 32%, transparent 64%);
}
.bloom.is-playing { animation: bloom 0.7s cubic-bezier(0.4, 0, 0.3, 1); }

/* ---- styles/30-map.css ---- */
/* Map screen: greeting, the solar-system map, and the list of poems for a planet. */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.topbar__greeting { margin: 0 0 0.1rem; font-size: 0.88rem; font-weight: 500; }
.topbar__title { margin: 0; font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--color-pink-deep); }
.topbar__subtitle { margin: 0.1rem 0 0; font-family: var(--font-fa); font-weight: 500; }

/* ---------- the map ---------- */
.map {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 108;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(#ffe9f0, #ffdce8);
  box-shadow: inset 0 0 0 1.5px #fbc4d6, 0 10px 28px rgba(229, 72, 123, 0.12);
}
.orbits { position: absolute; inset: 0; overflow: hidden; }
.orbit {
  position: absolute;
  /* left, top and width are set by map-view.js from MAP_LAYOUT */
  aspect-ratio: 1;
  border: 1.5px solid rgba(255, 92, 147, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-in 1.2s var(--ease-out) both;
}
.orbit__runner { position: absolute; inset: 0; border-radius: 50%; animation: orbit-spin linear infinite; }
.orbit__runner::after {
  content: "";
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--runner-color);
  box-shadow: 0 0 0 2px #fff;
}

.planet-node {
  position: absolute;
  width: var(--size);
  min-width: 44px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: node-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: var(--delay);
}
.planet-node__sprite { width: 100%; height: 100%; filter: var(--shadow-sprite); animation: float 5s ease-in-out infinite; animation-delay: var(--delay); }
.planet-node__sprite.is-hopping { animation: hop 0.55s var(--ease-pop); }
.planet-node::before { /* the dashed "selected" ring */
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px dashed var(--color-pink-deep);
  border-radius: 50%;
  opacity: 0;
  transform: scale(1.4);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
  animation: spin 18s linear infinite;
}
.planet-node[aria-pressed="true"]::before { opacity: 1; transform: none; }
.planet-node__label {
  position: absolute;
  white-space: nowrap;
  pointer-events: none;
  font-size: 0.76rem;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.planet-node[data-label="top"] .planet-node__label { left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); }
.planet-node[data-label="bottom"] .planet-node__label { left: 50%; top: calc(100% + 8px); transform: translateX(-50%); }
.planet-node[data-label="right"] .planet-node__label { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.planet-node[aria-pressed="true"] .planet-node__label { font-weight: 600; color: var(--color-pink-deep); }
.planet-node__today {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-pink-bright);
  box-shadow: 0 0 0 2px #fff;
  animation: pulse 2.4s ease-out infinite;
}

.rocket {
  position: absolute;
  width: 22px;
  height: 28px;
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg);
  shape-rendering: crispEdges;
  filter: drop-shadow(0 1px 0 rgba(91, 42, 63, 0.35));
  animation: fly 22s linear infinite 4s;
}

/* ---------- the selected planet's panel ---------- */
.destination { padding: 1.1rem 1rem 1rem; animation: screen-in 0.45s var(--ease-out) both; }
.destination__head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.destination__sprite { flex: none; width: 76px; height: 76px; filter: var(--shadow-sprite); animation: float 4s ease-in-out infinite; }
.destination__bubble {
  position: relative;
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--color-blush);
  font-weight: 500;
  line-height: 1.35;
  animation: pop 0.45s var(--ease-pop) both;
}
.destination__bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  margin-top: -8px;
  border: 8px solid transparent;
  border-left: 0;
  border-right-color: var(--color-blush);
}
.destination__name { margin: 0; font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--color-pink-deep); }
.destination__mood { margin: 0.15rem 0 0.9rem; font-weight: 500; }

.options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.option {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-blush-soft);
  box-shadow: inset 6px 0 0 var(--accent);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform var(--dur-fast) ease;
}
.option:hover { background: var(--color-blush); border-color: var(--color-pink); }
.option:active { transform: scale(0.98); }
.option__dot { flex: none; width: 10px; height: 10px; margin-left: 0.3rem; border-radius: 50%; background: var(--accent); }
.option__text { flex: 1; min-width: 0; }
.option__text > * { display: block; }
.option__title { font-size: 1.08rem; font-weight: 500; line-height: 1.25; }
.option__poet { font-size: 0.82rem; color: var(--color-ink-muted); }
.option__verse { direction: rtl; text-align: right; margin-top: 0.1rem; font-family: var(--font-fa); font-size: 0.88rem; color: var(--color-ink-muted); }
.option__tag { flex: none; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); background: var(--color-pink); font-size: 0.78rem; font-weight: 600; }
.option__kept { flex: none; font-size: 1rem; color: var(--color-pink-bright); }
.option__chevron { flex: none; font-size: 1.4rem; line-height: 1; color: var(--color-pink-deep); }

@media (hover: none) {
  .chip:hover, .dock__btn:hover, .option:hover, .keepsake:hover { border-color: var(--color-line); }
}
@media (max-width: 380px) {
  .topbar__title { font-size: 1.65rem; }
  .segmented button { min-width: 46px; padding: 0 0.6rem; }
  .planet-node__label { font-size: 0.7rem; }
}

/* ---- styles/40-poem.css ---- */
/* Poem screen: toolbar, planet header, and the poem card with its couplets. */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

.poem-header { display: flex; align-items: center; gap: var(--space-4); }
.poem-header__sprite { flex: none; width: 92px; height: 92px; filter: var(--shadow-sprite); animation: float 4s ease-in-out infinite; }
.poem-header__sprite.is-hopping { animation: hop 0.6s var(--ease-pop); }
.poem-header__name { margin: 0; font-size: 1.9rem; font-weight: 600; line-height: 1.1; color: var(--color-pink-deep); }
.poem-header p { margin: 0.15rem 0 0; font-weight: 500; }

/* ---------- the card ---------- */
.poem-card { animation: panel-in var(--dur-slow) var(--ease-out) both; }
.poem-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-bottom: 1.5px dashed var(--color-line);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-ink-muted);
}
.poem-card__body { padding: 1.4rem 1rem 1.7rem; text-align: center; }
.poem-card__title { margin: 0; font-size: clamp(1.6rem, 7.4vw, 2rem); font-weight: 600; line-height: 1.15; }
.poem-card__poet { margin: 0.6rem 0 0; display: flex; justify-content: center; align-items: baseline; gap: 0.8rem; font-weight: 500; color: var(--color-pink-deep); }
.poem-card__poet-fa { font-family: var(--font-fa); font-weight: 700; font-size: 1.45rem; }
.poem-card__note { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--color-ink-muted); }
.poem-card__rule { height: 0; margin: 1.2rem 1.4rem; border-top: 3px dotted var(--color-line); }
.poem-card__end { margin: 1.3rem 0 0; display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.poem-card__end i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-pink); animation: blink 1.6s ease-in-out infinite; }

/* ---------- couplets ---------- */
.couplets { display: flex; flex-direction: column; gap: 14px; }
.couplet {
  padding: 1.1rem 0.8rem 1.2rem;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: var(--color-blush-soft);
  box-shadow: inset 6px 0 0 var(--accent);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) ease, transform var(--dur-slow) var(--ease-out), background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.couplet.is-visible { opacity: 0.55; transform: none; }
.couplet.is-visible.is-focus {
  opacity: 1;
  background: var(--color-surface);
  border-color: var(--color-line);
  box-shadow: inset 6px 0 0 var(--accent), 0 8px 20px rgba(229, 72, 123, 0.13);
}
.couplet__fa { direction: rtl; font-family: var(--font-fa); font-weight: 500; font-size: clamp(1.3rem, 6.2vw, 1.58rem); line-height: 2.1; }
.couplet__en { font-size: clamp(1.04rem, 4.7vw, 1.18rem); line-height: 1.55; color: var(--color-ink-verse); }
.couplet__sep { display: flex; justify-content: center; gap: 7px; margin: 0.7rem 0 0.8rem; }
.couplet__sep i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-pink); }
.couplet__sep i:nth-child(2) { background: var(--color-peach); }
.couplet__sep i:nth-child(3) { background: var(--color-lilac); }
.line { display: block; }

/* each word fades in just after the one before it */
.word { display: inline-block; opacity: 0; transform: translateY(8px); filter: blur(3px); }
.couplet.is-visible .word {
  animation: word-in var(--dur-slow) var(--ease-out) forwards;
  animation-delay: calc((var(--index) + var(--offset, 0)) * var(--word-step) + 120ms);
}

/* the language switch hides one half of each couplet */
.poem-stage[data-language="fa"] .couplet__en,
.poem-stage[data-language="fa"] .couplet__sep,
.poem-stage[data-language="en"] .couplet__fa,
.poem-stage[data-language="en"] .couplet__sep { display: none; }
.poem-stage[data-language="en"] .couplet__en { --offset: 0 !important; }

/* ---- styles/50-keepsakes.css ---- */
/* Keepsakes: the bottom sheet with the constellation of kept poems. */

.keepsakes {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px 14px 0;
  background: rgba(91, 42, 63, 0.42);
}
.keepsakes__sheet {
  width: min(100%, var(--content-width));
  max-height: 90vh;
  max-height: 90svh;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  animation: panel-in 0.45s var(--ease-out) both;
}
.keepsakes__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 1.2rem;
  border-bottom: 1.5px dashed var(--color-line);
}
.keepsakes__bar h2 { margin: 0; font-size: 1.4rem; font-weight: 600; color: var(--color-pink-deep); }
.keepsakes__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
}
.keepsakes__note { margin: 0.9rem 0 0.7rem; text-align: center; }

/* the night-sky card the stars sit on */
.constellation { display: block; width: 100%; height: auto; border-radius: 20px; background: linear-gradient(var(--color-plum-light), var(--color-plum-deep)); }
.constellation__line { stroke: #fff; stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.5; }
.constellation__dust { fill: #fff; opacity: 0.5; }
.constellation__star { cursor: pointer; }
.constellation__shape { animation: twinkle 2.8s ease-in-out infinite; }

.keepsakes__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.keepsakes__list li { display: flex; align-items: stretch; gap: 8px; }
.keepsake {
  flex: 1;
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-blush-soft);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.keepsake:hover { border-color: var(--color-pink); background: var(--color-blush); }
.keepsake__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--color-plum); }
.keepsake__icon svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
.keepsake__text > * { display: block; }
.keepsake__title { line-height: 1.25; }
.keepsake__meta { font-size: 0.86rem; font-weight: 400; color: var(--color-ink-muted); }
.keepsake-remove {
  flex: none;
  width: 48px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 1.3rem;
  cursor: pointer;
}

/* ---- styles/60-motion.css ---- */
/* Motion: every keyframe lives here, plus the reduced-motion overrides.
   Components refer to these by name. */

@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); transform-origin: left center; } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 92, 147, 0.4); } 100% { box-shadow: 0 0 0 14px rgba(255, 92, 147, 0); } }
@keyframes float { 50% { transform: translateY(-4px); } }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-9px) scale(1.14); } 100% { transform: none; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes orbit-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes node-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes fly {
  0% { left: -6%; top: 98%; opacity: 0; }
  3% { opacity: 1; }
  55% { left: 102%; top: 2%; opacity: 1; }
  56%, 100% { left: 102%; top: 2%; opacity: 0; }
}
@keyframes word-in { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes twinkle { 50% { opacity: 0.35; } }
@keyframes ping { 40% { transform: scale(1.5) rotate(12deg); } }
@keyframes confetti { to { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
@keyframes bloom { 0% { opacity: 0; transform: scale(0.3); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(2.2); } }

@media (prefers-reduced-motion: reduce) {
  .orbit, .orbit__runner, .planet-node, .planet-node__sprite, .planet-node::before, .planet-node__today,
  .today-card__dot, .poem-header__sprite, .destination__sprite, .destination__bubble, .poem-card__end i,
  .constellation__shape, .dock__star svg, .bloom, .rocket { animation: none !important; }
  .rocket { display: none; }
  .screen, .poem-card, .destination, .keepsakes__sheet { animation: none; }
  .couplet, .couplet.is-visible { opacity: 1; transform: none; transition: none; }
  .couplet .word { animation: none; opacity: 1; transform: none; filter: none; }
  .toast { transition: none; }
}
