:root {
  color-scheme: light;
  --ink: #28333b;
  --muted: #6f777e;
  --cream: #fff9f1;
  --paper: rgba(255, 252, 246, 0.92);
  --rose: #d56b86;
  --rose-dark: #a94967;
  --teal: #5a9695;
  --teal-dark: #3b6f73;
  --gold: #d3ae55;
  --water: #c8e9eb;
  --shadow: 0 18px 60px rgba(46, 57, 66, 0.2);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #d7eef0;
}
button, select { font: inherit; }
button { color: inherit; }

#app, .screen { position: fixed; inset: 0; }
.screen { display: none; }
.screen--visible { display: block; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose-dark);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.primary-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: var(--rose);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(169, 73, 103, .25);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.primary-button:hover { transform: translateY(-2px); background: var(--rose-dark); box-shadow: 0 14px 30px rgba(169, 73, 103, .28); }
.primary-button:active { transform: translateY(0); }
.text-button {
  border: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 750;
  cursor: pointer;
}
.round-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(40, 51, 59, .12);
  background: rgba(255,255,255,.75);
  cursor: pointer;
}

/* Illustrated opening */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.splash-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 219, 232, .22), transparent 42%),
    linear-gradient(145deg, #2b2438 0%, #201b2d 58%, #171522 100%);
  isolation: isolate;
  transition: opacity .34s ease, transform .34s ease, filter .34s ease;
}
.splash-screen.screen--visible { display: block; }
.splash-screen--leaving {
  opacity: 0;
  transform: scale(1.018);
  filter: brightness(.82) saturate(.92);
}
.splash-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(95.5vw, 143vh);
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  padding: clamp(4px, .42vw, 7px);
  background:
    linear-gradient(145deg, rgba(255, 247, 244, .98), rgba(249, 222, 230, .98));
  border: 1px solid rgba(206, 112, 145, .72);
  border-radius: clamp(22px, 1.7vw, 30px);
  box-shadow:
    0 10px 30px rgba(13, 9, 23, .22),
    0 1px 0 rgba(255, 255, 255, .88) inset;
}
.splash-stage::before {
  content: '';
  position: absolute;
  inset: clamp(2px, .2vw, 4px);
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(181, 82, 119, .58);
  border-radius: clamp(19px, 1.5vw, 27px);
}
.splash-stage::after {
  content: '';
  position: absolute;
  inset: clamp(5px, .44vw, 7px);
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: clamp(17px, 1.35vw, 24px);
}
.splash-picture {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #fce9e6;
  border: 1px solid rgba(151, 76, 111, .52);
  border-radius: clamp(17px, 1.35vw, 24px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .58),
    inset 0 0 0 1px rgba(255, 255, 255, .20);
}
.splash-picture::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 47%, transparent 0 70%, rgba(106, 68, 111, .025) 100%);
}
.splash-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.splash-corner {
  position: absolute;
  z-index: 7;
  display: none;
  width: clamp(30px, 3vw, 48px);
  height: clamp(30px, 3vw, 48px);
  pointer-events: none;
  color: rgba(171, 78, 117, .78);
}
.splash-corner::before,
.splash-corner::after {
  content: '';
  position: absolute;
  border-color: currentColor;
  border-style: solid;
}
.splash-corner::before {
  inset: 0;
  border-width: 1.5px 0 0 1.5px;
  border-top-left-radius: 18px;
}
.splash-corner::after {
  left: 8px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-width: 1px 0 0 1px;
  border-top-left-radius: 9px;
  opacity: .72;
}
.splash-corner--tl { left: clamp(8px, .72vw, 12px); top: clamp(8px, .72vw, 12px); }
.splash-corner--tr { right: clamp(8px, .72vw, 12px); top: clamp(8px, .72vw, 12px); transform: rotate(90deg); }
.splash-corner--br { right: clamp(8px, .72vw, 12px); bottom: clamp(8px, .72vw, 12px); transform: rotate(180deg); }
.splash-corner--bl { left: clamp(8px, .72vw, 12px); bottom: clamp(8px, .72vw, 12px); transform: rotate(270deg); }
.splash-hit {
  position: absolute;
  z-index: 3;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: transparent;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
.splash-hit--start {
  left: 33.45%;
  top: 74.95%;
  width: 33.15%;
  height: 8.45%;
  border-radius: 999px;
}
.splash-hit--settings {
  left: 37.20%;
  top: 84.10%;
  width: 25.60%;
  height: 7.15%;
  border-radius: 999px;
}
.splash-hit--start:hover {
  background: rgba(255, 255, 255, .07);
  box-shadow:
    0 0 0 2px rgba(255, 236, 246, .22),
    0 0 28px rgba(255, 99, 161, .48),
    inset 0 0 24px rgba(255,255,255,.08);
  transform: translateY(-2px) scale(1.008);
}
.splash-hit--settings:hover {
  background: rgba(255, 255, 255, .055);
  box-shadow:
    0 0 0 2px rgba(214, 207, 255, .15),
    0 0 22px rgba(126, 105, 235, .28);
  transform: translateY(-1px);
}
.splash-hit:active { transform: translateY(1px) scale(.995); }
.splash-hit:focus-visible {
  outline: 3px solid rgba(255, 245, 252, .96);
  outline-offset: 4px;
}
.splash-settings {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(83, 73, 128, .30);
  -webkit-backdrop-filter: blur(10px) saturate(.9);
  backdrop-filter: blur(10px) saturate(.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.splash-settings.is-visible { opacity: 1; visibility: visible; }
.splash-settings__panel {
  position: relative;
  width: min(390px, calc(100vw - 38px));
  padding: 32px 28px 25px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(126, 104, 158, .94), rgba(88, 78, 130, .96));
  box-shadow:
    0 24px 70px rgba(8, 6, 28, .48),
    inset 0 1px 0 rgba(255,255,255,.16);
  color: #fff8f2;
  text-align: center;
}
.splash-settings__panel::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(247, 164, 201, .16);
  border-radius: 18px;
  pointer-events: none;
}
.splash-settings__title {
  position: relative;
  z-index: 1;
  margin: 0 0 22px;
  color: #ffdce8;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .18em;
}
.splash-settings__close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: #fff3f7;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.splash-settings__close:hover { background: rgba(255,255,255,.12); transform: rotate(4deg); }
.splash-setting-button {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 7px 0;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: #fff9f5;
  font-size: .86rem;
  font-weight: 750;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.splash-setting-button:hover {
  background: rgba(239, 117, 166, .18);
  border-color: rgba(255, 191, 218, .35);
  transform: translateY(-1px);
}
.splash-settings__note {
  position: relative;
  z-index: 1;
  margin: 17px 8px 0;
  color: rgba(255,244,248,.7);
  font-size: .77rem;
  line-height: 1.5;
}
@media (max-aspect-ratio: 5 / 6) {
  .splash-stage { width: 95vw; }
}
@media (max-width: 620px) {
  .splash-settings { padding: 14px; }
  .splash-settings__panel { padding: 30px 20px 22px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-screen, .splash-settings, .splash-hit, .splash-settings__close, .splash-setting-button { transition: none; }
}

/* Memory book map */
.map-screen {
  overflow: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 16% 13%, rgba(255, 247, 238, .88), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(235, 194, 207, .55), transparent 29%),
    linear-gradient(145deg, #e9d8d0 0%, #d8c7cb 48%, #c9b9c2 100%);
  isolation: isolate;
}
.map-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-linear-gradient(0deg, rgba(88, 57, 54, .055) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
}
.map-sky { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; opacity: .38; z-index: -1; }
.map-sky--one { width: 360px; height: 360px; background: #fff4e8; left: -130px; top: -130px; }
.map-sky--two { width: 460px; height: 460px; background: #e9b8c8; right: -160px; bottom: -220px; }
.book-desk-sparkle { position: fixed; z-index: 0; color: rgba(255,243,239,.72); pointer-events: none; font-family: Georgia, serif; }
.book-desk-sparkle--one { left: 4vw; top: 9vh; font-size: 2.2rem; transform: rotate(-12deg); }
.book-desk-sparkle--two { right: 4.5vw; bottom: 8vh; font-size: 2.7rem; transform: rotate(8deg); }
.memory-book {
  position: relative;
  z-index: 2;
  width: min(95vw, 1580px);
  height: min(91vh, 900px);
  min-height: 620px;
  margin: 50vh auto 0;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: minmax(350px, .78fr) minmax(0, 1.42fr);
  border-radius: 25px 29px 29px 25px;
  filter: drop-shadow(0 24px 34px rgba(73, 47, 54, .26));
}
.book-cover {
  position: absolute;
  inset: -12px -15px -16px -15px;
  z-index: -2;
  border-radius: 31px 35px 35px 31px;
  background: linear-gradient(145deg, #a85f73, #7e455a 72%, #6c3b50);
  box-shadow: 0 4px 0 rgba(255,255,255,.18) inset, 0 -5px 0 rgba(62,31,42,.14) inset;
}
.book-page {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  color: #5d4542;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.78), transparent 24%),
    repeating-linear-gradient(0deg, rgba(129,92,73,.025) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, #fffaf0 0%, #f8eddc 56%, #f2e4d2 100%);
  border: 1px solid rgba(143, 91, 75, .22);
}
.book-page::before {
  content: '';
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(185, 105, 116, .26);
  border-radius: 18px;
}
.book-page--left {
  padding: clamp(28px, 3.1vh, 42px) clamp(28px, 2.7vw, 44px) clamp(20px, 2.4vh, 30px);
  border-radius: 22px 5px 6px 22px;
  box-shadow: inset -18px 0 34px rgba(92, 60, 49, .1);
}
.book-page--right {
  padding: clamp(22px, 2.5vh, 34px) clamp(24px, 2.25vw, 38px) clamp(16px, 2vh, 24px);
  border-radius: 5px 24px 24px 6px;
  box-shadow: inset 18px 0 34px rgba(92, 60, 49, .11);
}
.book-spine {
  position: absolute;
  z-index: 6;
  left: calc(35.45% - 10px);
  top: 9px;
  bottom: 9px;
  width: 22px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(74,46,40,.18) 40%, rgba(255,255,255,.28) 51%, rgba(82,47,43,.12) 67%, transparent);
  filter: blur(.2px);
}
.book-ribbon {
  position: absolute;
  z-index: 5;
  top: -1px;
  left: clamp(20px, 2.4vw, 36px);
  width: 92px;
  height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: white;
  text-align: center;
  background: linear-gradient(#dc8396, #c9617c);
  box-shadow: 0 8px 14px rgba(115,61,71,.16), inset 0 1px rgba(255,255,255,.55);
  clip-path: polygon(0 0,100% 0,100% 100%,50% 84%,0 100%);
}
.book-ribbon span { font-size: 1.45rem; }
.book-ribbon b { font-size: .64rem; line-height: 1.25; letter-spacing: .12em; }
.book-tape { position: absolute; z-index: 4; width: 72px; height: 22px; background: rgba(239, 175, 185, .52); box-shadow: 0 1px 2px rgba(96,64,60,.1); }
.book-tape--left { top: 20px; right: 42px; transform: rotate(4deg); }
.book-tape--right { right: 38px; bottom: 26px; transform: rotate(-6deg); }
.book-flower { position: absolute; z-index: 4; color: #d98698; font-family: Georgia, serif; text-shadow: 12px 7px 0 rgba(234,171,183,.35), -9px 12px 0 rgba(234,171,183,.28); pointer-events: none; }
.book-flower--left { left: 22px; bottom: 26px; font-size: 2rem; transform: rotate(-11deg); }
.book-flower--right { right: 25px; top: 18px; font-size: 2.1rem; transform: rotate(14deg); }
.map-header { position: relative; z-index: 2; margin: 0 0 16px; padding: 5px 0 0 74px; text-align: left; }
.map-header .eyebrow { margin-bottom: 3px; color: #b45e74; font-family: Georgia, serif; font-size: .7rem; letter-spacing: .2em; }
.map-header h1 { margin: 0; color: #8f4058; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 3.2vw, 3.7rem); line-height: .98; font-weight: 600; letter-spacing: -.035em; }
.map-header > p:last-child { max-width: 420px; margin: 8px 0 0; color: #7b625b; font-family: Georgia, serif; font-size: clamp(.82rem, 1.05vw, 1rem); font-style: italic; line-height: 1.45; }
.book-divider { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; color: #cb6b82; }
.book-divider::before, .book-divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(177,98,111,.52), transparent); }
.book-divider span { font-family: Georgia, serif; font-size: 1.05rem; }
.memory-index { position: relative; z-index: 2; display: grid; gap: 5px; }
.memory-index__title { margin: 0 0 2px; color: #9d5668; font-family: Georgia, serif; font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.memory-index__item {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 38px 1fr 24px;
  align-items: center;
  gap: 8px;
  padding: 7px 28px 7px 7px;
  border: 0;
  border-bottom: 1px dashed rgba(159,108,92,.25);
  background: transparent;
  color: #5d4542;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.memory-index__item:hover, .memory-index__item:focus-visible, .memory-index__item.is-selected { background: rgba(225, 143, 161, .105); transform: translateX(3px); color: #8d4057; }
.memory-index__icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(170,91,111,.28); border-radius: 10px; background: rgba(255,255,255,.42); color: #b45770; font-family: Georgia, serif; font-size: 1.1rem; }
.memory-index__item strong { display: block; font-family: Georgia, serif; font-size: .86rem; font-weight: 700; }
.memory-index__item small { display: block; margin-top: 1px; color: #92786f; font-family: Georgia, serif; font-size: .65rem; font-style: italic; }
.memory-index__heart { color: #cb667f; font-family: Georgia, serif; font-size: 1.15rem; }
.memory-index__check { position: absolute; right: 4px; top: 7px; display: none; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #6f9e79; color: white; font-size: .63rem; font-weight: 900; }
.memory-index__item.is-complete .memory-index__check { display: grid; }
.location-card {
  position: relative;
  z-index: 2;
  top: auto;
  left: auto;
  width: 100%;
  min-height: 176px;
  margin-top: 14px;
  padding: 15px 16px 14px;
  border: 1px solid rgba(181,114,121,.23);
  border-radius: 16px;
  background: rgba(255, 252, 245, .58);
  box-shadow: 0 8px 24px rgba(94, 64, 54, .075), inset 0 0 0 4px rgba(255,255,255,.26);
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: background .2s ease, border-color .2s ease;
  backdrop-filter: none;
}
.location-card.is-visible { transform: none; opacity: 1; visibility: visible; background: rgba(255,250,241,.82); border-color: rgba(181,87,111,.34); }
.location-card:not(.is-visible) > :not(.location-card__placeholder) { display: none; }
.location-card.is-visible .location-card__placeholder { display: none; }
.location-card__placeholder { display: grid; min-height: 142px; align-content: center; justify-items: center; text-align: center; }
.location-card__placeholder .eyebrow { margin-bottom: 4px; }
.location-card__placeholder h2 { margin-bottom: 4px; }
.location-card__placeholder p:last-child { margin: 0; color: #89736b; font-family: Georgia, serif; font-size: .78rem; }
.location-card__sketch { color: #d27388; font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.location-card__close { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border-color: rgba(157,86,104,.2); background: rgba(255,255,255,.48); color: #9d5668; font-size: .9rem; }
.location-card > .eyebrow { margin: 0 34px 3px 0; font-size: .62rem; }
.location-card h2 { margin: 0 32px 1px 0; color: #7f3f52; font-family: Georgia, serif; font-size: clamp(1.2rem, 1.45vw, 1.55rem); line-height: 1.05; }
.location-card__subtitle { margin: 5px 0 4px; color: var(--rose-dark); font-family: Georgia, serif; font-size: .76rem; font-weight: 700; }
.location-card > p:not(.eyebrow):not(.location-card__subtitle) { display: -webkit-box; margin: 5px 0; overflow: hidden; color: #735e57; font-family: Georgia, serif; font-size: .72rem; line-height: 1.38; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.location-card .primary-button { width: 100%; margin-top: 8px; padding: 10px 14px; border-radius: 13px; background: linear-gradient(#dc7f94,#c8647e); box-shadow: 0 7px 14px rgba(169,73,103,.16); font-family: Georgia, serif; font-size: .78rem; letter-spacing: .02em; }
.location-progress { display: flex; justify-content: space-between; gap: 9px; margin-top: 7px; padding: 7px 9px; border-radius: 10px; background: rgba(221, 233, 215, .55); color: #5f7462; font-family: Georgia, serif; font-size: .66rem; }
.location-progress strong { text-align: right; }
.book-love-note { position: absolute; left: 50%; bottom: 18px; width: 74%; margin: 0; transform: translateX(-50%); color: #aa6473; font-family: Georgia, serif; font-size: .67rem; font-style: italic; text-align: center; }
.book-love-note span { color: #d05e78; }
.book-map-heading { position: relative; z-index: 2; margin: 0 0 8px; padding: 0 52px 0 8px; }
.book-map-heading .eyebrow { margin: 0 0 1px; color: #bd6579; font-size: .61rem; }
.book-map-heading h2 { margin: 0; color: #7d4253; font-family: Georgia, serif; font-size: clamp(1.15rem, 1.75vw, 1.65rem); font-weight: 600; }
.book-map-heading h2 span { color: #d36881; }
.nyc-map {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(153, 100, 84, .24);
  border-radius: 17px;
  background: #c9dfdc;
  box-shadow: 0 9px 20px rgba(103, 79, 64, .1), 0 0 0 5px rgba(255,255,255,.32);
}
.nyc-map::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 45px rgba(111,70,54,.10); }
.nyc-map__art { display: block; width: 100%; height: auto; filter: saturate(.82) sepia(.06) brightness(1.03); }
.nyc-map .map-clouds { opacity: .27; }
.map-roads { opacity: .57 !important; }
.ferry-route { animation: dash 11s linear infinite; opacity: .66; }
.tiny-hearts { animation: float 3.8s ease-in-out infinite; transform-origin: center; }
.water-washes { animation: water-breathe 7s ease-in-out infinite alternate; }
@keyframes dash { to { stroke-dashoffset: -90; } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes water-breathe { to { opacity: .58; transform: translateY(3px); } }
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: grid;
  place-items: center;
  min-width: 72px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  filter: drop-shadow(0 5px 5px rgba(88, 58, 54, .17));
}
.map-pin__heart {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50% 50% 48% 48%;
  background: linear-gradient(#e4879b,#ca607a);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.32rem;
  border: 3px solid rgba(255,250,243,.95);
  box-shadow: 0 4px 8px rgba(112,67,73,.14);
  transition: transform .2s ease, background .2s ease;
}
.map-pin__heart::after { content: ''; position: absolute; top: 39px; width: 2px; height: 9px; background: #a9666f; border-radius: 2px; }
.map-pin:hover .map-pin__heart, .map-pin:focus-visible .map-pin__heart, .map-pin.is-selected .map-pin__heart { transform: translateY(-4px) rotate(-3deg) scale(1.08); background: linear-gradient(#dc718a,#ac405f); }
.map-pin__label { margin-top: 8px; padding: 4px 8px; border: 1px solid rgba(159,108,92,.22); border-radius: 7px; background: rgba(255, 247, 235, .93); color: #754b46; box-shadow: 0 3px 7px rgba(96,68,57,.09); font-family: Georgia, serif; font-size: .62rem; font-weight: 700; white-space: nowrap; }
.map-pin__pulse { position: absolute; top: 0; width: 43px; height: 43px; border-radius: 50%; border: 2px solid #d26d83; animation: pulse 2.3s ease-out infinite; }
.map-pin__complete { position: absolute; top: -4px; right: 5px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #6f9e79; color: white; font-size: .65rem; font-weight: 900; border: 2px solid #fff8ee; }
.map-pin.is-complete .map-pin__complete { display: grid; }
.map-pin--csi { left: 18.5%; top: 79%; }
.map-pin--little-island { left: 38.6%; top: 64.5%; }
.map-pin--washington { left: 45.2%; top: 50.0%; }
.map-pin--met { left: 46.7%; top: 39.5%; }
@keyframes pulse { 0% { opacity: .72; transform: scale(.8); } 75%, 100% { opacity: 0; transform: scale(1.68); } }
.map-postcard {
  position: absolute;
  right: 4.5%;
  bottom: 5.2%;
  width: 104px;
  height: 69px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding-top: 7px;
  background: rgba(255,248,235,.93);
  border: 3px solid rgba(255,255,255,.8);
  outline: 1px dashed rgba(181,122,99,.65);
  outline-offset: -7px;
  transform: rotate(-4deg);
  color: #a05e6d;
  box-shadow: 0 7px 13px rgba(72, 73, 72, .12);
}
.map-postcard::before { content: ''; position: absolute; top: -8px; left: 29px; width: 45px; height: 16px; background: rgba(231,158,171,.5); transform: rotate(2deg); }
.map-postcard span { font-family: Georgia, serif; font-size: .78rem; font-style: italic; }
.map-postcard b { font-family: Georgia, serif; font-size: .65rem; letter-spacing: .07em; }
.map-footer { position: relative; z-index: 2; margin: 9px 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: #8a6b62; font-family: Georgia, serif; font-size: .7rem; }
.map-footer .text-button { padding: 5px 8px; color: #9e5266; font-family: Georgia, serif; font-size: .7rem; }

@media (max-height: 760px) and (min-width: 861px) {
  .memory-book { height: 92vh; min-height: 0; }
  .book-page--left { padding-top: 24px; padding-bottom: 16px; }
  .map-header { margin-bottom: 9px; }
  .map-header h1 { font-size: 2.25rem; }
  .map-header > p:last-child { font-size: .78rem; }
  .memory-index__item { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
  .memory-index__icon { width: 29px; height: 29px; }
  .location-card { margin-top: 9px; min-height: 148px; padding: 11px 13px; }
  .location-card__placeholder { min-height: 118px; }
  .book-love-note { display: none; }
  .book-map-heading { margin-bottom: 5px; }
  .map-footer { margin-top: 5px; }
}

@media (max-width: 860px) {
  .map-screen { overflow-y: auto; padding: 16px 12px 24px; }
  .memory-book { width: min(96vw, 720px); height: auto; min-height: 0; margin: 0 auto; transform: none; grid-template-columns: 1fr; filter: drop-shadow(0 18px 28px rgba(73,47,54,.22)); }
  .book-cover { inset: -8px -9px -10px; }
  .book-spine { display: none; }
  .book-page { height: auto; }
  .book-page--left { min-height: 600px; border-radius: 20px 20px 5px 5px; box-shadow: inset 0 -12px 22px rgba(92,60,49,.08); }
  .book-page--right { border-radius: 5px 5px 20px 20px; box-shadow: inset 0 12px 22px rgba(92,60,49,.08); }
  .book-love-note { position: relative; left: auto; bottom: auto; width: 100%; margin: 18px 0 0; transform: none; }
  .map-header { padding-left: 88px; }
  .nyc-map { margin-top: 2px; }
}

@media (max-width: 560px) {
  .memory-book { width: calc(100vw - 20px); }
  .book-page--left, .book-page--right { padding-left: 20px; padding-right: 20px; }
  .book-ribbon { left: 18px; width: 72px; height: 104px; }
  .map-header { padding-left: 74px; }
  .map-header h1 { font-size: 2.15rem; }
  .memory-index__item { grid-template-columns: 34px 1fr 20px; }
  .map-pin__heart { width: 35px; height: 35px; font-size: 1.05rem; border-width: 2px; }
  .map-pin__heart::after { top: 32px; height: 7px; }
  .map-pin__pulse { width: 35px; height: 35px; }
  .map-pin__label { margin-top: 6px; padding: 3px 5px; font-size: .52rem; }
  .map-postcard { width: 77px; height: 53px; }
  .map-footer { font-size: .62rem; }
}


/* Game */
.game-screen { background: #b7d5df; }
#game, #game canvas { width: 100%; height: 100%; display: block; }
.overlay, .modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(35, 45, 53, .32);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
  backdrop-filter: blur(8px);
}
.overlay--visible, .modal--visible { opacity: 1; visibility: visible; }
.panel {
  position: relative;
  width: min(520px, 100%);
  padding: 30px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.75);
}
.panel h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.04; }
.panel > p:not(.eyebrow) { color: #59656d; line-height: 1.55; }
.loading-panel { text-align: center; }
.progress-track { height: 9px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: #d9e3e1; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--rose)); transition: width .3s ease; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
.control-grid span { padding: 10px 12px; border-radius: 13px; background: #edf4f2; color: #59666b; font-size: .88rem; }
.intro-panel .primary-button { width: 100%; }

.hud { position: fixed; z-index: 15; left: 14px; right: 14px; top: max(14px, env(safe-area-inset-top)); display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud-card, .hud-actions { border: 1px solid rgba(255,255,255,.22); background: rgba(36, 45, 54, .85); color: white; box-shadow: 0 9px 28px rgba(25,30,34,.18); backdrop-filter: blur(12px); }
.hud-card { display: grid; gap: 2px; min-height: 58px; padding: 10px 15px; border-radius: 18px; }
.hud-card span { font-size: .66rem; color: rgba(255,255,255,.72); font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hud-card strong { font-size: 1rem; }
.hud-card--memory { min-width: 130px; }
.hud-card--objective { min-width: 280px; max-width: 480px; }
.hud-actions { margin-left: auto; display: flex; padding: 7px; border-radius: 18px; pointer-events: auto; }
.hud-button { border: 1px solid rgba(255,255,255,.18); border-radius: 11px; padding: 8px 10px; background: rgba(255,255,255,.08); color: white; cursor: pointer; }
.hud-button--icon { min-width: 40px; }

.interaction-prompt { position: fixed; z-index: 18; left: 50%; bottom: max(92px, calc(env(safe-area-inset-bottom) + 72px)); transform: translateX(-50%) translateY(15px); padding: 10px 16px; border-radius: 999px; background: rgba(32, 41, 49, .88); color: white; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; white-space: nowrap; }
.interaction-prompt.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.leave-early-button, .return-map-button { position: fixed; z-index: 20; border: 1px solid rgba(255,255,255,.3); color: white; font-weight: 850; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.17); backdrop-filter: blur(12px); }
.leave-early-button { left: 15px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 10px 14px; border-radius: 999px; background: rgba(39,48,56,.72); }
.return-map-button { left: 50%; bottom: max(23px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 13px 22px; border-radius: 999px; background: var(--rose); animation: button-breathe 2.2s ease-in-out infinite; }
@keyframes button-breathe { 50% { transform: translateX(-50%) translateY(-3px) scale(1.02); } }
.memory-panel { text-align: center; }
.memory-stamp, .complete-heart { display: grid; place-items: center; margin: -58px auto 16px; width: 64px; height: 64px; border-radius: 50%; background: var(--rose); color: white; font-size: 1.9rem; border: 6px solid #fff9f1; box-shadow: 0 9px 24px rgba(169,73,103,.25); }
.memory-panel .primary-button, .complete-panel .primary-button { width: 100%; margin-top: 10px; }
.complete-panel { text-align: center; }
.complete-heart { width: 76px; height: 76px; font-size: 2.25rem; }
.complete-panel .text-button { display: block; margin: 8px auto -8px; }

.mobile-controls { position: fixed; z-index: 16; inset: auto 18px max(17px, env(safe-area-inset-bottom)) 18px; display: none; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.mobile-controls button { pointer-events: auto; touch-action: none; width: 54px; height: 54px; border: 1px solid rgba(255,255,255,.3); border-radius: 17px; background: rgba(36,45,54,.66); color: white; font-weight: 900; backdrop-filter: blur(10px); }
.move-pad { display: grid; justify-items: center; gap: 6px; }
.move-pad > div { display: flex; gap: 6px; }
.action-pad { display: flex; gap: 8px; }
.action-pad button[data-action="jump"] { background: rgba(88,112,128,.76); font-size: 1.15rem; }
.action-pad button:last-child { width: 64px; height: 64px; border-radius: 50%; background: rgba(213,107,134,.8); font-size: 1.25rem; }

@media (pointer: coarse), (max-width: 800px) {
  .mobile-controls { display: flex; }
  .leave-early-button { bottom: auto; top: max(85px, calc(env(safe-area-inset-top) + 74px)); }
  .return-map-button { bottom: max(102px, calc(env(safe-area-inset-bottom) + 90px)); }
  .interaction-prompt { bottom: max(174px, calc(env(safe-area-inset-bottom) + 158px)); }
  .hud-card--objective { min-width: 0; flex: 1; }
  .hud-card--memory { min-width: 102px; }
  .hud-actions { position: fixed; right: 14px; top: max(80px, calc(env(safe-area-inset-top) + 68px)); }
}

@media (max-width: 600px) {
  .panel { padding: 26px 21px; }
  .control-grid { grid-template-columns: 1fr; }
  .hud { gap: 7px; }
  .hud-card { padding: 9px 10px; border-radius: 15px; }
  .hud-card strong { font-size: .82rem; }
  .hud-card--objective { max-width: calc(100vw - 125px); }
  .hud-card--objective strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Final memory-book polish */
@media (min-width: 861px) {
  .map-header { padding-left: 102px; padding-right: 6px; }
  .book-ribbon { width: 82px; }
}
.location-card:not(.is-visible) > #location-card-description { display: none !important; }
.map-landmark-doodles { filter: drop-shadow(0 2px 1px rgba(97,64,55,.08)); }
.book-page--right .nyc-map__art { background: #c9dfdc; }

/* --------------------------------------------------------------------------
   STORYBOOK MAP V2 — visual target: illustrated scrapbook reference
   -------------------------------------------------------------------------- */
.map-screen {
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 17% 18%, rgba(245, 172, 183, .12), transparent 23%),
    radial-gradient(circle at 83% 72%, rgba(222, 137, 156, .12), transparent 25%),
    linear-gradient(145deg, #2a171a 0%, #3f2527 48%, #211417 100%);
}
.map-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at center, transparent 42%, rgba(8, 3, 5, .28) 100%);
  opacity: .95;
}
.storybook-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.2vw, 18px);
}
.storybook-book {
  position: relative;
  width: min(98vw, 146vh);
  aspect-ratio: 3 / 2;
  max-height: 97vh;
  overflow: visible;
  filter: drop-shadow(0 24px 38px rgba(15, 5, 8, .38));
  animation: storybook-open .46s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes storybook-open {
  from { opacity: 0; transform: translateY(12px) scale(.986); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.storybook-book__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  border-radius: 2.4% / 3.6%;
}
.storybook-hit {
  position: absolute;
  z-index: 9;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.storybook-hit--close {
  right: 2.05%;
  top: 3.65%;
  width: 3.45%;
  height: 5.35%;
  border-radius: 22%;
}
.storybook-hit--close:hover,
.storybook-hit--close:focus-visible {
  outline: 3px solid rgba(255,255,255,.82);
  background: rgba(255,255,255,.12);
}

.storybook-left-ui {
  position: absolute;
  z-index: 5;
  left: 12.45%;
  top: 25.15%;
  width: 31.75%;
  height: 62.8%;
  pointer-events: none;
}
.storybook-left-ui > * { pointer-events: auto; }

.storybook-left-ui .memory-index {
  position: absolute;
  inset: 0 0 auto 0;
  height: 61.7%;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 2.2%;
}
.storybook-left-ui .memory-index__item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 26% minmax(0,1fr) auto 18px;
  align-items: center;
  gap: 2.5%;
  padding: 1.8% 3.2% 1.8% 2.1%;
  border: 1px solid rgba(147, 83, 67, .24);
  border-radius: 7px;
  background:
    linear-gradient(rgba(255, 244, 225, .965), rgba(248, 229, 204, .965)),
    repeating-linear-gradient(0deg, rgba(128,85,61,.03) 0 1px, transparent 1px 4px);
  color: #57352f;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(83,47,37,.08), inset 0 0 0 1px rgba(255,255,255,.35);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.storybook-left-ui .memory-index__item::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%) rotate(45deg) scale(.78);
  border-top: 1px solid rgba(147,83,67,.24);
  border-right: 1px solid rgba(147,83,67,.24);
  background: #f8e8d0;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.storybook-left-ui .memory-index__item:hover,
.storybook-left-ui .memory-index__item:focus-visible {
  transform: translateX(2px);
  border-color: rgba(183, 81, 103, .4);
  box-shadow: 0 5px 12px rgba(108,55,46,.12), inset 0 0 0 1px rgba(255,255,255,.5);
}
.storybook-left-ui .memory-index__item.is-selected {
  background:
    linear-gradient(rgba(242, 188, 185, .96), rgba(238, 177, 178, .96)),
    repeating-linear-gradient(0deg, rgba(128,85,61,.03) 0 1px, transparent 1px 4px);
  border-color: rgba(166, 68, 89, .56);
  box-shadow: 0 5px 13px rgba(143,66,79,.16), inset 0 0 0 1px rgba(255,255,255,.42);
}
.storybook-left-ui .memory-index__item.is-selected::after {
  opacity: 1;
  transform: translateY(-50%) rotate(45deg) scale(1);
  border-color: rgba(166,68,89,.48);
  background: #eeb4b3;
}
.memory-index__thumb {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: cover;
  border: 3px solid #fff4df;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(78,48,39,.18);
  filter: saturate(.9) contrast(.96) brightness(1.03);
}
.memory-index__copy { min-width: 0; }
.storybook-left-ui .memory-index__item strong {
  display: block;
  color: #54342f;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.72rem, 1.15vw, 1.18rem);
  font-weight: 500;
  line-height: 1.02;
}
.storybook-left-ui .memory-index__item small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #795247;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.55rem, .72vw, .77rem);
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-index__count {
  align-self: end;
  padding-bottom: 6%;
  color: #6e4037;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.53rem, .68vw, .75rem);
  white-space: nowrap;
}
.storybook-left-ui .memory-index__heart {
  color: #aa4058;
  font-family: Georgia, serif;
  font-size: clamp(.82rem, 1.15vw, 1.15rem);
}
.storybook-left-ui .memory-index__check {
  position: absolute;
  right: -6px;
  top: -6px;
  display: none;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff0db;
  background: #799c72;
  color: #fff;
  font-size: .62rem;
  box-shadow: 0 2px 5px rgba(48,54,34,.2);
}
.storybook-left-ui .memory-index__item.is-complete .memory-index__check { display: grid; }

.storybook-left-ui .location-card {
  position: absolute;
  left: -10.7%;
  right: -1.2%;
  top: 61.2%;
  bottom: auto;
  min-height: 0;
  height: 38.2%;
  display: grid;
  grid-template-columns: 38% 62%;
  gap: 2.4%;
  padding: 2.1% 2.5% 2.1% 2.1%;
  overflow: visible;
  border: 1px solid rgba(141,84,64,.27);
  border-radius: 7px;
  background:
    linear-gradient(rgba(255, 243, 223, .985), rgba(247, 226, 199, .985)),
    repeating-linear-gradient(0deg, rgba(139,96,69,.035) 0 1px, transparent 1px 4px);
  box-shadow: 0 5px 13px rgba(79,44,34,.1), inset 0 0 0 1px rgba(255,255,255,.38);
  color: #57352f;
  transform: none;
  opacity: 1;
  visibility: visible;
}
.storybook-left-ui .location-card::before {
  content: '';
  position: absolute;
  left: 24%;
  top: -7px;
  width: 16%;
  height: 14px;
  background: rgba(225, 144, 142, .68);
  transform: rotate(-5deg);
  box-shadow: 0 1px 2px rgba(92,48,43,.09);
}
.storybook-left-ui .location-card:not(.is-visible) {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}
.storybook-left-ui .location-card:not(.is-visible) > :not(.location-card__placeholder) { display: none !important; }
.storybook-left-ui .location-card.is-visible .location-card__placeholder { display: none; }
.location-card__placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-height: 0;
  width: 100%;
  text-align: center;
}
.location-card__placeholder .eyebrow { margin: 0; font-size: clamp(.5rem,.62vw,.7rem); color: #a14c62; }
.location-card__placeholder h2 { margin: 0; color: #6d3d3d; font-family: Georgia, serif; font-size: clamp(1rem,1.55vw,1.45rem); }
.location-card__placeholder p:last-child { width: min(90%, 360px); margin: 2px 0 0; color: #7c5d52; font-size: clamp(.55rem,.7vw,.74rem); line-height: 1.3; }
.location-card__sketch { color: #c35570; font-size: clamp(1.2rem,2vw,1.9rem); }
.location-card__photo {
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 7px solid #fff1d8;
  border-bottom-width: 16px;
  border-radius: 3px;
  background: #e7ceb0;
  box-shadow: 0 4px 8px rgba(82,49,37,.18);
  transform: rotate(-2.6deg);
  filter: saturate(.9) contrast(.97) brightness(1.03);
}
.location-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 2%;
}
.storybook-left-ui .location-card__close {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(142,80,63,.23);
  border-radius: 50%;
  background: rgba(255,246,227,.85);
  color: #8f4b59;
  font-size: .78rem;
}
.storybook-left-ui .location-card .eyebrow {
  margin: 0 26px 1px 0;
  color: #b44e67;
  font-size: clamp(.48rem,.58vw,.66rem);
  letter-spacing: .1em;
}
.storybook-left-ui .location-card h2 {
  margin: 0 24px 0 0;
  color: #57352f;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.92rem, 1.3vw, 1.42rem);
  line-height: 1.04;
  font-weight: 500;
}
.storybook-left-ui .location-card__subtitle {
  margin: 2px 0 4px;
  color: #b74f64;
  font-family: Georgia, serif;
  font-size: clamp(.54rem,.69vw,.76rem);
  font-style: italic;
}
.storybook-left-ui .location-card > p:not(.eyebrow):not(.location-card__subtitle) { display: none; }
.storybook-left-ui .location-card__body > #location-card-description {
  display: -webkit-box;
  margin: 3px 0 5px;
  overflow: hidden;
  color: #60463d;
  font-family: Georgia, serif;
  font-size: clamp(.5rem,.63vw,.69rem);
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.storybook-left-ui .location-progress {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: #91495b;
  font-family: Georgia, serif;
  font-size: clamp(.48rem,.59vw,.65rem);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.storybook-left-ui .location-progress strong {
  max-width: 63%;
  overflow: hidden;
  color: #71433d;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.storybook-left-ui .location-card .primary-button {
  width: 100%;
  margin-top: 5px;
  padding: clamp(5px,.65vw,8px) 10px;
  border: 1px solid rgba(137,55,78,.44);
  border-radius: 8px;
  background: linear-gradient(#dc778c,#c85e77);
  color: white;
  box-shadow: 0 4px 8px rgba(137,55,78,.19), inset 0 1px rgba(255,255,255,.28);
  font-family: Georgia, serif;
  font-size: clamp(.58rem,.76vw,.82rem);
  letter-spacing: .045em;
  text-transform: uppercase;
}

.storybook-map-ui {
  position: absolute;
  z-index: 6;
  left: 47.55%;
  top: 5.5%;
  width: 48%;
  height: 82.5%;
  pointer-events: none;
}
.storybook-map-ui .map-pin {
  position: absolute;
  z-index: 6;
  display: block;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: none;
  filter: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
.storybook-map-ui .map-pin:hover,
.storybook-map-ui .map-pin:focus-visible {
  border-color: rgba(255,255,255,.9);
  background: rgba(255,236,227,.09);
  box-shadow: 0 0 0 4px rgba(197,78,104,.24), 0 8px 18px rgba(64,38,33,.16);
  transform: translateY(-2px) rotate(-.4deg);
  outline: none;
}
.storybook-map-ui .map-pin.is-selected {
  border-color: rgba(255,252,243,.96);
  background: rgba(255,225,220,.11);
  box-shadow: 0 0 0 5px rgba(191,66,94,.36), 0 10px 22px rgba(64,38,33,.2);
}
.storybook-map-ui .map-pin__selected-ring { position:absolute; inset:0; border-radius:inherit; }
.storybook-map-ui .map-pin__complete {
  position: absolute;
  top: -8px;
  right: -8px;
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff4dc;
  background: #779b72;
  color: white;
  font-size: .72rem;
  font-weight: 900;
  box-shadow: 0 3px 7px rgba(50,52,34,.22);
}
.storybook-map-ui .map-pin.is-complete .map-pin__complete { display: grid; }
.storybook-map-ui .map-pin--met { left: 48.6%; top: 13.4%; width: 19%; height: 17.8%; }
.storybook-map-ui .map-pin--washington { left: 39.7%; top: 41.2%; width: 19.5%; height: 18.2%; }
.storybook-map-ui .map-pin--little-island { left: 6.3%; top: 47.2%; width: 19.5%; height: 17.1%; }
.storybook-map-ui .map-pin--csi { left: 6.1%; top: 76.8%; width: 20%; height: 17%; }

.storybook-dock {
  position: absolute;
  z-index: 8;
  left: 22.55%;
  top: 89.15%;
  width: 54.4%;
  height: 8.25%;
  display: grid;
  grid-template-columns: .95fr 1.35fr 1fr;
  align-items: stretch;
  pointer-events: none;
}
.storybook-dock__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6%;
  border: 0;
  background: transparent;
  color: transparent;
  text-align: left;
  pointer-events: none;
}
.storybook-dock__item strong,
.storybook-dock__item small,
.storybook-dock__icon { color: transparent; }
.storybook-dock__button {
  cursor: pointer;
  pointer-events: auto;
  border-radius: 16px;
}
.storybook-dock__button:hover,
.storybook-dock__button:focus-visible {
  outline: 2px solid rgba(187,72,96,.35);
  background: rgba(255,242,220,.16);
}
.storybook-reset {
  position: absolute;
  left: -28%;
  bottom: 4%;
  border: 0;
  background: rgba(74,40,39,.35);
  color: rgba(255,245,232,.74);
  padding: 4px 7px;
  border-radius: 999px;
  font-family: Georgia, serif;
  font-size: clamp(.42rem,.52vw,.58rem);
  cursor: pointer;
  pointer-events: auto;
  opacity: .72;
  transition: opacity .18s ease, background .18s ease;
}
.storybook-reset:hover,
.storybook-reset:focus-visible { opacity: 1; background: rgba(116,53,61,.66); }

@media (max-height: 760px) and (min-width: 861px) {
  .storybook-book { width: min(96vw, 143vh); max-height: 95vh; }
  .storybook-left-ui .memory-index__item strong { font-size: clamp(.68rem,1.05vw,1rem); }
  .storybook-left-ui .memory-index__item small { font-size: clamp(.5rem,.66vw,.68rem); }
  .storybook-left-ui .location-card__body > #location-card-description { -webkit-line-clamp: 1; }
}

@media (max-width: 860px) {
  .map-screen { overflow: auto; }
  .storybook-stage { min-width: 780px; min-height: 520px; place-items: start center; }
  .storybook-book { width: 780px; max-height: none; margin: 8px auto; }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-book { animation: none; }
  .storybook-map-ui .map-pin,
  .storybook-left-ui .memory-index__item { transition: none; }
}

/* ======================================================================
   CITY MAP V3 — bright illustrated memory map inspired by the user's
   cleaner reference. The art is the hero; real controls are layered over it.
   ====================================================================== */
.map-screen {
  overflow: hidden;
  padding: 0;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,231,210,.34), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(233,151,177,.22), transparent 28%),
    #162432;
}
.map-screen::before { display: none; }

.city-map-stage {
  position: relative;
  width: min(98vw, 146vh);
  aspect-ratio: 3 / 2;
  max-height: 96vh;
  overflow: hidden;
  border: 1px solid rgba(255,238,222,.46);
  border-radius: clamp(18px, 2vw, 30px);
  background: #c9e4ed;
  box-shadow: 0 30px 80px rgba(0,0,0,.32), 0 0 0 5px rgba(255,247,238,.08);
  isolation: isolate;
}
.city-map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.city-map-control {
  position: absolute;
  z-index: 20;
  display: grid;
  place-items: center;
  width: clamp(32px, 3vw, 46px);
  height: clamp(32px, 3vw, 46px);
  border: 1px solid rgba(116,65,75,.25);
  border-radius: 50%;
  background: rgba(255,247,234,.9);
  color: #7b4050;
  box-shadow: 0 6px 16px rgba(57,39,41,.16);
  font-size: clamp(.9rem, 1.4vw, 1.2rem);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.city-map-control:hover,
.city-map-control:focus-visible {
  transform: translateY(-2px);
  background: #fffaf1;
  box-shadow: 0 9px 20px rgba(57,39,41,.22);
}
.city-map-control--back { right: 1.4%; top: 1.8%; }
.city-map-control--settings { right: 1.4%; top: 7.1%; }

/* The baked artwork already includes the title panel. These real controls sit
   directly over its list/detail zones, fully covering baked placeholder copy. */
.city-map-panel {
  position: absolute;
  z-index: 12;
  left: 4.7%;
  top: 24.3%;
  width: 23.5%;
  height: 69.2%;
  pointer-events: none;
}
.city-map-panel > * { pointer-events: auto; }

.city-map-list {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: .7%;
  height: 39.2%;
  margin: 0;
}
.city-map-list .memory-index__item {
  position: relative;
  display: grid;
  grid-template-columns: clamp(24px,2.25vw,37px) minmax(0,1fr) auto clamp(13px,1vw,18px);
  align-items: center;
  gap: clamp(4px,.55vw,9px);
  width: 100%;
  min-width: 0;
  padding: 0 clamp(7px,.8vw,13px);
  border: 1px solid rgba(150,83,83,.15);
  border-radius: clamp(7px,.7vw,11px);
  background: rgba(255,242,218,.94);
  color: #4e3433;
  box-shadow: inset 0 1px rgba(255,255,255,.7);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.city-map-list .memory-index__item:hover,
.city-map-list .memory-index__item:focus-visible {
  transform: translateX(3px);
  background: rgba(255,246,226,.99);
  border-color: rgba(204,100,124,.35);
  box-shadow: 0 5px 12px rgba(95,57,55,.09), inset 0 1px rgba(255,255,255,.8);
}
.city-map-list .memory-index__item.is-selected {
  background: linear-gradient(90deg, rgba(249,207,203,.98), rgba(255,235,216,.97));
  border-color: rgba(200,88,116,.48);
  box-shadow: 0 6px 14px rgba(146,71,84,.13), inset 4px 0 #d86c88;
}
.city-map-list .memory-index__heart {
  display: grid;
  place-items: center;
  color: #df7890;
  font-size: clamp(1rem,1.5vw,1.45rem);
  filter: drop-shadow(0 2px 1px rgba(117,56,72,.1));
}
.city-map-list .memory-index__copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.05;
}
.city-map-list .memory-index__copy strong {
  overflow: hidden;
  color: #4f3333;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.61rem,1.03vw,1rem);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-map-list .memory-index__copy small {
  color: #9b5360;
  font-family: system-ui, sans-serif;
  font-size: clamp(.46rem,.61vw,.63rem);
  white-space: nowrap;
}
.city-map-list .memory-index__count {
  color: #9d5360;
  font-family: Georgia, serif;
  font-size: clamp(.46rem,.62vw,.66rem);
  white-space: nowrap;
}
.city-map-list .memory-index__arrow {
  color: #af766f;
  font-family: Georgia, serif;
  font-size: clamp(1rem,1.4vw,1.35rem);
  line-height: 1;
}
.city-map-list .memory-index__check {
  position: absolute;
  right: -5px;
  top: -6px;
  display: none;
  place-items: center;
  width: clamp(16px,1.45vw,22px);
  height: clamp(16px,1.45vw,22px);
  border: 2px solid #fff3de;
  border-radius: 50%;
  background: #719f7c;
  color: white;
  font-size: clamp(.45rem,.62vw,.65rem);
  font-weight: 900;
}
.city-map-list .memory-index__item.is-complete .memory-index__check { display: grid; }

.city-map-detail.location-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 44% 1fr;
  grid-template-rows: 1fr;
  gap: clamp(7px,.8vw,12px);
  width: 100%;
  height: 55.5%;
  min-height: 0;
  margin: 0;
  padding: clamp(9px,.85vw,14px);
  overflow: hidden;
  border: 1px solid rgba(158,89,88,.19);
  border-radius: clamp(9px,.85vw,14px);
  background: rgba(255,241,218,.96);
  box-shadow: 0 4px 12px rgba(88,54,50,.09), inset 0 1px rgba(255,255,255,.72);
  transform: none;
  opacity: 1;
  visibility: visible;
}
.city-map-detail.location-card::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 15%;
  width: 22%;
  height: 13px;
  background: rgba(229,150,163,.48);
  transform: rotate(-2deg);
  z-index: 2;
}
.city-map-detail.location-card:not(.is-visible) {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}
.city-map-detail.location-card:not(.is-visible) > :not(.location-card__placeholder) { display: none !important; }
.city-map-detail.location-card.is-visible .location-card__placeholder { display: none; }
.city-map-detail .location-card__placeholder {
  align-content: center;
  justify-items: center;
  width: 100%;
  min-height: 0;
  color: #7d5b55;
  text-align: center;
}
.city-map-detail .location-card__placeholder .eyebrow { margin: 2px 0; color: #a94f68; font-size: clamp(.5rem,.6vw,.64rem); }
.city-map-detail .location-card__placeholder h2 { margin: 0; color: #633a40; font-family: Georgia, serif; font-size: clamp(1rem,1.25vw,1.25rem); }
.city-map-detail .location-card__placeholder p:last-child { width: 82%; margin: 4px auto 0; color: #7a625c; font-size: clamp(.5rem,.58vw,.62rem); }
.city-map-detail .location-card__sketch { color: #db748d; font-size: clamp(1.2rem,1.8vw,1.7rem); }
.city-map-detail .location-card__close { display: none; }
.city-map-detail .location-card__photo {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: clamp(4px,.43vw,7px) solid #fff8e9;
  border-bottom-width: clamp(11px,1vw,16px);
  border-radius: 3px;
  box-shadow: 0 5px 10px rgba(87,55,48,.15);
  transform: rotate(-1deg);
}
.city-map-detail .location-card__body {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 3% 1% 0 0;
}
.city-map-detail .eyebrow {
  order: 2;
  margin: 2px 0 0;
  color: #c15f78;
  font-family: Georgia, serif;
  font-size: clamp(.47rem,.56vw,.61rem);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}
.city-map-detail h2 {
  order: 1;
  margin: 0;
  color: #533435;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.82rem,1.18vw,1.15rem);
  line-height: 1.04;
  font-weight: 600;
}
.city-map-detail .location-card__subtitle {
  order: 3;
  margin: 3px 0;
  color: #a34e62;
  font-family: Georgia, serif;
  font-size: clamp(.48rem,.58vw,.62rem);
  font-style: italic;
}
.city-map-detail #location-card-description {
  order: 4;
  display: -webkit-box;
  margin: 4px 0 5px;
  overflow: hidden;
  color: #594646;
  font-family: system-ui, sans-serif;
  font-size: clamp(.46rem,.56vw,.6rem);
  line-height: 1.34;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.city-map-detail .location-progress {
  order: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin: auto 0 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(155,78,94,.18);
  color: #a24f62;
  font-family: system-ui, sans-serif;
  font-size: clamp(.43rem,.51vw,.55rem);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.city-map-detail .location-progress strong {
  overflow: hidden;
  color: #6e4548;
  font-size: inherit;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-map-detail .primary-button {
  order: 6;
  width: 100%;
  margin: 0;
  padding: clamp(6px,.65vw,10px) 8px;
  border: 1px solid rgba(139,56,78,.24);
  border-radius: 8px;
  background: linear-gradient(#dc7791,#c95476);
  box-shadow: 0 4px 8px rgba(141,62,83,.18), inset 0 1px rgba(255,255,255,.4);
  color: #fffaf2;
  font-family: Georgia, serif;
  font-size: clamp(.55rem,.75vw,.78rem);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.city-map-detail .primary-button:hover,
.city-map-detail .primary-button:focus-visible { filter: brightness(1.05); transform: translateY(-1px); }

.city-map-hotspots {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.city-map-hotspots .map-pin {
  position: absolute;
  pointer-events: auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .17s ease;
}
.city-map-hotspots .map-pin:hover,
.city-map-hotspots .map-pin:focus-visible { transform: translate(-50%,-50%) scale(1.07); }
.city-map-hotspots .map-pin__selected-ring {
  position: absolute;
  inset: -10%;
  border: 3px solid rgba(255,255,255,.94);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 0 4px rgba(220,99,128,.48), 0 0 22px rgba(255,125,160,.62);
  animation: city-pin-breathe 1.8s ease-in-out infinite;
}
.city-map-hotspots .map-pin.is-selected .map-pin__selected-ring { opacity: 1; }
@keyframes city-pin-breathe { 50% { transform: scale(1.08); opacity: .72; } }
.city-map-hotspots .map-pin__complete {
  position: absolute;
  right: -4px;
  top: -5px;
  display: none;
  place-items: center;
  width: clamp(16px,1.5vw,24px);
  height: clamp(16px,1.5vw,24px);
  border: 2px solid #fff9ea;
  border-radius: 50%;
  background: #6d9c77;
  color: white;
  font-size: clamp(.45rem,.63vw,.66rem);
  font-weight: 900;
}
.city-map-hotspots .map-pin.is-complete .map-pin__complete { display: grid; }
.city-map-hotspots .map-pin--met { left: 75.0%; top: 15.4%; width: 5.6%; height: 8.7%; }
/* HARUFILM was added after the map illustration was painted. Reuse the
   exact illustrated heart-pin artwork extracted from the existing map so the
   fifth marker is visually identical to the original four. Keep its approved
   northeast placement so it stays clear of the MANHATTAN ribbon. */
.city-map-hotspots .map-pin--harufilm { left: 67.3%; top: 24.2%; width: 5.6%; height: 8.7%; }
.city-map-hotspots .map-pin--harufilm .map-pin__harufilm-art {
  position: absolute;
  left: 42%;
  top: 47%;
  width: 58%;
  height: auto;
  transform: translate(-50%,-50%);
  pointer-events: none;
  user-select: none;
}
.city-map-hotspots .map-pin--harufilm .map-pin__harufilm-label {
  position: absolute;
  left: 68%;
  top: 47%;
  transform: translateY(-50%);
  padding: clamp(3px,.32vw,5px) clamp(6px,.55vw,9px);
  border: 1px solid rgba(132,83,75,.18);
  border-radius: clamp(5px,.45vw,8px);
  background: rgba(255,246,226,.96);
  box-shadow: 0 3px 7px rgba(90,61,54,.13);
  color: #5b403b;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.48rem,.70vw,.76rem);
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.city-map-hotspots .map-pin--washington { left: 54.6%; top: 39.8%; width: 5.7%; height: 8.8%; }
.city-map-hotspots .map-pin--little-island { left: 43.3%; top: 48.4%; width: 5.7%; height: 8.8%; }
.city-map-hotspots .map-pin--csi { left: 42.1%; top: 82.2%; width: 5.6%; height: 8.7%; }

.city-map-reset {
  position: absolute;
  z-index: 20;
  left: 1.2%;
  bottom: 1.1%;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(54,60,65,.42);
  color: rgba(255,255,255,.74);
  padding: 5px 9px;
  font: 600 clamp(.45rem,.55vw,.58rem)/1 system-ui, sans-serif;
  cursor: pointer;
  opacity: .45;
  backdrop-filter: blur(8px);
  transition: opacity .16s ease, background .16s ease;
}
.city-map-reset:hover,
.city-map-reset:focus-visible { opacity: 1; background: rgba(54,60,65,.65); }

@media (max-height: 760px) and (min-width: 820px) {
  .city-map-stage { width: min(98vw, 145vh); max-height: 95vh; }
  .city-map-detail #location-card-description { -webkit-line-clamp: 2; }
}
@media (max-width: 820px) {
  .map-screen { overflow: auto; place-items: start center; padding: 10px; }
  .city-map-stage { width: 780px; max-height: none; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .city-map-hotspots .map-pin__selected-ring { animation: none; }
  .city-map-list .memory-index__item,
  .city-map-control,
  .city-map-hotspots .map-pin { transition: none; }
}


/* --------------------------------------------------------------------------
   V9.9 final map-menu polish: keep the illustrated map, but make the selection
   panel a clean list + compact text-only memory summary.  The opaque paper
   surface also masks the older baked detail/photo artwork underneath so there
   is no double-card/overlay effect.
   -------------------------------------------------------------------------- */
.city-map-panel {
  display: flex;
  flex-direction: column;
  gap: 2.2%;
  padding: clamp(7px,.7vw,11px);
  overflow: hidden;
  border: 1px solid rgba(151, 91, 82, .19);
  border-radius: clamp(10px,.9vw,15px);
  background:
    radial-gradient(circle at 18% 8%, #fffdf6 0, #fff6e5 29%, transparent 30%),
    linear-gradient(180deg, #fff6e5 0%, #fbe9cc 100%);
  box-shadow:
    0 9px 24px rgba(74, 49, 43, .10),
    inset 0 1px 0 rgba(255,255,255,.82);
}
.city-map-list {
  flex: 0 0 52%;
  height: auto;
  min-height: 0;
  gap: 2.2%;
}
.city-map-list .memory-index__item {
  background: rgba(255, 249, 235, .88);
  box-shadow: none;
}
.city-map-list .memory-index__item.is-selected {
  background: linear-gradient(90deg, rgba(249,211,207,.98), rgba(255,239,220,.98));
  box-shadow: inset 4px 0 #d86c88;
}
.city-map-detail.location-card,
.city-map-detail.location-card:not(.is-visible) {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: clamp(88px, 12vh, 132px);
  margin: 0;
  padding: clamp(8px,.75vw,12px) clamp(9px,.85vw,14px);
  overflow: hidden;
  border: 1px solid rgba(159, 93, 88, .15);
  border-radius: clamp(8px,.75vw,12px);
  background: rgba(255, 250, 239, .93);
  box-shadow: inset 0 1px rgba(255,255,255,.76);
  transform: none;
  opacity: 1;
  visibility: visible;
}
.city-map-detail.location-card::before { display: none; }
.city-map-detail.location-card:not(.is-visible) {
  align-items: center;
  justify-content: center;
}
.city-map-detail .location-card__placeholder {
  display: grid;
  width: 100%;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 1px;
  padding: 2px 0;
}
.city-map-detail .location-card__placeholder .eyebrow {
  margin: 0;
  font-size: clamp(.45rem,.54vw,.58rem);
}
.city-map-detail .location-card__placeholder h2 {
  margin: 0;
  font-size: clamp(.88rem,1.03vw,1.06rem);
}
.city-map-detail .location-card__placeholder p:last-child {
  width: 90%;
  margin: 2px auto 0;
  font-size: clamp(.46rem,.53vw,.57rem);
  line-height: 1.25;
}
.city-map-detail .location-card__sketch {
  font-size: clamp(1rem,1.35vw,1.35rem);
}
.city-map-detail .location-card__photo { display: none !important; }
.city-map-detail .location-card__body {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 0;
}
.city-map-detail .eyebrow {
  order: 1;
  margin: 0 0 1px;
  color: #bb6075;
  font-size: clamp(.50rem,.58vw,.62rem);
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.city-map-detail h2 {
  order: 2;
  margin: 0;
  color: #56383a;
  font-size: clamp(.92rem,1.12vw,1.12rem);
  line-height: 1.05;
}
.city-map-detail .location-card__subtitle {
  order: 3;
  margin: 2px 0 1px;
  color: #ad5268;
  font-size: clamp(.53rem,.60vw,.64rem);
}
.city-map-detail #location-card-description {
  order: 4;
  display: -webkit-box;
  margin: 2px 0 5px;
  overflow: hidden;
  color: #6e5650;
  font-size: clamp(.53rem,.59vw,.63rem);
  line-height: 1.28;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.city-map-detail .location-progress {
  order: 5;
  margin: 0 0 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(155,78,94,.13);
  font-size: clamp(.49rem,.55vw,.58rem);
}
.city-map-detail .location-progress strong {
  color: #7a4d53;
  font-weight: 650;
}
.city-map-detail .primary-button {
  order: 6;
  align-self: center;
  width: min(92%, 260px);
  margin: 0;
  padding: clamp(6px,.55vw,8px) 10px;
  border-radius: 999px;
  font-size: clamp(.60rem,.71vw,.74rem);
  letter-spacing: .035em;
  text-transform: none;
}
@media (max-height: 760px) and (min-width: 820px) {
  .city-map-panel { gap: 1.5%; padding: 6px; }
  .city-map-list { flex-basis: 48%; }
  .city-map-detail.location-card,
  .city-map-detail.location-card:not(.is-visible) { min-height: 82px; padding: 6px 8px; }
  .city-map-detail #location-card-description { -webkit-line-clamp: 1; margin-bottom: 3px; }
  .city-map-detail .location-progress { margin-bottom: 3px; }
}

/* Screen visibility guard: later map art-direction rules use CSS grid for layout,
   so keep that grid mode strictly scoped to the visible map screen.  Without
   this guard the hidden map can sit above the splash and intercept clicks. */
.map-screen:not(.screen--visible) { display: none !important; }
.map-screen.screen--visible { display: grid !important; }

/* --------------------------------------------------------------------------
   Global full-viewport presentation
   Match the UI screens to the 3D memory viewport: no centered card margins,
   no outer frame gap, and all interactive overlays scale with the artwork.
   -------------------------------------------------------------------------- */
html,
body,
#app,
.screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

/* Title screen: use the whole browser viewport as the stage. */
.splash-stage {
  inset: 0;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fce9e6;
}
.splash-stage::before,
.splash-stage::after,
.splash-corner {
  display: none;
}
.splash-picture {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.splash-art {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* Illustrated map: fill the same viewport used by the 3D experience. */
.map-screen.screen--visible {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  place-items: stretch;
}
.city-map-stage {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.city-map-art {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* Keep map controls just inside device safe areas while still reading edge-to-edge. */
.city-map-control--back {
  right: max(1.15%, env(safe-area-inset-right));
  top: max(1.45%, env(safe-area-inset-top));
}
.city-map-control--settings {
  right: max(1.15%, env(safe-area-inset-right));
  top: max(6.8%, calc(env(safe-area-inset-top) + 44px));
}

/* --------------------------------------------------------------------------
   Global music controls — visual regression-safe version.
   Keep the map music button the exact same footprint as the existing back
   control and place it directly below. The compass is removed in the artwork,
   so this button does not need to hide or cover anything.
   -------------------------------------------------------------------------- */
.city-map-control--music {
  right: max(1.15%, env(safe-area-inset-right));
  top: max(7.6%, calc(env(safe-area-inset-top) + 50px));
}

.music-panel {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 19, 27, .42);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.music-panel.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.music-panel__card {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  padding: 28px 26px 24px;
  border: 1px solid rgba(150, 77, 96, .3);
  border-radius: 26px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 184, 204, .22), transparent 32%),
    linear-gradient(180deg, #fff8eb 0%, #f9eadb 100%);
  color: #633c47;
  box-shadow: 0 24px 70px rgba(37, 23, 28, .28), inset 0 0 0 4px rgba(255,255,255,.42);
  text-align: center;
  max-height: calc(100dvh - 40px);
  overflow: auto;
}
.music-panel__card h2 {
  margin: 2px 0 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  color: #8f4059;
}
.music-panel__card .eyebrow {
  margin: 0;
  color: #cf6685;
  letter-spacing: .11em;
}
.music-panel__close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(144, 73, 92, .25);
  border-radius: 50%;
  background: rgba(255,255,255,.68);
  color: #9c4960;
  font-size: 1.2rem;
  cursor: pointer;
}
.music-panel__now-playing {
  margin: 0 0 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  color: #8e6470;
}
.music-track-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 14px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding-right: 3px;
}
.music-track-button {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(158, 83, 104, .2);
  border-radius: 14px;
  background: rgba(255,255,255,.56);
  color: #774452;
  text-align: left;
  cursor: pointer;
}
.music-track-button.is-selected {
  background: #f6c4d1;
  border-color: rgba(162, 67, 94, .45);
}
.music-panel__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 8px;
}
.music-panel__button {
  padding: 10px 12px;
  border: 1px solid rgba(151, 72, 94, .28);
  border-radius: 999px;
  background: #d96584;
  color: #fff9f4;
  font-weight: 800;
  cursor: pointer;
}
.music-panel__button:hover,
.music-panel__button:focus-visible { filter: brightness(1.04); }
.music-panel__volume {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: .82rem;
  font-weight: 750;
  color: #885362;
}
.music-panel__volume input { width: 100%; accent-color: #d96584; }
.music-panel__empty {
  margin: 14px 0 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.42);
  color: #9a7180;
  font-size: .78rem;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .music-panel__card { padding: 25px 18px 20px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .music-panel, .city-map-control--music { transition: none; }
}

/* V9.12 HARUFILM: five compact location rows fit the existing full-screen map panel. */
.city-map-list .memory-index__item { min-height: 0; }

/* CSI photo-memory scrapbook cards */
.memory-panel--with-photos {
  width: min(900px, 100%);
  max-height: min(94vh, 940px);
  padding: 34px 38px 30px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
/* Photo memories need the heart fully inside the scrollable card; the default
   negative stamp margin can otherwise be clipped once a gallery makes the
   panel scroll. */
.memory-panel--with-photos .memory-stamp {
  margin: 0 auto 16px;
}
.memory-panel--with-photos h2 {
  font-size: clamp(1.75rem, 4vw, 2.55rem);
}
.memory-panel--with-photos .memory-photo-wrap {
  margin-top: 14px;
}
.memory-photo-wrap {
  position: relative;
  margin: 18px 0 10px;
  padding: 20px 18px 16px;
  border: 1px solid rgba(190, 126, 145, .2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 16%, rgba(236,169,186,.18) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 84%, rgba(212,167,104,.16) 0 3px, transparent 4px),
    linear-gradient(145deg, #fffaf5, #fff4f2 58%, #f8efe7);
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 10px 24px rgba(117,72,85,.08);
}
.memory-photo-wrap::before,
.memory-photo-wrap::after {
  content: '♥';
  position: absolute;
  color: rgba(203,102,127,.42);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}
.memory-photo-wrap::before { left: 10px; top: 8px; transform: rotate(-15deg); }
.memory-photo-wrap::after { right: 11px; bottom: 7px; transform: rotate(13deg); }
.memory-photo-gallery {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.memory-photo-gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.memory-photo-gallery--2 { grid-template-columns: repeat(2, minmax(0, 240px)); }
.memory-photo-gallery--1 { grid-template-columns: minmax(0, 320px); }
.memory-photo-card {
  position: relative;
  margin: 0;
  padding: 8px 8px 23px;
  border-radius: 5px;
  background: #fffdfa;
  box-shadow: 0 9px 20px rgba(76,52,58,.16), 0 1px 2px rgba(76,52,58,.12);
  transform-origin: 50% 70%;
}
.memory-photo-card::before {
  content: '';
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 15px;
  left: 50%;
  top: -7px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(225, 201, 165, .68);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.memory-photo-card--1 { transform: rotate(-2.2deg); }
.memory-photo-card--2 { transform: rotate(1.5deg) translateY(-4px); }
.memory-photo-card--3 { transform: rotate(2.1deg); }
.memory-photo-card img,
.memory-photo-card video {
  display: block;
  width: 100%;
  height: clamp(150px, 26vh, 270px);
  border-radius: 2px;
  object-fit: contain;
  background: #151515;
}
.memory-photo-card img { background: #f0ece7; }
.memory-photo-gallery--2 .memory-photo-card img,
.memory-photo-gallery--2 .memory-photo-card video { height: clamp(170px, 25vh, 245px); }
.memory-photo-gallery--2 .memory-photo-card img { object-fit: cover; }
.memory-photo-card--video { padding-bottom: 18px; }
.memory-photo-card--video::after {
  content: 'little video moment ♥';
  display: block;
  margin-top: 8px;
  color: #a86a7b;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: .75rem;
  font-style: italic;
  text-align: center;
}
.memory-photo-caption {
  max-width: 620px;
  margin: 16px auto 0 !important;
  color: #8e5364 !important;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(.92rem, 1.8vw, 1.08rem);
  font-style: italic;
  line-height: 1.45 !important;
}
@media (max-width: 640px) {
  .memory-panel--with-photos { padding: 20px 17px 18px; }
  .memory-panel--with-photos .memory-stamp { width: 58px; height: 58px; font-size: 1.7rem; margin-bottom: 12px; }
  .memory-photo-wrap { padding: 15px 10px 13px; }
  .memory-photo-gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .memory-photo-gallery--2 { gap: 8px; }
  .memory-photo-card { padding: 5px 5px 14px; }
  .memory-photo-card::before { width: 32px; height: 10px; top: -5px; }
  .memory-photo-card img, .memory-photo-card video, .memory-photo-gallery--2 .memory-photo-card img, .memory-photo-gallery--2 .memory-photo-card video { height: clamp(118px, 22vh, 190px); }
}


/* V9.70 memory reset controls */
.city-map-panel {
  gap: 1.55%;
}
.city-map-list {
  flex-basis: 49%;
}
.city-map-reset {
  position: relative;
  z-index: 2;
  left: auto;
  bottom: auto;
  align-self: flex-start;
  flex: 0 0 auto;
  margin: 0;
  padding: clamp(5px,.5vw,8px) clamp(9px,.85vw,13px);
  border: 1px solid rgba(184, 104, 116, .24);
  border-radius: 999px;
  background: rgba(255, 248, 233, .82);
  color: #9a5868;
  font: 700 clamp(.48rem,.62vw,.66rem)/1 Georgia, "Times New Roman", serif;
  letter-spacing: .01em;
  opacity: .88;
  box-shadow: inset 0 1px rgba(255,255,255,.75);
  backdrop-filter: none;
}
.city-map-reset:hover,
.city-map-reset:focus-visible {
  opacity: 1;
  background: rgba(251, 226, 221, .96);
  color: #844456;
}
.reset-location-button {
  position: fixed;
  z-index: 20;
  left: 15px;
  bottom: max(62px, calc(env(safe-area-inset-bottom) + 60px));
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 999px;
  background: rgba(91, 54, 67, .68);
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  backdrop-filter: blur(12px);
  font: 800 .74rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.reset-location-button:hover,
.reset-location-button:focus-visible {
  background: rgba(128, 66, 88, .84);
}
@media (max-width: 700px) {
  .reset-location-button {
    bottom: auto;
    top: max(131px, calc(env(safe-area-inset-top) + 120px));
  }
}
