*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* One warm world: cream paper, school-bus amber accent, chunky rounded
   shapes, emoji art. Single accent per the house design doctrine. */
:root {
  --bg: #fdf8ef;
  --surface: #ffffff;
  --border: rgba(93, 64, 28, 0.14);
  --text: #2b2013;
  --muted: #8a7a64;
  --accent: #e8930c;
  --accent-soft: #fff3dc;
  --go: #2e9e6b;
  --go-soft: #e9f9f1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(93, 64, 28, 0.09);
  --shadow-md: 0 6px 20px rgba(93, 64, 28, 0.13);
  font-size: 16px;
}

html { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, sans-serif; }
body { min-height: 100dvh; display: flex; flex-direction: column; }

/* ── HEADER ── */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 200;
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-header h1 { font-size: 1.12rem; font-weight: 800; white-space: nowrap; }
.exit-btn { font-size: 0.8rem; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 8px; border-radius: 8px; }
.exit-btn:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.day-badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em;
  background: var(--accent-soft); color: #9a5f00;
  border: 1.5px solid #f3c774; border-radius: 20px; padding: 3px 10px;
  white-space: nowrap;
}

/* ── DAY STRIP ── */
.day-strip {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 12px; flex-wrap: wrap;
  background: var(--surface); border-bottom: 1.5px solid var(--border);
}
.strip-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 6px;
  border-radius: 50%; font-size: 1.05rem;
  background: var(--bg); border: 2px solid var(--border);
}
.strip-chip.done { background: var(--go-soft); border-color: #9edfbf; }
.strip-chip.current { background: var(--accent-soft); border-color: var(--accent); transform: scale(1.15); }
.strip-dot { color: var(--muted); opacity: 0.5; }

/* ── SCREENS ── */
.screen { display: none; flex: 1; flex-direction: column; padding: 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.screen.visible { display: flex; }

/* ── MAP ── */
.map-intro { text-align: center; padding: 8px 0 18px; }
.map-intro h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.map-intro p { color: var(--muted); font-size: 0.95rem; }

.map-trail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 30px; }
.trail-link { color: var(--muted); opacity: 0.55; font-size: 1.2rem; line-height: 1; }

.station {
  width: 100%; max-width: 420px;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 2.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px;
  font-family: inherit; text-align: left; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 64px;
}
.station:disabled { cursor: default; opacity: 0.55; box-shadow: none; }
.station.done { opacity: 0.9; background: var(--go-soft); border-color: #9edfbf; }
.station.current {
  border-color: var(--accent); background: var(--accent-soft);
  animation: station-breathe 1.6s ease-in-out infinite;
}
.station.current:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
@keyframes station-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 147, 12, 0.25); }
  50% { box-shadow: 0 0 0 9px rgba(232, 147, 12, 0.07); }
}
.st-icon { font-size: 2rem; line-height: 1; }
.st-label { font-size: 1.02rem; font-weight: 800; flex: 1; color: var(--text); }
.st-play {
  font-size: 0.9rem; font-weight: 800; color: #fff;
  background: var(--accent); border-radius: 20px; padding: 7px 14px;
  white-space: nowrap;
}
.st-done { font-size: 0.8rem; font-weight: 700; color: var(--go); }

/* Avatar picker */
.avatar-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.avatar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 84px; min-height: 96px; padding: 12px;
  background: var(--bg); border: 3px solid var(--border); border-radius: 18px;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.avatar-btn:hover { border-color: var(--accent); transform: translateY(-3px); }
.avatar-btn:active { transform: scale(0.94); }
.av-emoji { font-size: 2.6rem; line-height: 1; }
.av-name { font-size: 0.85rem; font-weight: 800; color: var(--text); }

/* ── LEVEL SHELL ── */
.level-head { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.lh-icon { font-size: 2.2rem; line-height: 1; }
.level-head h2 { font-size: 1.35rem; font-weight: 800; }
.lh-sub { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.level-status {
  min-height: 2.6em; padding: 8px 2px; font-size: 0.95rem; color: var(--text);
  font-weight: 600;
}
.level-stage { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }

/* Shared bits */
.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border: 2.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 1rem; font-weight: 800; font-family: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  transition: transform 0.12s, background 0.15s;
  align-self: center;
}
.fd-btn:active { transform: scale(0.96); }
.fd-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.fd-btn.primary:hover { background: #cf8005; }

.fd-json {
  background: #1e1e2e; color: #cdd6f4;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.74rem; line-height: 1.5;
  border-radius: var(--radius-sm); padding: 14px 16px;
  text-align: left; white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto; max-width: 100%;
}
.fd-artifact {
  font-size: 1.3rem; letter-spacing: 0.06em; line-height: 1.7;
  background: var(--bg); border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px;
}
.fd-artifact-list { font-size: 0.9rem; letter-spacing: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }

.wobble { animation: fd-wobble 0.55s ease; }
@keyframes fd-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
  75% { transform: rotate(-1.5deg); }
}
.guide { animation: fd-guide 1.1s ease-in-out infinite; border-color: var(--go) !important; }
@keyframes fd-guide {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.35); }
  50% { box-shadow: 0 0 0 9px rgba(46, 158, 107, 0.12); }
}

/* Done panel */
.done-panel {
  text-align: center; display: flex; flex-direction: column; gap: 12px;
  align-items: center; padding: 22px 8px;
}
.dp-big { font-size: 3.4rem; line-height: 1; animation: dp-pop 0.45s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes dp-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-panel h3 { font-size: 1.4rem; font-weight: 800; }
.dp-sub { color: var(--muted); font-size: 0.95rem; max-width: 46ch; }

/* ── L1 PACK ── */
.pack-pockets { display: flex; flex-direction: column; gap: 10px; }
.pocket-group { display: flex; flex-direction: column; gap: 6px; }
.pg-label { font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.pg-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pocket {
  flex: 1; min-width: 100px; min-height: 76px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, transform 0.12s;
}
.pocket:active { transform: scale(0.97); }
.pk-head { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.pk-chips { display: flex; gap: 4px; flex-wrap: wrap; font-size: 1.3rem; min-height: 1.3em; }
.pack-tray { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-top: 6px; }
.pack-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 86px; min-height: 86px; padding: 10px;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.pack-item.selected { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-5px) scale(1.06); }
.pi-emoji { font-size: 1.9rem; line-height: 1; }
.pi-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-align: center; }
body[data-mode="little"] .pack-item { min-width: 104px; min-height: 104px; }
body[data-mode="little"] .pi-emoji { font-size: 2.4rem; }
body[data-mode="little"] .pocket { min-height: 96px; }

/* ── L2 ROUTE ── */
.route-board {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #fffdf7, #fbf3e2);
  border: 2.5px solid var(--border); border-radius: var(--radius);
  overflow: visible;
}
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-svg .edge         { stroke: #d9c9ab; stroke-width: 1.4; }
.route-svg .edge-crowd   { stroke: #e8930c; stroke-width: 1.4; stroke-dasharray: 3 2; opacity: 0.6; }
.route-svg .edge-blocked { stroke: #c9c2b7; stroke-width: 1.2; stroke-dasharray: 1.5 2.5; opacity: 0.7; }
.route-svg .edge-walked  { stroke: var(--go); stroke-width: 2.4; }
.route-svg .edge-guide   { stroke: #f3c774; stroke-width: 4; opacity: 0.85; }
.route-svg .edge-tag     { font-size: 7px; text-anchor: middle; }
.route-node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: 14px;
  padding: 7px 9px; min-width: 58px; min-height: 58px;
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s;
}
.route-node.here { border-color: var(--accent); background: var(--accent-soft); z-index: 5; }
.route-node.walkable { border-color: var(--go); animation: fd-guide 1.3s ease-in-out infinite; }
.rn-icon { font-size: 1.4rem; line-height: 1; }
.rn-label { font-size: 0.6rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.route-cost { font-size: 0.9rem; font-weight: 800; color: var(--muted); }
body:not([data-mode="big"]) .big-only-inline { display: none; }
body[data-mode="little"] .route-node { min-width: 72px; min-height: 72px; }
body[data-mode="little"] .rn-icon { font-size: 1.8rem; }

/* ── L3 FRIENDS ── */
.friend-yard {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 480px; margin: 0 auto;
  background: radial-gradient(circle at 50% 45%, #fffdf7 55%, #f7ecd6);
  border: 2.5px solid var(--border); border-radius: 50%;
}
.friend-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.friend-line { stroke: var(--go); stroke-width: 1.6; opacity: 0.8; }
.friend-kid {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: 16px;
  padding: 6px 8px; min-width: 62px; min-height: 62px;
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
}
.friend-kid.selected { border-color: var(--accent); background: var(--accent-soft); transform: translate(-50%, -50%) scale(1.1); z-index: 5; }
.fk-emoji { font-size: 1.5rem; line-height: 1; position: relative; }
.fk-happy { position: absolute; top: -8px; right: -12px; font-size: 0.8rem; }
.fk-name { font-size: 0.62rem; font-weight: 800; color: var(--text); }
.fk-likes { font-size: 0.72rem; letter-spacing: 0.1em; }
.friend-stat { text-align: center; font-size: 0.9rem; font-weight: 800; color: var(--muted); }
body[data-mode="little"] .friend-kid { min-width: 76px; min-height: 76px; }
body[data-mode="little"] .fk-emoji { font-size: 1.9rem; }
body[data-mode="little"] .fk-likes { font-size: 1rem; }

/* ── L4 SCHEDULE ── */
.sched-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sl-dep {
  font-size: 0.9rem; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px;
  padding: 4px 12px;
}
.sched-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sched-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 92px; min-height: 96px; padding: 10px 8px;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow); position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.sched-card.selected { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-5px); }
.sc-slot {
  position: absolute; top: -9px; left: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.sc-emoji { font-size: 1.8rem; line-height: 1; }
.sc-label { font-size: 0.68rem; font-weight: 800; color: var(--muted); text-align: center; }
body[data-mode="little"] .sched-card { min-width: 108px; min-height: 116px; }
body[data-mode="little"] .sc-emoji { font-size: 2.4rem; }

/* ── L5 TRADE ── */
.trade-banner {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  font-size: 0.95rem;
}
.trade-banner span {
  background: var(--surface); border: 2px solid var(--border); border-radius: 20px;
  padding: 8px 16px; font-weight: 700;
}
.tb-goal { border-color: #f3c774 !important; background: var(--accent-soft) !important; }
.trade-kids { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.trade-kid {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 120px; min-height: 120px; padding: 12px;
  background: var(--surface); border: 2.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.trade-kid.traded { background: var(--go-soft); border-color: #9edfbf; }
.tk-face { font-size: 2rem; line-height: 1; }
.tk-name { font-size: 0.8rem; font-weight: 800; }
.tk-bubble {
  font-size: 0.78rem; color: var(--muted); font-weight: 700;
  background: var(--bg); border-radius: 12px; padding: 4px 10px;
}
body[data-mode="little"] .trade-kid { min-width: 140px; min-height: 140px; }
body[data-mode="little"] .tk-face { font-size: 2.5rem; }
body[data-mode="little"] .tk-bubble { font-size: 0.92rem; }

/* ── L6 RULES ── */
.rules-poster {
  background: var(--surface); border: 2.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
  background-image: repeating-linear-gradient(transparent, transparent 30px, rgba(93,64,28,0.035) 31px);
}
.rp-head { font-size: 1.05rem; font-weight: 800; text-align: center; padding-bottom: 6px; border-bottom: 2px dashed var(--border); }
.rule-row { display: flex; flex-direction: column; gap: 6px; }
.rule-text {
  text-align: left; font-family: inherit; font-size: 0.95rem; font-weight: 700;
  background: transparent; border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; min-height: 48px; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.rule-row:not(.fixed) .rule-text:hover { border-color: var(--border); background: var(--bg); }
.rule-row.open .rule-text { border-color: var(--accent); background: var(--accent-soft); }
.rule-row.fixed .rule-text { color: var(--go); cursor: default; }
.rt-mark, .rt-check { margin-right: 6px; }
.rule-opts { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; }
.rule-opt {
  text-align: left; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; cursor: pointer; min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s;
}
.rule-opt:hover { border-color: var(--accent); }
body[data-mode="little"] .rule-text { font-size: 1.05rem; min-height: 56px; }
body[data-mode="little"] .rule-opt { font-size: 1rem; min-height: 60px; }

/* ── L7 CREDITS ── */
.credits-viewport { flex: 1; overflow: hidden; position: relative; min-height: 340px; }
.credits-roll {
  display: flex; flex-direction: column; gap: 18px; align-items: center;
  text-align: center; padding: 20px 8px 60px;
  animation: credits-rise 26s linear forwards;
}
.credits-viewport.no-anim .credits-roll { animation: none; }
.credits-viewport.no-anim { overflow-y: auto; }
@keyframes credits-rise {
  from { transform: translateY(30%); }
  to   { transform: translateY(calc(-100% + 340px)); }
}
.cr-title { font-size: 2rem; font-weight: 800; }
.cr-sub { color: var(--muted); font-size: 1rem; max-width: 46ch; }
.cr-block {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.cr-block h3 { font-size: 1rem; font-weight: 800; }
.cr-stickers .cr-sticker-row { font-size: 2rem; letter-spacing: 0.2em; }
.cr-credits { color: var(--muted); font-size: 0.8rem; line-height: 1.7; padding-top: 10px; }
.cr-actions {
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  padding: 14px 0 30px; max-width: 340px; width: 100%; margin: 0 auto;
}

/* ── FOOTER ── */
.showcase-footer {
  text-align: center; padding: 20px 16px 36px;
  font-size: 0.82rem; color: var(--muted);
  border-top: 1.5px solid var(--border);
  line-height: 2;
}
.sf-note { font-size: 0.78rem; }
.sf-link { color: var(--muted); text-decoration: none; }
.sf-link:hover { color: var(--accent); }
.sf-link strong { color: var(--text); }
.sf-sep { margin: 0 10px; opacity: 0.4; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .station.current, .guide, .route-node.walkable { animation: none; }
  .station.current { box-shadow: 0 0 0 4px rgba(232, 147, 12, 0.2); }
  .guide, .route-node.walkable { box-shadow: 0 0 0 4px rgba(46, 158, 107, 0.35); }
  .wobble, .dp-big { animation: none; }
  .credits-roll { animation: none; }
  .credits-viewport { overflow-y: auto; }
  .fd-btn, .pack-item, .sched-card, .friend-kid, .trade-kid, .station { transition: none; }
}

/* ── WIDER SCREENS ── */
@media (min-width: 640px) {
  .map-trail { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .trail-link { display: none; }
  .station { width: 200px; max-width: none; flex-direction: column; text-align: center; gap: 8px; min-height: 140px; }
  .cr-actions { flex-direction: row; }
  .cr-actions .fd-btn { flex: 1; }
}

/* ── NARROW HEADER (≤430px): keep title, badge, and controls apart ── */
.header-left { flex: 1; min-width: 0; }
@media (max-width: 430px) {
  .site-header { padding: 8px 10px; gap: 6px; }
  .site-header h1 { font-size: 0.98rem; }
  .exit-btn { font-size: 0.7rem; padding: 4px 4px; }
  .day-badge { font-size: 0.64rem; padding: 2px 7px; }
  .kc-header-actions { gap: 3px; }
  .kc-hbtn { min-width: 40px; min-height: 40px; font-size: 1rem; }
  body[data-mode="little"] .kc-hbtn { min-width: 44px; min-height: 44px; }
}

/* ══ JUICE PASS: MOTION + ACTION LAYER ══════════════════════════════════ */

/* Combo streak meter */
.combo-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 2px; min-height: 18px;
}
.combo-track {
  flex: 1; height: 7px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden;
}
.combo-fill {
  height: 100%; border-radius: 4px; width: 0%;
  background: linear-gradient(90deg, #f3c774, var(--accent));
  transition: width 0.3s ease-out;
}
.combo-txt {
  font-size: 0.74rem; font-weight: 800; color: var(--accent);
  white-space: nowrap; min-width: 30px; text-align: right;
}

/* Avatar sparkle on high streak */
@keyframes fd-sparkle {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4) drop-shadow(0 0 5px rgba(232,147,12,.8)); }
}
.strip-chip.current.sparkle { animation: fd-sparkle 0.5s ease-in-out 3; }

/* Flying emoji (Web Animation API provides keyframes; this sets base position) */
.fd-flyer {
  position: fixed; pointer-events: none; z-index: 9999;
  font-size: 1.7rem; line-height: 1; transform: translate(-50%,-50%);
}

/* L1: conveyor slide-in (BIG, Day 2+) */
@keyframes fd-slide-from-right { from { transform: translateX(38px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.pack-item.conveyor-arrive { animation: fd-slide-from-right 0.28s ease-out both; }

/* L1: pocket pulse when item lands correctly */
@keyframes fd-pocket-land {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.08); }
  70% { transform: scale(0.97); }
}
.pocket.just-landed { animation: fd-pocket-land 0.35s ease-out; }

/* L2: avatar bounce when stepping to a new node */
@keyframes fd-step-bounce {
  0%   { transform: translate(-50%,-50%) scale(1.15); }
  35%  { transform: translate(-50%,-50%) scale(1.3) translateY(-9px); }
  65%  { transform: translate(-50%,-50%) scale(1.05); }
  100% { transform: translate(-50%,-50%) scale(1.15); }
}
.route-node.step-bounce { animation: fd-step-bounce 0.36s cubic-bezier(0.34,1.56,0.64,1); }

/* L2: new walked edge draws in */
@keyframes fd-edge-draw {
  from { stroke-dashoffset: 120; opacity: 0.2; }
  to   { stroke-dashoffset: 0;   opacity: 1; }
}
.route-svg .edge-new {
  stroke: var(--go); stroke-width: 2.4;
  stroke-dasharray: 120; animation: fd-edge-draw 0.38s ease-out forwards;
}

/* L3: friend line drawn-in via JS Web Animation API (no pre-class needed) */

/* L4: schedule card jump on swap */
@keyframes fd-card-jump {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-11px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}
.sched-card.jumping { animation: fd-card-jump 0.32s cubic-bezier(0.34,1.56,0.64,1); }

/* L5 BIG: classmates gently bob while waiting */
@keyframes fd-kid-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
body[data-mode="big"] .trade-kid:not(.traded) { animation: fd-kid-float 2.1s ease-in-out infinite; }
body[data-mode="big"] .trade-kids .trade-kid:nth-child(2):not(.traded) { animation-delay: 0.35s; }
body[data-mode="big"] .trade-kids .trade-kid:nth-child(3):not(.traded) { animation-delay: 0.7s;  }
body[data-mode="big"] .trade-kids .trade-kid:nth-child(4):not(.traded) { animation-delay: 1.05s; }
body[data-mode="big"] .trade-kids .trade-kid:nth-child(5):not(.traded) { animation-delay: 1.4s;  }

/* L6: fixed rule stamps in */
@keyframes fd-stamp {
  0%   { transform: scale(1.4); opacity: 0.5; }
  60%  { transform: scale(0.93); }
  80%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
.rule-row.just-fixed .rule-text { animation: fd-stamp 0.38s cubic-bezier(0.34,1.56,0.64,1); }

/* Reduced-motion: disable all juice animations */
@media (prefers-reduced-motion: reduce) {
  .strip-chip.current.sparkle,
  .pack-item.conveyor-arrive,
  .pocket.just-landed,
  .route-node.step-bounce,
  .sched-card.jumping,
  .rule-row.just-fixed .rule-text { animation: none !important; }
  body[data-mode="big"] .trade-kid:not(.traded) { animation: none; }
  .combo-fill { transition: none; }
  .route-svg .edge-new { animation: none; stroke-dasharray: none; }
}
