:root {
  --paper: #fffdfa;
  --ink: #253970;
  --red: #d94855;
  --blue: #5ca8d7;
  --yellow: #f0c95a;
  --green: #74a77d;
  --line: rgba(37, 57, 112, 0.18);
  --shadow: 0 24px 70px rgba(33, 37, 50, 0.18);
  --radius: 28px;
  font-family: "Comic Sans MS", "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 18%, rgba(240, 201, 90, 0.2), transparent 26%),
    linear-gradient(135deg, #eef8ff 0%, #fff7ec 48%, #f5fff2 100%);
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone {
  position: relative;
  width: min(100%, 430px);
  min-height: min(920px, calc(100vh - 36px));
  overflow: hidden;
  border: 2px solid rgba(37, 57, 112, 0.58);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(92, 168, 215, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 201, 90, 0.12) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px, 44px 44px, auto;
  box-shadow: var(--shadow);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(217, 72, 85, 0.32);
  border-radius: calc(var(--radius) - 9px);
}

.topbar,
.detail-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}

.phone[data-view="detail"] .topbar,
.phone[data-view="about"] .topbar,
.phone[data-view="gallery"] .topbar {
  display: none;
}

.icon-button,
.back-button,
.heart-button,
.close-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 32px;
}

.icon-button span {
  width: 26px;
  height: 2px;
  display: block;
  margin: 3px 0;
  background: var(--red);
  border-radius: 2px;
}

.info-button {
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.view {
  display: none;
  min-height: 100%;
  animation: pageIn 240ms ease both;
}

.view.is-active {
  display: block;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  letter-spacing: 0;
}

.map-wrap {
  position: relative;
  height: min(68vh, 620px);
  min-height: 558px;
  margin: 10px 14px 0;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.78);
}

.poster-border {
  position: absolute;
  inset: 8px;
  z-index: 5;
  pointer-events: none;
  border: 2px solid rgba(217, 72, 85, 0.48);
  border-radius: 2px;
}

.paper-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(26deg, transparent 0 48%, rgba(240, 201, 90, 0.25) 49% 51%, transparent 52% 100%),
    linear-gradient(138deg, transparent 0 56%, rgba(240, 201, 90, 0.18) 57% 58%, transparent 59% 100%);
  background-size: 160px 190px, 180px 170px;
  opacity: 0.9;
}

.river-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 0 rgba(92, 168, 215, 0.13));
}

.river-lines path {
  fill: none;
  stroke: rgba(92, 168, 215, 0.58);
  stroke-width: 22;
  stroke-linecap: round;
}

.title-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 7;
  width: 292px;
  text-align: left;
  transform: rotate(1deg);
}

.title-copy h1 {
  line-height: 1;
}

.title-art {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.98) contrast(1.02);
  mix-blend-mode: multiply;
}

.title-copy p {
  display: none;
}

.poster-cloud {
  position: absolute;
  z-index: 4;
  width: 48px;
  height: 19px;
  border: 2px solid rgba(37, 57, 112, 0.34);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.poster-cloud::before,
.poster-cloud::after {
  content: "";
  position: absolute;
  bottom: 5px;
  border: 2px solid rgba(37, 57, 112, 0.34);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: var(--paper);
}

.poster-cloud::before {
  left: 8px;
  width: 17px;
  height: 17px;
}

.poster-cloud::after {
  right: 8px;
  width: 22px;
  height: 22px;
}

.cloud-a {
  left: 48px;
  top: 30px;
}

.cloud-b {
  left: 112px;
  top: 44px;
  transform: scale(0.7);
}

.map-pins {
  position: absolute;
  inset: 0;
  z-index: 8;
}

.map-place {
  position: absolute;
  min-width: 64px;
  max-width: 104px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transform: translate(-50%, -50%);
}

.map-place:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.place-art {
  width: 58px;
  height: 44px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  filter: contrast(1.08) saturate(0.88);
  mix-blend-mode: multiply;
  opacity: 0.96;
}

.place-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kid-drawing {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.kid-raster {
  display: block;
  object-fit: contain;
  object-position: center;
  filter: saturate(0.98) contrast(1.04);
  mix-blend-mode: multiply;
}

.kid-drawing path {
  fill: none;
  stroke: rgba(37, 57, 112, 0.78);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kid-drawing .thin {
  stroke-width: 2;
}

.kid-drawing .sky {
  stroke: rgba(92, 168, 215, 0.45);
  stroke-width: 4;
}

.kid-drawing .water {
  stroke: rgba(92, 168, 215, 0.58);
  stroke-width: 6;
}

.kid-drawing .gold {
  fill: rgba(240, 201, 90, 0.72);
  stroke: rgba(37, 57, 112, 0.7);
}

.kid-drawing .red {
  fill: rgba(217, 72, 85, 0.58);
  stroke: rgba(37, 57, 112, 0.7);
}

.kid-drawing .green {
  fill: rgba(116, 167, 125, 0.42);
  stroke: rgba(37, 57, 112, 0.7);
}

.kid-drawing .blue {
  fill: rgba(92, 168, 215, 0.32);
  stroke: rgba(37, 57, 112, 0.7);
}

.pin-dot {
  width: 31px;
  height: 41px;
  display: block;
  margin-top: -4px;
  background: url("assets/drawn/pin.svg") center / contain no-repeat;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 2px 0 rgba(37, 57, 112, 0.12));
}

.place-label {
  display: block;
  width: max-content;
  max-width: 104px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 1px 4px rgba(37, 57, 112, 0.14);
  font-size: 10px;
  line-height: 1.04;
}

.map-place.is-active .place-label {
  background: #fff;
  box-shadow: 0 2px 8px rgba(217, 72, 85, 0.22);
}

.map-place.is-active {
  z-index: 12;
}

.map-place.is-active .pin-dot {
  animation: pinBounce 360ms ease both;
  filter: drop-shadow(0 3px 0 rgba(37, 57, 112, 0.15)) saturate(1.08);
}

.map-place.is-favorite .pin-dot {
  background-image: url("assets/drawn/pin-heart.svg");
}

.map-place.is-active .place-art {
  opacity: 1;
  transform: scale(1.12) rotate(-1deg);
}

.map-place.is-active .place-label {
  color: var(--red);
  font-weight: 700;
}

.map-bubble {
  position: absolute;
  left: 50%;
  top: 43%;
  z-index: 16;
  width: min(76%, 286px);
  min-height: 90px;
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 12px;
  border: 1.5px solid rgba(37, 57, 112, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 12px 24px rgba(37, 57, 112, 0.12);
  transform: translate(-50%, -50%) rotate(-1deg);
}

.map-bubble.is-hidden {
  display: none;
}

.bubble-open {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 16px;
  line-height: 1.1;
}

.bubble-art {
  width: 96px;
  height: 72px;
  display: block;
}

.bubble-art .kid-raster {
  width: 100%;
  height: 100%;
}

.bubble-heart,
.bubble-close {
  border: 0;
  background: transparent;
  color: var(--red);
}

.bubble-close {
  position: absolute;
  right: 10px;
  top: 4px;
  font-size: 22px;
}

.bubble-heart {
  align-self: end;
  font-size: 27px;
}

.tiny-sketch {
  display: none;
}

.sketch-ship {
  left: 22px;
  bottom: 68px;
  width: 118px;
  height: 58px;
  border-bottom: 3px solid #2c3344;
}

.sketch-ship::before,
.sketch-ship::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 48px;
  height: 48px;
  border-left: 2px solid #2c3344;
  border-top: 2px solid #2c3344;
  transform: skewX(-20deg);
}

.sketch-ship::before {
  left: 15px;
}

.sketch-ship::after {
  right: 4px;
  transform: skewX(20deg);
}

.sketch-dome {
  left: 176px;
  top: 110px;
  width: 74px;
  height: 60px;
  border: 2px solid rgba(37, 57, 112, 0.48);
  border-radius: 44px 44px 8px 8px;
  background: linear-gradient(90deg, transparent 40%, rgba(240, 201, 90, 0.45) 41% 59%, transparent 60%);
}

.sketch-bridge {
  left: 94px;
  top: 222px;
  width: 122px;
  height: 54px;
  border-bottom: 3px solid rgba(44, 51, 68, 0.75);
}

.sketch-bridge::before,
.sketch-bridge::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 38px;
  height: 58px;
  border-left: 5px solid rgba(44, 51, 68, 0.75);
  transform-origin: bottom;
}

.sketch-bridge::before {
  left: 16px;
  transform: rotate(-18deg);
}

.sketch-bridge::after {
  right: 20px;
  transform: rotate(18deg);
}

.sketch-tower {
  right: 18px;
  top: 138px;
  width: 42px;
  height: 126px;
  clip-path: polygon(50% 0, 82% 100%, 18% 100%);
  background: repeating-linear-gradient(90deg, rgba(92, 168, 215, 0.65) 0 5px, transparent 6px 10px);
  border: 1px solid rgba(37, 57, 112, 0.3);
}

.sketch-horse {
  left: 218px;
  top: 350px;
  width: 72px;
  height: 42px;
  border: 3px solid rgba(44, 51, 68, 0.6);
  border-radius: 44% 52% 36% 36%;
  transform: rotate(-8deg);
}

.sketch-horse::before {
  content: "";
  position: absolute;
  right: -13px;
  top: -9px;
  width: 24px;
  height: 22px;
  border-top: 3px solid rgba(44, 51, 68, 0.6);
  border-right: 3px solid rgba(44, 51, 68, 0.6);
  border-radius: 50%;
}

.place-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 20px 10px;
  scrollbar-width: none;
}

.place-strip::-webkit-scrollbar {
  display: none;
}

.place-chip {
  flex: 0 0 auto;
  min-width: 116px;
  max-width: 142px;
  min-height: 40px;
  border: 1.5px solid rgba(37, 57, 112, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.05;
}

.place-chip.is-active {
  border-color: var(--red);
  box-shadow: inset 0 -4px 0 rgba(217, 72, 85, 0.11);
}

.place-card {
  position: relative;
  min-height: 96px;
  margin: 0 18px 18px;
  padding: 12px 74px 12px 16px;
  border: 1.5px solid rgba(217, 72, 85, 0.5);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 8px 22px rgba(37, 57, 112, 0.08);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
}

.prompt-pin {
  width: 30px;
  height: 39px;
  display: block;
  background: url("assets/drawn/pin.svg") center / contain no-repeat;
}

.place-card h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.03;
}

.place-card p {
  font-size: 14px;
  line-height: 1.26;
}

.card-heart {
  position: absolute;
  right: 16px;
  top: 12px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 26px;
  line-height: 1;
}

.open-place {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1.6px solid rgba(217, 72, 85, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--red);
  font-size: 28px;
  line-height: 1;
}

.open-place:active {
  background: rgba(217, 72, 85, 0.1);
}

.detail-card,
.about-card {
  padding: 12px 24px 24px;
}

.detail-card h2,
.about-card h2,
.view-gallery h2,
.menu-card h2 {
  color: var(--ink);
  text-align: center;
  font-size: 28px;
  line-height: 1.05;
}

.art-frame {
  width: 100%;
  height: 310px;
  margin: 18px 0 14px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(92, 168, 215, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.18);
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 220ms ease;
}

.art-frame .kid-drawing {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(1.04);
}

.scan-preview {
  border: 1.5px solid rgba(37, 57, 112, 0.2);
  border-radius: 8px;
  background: #fff;
}

.art-frame img.rotate-left {
  transform: rotate(-90deg) scale(1.25);
}

.art-frame img.rotate-right {
  transform: rotate(90deg) scale(1.25);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 17px;
}

.dots span {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(37, 57, 112, 0.45);
  border-radius: 50%;
}

.dots span.is-active {
  border-color: var(--red);
  background: var(--red);
}

.story,
.about-card p {
  font-size: 18px;
  line-height: 1.38;
}

.thumb-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 16px 0;
  scrollbar-width: none;
}

.gallery-count {
  font-size: 16px;
  font-weight: 700;
  color: rgba(37, 57, 112, 0.5);
  letter-spacing: 1px;
}

.thumb-row::-webkit-scrollbar {
  display: none;
}

.thumb {
  flex: 0 0 104px;
  height: 82px;
  overflow: hidden;
  border: 1.5px solid rgba(37, 57, 112, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.detail-gallery {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 6px;
  margin: 2px -8px 6px;
}

.side-arrow {
  width: 30px;
  height: 84px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 42px;
  line-height: 1;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

.primary-button {
  border: 1.7px solid rgba(217, 72, 85, 0.68);
  color: var(--red);
}

.secondary-button {
  border: 1.7px solid rgba(37, 57, 112, 0.36);
}

.boy-portrait {
  width: 236px;
  height: 178px;
  margin: 14px auto 20px;
  display: grid;
  place-items: center;
}

.boy-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: saturate(0.98) contrast(1.04);
}

.author-photo {
  width: 232px;
  max-width: 76%;
  margin: 18px auto 22px;
  padding: 10px 10px 16px;
  background: #fff;
  border: 1px solid rgba(37, 57, 112, 0.16);
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(37, 57, 112, 0.16);
  transform: rotate(-2deg);
  position: relative;
}

.author-photo::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 26px;
  transform: translateX(-50%) rotate(1.5deg);
  background: rgba(240, 201, 90, 0.5);
  border: 1px dashed rgba(37, 57, 112, 0.22);
  border-radius: 1px;
}

.author-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.author-photo figcaption {
  margin-top: 9px;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
}

.author-quote {
  margin: 18px 0;
  padding: 12px 14px 12px 18px;
  border-left: 3px solid var(--red);
  background: rgba(240, 201, 90, 0.12);
  border-radius: 0 8px 8px 0;
  font-size: 17px;
  line-height: 1.36;
}

.author-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 700;
  color: var(--red);
}

.about-card strong {
  color: var(--red);
}

.about-card p + p {
  margin-top: 16px;
}

.about-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.about-silhouette {
  width: 100%;
  height: 74px;
  object-fit: contain;
  margin: 8px 0 2px;
  mix-blend-mode: multiply;
  filter: saturate(0.98) contrast(1.04);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 26px;
}

.gallery-item {
  height: 188px;
  overflow: hidden;
  border: 1.5px solid rgba(37, 57, 112, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.menu-panel {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  padding: 0;
  background:
    linear-gradient(rgba(92, 168, 215, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 201, 90, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px, 44px 44px, auto;
  overflow-y: auto;
}

.menu-panel.is-open {
  display: block;
}

.menu-card {
  min-height: 100%;
  padding: 22px 22px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
}

.close-button {
  position: absolute;
  left: 18px;
  top: 18px;
  margin-left: 0;
  color: var(--red);
}

.menu-card h2 {
  padding-top: 2px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.menu-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.menu-item {
  display: grid;
  grid-template-columns: 78px 14px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.05;
}

.menu-thumb {
  width: 78px;
  height: 48px;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: transparent;
  mix-blend-mode: multiply;
}

.menu-thumb .kid-drawing {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.menu-dot {
  width: 12px;
  height: 12px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(217, 72, 85, 0.55);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pinBounce {
  0% {
    transform: translateY(0) scale(1);
  }
  38% {
    transform: translateY(-10px) scale(1.08) rotate(-2deg);
  }
  68% {
    transform: translateY(2px) scale(0.98) rotate(1deg);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-height: 760px) {
  .phone {
    min-height: calc(100vh - 20px);
  }

  .map-wrap {
    min-height: 450px;
    height: 58vh;
  }

  .title-copy {
    top: 14px;
    right: 12px;
    width: 262px;
  }

  .place-art {
    width: 66px;
    height: 48px;
  }

  .place-label {
    max-width: 96px;
    font-size: 9.5px;
  }

  .poster-cloud,
  .sketch-dome {
    display: none;
  }

  .art-frame {
    height: 240px;
  }
}

@media (min-width: 860px) {
  .app-shell {
    padding: 30px;
  }

  .phone {
    min-height: 860px;
  }
}
