:root {
  --blue: #0757a7;
  --blue-deep: #073a75;
  --ink: #082f5d;
  --paper: #fff8e9;
  --yellow: #ffc928;
  --muted: #58718a;
}
* { box-sizing: border-box; }
html { background: #153c68; }
body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a { touch-action: manipulation; }
img { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}
[hidden] { display: none !important; }
.phone-canvas, .map-canvas, .detail-canvas {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  background: var(--paper);
  box-shadow: 0 0 65px rgba(0, 0, 0, .18);
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .16em;
}
.round-button {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
  color: white;
  background: var(--blue-deep);
  font-size: 23px;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 2px solid var(--ink);
  border-radius: 5px 15px 5px 15px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 5px 0 var(--ink);
  font: inherit;
  font-weight: 800;
  letter-spacing: .035em;
  transition: transform .16s, box-shadow .16s;
}
.primary-button:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.primary-button--dark { color: white; background: var(--blue); }
.text-button {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.image-frame { position: relative; }
.image-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  color: var(--blue-deep);
  background: #e5eff3;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}
.is-image-error > .image-fallback { display: flex; }
.is-image-error > img { visibility: hidden; }
.image-fallback button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid currentColor;
  border-radius: 5px;
  background: var(--paper);
  color: inherit;
}
.noscript-note { margin: 0; padding: 20px; background: var(--paper); font-size: 14px; line-height: 1.8; }
.noscript-note a { text-decoration: underline; }

/* The cover remains visible until the map takes over its final frame. */
.cover { display: flex; flex-direction: column; min-height: max(360px, 100vh); min-height: max(360px, 100svh); padding-top: 9vh; padding-top: 9svh; overflow: hidden; overflow: clip; }
.cover__visual, .cover__image, .cover__wash { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover__image { object-fit: cover; animation: cover-push 8s ease-out both; }
.cover__wash {
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,248,233,.06) 36%, transparent 52%, rgba(4,37,73,.68) 100%);
  transition: opacity .24s cubic-bezier(.2,.7,.25,1);
}
.cover__content {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin: 0 8% 40px;
  animation: rise-in .65s ease both;
}
.cover__content h1 { margin: 11px 0 17px; font-size: clamp(37px, 12vw, 62px); line-height: 1.05; letter-spacing: -.06em; }
.cover__content h1 span { display: block; margin-bottom: 6px; color: var(--blue); font-size: .6em; letter-spacing: .06em; }
.cover__lead { margin: 0; color: var(--blue-deep); font-size: 15px; font-weight: 650; line-height: 1.8; }
.cover__action { position: relative; z-index: 3; flex-shrink: 0; margin: auto 8% max(30px, env(safe-area-inset-bottom)); animation: rise-in .65s .12s both; }
.cover-progress { margin: 0 0 14px; color: #fffdf7; font-size: 12px; line-height: 1.6; text-shadow: 0 1px 8px #123a63; }
.cover-restart { display: block; margin: 10px auto -7px; color: white; }
.mist { position: absolute; z-index: 1; width: 70%; height: 20%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.25), transparent 70%); pointer-events: none; transition: opacity .12s ease-out; }
.mist--one { top: 35%; left: -45%; animation: mist-drift 12s ease-in-out infinite alternate; }
.mist--two { top: 55%; right: -50%; animation: mist-drift 14s -3s ease-in-out infinite alternate-reverse; }
.cover.is-leaving .cover__content, .cover.is-leaving .cover__action { animation: cover-copy-out .18s ease-out both; }
.cover.is-leaving .cover__image { animation: cover-enter-map .18s cubic-bezier(.2,.7,.25,1) both; }
.cover.is-leaving .cover__wash { opacity: .3; }
.cover.is-leaving .mist { opacity: 0; animation: none; }

/* A single paper surface and continuous route connect all eight independent stickers. */
.map-canvas {
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(149,119,67,.1) .6px, transparent .7px);
  background-size: 5px 5px;
}
.map-nav {
  position: fixed;
  z-index: 30;
  top: 12px;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  max-width: 496px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 32px;
  color: white;
  background: rgba(7,58,117,.96);
  box-shadow: 0 8px 26px rgba(8,47,93,.15);
  transform: translateX(-50%);
}
.map-nav .round-button { border-color: rgba(255,255,255,.35); background: transparent; }
.map-nav__title { flex: 1; min-width: 0; }
.map-nav__title strong { display: block; font-size: 13px; }
.map-nav__title > span { display: block; margin-top: 3px; font-size: 11px; color: #d6e8f9; letter-spacing: .08em; }
.collection-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 22px; color: var(--yellow); font-size: 12px; font-weight: 750; white-space: nowrap; }
.collection-link > span:first-child { font-size: 20px; }
.map-nav a:focus-visible { outline-color: var(--yellow); outline-offset: 2px; }
.map-panel { position: relative; }
.map-panel--intro { height: 86vh; height: 86svh; min-height: 500px; max-height: 830px; }
.map-intro__visual { position: absolute; inset: 0 0 -30px; }
.map-intro__visual > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.map-intro__visual::after { content: ""; position: absolute; z-index: 4; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,248,233,.1) 65%, var(--paper) 100%); }
.map-intro { position: relative; z-index: 5; padding: 115px 8% 0; }
.map-intro .eyebrow { font-size: 9px; letter-spacing: .1em; }
.map-intro h1 { margin: 13px 0 19px; color: var(--blue); font-size: clamp(38px, 12vw, 60px); line-height: 1.03; letter-spacing: -.065em; }
.map-intro > p:last-child { margin: 0; font-size: 14px; line-height: 1.8; font-weight: 650; }
.scroll-cue { position: absolute; z-index: 6; bottom: 0; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 60px; padding: 8px 20px; color: var(--blue); font-size: 12px; font-weight: 750; white-space: nowrap; transform: translateX(-50%); }
.scroll-cue span { font-size: 25px; animation: cue-drift 2s ease-in-out infinite; }
.journey { position: relative; }
.journey-map-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.journey-map-route path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.river-bank { stroke: #c8e5ed; stroke-width: 126; opacity: .65; }
.river-water { stroke: #8bc9df; stroke-width: 90; opacity: .4; }
.river-shimmer { stroke: #fff8e9; stroke-width: 56; opacity: .4; stroke-dasharray: 2 11; }
.route-line { stroke: #467caa; stroke-width: 2; stroke-dasharray: 3 8; }
.journey-stop { min-height: 570px; padding: 62px 7% 42px; scroll-margin-top: 90px; }
.spot-link { position: relative; z-index: 3; display: block; width: 78%; max-width: 310px; transform-origin: center; transition: transform .18s ease; }
.spot-link:active { transform: scale(.965); }
.spot-link:focus-visible { border-radius: 16px; }
.journey-stop--right .spot-link { margin-left: auto; }
.spot-art { display: block; width: 88%; margin: 0 auto; transform: rotate(var(--tilt)); animation: sticker-float 5s var(--float-delay) ease-in-out infinite; animation-play-state: paused; filter: drop-shadow(0 9px 5px rgba(8,47,93,.12)); }
.spot-art > img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; }
.spot-art .image-fallback { border: 2px dashed #7eabc3; border-radius: 30px; background: #edf3ef; }
.is-visible .spot-art { animation-play-state: running; }
.spot-caption { display: block; position: relative; margin-top: 16px; }
.spot-caption__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stop-category { font-size: 11px; letter-spacing: .15em; color: var(--muted); font-weight: 650; }
.spot-state { color: #586d78; font-size: 11px; }
.spot-state::before { content: "○"; margin-right: 4px; }
.spot-link.is-collected .spot-state { color: var(--blue); }
.spot-link.is-collected .spot-state::before { content: "✓"; }
.spot-caption h2 { margin: 8px 0; color: var(--blue); font-size: 31px; line-height: 1.15; letter-spacing: -.04em; }
.spot-teaser { display: block; color: #405d70; font-size: 13px; line-height: 1.65; }
.spot-link__action { display: inline-flex; align-items: center; gap: 17px; margin-top: 13px; padding: 4px 0 6px; border-bottom: 1px solid rgba(7,87,167,.35); color: var(--blue); font-size: 12px; font-weight: 750; }
.spot-link__action > span { font-size: 18px; }
.stop-marker { position: absolute; z-index: 2; top: 43%; right: 8%; display: grid; width: 39px; height: 39px; place-items: center; border: 2px solid #427fa9; border-radius: 50%; color: var(--blue); background: var(--paper); font-size: 13px; font-weight: 850; box-shadow: 0 0 0 7px rgba(255,248,233,.6); }
.journey-stop--right .stop-marker { right: auto; left: 8%; }
.journey-stop.is-collected .stop-marker { background: var(--yellow); border-color: var(--ink); }
.map-panel--outro { padding: 70px 8% 35px; scroll-margin-top: 76px; }
.map-outro h2 { margin: 12px 0 18px; color: var(--blue); font-size: clamp(33px, 10vw, 50px); line-height: 1.1; letter-spacing: -.06em; }
#outroCopy { margin: 0; font-size: 14px; line-height: 1.8; color: #405d70; }
.collection-tally { display: flex; align-items: baseline; gap: 11px; margin: 27px 0 10px; }
.collection-tally strong { color: var(--blue); font-size: 54px; line-height: 1; letter-spacing: -.08em; }
.collection-tally span { color: var(--muted); font-size: 12px; }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 9px; margin: 22px -3px 32px; padding: 0; list-style: none; }
.collection-grid a { display: block; text-align: center; border-radius: 6px; }
.collection-grid .stamp-image { position: relative; display: block; height: 95px; }
.collection-grid img { width: 100%; height: 100%; object-fit: contain; opacity: .32; filter: grayscale(1); transition: filter .3s, opacity .3s; }
.collection-grid .is-collected img { opacity: 1; filter: none; }
.collection-grid .stamp-name { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; }
.collection-grid .stamp-status { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.collection-grid .is-collected .stamp-status { color: var(--blue); }
.collection-grid .image-fallback { border: 1px dashed #94b1c0; border-radius: 6px; padding: 4px; font-size: 10px; }
.outro-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 19px; color: var(--blue); font-size: 13px; }
.outro-links > a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; text-decoration: underline; text-underline-offset: 5px; }
.map-note { margin: 25px 0 0; border-top: 1px solid rgba(7,87,167,.15); padding-top: 22px; color: var(--muted); font-size: 11px; line-height: 1.9; }

/* Shorter artwork lets the first note and collection action arrive sooner. */
.detail-canvas { min-height: 100vh; overflow: hidden; }
.detail-back { position: fixed; z-index: 30; top: 16px; top: max(16px, env(safe-area-inset-top)); left: max(calc(50% - 244px), 16px); box-shadow: 0 5px 18px rgba(8,47,93,.18); }
.detail-hero { height: 66vh; height: 66svh; min-height: 320px; max-height: 610px; overflow: hidden; background: #d5e5ec; }
.detail-hero > img { width: 100%; height: 100%; object-fit: cover; }
.is-detail-poster-visible .detail-hero > img { animation: detail-image-in .3s ease both; }
.detail-hero__shade { position: absolute; z-index: 4; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 38%, rgba(4,39,78,.05) 50%, rgba(4,36,72,.88) 100%); }
.detail-hero .image-fallback { padding-bottom: 145px; }
.detail-title { position: absolute; z-index: 5; right: 8%; bottom: 38px; left: 8%; color: white; }
.is-detail-entry-pending .detail-title { opacity: 0; }
.is-detail-visible .detail-title { animation: rise-in .24s ease both; }
.detail-title .eyebrow { color: #ffe083; font-size: 10px; }
.detail-title h1 { margin: 9px 0 11px; font-size: clamp(36px, 11vw, 54px); line-height: 1; letter-spacing: -.05em; text-shadow: 0 2px 8px rgba(4,44,88,.2); }
.detail-title > p:last-child { max-width: 350px; margin: 0; font-size: 14px; line-height: 1.6; font-weight: 650; }
.detail-hero.is-image-error { display: flex; flex-direction: column; height: auto; max-height: none; padding: max(80px, calc(env(safe-area-inset-top) + 60px)) 8% 38px; }
.detail-hero.is-image-error > img, .detail-hero.is-image-error .detail-hero__shade { display: none; }
.detail-hero.is-image-error .detail-title { position: static; order: 0; color: var(--ink); }
.detail-hero.is-image-error .detail-title .eyebrow { color: var(--blue); }
.detail-hero.is-image-error .detail-title h1 { text-shadow: none; }
.detail-hero.is-image-error > .image-fallback { position: static; order: 1; margin-top: 20px; padding: 18px 0 0; border-top: 1px solid #94b1c0; background: transparent; }
.detail-sheet { position: relative; z-index: 6; margin-top: -20px; padding: 29px 8% max(35px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--paper); }
.detail-index { display: flex; align-items: center; gap: 15px; }
.detail-index > span { font-size: 45px; font-weight: 850; line-height: 1; color: var(--blue); letter-spacing: -.065em; }
.detail-index p { margin: 0; color: var(--blue); font-size: 12px; line-height: 1.7; font-weight: 650; }
.detail-index small { font-size: 9px; letter-spacing: .1em; }
.memory-note { padding: 25px 0 23px; }
.memory-note > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.memory-note > h2 { margin: 0; color: var(--ink); font-size: 21px; font-weight: 750; line-height: 1.55; letter-spacing: -.03em; }
.collect-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; border-top: 1px solid #cad7d9; border-bottom: 1px solid #cad7d9; }
.collect-row strong { display: block; font-size: 12px; }
.collect-row #collectionCount { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.collect-button { min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--ink); border-radius: 4px 12px 4px 12px; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 750; box-shadow: 2px 3px 0 var(--ink); transition: transform .16s, background .2s; }
.collect-button:active { transform: scale(.95); }
.collect-button.is-collected, .collect-button[aria-pressed="true"], .collect-button:disabled { background: var(--blue); color: white; box-shadow: none; cursor: default; }
.collect-status { min-height: 30px; margin: 9px 0 0; color: var(--blue); font-size: 11px; line-height: 1.6; }
.detail-section { padding-top: 22px; }
.detail-section h2 { margin: 0 0 10px; color: var(--blue); font-size: 17px; letter-spacing: -.02em; }
.detail-section p { margin: 0; color: #35536c; font-size: 14px; line-height: 1.95; }
.detail-time { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; padding: 18px 0; border-top: 1px solid #cad7d9; border-bottom: 1px solid #cad7d9; }
.detail-time span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.detail-time strong { color: var(--blue); font-size: 13px; text-align: right; line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 20px 0 28px; }
.tags span { color: var(--muted); font-size: 11px; line-height: 1.7; }
.detail-footer-note { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.7; }
.notice { margin: 0 0 20px; padding: 12px; border-left: 3px solid var(--blue); color: var(--blue-deep); background: #e7efed; font-size: 12px; line-height: 1.7; }

@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cover-push { from { transform: scale(1.04); } to { transform: scale(1); } }
@keyframes mist-drift { to { transform: translateX(130%); opacity: .12; } }
@keyframes cover-copy-out { from { opacity: var(--cover-start-opacity, 1); transform: var(--cover-start-transform, none); } to { opacity: 0; transform: translateY(-6px); } }
@keyframes cover-enter-map { from { transform: var(--cover-start-transform, scale(1)); } to { transform: translateY(-1%) scale(1.04); } }
@keyframes cover-copy-fade { from { opacity: var(--cover-start-opacity, 1); } to { opacity: 0; } }
@keyframes cue-drift { 0%,100% { transform: translateY(-3px); } 50% { transform: translateY(3px); } }
@keyframes sticker-float { 0%,100% { transform: translateY(0) rotate(var(--tilt)); } 50% { transform: translateY(-7px) rotate(calc(var(--tilt) + 1deg)); } }
@keyframes detail-image-in { from { transform: scale(1.035); } to { transform: scale(1); } }

@media (max-width: 359px) {
  .map-nav { gap: 6px; width: calc(100% - 16px); padding: 5px 6px; }
  .map-nav__title strong { font-size: 12px; }
  .collection-link { gap: 3px; padding: 0 5px; font-size: 11px; }
  .collection-link > span:first-child { font-size: 17px; }
  .journey-stop { min-height: 490px; padding-top: 45px; }
  .spot-link { width: 80%; }
  .spot-caption h2 { font-size: 28px; }
  .spot-teaser { font-size: 12px; }
  .stop-marker { width: 34px; height: 34px; font-size: 12px; right: 6%; }
  .journey-stop--right .stop-marker { left: 6%; }
  .collection-grid { gap: 16px 6px; }
  .collection-grid .stamp-image { height: 80px; }
  .collect-row { gap: 8px; }
  .collect-button { padding: 9px 8px; font-size: 11px; }
}
@media (max-height: 600px) {
  .cover { padding-top: 8vh; padding-top: 8svh; }
  .cover__content h1 { margin-bottom: 12px; font-size: 39px; }
  .cover__lead { font-size: 13px; line-height: 1.7; }
  .cover__action { margin-bottom: max(22px, env(safe-area-inset-bottom)); }
  .cover-progress { margin-bottom: 9px; font-size: 11px; }
  .cover-restart { margin-top: 7px; }
  .map-panel--intro { min-height: 460px; }
  .map-intro { padding-top: 100px; }
  .map-intro h1 { font-size: 38px; }
  .detail-hero { min-height: 300px; }
  .detail-title { bottom: 32px; }
}
@media (max-height: 430px) and (min-width: 500px) {
  .cover__wash { background: linear-gradient(180deg, rgba(255,248,233,.86), rgba(255,248,233,.65) 46%, rgba(255,248,233,.08) 65%, rgba(4,37,73,.68)); }
  .cover { padding-top: 34px; }
  .cover__content h1 { font-size: 35px; }
  .cover__content .eyebrow { font-size: 9px; }
  .cover__lead { font-size: 12px; }
  .cover__action { margin-bottom: max(18px, env(safe-area-inset-bottom)); }
  .cover-progress { margin-bottom: 6px; }
  .cover__action .primary-button { min-height: 46px; padding-top: 10px; padding-bottom: 10px; }
  .cover-restart { min-height: 44px; padding: 4px; }
}
@media (hover: hover) {
  .spot-link:hover { transform: translateY(-4px); }
  .collection-link:hover { background: rgba(255,255,255,.08); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .cover.is-leaving .cover__content, .cover.is-leaving .cover__action { animation: cover-copy-fade .08s ease-out both !important; }
}
