/* The playable picture stays 16:9. UI belongs to the screen, not the scenery. */
:root {
  font-family: 'Trebuchet MS', 'Avenir Next Rounded Pro', 'Arial Rounded MT Bold', sans-serif;
  color: #183f41;
  background: #173e3d;
  font-synthesis: weight;
  --parade-ink: #183f41;
  --parade-paper: #fff5db;
  --parade-paper-light: #fffbed;
  --parade-teal: #198d91;
  --parade-teal-dark: #12636c;
  --parade-honey: #efbf62;
  --parade-timber: #99723e;
  --parade-leaf: #88ae72;
  --parade-safe-top: env(safe-area-inset-top, 0px);
  --parade-safe-bottom: env(safe-area-inset-bottom, 0px);
  --parade-safe-left: env(safe-area-inset-left, 0px);
  --parade-safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, a, input { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px solid #f8bd45; }
button:disabled { cursor: default; }
button svg { width: 1.3em; height: 1.3em; flex: 0 0 auto; vertical-align: middle; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

#parade-app {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #173e3d;
  user-select: none;
}

#parade-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(56.25vw, 100dvh);
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  overflow: hidden;
  isolation: isolate;
  background: #a7c993;
  container-type: size;
}

#parade-background, #parade-background img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
#parade-world { position: absolute; inset: 0; z-index: 1; }
#parade-hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
#parade-dialogue { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#parade-overlay { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
#parade-hud button, #parade-dialogue > *, #parade-overlay > * { pointer-events: auto; }
#parade-overlay:not(:empty) {
  display: grid;
  place-items: center;
  padding: max(14px, var(--parade-safe-top)) max(18px, var(--parade-safe-right)) max(18px, var(--parade-safe-bottom)) max(18px, var(--parade-safe-left));
  background: #113c3b7d;
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.parade-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 44px;
  min-height: 48px;
  padding: 10px 23px;
  border: 2px solid #97d7d0;
  border-radius: 17px;
  background: var(--parade-teal);
  color: #fffbed;
  box-shadow: 0 4px 0 var(--parade-teal-dark);
  font-size: clamp(16px, 1.65vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition: background-color 120ms, box-shadow 120ms, transform 120ms;
}
.parade-button.primary, .parade-button--primary { background: var(--parade-teal); }
.parade-button.secondary, .parade-button--secondary {
  color: var(--parade-ink);
  background: var(--parade-paper);
  border-color: #dfc28d;
  box-shadow: 0 4px 0 #b59760;
}
.parade-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--parade-teal-dark); }
.parade-button:disabled { opacity: .48; box-shadow: none; }
.parade-button svg { width: 24px; height: 24px; }
.parade-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.parade-text-button { min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--parade-ink); text-underline-offset: 4px; }

.parade-hud-top {
  position: absolute;
  top: max(14px, var(--parade-safe-top));
  left: max(18px, var(--parade-safe-left));
  right: max(18px, var(--parade-safe-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.parade-hud-actions { display: flex; align-items: center; gap: 10px; }
.parade-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: clamp(46px, 4.8vw, 64px);
  height: clamp(46px, 4.8vw, 64px);
  padding: 9px;
  border: 2px solid #d4b278;
  border-radius: 50%;
  background: var(--parade-paper);
  color: var(--parade-ink);
  box-shadow: 0 3px 0 #896b4266;
}
.parade-round svg { width: 28px; height: 28px; }
.parade-round img { width: 100%; height: 100%; object-fit: contain; }
.parade-round:active { transform: translateY(2px); box-shadow: 0 1px 0 #896b4266; }
.parade-goal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  max-width: min(64vw, 580px);
  padding: 9px 21px;
  border: 2px solid #d8b67c;
  border-radius: 26px;
  background: var(--parade-paper-light);
  box-shadow: 0 3px 0 #896b423d;
  font-size: clamp(15px, 1.7vw, 22px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.parade-goal img { width: 34px; height: 34px; object-fit: contain; }
.parade-goal small { font-size: .72em; font-weight: 400; }

.parade-inventory {
  position: absolute;
  left: 50%;
  bottom: max(12px, var(--parade-safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 30px);
  padding: 7px 12px;
  border: 2px solid #caa575;
  border-radius: 22px;
  background: #fff6dbeF;
  box-shadow: 0 4px 0 #82664366;
  pointer-events: auto;
}
.parade-inventory:empty { display: none; }
.inventory-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: clamp(53px, 6vw, 83px);
  min-height: 53px;
  padding: 3px 5px;
  border: 2px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--parade-ink);
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.15;
  font-weight: 700;
}
.inventory-item img { display: block; width: 44px; height: 44px; object-fit: contain; }
.inventory-item svg { width: 34px; height: 34px; }
.inventory-item.selected, .inventory-item[aria-pressed="true"] {
  border-color: #dfaa3e;
  background: #ffe5a2;
  box-shadow: 0 0 0 2px #fff5d9;
}
.inventory-item .item-count { position: absolute; right: 1px; top: 0; padding: 2px 5px; border-radius: 9px; background: var(--parade-teal-dark); color: white; }

/* Authored object boxes use top-left coordinates in the illustrated stage. */
.scene-object, .scene-exit {
  position: absolute;
  display: block;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--parade-ink);
  overflow: visible;
  touch-action: manipulation;
}
.object-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.scene-object .object-art { transition: filter 140ms; }
.scene-object:focus-visible { outline: 3px solid #ffe9a7; outline-offset: 4px; border-radius: 24%; }
.object-halo {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 25%;
  border: 3px solid #fff1ae;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #f4cb5550, 0 0 19px #ffd462b0;
  pointer-events: none;
  animation: parade-beckon 2.7s ease-in-out infinite;
}
.scene-object[data-hint="true"] .object-art, .scene-object.hinted .object-art { filter: drop-shadow(0 0 5px #ffe698) drop-shadow(0 0 10px #fff7c2); }
.object-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 150px;
  padding: 5px 11px;
  border: 1px solid #d0b27b;
  border-radius: 14px;
  background: var(--parade-paper-light);
  color: var(--parade-ink);
  box-shadow: 0 2px 0 #a1875050;
  font-size: clamp(11px, 1.15vw, 16px);
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.scene-object:focus-visible .object-label, .scene-object.hinted .object-label,
.scene-object[data-hint="true"] .object-label, .scene-object.show-label .object-label { opacity: 1; }
.scene-exit { display: flex; align-items: center; justify-content: center; }
.scene-exit > span, .scene-exit > svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #dfc286;
  border-radius: 50%;
  background: #fff5dbee;
  color: var(--parade-teal-dark);
  box-shadow: 0 3px 0 #97754870;
  font-size: 29px;
  line-height: 1;
}
.scene-exit svg { padding: 7px; }
.character, .hero-sprite { position: absolute; pointer-events: none; }
.character img, .hero-sprite img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-sprite { z-index: 4; }
.hero-sprite.walking { animation: parade-step 350ms ease-in-out infinite; }
.character.reacting { animation: parade-delight 500ms ease-out; }

.speech-bubble {
  position: absolute;
  left: 50%;
  bottom: max(20px, var(--parade-safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(850px, calc(100vw - 36px));
  min-height: 100px;
  padding: 16px 18px 16px 22px;
  border: 3px solid #ddc18b;
  border-radius: 26px;
  background: var(--parade-paper-light);
  box-shadow: 0 6px 0 #ad8a5255, 0 12px 40px #0b343635;
  font-size: clamp(18px, 2.3vw, 30px);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}
.speech-bubble .speaker, .speech-bubble strong.speaker-name { display: block; margin-bottom: 5px; color: #528071; font-size: clamp(12px, 1.2vw, 16px); }
.speech-bubble .speech-copy { flex: 1; min-width: 0; }
.speech-bubble > p { flex: 1; }
.speech-bubble .speech-portrait { flex: 0 0 70px; width: 70px; height: 76px; object-fit: contain; }
.speech-bubble .parade-button { margin-left: auto; flex: 0 0 auto; min-width: 52px; min-height: 52px; padding: 9px 16px; }
.speech-bubble .parade-round { margin-left: auto; }
.speech-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.speech-choices .parade-button { font-size: 17px; min-height: 44px; }

.parade-panel {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100dvh - 38px - var(--parade-safe-top) - var(--parade-safe-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 40px);
  border: 3px solid #d7b982;
  border-radius: 28px;
  background: var(--parade-paper-light);
  box-shadow: 0 6px 0 #94723c55, 0 20px 75px #082f3350;
  text-align: center;
  scrollbar-color: #bda16f transparent;
}
.parade-panel h1, .parade-panel h2 { margin-bottom: 14px; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.parade-panel:not(.parade-title) > h2 { padding-inline: 35px; }
.parade-panel h3 { font-size: 21px; line-height: 1.2; }
.parade-panel p { max-width: 52ch; margin: 0 auto 14px; font-size: clamp(16px, 1.55vw, 20px); line-height: 1.45; }
.parade-panel .close, .parade-panel .panel-close { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; font-size: 24px; }
.parade-panel label { display: block; margin: 18px 0 8px; font-size: 17px; font-weight: 700; text-align: left; }
.parade-panel input[type="text"] { width: 100%; min-height: 50px; padding: 11px 15px; border: 2px solid #bfa477; border-radius: 12px; background: white; color: var(--parade-ink); font-size: 21px; }
.parade-panel small, .parade-panel .fine-print { font-size: 13px; line-height: 1.4; color: #62786a; }
.parade-panel .panel-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.parade-panel .panel-art { display: block; width: 100%; max-height: 30dvh; margin: 0 auto 18px; object-fit: contain; }

.parade-title { width: min(760px, 100%); text-align: center; }
.parade-title h1 { margin: 0 0 15px; font-size: clamp(34px, 5.7vw, 76px); font-weight: 900; letter-spacing: -.05em; line-height: .99; color: var(--parade-ink); text-wrap: balance; }
.parade-title .brand { display: block; margin: 0 0 12px; font-size: 23px; font-weight: 700; letter-spacing: -.05em; color: #4d8d7c; }
.parade-title p { max-width: 32ch; margin: 0 auto 21px; font-size: clamp(17px, 1.9vw, 25px); line-height: 1.35; }
.parade-title .parade-button { min-height: 57px; padding: 12px 33px; font-size: 23px; }
.parade-title .parade-actions { margin-top: 22px; }
.parade-title .parade-text-button { display: block; margin: 12px auto 0; font-size: 14px; }

.rescue-card { display: flex; align-items: center; gap: 15px; padding: 12px; text-align: left; }
.rescue-card img { width: 72px; height: 82px; object-fit: contain; }
.rescue-card p { margin: 4px 0 0; font-size: 16px; }
.rescue-check { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; margin-left: auto; border: 2px solid #b6c4a0; border-radius: 50%; color: #93a982; background: #edf0db; font-size: 22px; font-weight: 700; }
.rescue-check.done, .rescue-check[data-complete="true"] { color: white; border-color: #3f906e; background: #3f906e; }
.rescue-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.rescue-list .rescue-card { flex-direction: column; justify-content: center; gap: 7px; text-align: center; }
.rescue-list .rescue-check { margin: 0; }

.parade-map { width: min(940px, 100%); }
.map-cards, .parade-map .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 21px 0 4px; }
.chapter-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 6px 6px 13px; border: 2px solid #dac393; border-radius: 17px; background: #fff7e3; font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center; }
.chapter-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.chapter-card small { display: block; font-size: 12px; font-weight: 400; }
.chapter-card.current { border-color: var(--parade-teal); box-shadow: 0 0 0 3px #bfe2cf; }
.chapter-card:disabled img { filter: saturate(.35); opacity: .62; }
.chapter-card .rescue-check { position: absolute; right: 11px; top: 11px; }

.parade-report { text-align: left; }
.parade-report > h2, .parade-report > p { text-align: center; }
.parade-report article { padding: 17px 0; border-top: 1px solid #deceb1; }
.parade-report article:first-of-type { margin-top: 20px; }
.parade-report article h3 { margin-bottom: 8px; font-size: 21px; }
.parade-report article p { margin: 5px 0 0; font-size: 16px; }
.parade-report .skill { color: #2f786e; font-weight: 700; }
.parade-report .report-counts { display: block; margin-top: 8px; font-size: 13px; color: #637568; }
.parade-ending h1 { font-size: clamp(34px, 4.7vw, 64px); }
.parade-ending .ending-art { display: block; width: 100%; height: min(29dvh, 230px); margin: 7px auto 16px; object-fit: contain; }
.parade-ending .rescue-list { margin: 12px 0; }
.parade-ending .parade-actions { margin-top: 17px; }

#parade-toast {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: max(83px, calc(var(--parade-safe-top) + 70px));
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 34px));
  padding: 10px 20px;
  border: 2px solid #e2c081;
  border-radius: 22px;
  background: var(--parade-paper-light);
  box-shadow: 0 3px 0 #9a774d55;
  color: var(--parade-ink);
  font-size: clamp(15px, 1.6vw, 21px);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}
#parade-toast:empty { display: none; }
.rotate-hint { display: none; }

@media (hover: hover) {
  .parade-button:hover:not(:disabled) { background: #239c9d; }
  .parade-button.secondary:hover:not(:disabled) { background: #ffefd0; }
  .scene-object:not([data-discovery="true"]):hover .object-art { filter: drop-shadow(0 0 3px white) drop-shadow(0 0 8px #8addff); }
  .scene-object:hover .object-label { opacity: 1; }
  .parade-text-button:hover { text-decoration: underline; }
}

/* Phones in landscape retain 44px controls; decoration gives way first. */
@media (max-height: 520px) and (orientation: landscape) {
  .parade-hud-top { top: max(8px, var(--parade-safe-top)); left: max(10px, var(--parade-safe-left)); right: max(10px, var(--parade-safe-right)); gap: 8px; }
  .parade-hud-actions { gap: 7px; }
  .parade-round { width: 44px; height: 44px; padding: 8px; }
  .parade-round svg { width: 24px; height: 24px; }
  .parade-goal { min-height: 44px; padding: 6px 15px; font-size: 15px; border-radius: 23px; }
  .parade-goal img { width: 27px; height: 27px; }
  .parade-inventory { bottom: max(7px, var(--parade-safe-bottom)); padding: 3px 9px; gap: 5px; border-radius: 16px; }
  .inventory-item { width: 50px; min-height: 46px; padding: 1px 3px; font-size: 10px; }
  .inventory-item img { width: 31px; height: 31px; }
  .inventory-item svg { width: 27px; height: 27px; }
  .speech-bubble { bottom: max(10px, var(--parade-safe-bottom)); width: min(720px, calc(100vw - 28px)); min-height: 78px; padding: 11px 13px 11px 17px; gap: 12px; border-width: 2px; border-radius: 20px; font-size: 21px; }
  .speech-bubble .speech-portrait { flex-basis: 51px; width: 51px; height: 57px; }
  .speech-bubble .parade-button { min-height: 46px; min-width: 46px; padding: 8px 13px; }
  .speech-bubble .speaker { margin-bottom: 2px; font-size: 12px; }
  #parade-overlay:not(:empty) { padding: max(10px, var(--parade-safe-top)) max(13px, var(--parade-safe-right)) max(14px, var(--parade-safe-bottom)) max(13px, var(--parade-safe-left)); }
  .parade-panel { max-height: calc(100dvh - 26px - var(--parade-safe-top) - var(--parade-safe-bottom)); padding: 18px 25px; border-width: 2px; border-radius: 22px; }
  .parade-panel h1, .parade-panel h2 { margin-bottom: 9px; font-size: 31px; }
  .parade-panel p { margin-bottom: 9px; font-size: 16px; line-height: 1.35; }
  .parade-actions, .parade-panel .panel-footer { margin-top: 13px; gap: 11px; }
  .parade-button { min-height: 44px; padding: 8px 20px; font-size: 17px; border-radius: 13px; }
  .parade-title h1 { font-size: 44px; }
  .parade-title .brand { margin-bottom: 8px; font-size: 19px; }
  .parade-title .parade-button { min-height: 46px; padding: 10px 27px; font-size: 20px; }
  .parade-title .parade-text-button { margin-top: 3px; }
  .rescue-list { margin: 10px 0; }
  .rescue-card { padding: 6px; }
  .rescue-card img { width: 52px; height: 59px; }
  .rescue-check { width: 27px; height: 27px; flex-basis: 27px; font-size: 18px; }
  .rescue-list .rescue-card { flex-direction: row; font-size: 14px; }
  .map-cards, .parade-map .cards { gap: 10px; margin-top: 12px; }
  .chapter-card { padding: 4px 4px 8px; font-size: 15px; gap: 5px; border-radius: 12px; }
  .chapter-card img { max-height: 80px; }
  .parade-ending .ending-art { height: 85px; margin-bottom: 8px; }
  #parade-toast { top: max(63px, calc(var(--parade-safe-top) + 58px)); padding: 7px 15px; font-size: 15px; }
}

/* Portrait remains playable: the picture never stretches or crops its routes. */
@media (orientation: portrait) {
  #parade-app { background: radial-gradient(ellipse at 50% 45%, #326d5e, #173e3d 75%); }
  #parade-stage { box-shadow: 0 -2px 0 #d6ba7c, 0 2px 0 #d6ba7c, 0 14px 45px #0d262b55; }
  .parade-hud-top { top: max(18px, var(--parade-safe-top)); align-items: center; flex-wrap: wrap; }
  .parade-goal { order: 3; flex-basis: 100%; max-width: 100%; margin: 5px auto 0; padding: 10px 15px; font-size: 17px; }
  .parade-inventory { bottom: max(30px, var(--parade-safe-bottom)); gap: 9px; padding: 9px 12px; flex-wrap: wrap; width: max-content; }
  .inventory-item { width: 58px; min-height: 60px; }
  .inventory-item img { width: 39px; height: 39px; }
  .speech-bubble { bottom: max(26px, var(--parade-safe-bottom)); width: calc(100vw - 28px); flex-wrap: wrap; min-height: 110px; padding: 15px; gap: 12px; font-size: 21px; }
  .speech-bubble .speech-portrait { width: 46px; height: 57px; flex-basis: 46px; }
  .speech-bubble .speech-copy { flex-basis: calc(100% - 60px); }
  .speech-bubble .parade-button { margin-left: auto; }
  .parade-panel { padding: 28px 20px; border-radius: 24px; }
  .parade-panel h1, .parade-panel h2 { font-size: 33px; }
  .parade-title h1 { font-size: 44px; }
  .parade-title .parade-button { min-height: 54px; font-size: 21px; }
  .map-cards, .parade-map .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .chapter-card { font-size: 15px; }
  .rescue-list { gap: 3px; }
  .rescue-list .rescue-card { padding: 5px; font-size: 14px; }
  .rescue-card img { width: 61px; height: 70px; }
  .parade-actions { gap: 12px; }
  .parade-actions .parade-button { flex: 1 1 auto; }
  .rotate-hint { position: absolute; display: flex; align-items: center; justify-content: center; gap: 7px; top: calc(50% + 28.125vw + 16px); left: 20px; right: 20px; margin: 0; color: #efe8c9; font-size: 13px; font-weight: 400; text-align: center; pointer-events: none; }
  #parade-toast { top: max(151px, calc(var(--parade-safe-top) + 131px)); width: max-content; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@keyframes parade-beckon { 0%, 100% { opacity: .52; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes parade-step { 0%, 100% { margin-top: 0; } 50% { margin-top: -2px; } }
@keyframes parade-delight { 0%, 100% { margin-top: 0; } 45% { margin-top: -9px; } }

#hero-canvas { position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none; }
#parade-stage { transition:opacity 180ms; }
#parade-stage.changing { opacity:.25; }
.object-art>svg { width:100%;height:100%; }
.object-art>img { width:100%;height:100%;object-fit:contain; }
.hero-medallion { position:relative;display:block;flex:none;width:74px;height:74px;overflow:hidden;border:4px solid #fff5db;outline:2px solid #315b60;border-radius:50%;padding:0;background:#b9ddd7;box-shadow:0 3px 0 #7b9a85; }
.hero-medallion>img { position:absolute;left:50%;top:-8%;transform:translateX(-50%);height:280%;width:auto;max-width:none; }
.hero-medallion>img[src^="data:"] { inset:0;transform:none;width:100%;height:100%;object-fit:cover; }
.hero-medallion>span { position:absolute;bottom:0;right:0;left:0;background:#fff5dbcF;color:#214c51;font-size:12px;line-height:17px;font-weight:bold; }
.parade-goal>svg { flex:none;width:34px;height:34px; }
.action-bubble { position:absolute;display:grid;place-items:center;width:clamp(36px,4.5cqw,62px);height:clamp(36px,4.5cqw,62px);transform:translate(-50%,-50%) rotate(-6deg);border:2px solid #586b50;border-radius:50%;background:#fff8df;box-shadow:0 3px 0 #61745844;z-index:3;pointer-events:none; }
.action-bubble::after { content:'';position:absolute;bottom:-7px;left:21%;width:12px;height:12px;background:#fff8df;border-right:2px solid #586b50;border-bottom:2px solid #586b50;transform:skew(-18deg) rotate(35deg);z-index:-1; }
.action-bubble>svg,.action-bubble>img { width:65%;height:65%;object-fit:contain; }
.interactive-glow>.object-art { filter:drop-shadow(0 0 2px #f1fcff) drop-shadow(0 0 6px #bdefff) drop-shadow(0 0 11px #60c9ed99); }
.scene-object .object-halo { display:none; }
.interactive-glow:not(:has(.object-art)) .object-halo { display:block;inset:4%;height:auto;border:2px solid #e2f9ff;box-shadow:0 0 6px #c3efff,0 0 14px #55b9eaaa;border-radius:40%;animation:none; }
.building-entrance>.object-art,.window-destination>.object-art { filter:none; }
.building-entrance .building-aura { position:absolute;inset:0;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 0 3px #dcf8ff) drop-shadow(0 0 7px #75d4f3); }
.building-aura path { fill:#e5faff05;stroke:#e8fbff;stroke-width:1.6;vector-effect:non-scaling-stroke;stroke-linejoin:round; }
.building-entrance:active .building-aura path,.building-entrance:focus-visible .building-aura path { stroke-width:3;fill:#c1f4ff22; }
.window-destination::before { content:'';position:absolute;inset:0;border:2px solid #e2f9ff;border-radius:15% 15% 10% 10%;box-shadow:0 0 6px #c3efff,0 0 13px #64c5eebb; }
.clubhouse-board { position:absolute;left:33.5%;top:17%;width:27.5%;height:22%;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr);gap:3% 4%; }
.crew-pin { position:relative;min-width:44px;min-height:44px;background:#fff2d7;border:1px solid #ba945b;border-radius:4px;box-shadow:1px 2px 3px #55311966;transform:rotate(-3deg);padding:3%; }
.crew-pin:nth-child(even) { transform:rotate(3deg); }
.crew-pin::before { content:'';position:absolute;left:48%;top:-3px;width:6px;height:6px;border-radius:50%;background:#db805d;box-shadow:0 1px #714124; }
.crew-pin>img { width:100%;height:80%;object-fit:contain; }
.crew-pin>span { position:absolute;bottom:0;left:0;right:0;font-size:clamp(10px,1cqw,15px);line-height:1.1;font-weight:bold; }
.crew-pin.found { border-color:#5b9b83;background:#eaf1d1; }
.table-map { display:flex;width:100%;height:100%;gap:3%;align-items:center;transform:rotate(9deg); }
.table-map>img { width:28%;height:65%;object-fit:cover;border-radius:45%;border:2px solid #c2a87e; }
.speech-bubble { width:min(1250px,calc(100vw - 32px));min-height:130px;padding:17px 23px 17px 150px;border-radius:32px;background:#fff8e5; }
.speech-bubble .speech-portrait { position:absolute;left:6px;bottom:3px;width:140px;height:170px;object-fit:contain; }
.speech-bubble .speaker { display:table;padding:4px 20px;border-radius:22px;background:#c9ded1;font-size:20px;color:#234f53;margin-bottom:8px; }
.speech-bubble .parade-round { width:74px;height:74px;background:#229eaa;border:3px solid #98dbda;color:#fffdf0;box-shadow:0 4px 0 #247883; }
.speech-bubble .parade-round>svg { width:36px;height:36px; }
#parade-app[data-intro="true"] .building-aura { opacity:0; }
.parade-goal { border-radius:30px;padding-inline:24px;min-height:59px;background:#fff6dc; }
@media(max-height:520px) and (orientation:landscape){
 .hero-medallion{width:48px;height:48px;border-width:3px}.hero-medallion>span{font-size:9px;line-height:12px}
 .parade-goal{min-height:44px;max-width:55vw;padding:6px 14px}.parade-goal>svg{width:27px;height:27px}
 .speech-bubble{min-height:86px;padding:11px 13px 11px 92px;border-radius:23px}.speech-bubble .speech-portrait{width:87px;height:106px;left:2px}.speech-bubble .speaker{font-size:13px;padding:3px 12px;margin-bottom:4px}.speech-bubble .parade-round{width:54px;height:54px}.speech-bubble .parade-round>svg{width:26px;height:26px}
 .crew-pin>span{font-size:9px}.action-bubble{width:35px;height:35px}
}
@media(orientation:portrait){.hero-medallion{width:60px;height:60px}.speech-bubble{padding-left:86px}.speech-bubble .speech-portrait{width:78px;height:106px}.speech-bubble .speaker{font-size:14px}.speech-bubble .speech-copy{flex-basis:calc(100% - 30px)}}
.scene-object[data-action="pick-tools"] .object-art { display:flex;align-items:center; }
.scene-object[data-action="pick-tools"] .object-art>img { width:33%; }
#parade-app[data-intro="true"] .scene-object:not(.hanging-bell) .object-halo { display:none; }
#parade-app[data-intro="true"] .scene-object:not(.hanging-bell) { pointer-events:none; }
.scene-object .parade-actor { filter:drop-shadow(0 4px 2px #1f422d33); }
.chosen-target .object-halo { opacity:1; border-color:white; box-shadow:0 0 0 6px #8addff88; }
.chosen-target .object-label { opacity:1; }
.hanging-bell { transform-origin:50% 0; animation:bell-invitation 2.8s ease-in-out infinite; }
.need-picture { display:grid;place-items:center;width:100%;height:100%;border:2px solid #d4b278;border-radius:50%;background:#fffbed;box-shadow:0 2px 0 #88674255; }
.need-picture svg,.need-picture img { width:75%;height:75%;object-fit:contain; }
.station-tickets { position:absolute;display:flex;gap:5px;left:35%;top:16%;height:10%;pointer-events:none; }
.station-ticket { position:relative;display:block;width:5cqw;background:#fff4d6dc;border:1px solid #bc925a;border-radius:9px;transform:rotate(-3deg); }
.station-ticket img { width:100%;height:100%;object-fit:contain;opacity:.3;filter:grayscale(.7); }
.station-ticket b { position:absolute;inset:0;display:grid;place-items:center;font-size:3cqw;color:#456e62; }
.station-ticket.home img { opacity:1;filter:none; }
.station-ticket.home b { inset:auto -3px -4px auto;background:#297d6d;color:white;border-radius:50%;font-size:1.6cqw;padding:1px 4px; }
.intro-friends>span { position:relative;flex:1;min-width:0; }
.intro-friends>span img { width:100%;height:100%;opacity:.6; }
.intro-friends>span b { position:absolute;bottom:-5px;right:2px;font-size:4cqw;color:#205b58; }
.toy-performance { position:absolute;pointer-events:none;z-index:2;font-size:5cqw;display:flex;gap:2cqw;animation:toy-tumble 2.1s ease-in both; }
.toy-performance>svg,.toy-performance>img { width:5cqw;height:5cqw;object-fit:contain; }
.toy-apples { left:78%;top:12%; }
.toy-snow { left:61%;top:24%;color:white; }
.toy-jar { left:56%;top:22%; }
.toy-fire { left:25%;top:31%;color:#ffd27b;animation:toy-glow 2s ease-out both; }
.toy-bell { left:6%;top:20%;color:#fff6b9;animation:toy-glow 2s ease-out both; }
.just-packed { animation:packed 450ms ease-out; }
.rescue-drink { animation:drink-arrives 700ms ease-out both; }
.parade-procession>.parade-actor { flex:1;min-width:0; }
@keyframes bell-invitation { 0%,80%,100%{transform:rotate(0)}85%{transform:rotate(7deg)}92%{transform:rotate(-7deg)} }
@keyframes toy-tumble { 0%{transform:translateY(0) rotate(-5deg);opacity:0}12%{opacity:1}70%{transform:translateY(20cqh) rotate(12deg);opacity:1}100%{transform:translateY(28cqh) rotate(-4deg);opacity:0} }
@keyframes toy-glow { 0%{transform:translateY(0) scale(.3);opacity:0}25%{opacity:1}100%{transform:translateY(-12cqh) scale(1.2);opacity:0} }
@keyframes packed { 0%{transform:translateY(-25px) scale(1.3)}70%{transform:translateY(3px)}100%{transform:none} }
@keyframes drink-arrives { from{transform:translate(-30px,20px);opacity:0}to{transform:none;opacity:1} }
.world-decoration { position:absolute;pointer-events:none; }
.world-decoration svg,.world-decoration img { width:100%;height:100%;object-fit:contain; }
.parade-panel>.parade-round { position:absolute;top:8px;right:8px; }
.title-cast { display:flex;justify-content:center;height:100px;margin:12px 0;gap:20px; }
.title-cast img { width:80px;object-fit:contain; }
.map-friends { display:flex;justify-content:center;align-items:center;height:48px; }
.map-friends img { width:38px;height:45px;object-fit:contain; }
.intro-friends { position:absolute;left:27%;right:15%;top:24%;display:flex;justify-content:center;gap:1%;height:24%;padding:12px;background:#fff5e9ed;border:3px solid #e7c373;border-radius:25px; }
.intro-friends img { width:15%;object-fit:contain; }
.thought-item { position:absolute;top:-40%;left:60%;width:58px;height:58px;border:2px solid #d1b479;border-radius:50%;background:#fffbed;display:grid;place-items:center; }
.thought-item svg { width:75%;height:75%; }
.thought-item img { width:75%;height:75%;object-fit:contain; }
.wing-bandage { display:grid;place-items:center;width:100%;height:100%;background:#fff5d6;border:2px solid #b59063;border-radius:5px;color:#ba765a;font-size:13px;transform:rotate(24deg); }
.stuck-mud { display:block;width:100%;height:100%;border-radius:50%;background:#705442;box-shadow:0 3px 0 #4c4933; }
.shivering>.object-art { animation:shiver 180ms 8 alternate; }
@keyframes shiver { from{transform:translateX(-1px)}to{transform:translateX(1px)} }
.ice-slot,.ice-piece { filter:drop-shadow(0 5px 2px #235b7660); }
.ice-slot svg,.ice-piece svg { width:100%;height:100%; }
.ice-piece.selected { filter:drop-shadow(0 0 9px #ffdd6c);transform:translateY(-8px); }
.ice-slot.awaiting-piece { filter:drop-shadow(0 0 5px #fffacb); }
.ice-slot.wrong { animation:ice-wobble 600ms ease; }
.ice-test { position:absolute;left:83%;top:64%; }
.ice-test .parade-button { min-width:70px;padding:9px 14px; }
.missing-log { display:block;width:100%;height:100%;background:#22544e;transform:rotate(-8deg);border:3px dashed #ffe4ac;border-radius:8px; }
.water-draining { display:block;width:100%;height:100%;background:linear-gradient(#103f3888,#25483955);border-radius:4px; }
.dam-open { mix-blend-mode:multiply; }
.reacting { animation:parade-delight 550ms ease; }
.boulder-roll { transform:translateX(90px) rotate(50deg);opacity:0;transition:transform 600ms,opacity 600ms; }
.beetle-picnic { transform:translateX(-80px);transition:transform 600ms; }
.rescued { animation:parade-delight 400ms 2; }
.sparkles { position:absolute;z-index:8;pointer-events:none; }
.sparkles i { position:absolute;color:#ffe48a;font-style:normal;font-size:27px;text-shadow:0 2px #986136;animation:sparkle-burst 1100ms var(--delay) both; }
.snowfall { position:absolute;left:60%;top:25%;color:white;font-size:60px;pointer-events:none;animation:snow-drop 1500ms both; }
.night #parade-background { filter:none; }
.night #parade-stage:after { content:'';position:absolute;inset:0;pointer-events:none;z-index:5;background:radial-gradient(circle at 51% 32%,#ffe29f66,transparent 24%); }
.finale-action { position:absolute;left:38%;top:40%;z-index:7; }
.parade-procession { position:absolute;left:31%;top:50%;display:flex;width:43%;height:18%;gap:1%;animation:procession 4s ease-in-out forwards; }
.parade-procession img { width:15%;object-fit:contain;animation:parade-delight 500ms infinite; }
.ending-friends { display:flex;justify-content:center;height:110px;margin:10px 0; }
.ending-friends img { width:15%;object-fit:contain; }
#photo-preview img { width:96px;height:96px;object-fit:cover;border-radius:50%;margin:10px; }
.gentle * { animation-duration:1ms!important;animation-iteration-count:1!important;transition-duration:1ms!important; }
@keyframes sparkle-burst { from { transform:rotate(var(--a)) translateX(0) scale(.1);opacity:1; } to { transform:rotate(var(--a)) translateX(var(--d)) scale(.8);opacity:0; } }
@keyframes ice-wobble { 25%,75% { transform:translateX(-5px); } 50% { transform:translateX(5px); } }
@keyframes snow-drop { to { transform:translateY(130px);opacity:0; } }
@keyframes procession { to { transform:translateX(20%); } }
@media(max-height:520px) and (orientation:landscape){.title-cast{height:58px;margin:7px 0}.title-cast img{width:55px}.ending-friends{height:70px}.map-friends{height:35px}.map-friends img{height:32px;width:27px}.thought-item{width:44px;height:44px}.ice-test .parade-button{font-size:15px;min-width:65px}.parade-title p{font-size:16px}.parade-title h1{font-size:38px}}

#parade-app[data-intro="true"] .building-entrance .action-bubble { display:none; }
