:root {
  --bg: #fdf7ef;
  --ink: #2c2018;
  --muted: #75675e;
  --line: #e7d5c3;
  --accent: #d96b3f;
  --accent-2: #3c9b84;
  --nav-w: 230px;
  --rail: #dcc8b5;
  --video-slot: 124px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, #ffe7d3 0, transparent 24%),
    radial-gradient(circle at 92% 16%, #dcf4ec 0, transparent 20%),
    var(--bg);
}

.page-corner-video-wrap {
  position: fixed;
  left: 10px;
  top: 12px;
  z-index: 12;
  width: clamp(72px, 8vw, 108px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(59, 36, 22, 0.18);
  background: #000;
}

.page-corner-video {
  display: block;
  width: 100%;
  height: auto;
}

.topbar {
  padding: 32px 18px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff9f4e8;
  backdrop-filter: blur(4px);
}

.topbar-inner {
  width: min(1100px, 94vw);
  margin: 0 auto;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.timeline-nav {
  position: fixed;
  left: calc(var(--video-slot) + clamp(10px, 2.2vw, 28px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: min(var(--nav-w), 24vw);
  max-height: 82vh;
  overflow-y: auto;
  padding: 14px 14px 14px 18px;
  border-radius: 16px;
  background: #fff9f2d9;
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(59, 36, 22, 0.08);
}

.timeline-nav::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: linear-gradient(180deg, #efdfcf, var(--rail), #efdfcf);
}

.timeline-link {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  margin: 0 0 30px;
  padding: 0 0 0 24px;
  color: #6d5c51;
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
}

.timeline-link:last-child {
  margin-bottom: 0;
}

.timeline-link::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0.28rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #e6d2bf;
  background: #fff8f0;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.timeline-link.active {
  color: var(--accent);
  font-weight: 700;
}

.timeline-link.completed {
  color: #5d4f45;
}

.timeline-link.locked {
  color: #b5a89e;
  cursor: not-allowed;
}

.timeline-link.active::before {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}

.timeline-link.locked::before {
  background: #f0e6dd;
  border-color: #e6d7ca;
  transform: none;
}

.story-section {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 22px 18px;
}

.story-section.is-hidden {
  display: none;
}

.story-inner {
  position: relative;
  width: min(1280px, calc(100vw - var(--nav-w) - var(--video-slot) - 56px));
  min-height: calc(100vh - 44px);
  margin: 0 0 0 calc(var(--nav-w) + var(--video-slot) + 56px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffffd9;
  padding: 22px;
  box-shadow: 0 12px 34px rgba(62, 33, 20, 0.1);
  overflow: hidden;
}

.story-inner::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px #eef7f3;
}

.title-avatar-pair {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  margin: 2px auto 10px;
}

.title-avatar {
  width: clamp(54px, 7vw, 84px);
  height: auto;
  display: block;
  object-fit: contain;
  transform-origin: center bottom;
  filter: drop-shadow(0 6px 12px rgba(42, 24, 14, 0.2));
}

.title-avatar.sway-left {
  animation: title-avatar-sway-left 2.2s ease-in-out infinite;
}

.title-avatar.sway-right {
  animation: title-avatar-sway-right 2.2s ease-in-out infinite;
}

.story-time {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

.story-title {
  margin: 8px 0;
  font-size: clamp(1.3rem, 3.6vw, 2rem);
}

.story-desc {
  margin: 0;
  line-height: 1.8;
}

.story-media {
  position: relative;
  margin-top: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px 14px 96px;
  color: var(--muted);
  background: #fffdf9;
}

.media-list {
  margin: 0;
  padding-left: 18px;
}

.section-next-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.section-next-btn img {
  width: clamp(148px, 20vw, 230px);
  height: auto;
  display: block;
  object-fit: contain;
}

.section-next-btn.show {
  animation: section-next-in 0.32s ease;
}

.july-section .story-time,
.july-section .story-title,
.july-section .story-desc {
  display: none;
}

.july-meet-media {
  margin-top: 0;
  border-style: solid;
  min-height: calc(100vh - 120px);
  background:
    radial-gradient(circle at 24% 20%, #ffe8d7 0, transparent 36%),
    radial-gradient(circle at 77% 16%, #dff5eb 0, transparent 36%),
    #fffaf4;
  display: grid;
}

.july-meet-scene {
  width: 100%;
  min-height: 100%;
  display: grid;
  align-content: start;
  padding: 24px 20px 18px;
}

.july-meet-title {
  margin: 2px auto 16px;
  text-align: center;
  font-size: clamp(1.2rem, 3.1vw, 1.9rem);
  font-weight: 700;
  color: #3d291f;
}

.july-track-wrap {
  position: relative;
  height: min(62vh, 540px);
  min-height: 380px;
  border-radius: 16px;
  border: 1px solid #ead5c5;
  background: linear-gradient(180deg, #fff3e8 0%, #fffdfb 72%);
  overflow: hidden;
}

.july-track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.july-track {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10 8;
  opacity: 0.9;
}

.july-track.piggy {
  stroke: #ea8359;
}

.july-track.thea {
  stroke: #2f9d88;
}

.july-avatar {
  position: absolute;
  width: clamp(74px, 9vw, 108px);
  height: clamp(74px, 9vw, 108px);
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 14px rgba(35, 20, 12, 0.24));
  will-change: left, top;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.july-avatar.dragging {
  cursor: grabbing;
}

.july-avatar.met {
  animation: july-met-pop 0.5s ease forwards;
}

.july-meet-hint {
  margin: 10px 0 0;
  text-align: center;
  color: #7d6a5f;
  font-size: 0.95rem;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.july-meet-hint.done {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.july-meet-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.july-meet-spark.show {
  opacity: 1;
  animation: july-spark 0.9s ease-out forwards;
}

.july-next-area {
  margin-top: 16px;
  border: 1px dashed #d9c4b3;
  border-radius: 12px;
  padding: 12px 14px;
  color: #6b5a50;
  background: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.july-next-area.show {
  opacity: 1;
  transform: translateY(0);
}

.july-memory-layer {
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  border: 1px solid #ead6c8;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(3px);
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.78, 0.24, 1);
  pointer-events: none;
}

.july-memory-layer.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.july-memory-text {
  margin: 0;
  font-size: clamp(1rem, 1.75vw, 1.18rem);
  line-height: 1.75;
  color: #4b3628;
}

.july-memory-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.july-memory-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #ecd9ca;
  box-shadow: 0 10px 18px rgba(52, 30, 16, 0.14);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.july-memory-layer.show .july-memory-photo {
  animation: july-photo-in 0.55s ease forwards;
}

.july-memory-layer.show .july-memory-photo:nth-child(2) {
  animation-delay: 0.12s;
}

.july-memory-layer.show .july-memory-photo:nth-child(3) {
  animation-delay: 0.24s;
}

.sep-memory-media {
  border-style: solid;
  background:
    radial-gradient(circle at 80% 14%, #ffe8cc 0, transparent 34%),
    radial-gradient(circle at 14% 84%, #dcefff 0, transparent 36%),
    #fffdf8;
}

.sep-memory-card {
  border: 1px solid #ecd9c8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 28px rgba(72, 45, 28, 0.1);
  padding: 18px;
  display: grid;
  gap: 14px;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.66s cubic-bezier(0.22, 0.78, 0.24, 1), transform 0.66s cubic-bezier(0.22, 0.78, 0.24, 1);
}

.sep-memory-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sep-memory-text {
  margin: 0;
  font-size: clamp(1.03rem, 1.82vw, 1.2rem);
  line-height: 1.75;
  color: #4b3628;
  opacity: 0;
  transform: translateY(8px);
}

.sep-memory-card.show .sep-memory-text {
  animation: july-photo-in 0.52s ease forwards;
}

.sep-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.sep-slider.show {
  opacity: 1;
  transform: translateY(0);
}

.sep-slider-viewport {
  overflow: hidden;
  border-radius: 12px;
  touch-action: pan-y;
}

.sep-slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.22, 0.78, 0.24, 1);
  will-change: transform;
}

.sep-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e6d1bf;
  background: #fff8f0;
  color: #704b35;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.sep-arrow:disabled {
  opacity: 0.45;
  cursor: default;
}

.sep-slider-index {
  margin: 0;
  text-align: center;
  color: #7f6b5f;
  font-size: 0.92rem;
}

.sep-memory-photo {
  width: 100%;
  min-width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #ecd9ca;
  box-shadow: 0 10px 18px rgba(52, 30, 16, 0.14);
}

@keyframes july-photo-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes july-spark {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 149, 77, 0.5), 0 0 0 0 rgba(61, 170, 145, 0.45);
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    box-shadow: 0 0 0 56px rgba(255, 149, 77, 0), 0 0 0 76px rgba(61, 170, 145, 0);
    transform: translate(-50%, -50%) scale(1.2);
  }
}

@keyframes july-met-pop {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  55% {
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes title-avatar-sway-left {
  0% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg);
  }
  100% {
    transform: rotate(-8deg);
  }
}

@keyframes title-avatar-sway-right {
  0% {
    transform: rotate(8deg);
  }
  50% {
    transform: rotate(-8deg);
  }
  100% {
    transform: rotate(8deg);
  }
}

@keyframes section-next-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-media {
  border-style: solid;
  height: auto;
  min-height: 520px;
  display: grid;
  align-items: start;
}

.intro-block {
  text-align: center;
  min-height: 100%;
  display: grid;
  align-content: start;
  padding-top: 8px;
}

.intro-step {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
}

.intro-step.show {
  opacity: 1;
  max-height: 800px;
  overflow: visible;
  transform: translateY(0);
}

.intro-step.hidden {
  display: none;
}

.intro-lead {
  margin: 6px auto 14px;
  font-size: clamp(1.1rem, 2.8vw, 1.45rem);
  font-weight: 700;
  color: #3f2e22;
}

.intro-stage {
  display: none;
}

.intro-stage.show {
  display: grid;
  align-content: center;
  min-height: 100%;
  position: relative;
}

.intro-video {
  width: min(100%, 900px);
  max-height: 68vh;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #000;
}

.intro-copy {
  margin: 14px auto 10px;
  color: #4d433c;
  line-height: 1.8;
}

.balloon-game {
  position: relative;
  min-height: 420px;
  padding: 38px 0 2px;
  overflow: visible;
}

.balloon-wrap {
  position: relative;
  z-index: 110;
  height: 230px;
  margin-top: 24px;
  display: grid;
  place-items: center;
}

.balloon-body {
  position: relative;
  z-index: 115;
  width: 92px;
  height: 116px;
  border-radius: 48% 48% 52% 52%;
  background: radial-gradient(circle at 28% 25%, #ffd2dc 0, #ff6f96 55%, #e94d7a 100%);
  box-shadow: inset -7px -10px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center bottom;
}

.balloon-body::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid #e94d7a;
}

.balloon-body.popped {
  opacity: 0;
  transform: scale(2.5);
}

.balloon-string {
  position: absolute;
  left: 50%;
  top: 152px;
  width: 2px;
  height: 84px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #d8c1ab, #bea38a);
}

.inflate-btn {
  position: relative;
  z-index: 110;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.inflate-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.intro-final-overlay {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%) scale(0.75);
  width: min(92%, 26em);
  text-align: center;
  z-index: 140;
  margin: 24px auto 12px;
  line-height: 1.18;
  font-size: clamp(1.9rem, 5.4vw, 4.9rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ff5e5b 0%, #ffb347 24%, #ffd166 40%, #5dd39e 58%, #4cc9f0 78%, #c77dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 20px rgba(120, 60, 20, 0.18);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.intro-final-overlay.show {
  opacity: 1;
  animation: final-pop 0.8s cubic-bezier(0.2, 0.85, 0.24, 1) forwards;
  z-index: 80;
}

.balloon-game.final-mode .intro-final-overlay {
  top: 46%;
}

.balloon-game.final-mode .chase-game .start-target {
  bottom: 8px;
}

@keyframes final-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.75) translateY(18px);
    filter: blur(4px);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) translateY(-4px);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
    filter: blur(0);
  }
}

.chase-game {
  position: absolute;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
}

.chase-game.show {
  opacity: 1;
  pointer-events: auto;
}

.next-btn {
  position: absolute;
  margin-top: 0;
  left: 24px;
  top: 24px;
  transform: translateY(10px);
  border: 0;
  background: transparent;
  padding: 0;
  width: 180px;
  height: 180px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, left 0.2s ease, top 0.2s ease;
  z-index: 100;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.next-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.next-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.next-btn.dragging {
  cursor: grabbing;
}

.start-target {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #e36f44, #c8512b);
  box-shadow: 0 10px 20px rgba(199, 81, 43, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.2s ease;
  z-index: 95;
}

.start-target:active {
  transform: translateX(-50%) scale(0.97);
}

.chase-game.show .start-target {
  opacity: 1;
  pointer-events: auto;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 130;
}

.balloon-game.final-mode .balloon-wrap,
.balloon-game.final-mode .inflate-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


.confetti-piece {
  position: absolute;
  top: 45%;
  width: 8px;
  height: 14px;
  opacity: 0;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.18, 0.84, 0.34, 1);
  animation-fill-mode: forwards;
}

.confetti-emoji {
  width: auto;
  height: auto;
  font-size: clamp(16px, 2.2vw, 24px);
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.14));
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc((var(--drift, 0.5) - 0.5) * 240px), 190px, 0) rotate(560deg);
  }
}

.mini-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #ecd9c8;
  border-radius: 12px;
  background: #fff;
}

.mini-tip,
.mini-text,
.mini-log,
.floor-label {
  margin: 0;
  color: #4b3628;
}

.mini-btn {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #d96b3f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.move-tower {
  position: relative;
  width: min(340px, 100%);
  height: 300px;
  margin-top: 2px;
}

.move-shaft {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid #ead4bf;
  background: linear-gradient(180deg, #fff7ef 0%, #f7e8d8 100%);
  overflow: hidden;
}

.move-floor {
  position: relative;
  height: calc(100% / 7);
  border-top: 1px dashed #dcbda2;
}

.move-floor:first-child {
  border-top: 0;
}

.move-floor-tag {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #9a6d50;
}

.move-floor.active {
  background: linear-gradient(90deg, rgba(217, 107, 63, 0.08), rgba(60, 155, 132, 0.15));
}

.move-person {
  position: absolute;
  font-size: 30px;
  line-height: 1;
  transition: bottom 0.36s cubic-bezier(0.2, 0.8, 0.24, 1);
}

.move-person.step {
  animation: moveStepBounce 0.36s ease;
}

.move-person-left {
  left: 46%;
  transform: translateX(-50%);
}

.move-person-right {
  left: 61%;
  transform: translateX(-50%);
}

@keyframes moveStepBounce {
  0% {
    transform: translateX(-50%) scale(1);
  }
  45% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

.reveal-block {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.45s ease;
}

.linear-game {
  display: grid;
  gap: 10px;
  opacity: 1;
  transform: translateY(0);
  max-height: 1200px;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
}

#moveGame,
#danceGame,
#desertGame {
  justify-items: center;
}

#moveGame .mini-tip,
#moveGame .floor-label,
#desertGame .mini-tip,
#desertGame .mini-log,
#danceGame .mini-tip {
  text-align: center;
}

.linear-game.done {
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
}

.reveal-block.show {
  opacity: 1;
  max-height: 2000px;
  transform: translateY(0);
}

.mini-video {
  width: 100%;
  border-radius: 10px;
}

.mini-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-photo-grid.uneven {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-photo {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ecd9ca;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

#m202506 .mini-photo {
  width: 50%;
  justify-self: center;
}

#desertGame .dino-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: min(760px, 100%);
  margin: 0 auto;
}

#desertGame .mini-btn {
  margin-left: auto;
}

.dino-canvas {
  width: 100%;
  max-width: 760px;
  border: 1px solid #ecd9c8;
  border-radius: 12px;
  display: block;
  background: #fff8ef;
  touch-action: manipulation;
}

.uneven-1 {
  aspect-ratio: 4 / 5;
}

.uneven-2 {
  aspect-ratio: 3 / 4;
}

.uneven-3 {
  aspect-ratio: 1 / 1;
}

.dance-pad,
.mix-row,
.tab-row,
.quiz-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#hawaiiReveal .tab-row {
  gap: 12px;
  margin: 4px 0 16px;
  padding: 6px;
  border: 1px solid #ebd8c8;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf4, #fff4e8);
  width: fit-content;
}

#hawaiiReveal .tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 16px;
  min-width: 64px;
  background: #f6e8d9;
  color: #714b35;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

#hawaiiReveal .tab-btn:hover {
  transform: translateY(-1px);
  border-color: #e5c8ad;
  background: #fbeee1;
  box-shadow: 0 8px 14px rgba(120, 76, 48, 0.12);
}

#hawaiiReveal .tab-btn.is-active {
  background: linear-gradient(180deg, #df7f4d, #c96737);
  color: #fff;
  box-shadow: 0 8px 16px rgba(191, 100, 56, 0.28);
}

#hawaiiPhotos {
  margin-top: 8px;
}

.dance-display {
  width: min(320px, 100%);
  border: 1px solid #ecd9ca;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8f1 0%, #fff1e4 100%);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(80, 45, 24, 0.08);
  margin: 0 auto;
}

.dance-prompt-img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.dance-hit-hint {
  margin: 2px 0 0;
  min-height: 1.4em;
  text-align: center;
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #5a2f1c;
  text-shadow: 0 2px 8px rgba(140, 80, 40, 0.18);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.dance-hit-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.dance-display.dance-hit-ok {
  animation: dance-hit-ok 0.3s ease;
}

#danceGame {
  justify-items: center;
}

#danceGame .mini-tip {
  text-align: center;
  font-size: clamp(1.08rem, 2.1vw, 1.35rem);
}

@keyframes dance-hit-ok {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 18px rgba(80, 45, 24, 0.08);
  }
  45% {
    transform: scale(1.035);
    box-shadow: 0 0 0 5px rgba(60, 155, 132, 0.24), 0 10px 22px rgba(80, 45, 24, 0.1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 8px 18px rgba(80, 45, 24, 0.08);
  }
}

.quiz-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #ecd9ca;
  border-radius: 10px;
  background: #fff9f3;
}

#quizGame .quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: stretch;
}

#quizGame .quiz-grid input[type="checkbox"] {
  margin: 0;
}

.quiz-option-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.quiz-option-text {
  line-height: 1.3;
}

.distance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 120px;
}

.distance-row.meet {
  justify-content: center;
  gap: 80px;
}

.distance-avatar {
  width: 86px;
  transition: transform 0.78s cubic-bezier(0.22, 0.78, 0.24, 1);
}

.distance-title-row {
  position: relative;
  min-height: 108px;
  gap: clamp(8px, 1.4vw, 14px);
}

.distance-mover {
  --offset: 0px;
  width: clamp(70px, 8.2vw, 96px);
  display: inline-flex;
  justify-content: center;
  transform: translateX(var(--offset));
  transition: transform 0.78s cubic-bezier(0.22, 0.78, 0.24, 1);
}

.distance-title-row .distance-avatar {
  width: clamp(70px, 8.2vw, 96px);
}

.distance-title-row .distance-mover.start-left {
  --offset: 20px;
}

.distance-title-row .distance-mover.start-right {
  --offset: -20px;
}

.distance-title-row .distance-mover.far-left {
  --offset: -150px;
}

.distance-title-row .distance-mover.far-right {
  --offset: 150px;
}

.meet-title-row {
  position: relative;
  min-height: 108px;
  gap: clamp(8px, 1.4vw, 14px);
}

.meet-title-row .distance-mover.start-left {
  --offset: -150px;
}

.meet-title-row .distance-mover.start-right {
  --offset: 150px;
}

.distance-avatar.meet-center {
  transform: scale(1.08);
}

.meet-title-row .distance-mover.meet-center {
  --offset: 0px;
}

.distance-avatar.distance-sway-left {
  animation: distance-avatar-sway-left 2.2s ease-in-out infinite;
}

.distance-avatar.distance-sway-right {
  animation: distance-avatar-sway-right 2.2s ease-in-out infinite;
}

@keyframes distance-avatar-sway-left {
  0% {
    transform: translateX(var(--offset)) rotate(-8deg);
  }
  50% {
    transform: translateX(var(--offset)) rotate(8deg);
  }
  100% {
    transform: translateX(var(--offset)) rotate(-8deg);
  }
}

@keyframes distance-avatar-sway-right {
  0% {
    transform: translateX(var(--offset)) rotate(8deg);
  }
  50% {
    transform: translateX(var(--offset)) rotate(-8deg);
  }
  100% {
    transform: translateX(var(--offset)) rotate(8deg);
  }
}

.meet-static-row .distance-avatar {
  transition: none;
}

.alchemy-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  min-height: 440px;
}

.alchemy-canvas {
  position: relative;
  border-radius: 12px;
  border: 1px solid #e5d1bf;
  background:
    radial-gradient(circle at 18% 16%, #fff2de 0, transparent 30%),
    radial-gradient(circle at 80% 82%, #e1f4ee 0, transparent 34%),
    linear-gradient(180deg, #fffdf9, #fff8f1);
  overflow: hidden;
}

.alchemy-sidebar {
  border: 1px solid #ead7c7;
  border-radius: 12px;
  background: #fffaf4;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.alchemy-side-title {
  margin: 0;
  font-weight: 700;
  color: #5c4434;
}

.alchemy-source-list {
  display: grid;
  gap: 8px;
}

.alchemy-source-btn {
  border: 1px solid #e6d3c2;
  border-radius: 10px;
  background: #fff;
  color: #4f3a2b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 6px;
  font-size: 14px;
  cursor: pointer;
}

.alchemy-node {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid #dcbca3;
  border-radius: 12px;
  background: #fff9f2;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 16px rgba(70, 44, 29, 0.14);
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.alchemy-node.dragging {
  cursor: grabbing;
  box-shadow: 0 14px 20px rgba(70, 44, 29, 0.2);
}

.alchemy-node-emoji {
  font-size: 20px;
  line-height: 1;
}

.alchemy-node-text {
  font-size: 14px;
  font-weight: 700;
  color: #4f3a2b;
  line-height: 1;
}

.alchemy-win-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 220;
  pointer-events: none;
}

.alchemy-win-modal.show {
  display: grid;
}

.alchemy-win-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 236, 166, 0.28) 0, rgba(255, 236, 166, 0) 56%),
    radial-gradient(circle at 20% 30%, rgba(255, 184, 120, 0.2) 0, rgba(255, 184, 120, 0) 34%),
    radial-gradient(circle at 82% 68%, rgba(131, 216, 255, 0.2) 0, rgba(131, 216, 255, 0) 36%);
  animation: alchemyGlowPulse 1.2s ease-in-out infinite;
}

.alchemy-win-card {
  position: relative;
  border: 1px solid #ebcfae;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9ef, #fff2df);
  padding: 18px 24px;
  text-align: center;
  box-shadow: 0 18px 36px rgba(81, 46, 22, 0.22);
  animation: alchemyCardPop 0.46s cubic-bezier(0.2, 0.84, 0.24, 1) both;
}

.alchemy-win-card::before,
.alchemy-win-card::after {
  content: "✦";
  position: absolute;
  font-size: 18px;
  color: #f6a23d;
  animation: alchemySparkleBlink 0.8s ease-in-out infinite alternate;
}

.alchemy-win-card::before {
  left: -14px;
  top: -8px;
}

.alchemy-win-card::after {
  right: -12px;
  bottom: -8px;
  animation-delay: 0.2s;
}

.alchemy-win-emoji {
  margin: 0 0 6px;
  font-size: 34px;
  letter-spacing: 2px;
}

.alchemy-win-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: #563a26;
}

@keyframes alchemyGlowPulse {
  0% {
    opacity: 0.56;
  }
  50% {
    opacity: 0.95;
  }
  100% {
    opacity: 0.56;
  }
}

@keyframes alchemyCardPop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.8);
  }
  65% {
    opacity: 1;
    transform: translateY(-2px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes alchemySparkleBlink {
  0% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1.22);
  }
}

@media (max-width: 700px) {
  :root {
    --nav-w: 100%;
    --video-slot: 0px;
  }

  .timeline-nav {
    position: sticky;
    left: auto;
    top: 132px;
    transform: none;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 14px 10px;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: blur(10px);
  }

  .timeline-nav::before {
    left: 20px;
    right: 20px;
    top: 22px;
    bottom: auto;
    height: 2px;
    width: auto;
    background: linear-gradient(90deg, #efdfcf, var(--rail), #efdfcf);
  }

  .timeline-link {
    display: inline-block;
    margin: 0 16px 0 0;
    padding: 18px 0 0;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .timeline-link::before {
    left: 0;
    top: 0;
  }

  .story-section {
    min-height: auto;
    padding: 20px 12px;
  }

  .story-inner {
    width: min(1200px, 96vw);
    min-height: auto;
    margin: 0 auto;
    padding: 16px;
  }

  .july-track-wrap {
    min-height: 300px;
    height: min(52vh, 430px);
  }

  .july-next-area {
    margin-top: 12px;
  }

  .july-memory-grid {
    grid-template-columns: 1fr;
  }

  .july-memory-photo {
    aspect-ratio: 16 / 10;
  }

  .sep-slider {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sep-arrow {
    justify-self: center;
  }

  .sep-arrow-left {
    order: 2;
  }

  .sep-slider-viewport {
    order: 1;
  }

  .sep-arrow-right {
    order: 3;
  }

  .sep-memory-photo {
    aspect-ratio: 16 / 10;
  }

  .intro-media {
    height: auto;
    min-height: 0;
  }

  .intro-video {
    max-height: none;
  }

  .balloon-game {
    min-height: 280px;
  }

  .next-btn img {
    width: 100%;
  }

  .next-btn {
    width: 128px;
    height: 128px;
  }

  .start-target {
    bottom: 10px;
    font-size: 1.1rem;
    padding: 10px 22px;
  }

  .story-inner::before {
    display: none;
  }

  .mini-photo-grid,
  .mini-photo-grid.uneven {
    grid-template-columns: 1fr;
  }

  #quizGame .quiz-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .alchemy-layout {
    grid-template-columns: 1fr;
  }

  .alchemy-canvas {
    min-height: 360px;
  }

  .page-corner-video-wrap {
    width: 40px;
    left: auto;
    right: 10px;
    top: 10px;
    border-radius: 10px;
  }
}
.story-heading-centered .story-time,
.story-heading-centered .story-title {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.story-heading-centered .story-time {
  color: #ff8a6d;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 4px 14px rgba(255, 122, 94, 0.22);
}

/* Non-intro subtitle gets a soft container so it doesn't feel abrupt. */
.story-section:not(#intro) .story-time {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px 6px 20px;
  border: 1px solid #ffd9ca;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8f3 0%, #fff1e8 100%);
  box-shadow: 0 8px 16px rgba(255, 122, 94, 0.12);
}

.story-heading-centered .story-title {
  font-weight: 800;
  background: linear-gradient(110deg, #ff8f66 0%, #ff5f8f 50%, #ffb347 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 20px rgba(255, 111, 97, 0.2);
}

.story-heading-hidden .story-title {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.story-heading-hidden .story-desc-inner {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.story-heading-centered .story-time,
.story-heading-centered .story-title {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.story-desc {
  display: none;
}

.story-desc-inner {
  margin: 0 0 16px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ending-media {
  position: relative;
  border-style: solid;
  background:
    radial-gradient(circle at 12% 18%, #ffe7cf 0, transparent 34%),
    radial-gradient(circle at 86% 8%, #fbe1d2 0, transparent 30%),
    #fffdf8;
}

.ending-page-confetti {
  z-index: 20;
}

.ending-letter-wrap {
  position: relative;
  z-index: 30;
}

.ending-letter-wrap {
  width: min(780px, 100%);
  margin: 8px auto 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.ending-envelope {
  position: relative;
  width: min(460px, 92%);
  aspect-ratio: 16 / 10;
  border: 1px solid #e6c7ad;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7d9bb 0%, #efc49f 100%);
  box-shadow: 0 12px 22px rgba(79, 45, 24, 0.16);
  cursor: pointer;
  overflow: hidden;
}

.ending-envelope-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  background: linear-gradient(180deg, #ffdcbc, #efc3a2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.56s cubic-bezier(0.2, 0.84, 0.24, 1);
  z-index: 3;
}

.ending-envelope-heart {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: #cc5a5a;
  z-index: 4;
}

.ending-envelope-label {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: #6b4936;
  font-weight: 700;
  z-index: 4;
}

.ending-letter-paper {
  width: min(720px, 95%);
  border: 1px solid #e7d3c2;
  border-radius: 12px;
  padding: 24px 26px;
  background:
    repeating-linear-gradient(
      to bottom,
      #fffefb 0px,
      #fffefb 30px,
      #eadfd4 31px,
      #fffefb 32px
    );
  box-shadow: 0 16px 26px rgba(66, 39, 24, 0.12);
  opacity: 0;
  transform: translateY(-62px) scaleY(0.2);
  transform-origin: top center;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.62s ease,
    transform 0.72s cubic-bezier(0.2, 0.84, 0.24, 1),
    max-height 0.72s cubic-bezier(0.2, 0.84, 0.24, 1);
}

.ending-letter-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 32px;
  color: #5f4637;
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  font-family: "STKaiti", "Kaiti SC", "KaiTi", "Comic Sans MS", cursive;
}

.ending-letter-wrap.is-open .ending-envelope-top {
  transform: rotateX(170deg);
}

.ending-letter-wrap.is-open .ending-letter-paper {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  max-height: 560px;
}
